Trong bài viết này sẽ hướng dẫn Quý khách cấu hình Relay toàn bộ email của DirectAdmin gửi thông qua một SMTP và chứng thực với username và mật khẩu
vi /etc/exim.conf
Sau begin routers thêm đoạn code sau:
spamexperts_smarthost_router:
driver = manualroute
domains = ! +local_domains
ignore_target_hosts = 127.0.0.0/8
condition = "${perl{check_limits}}"
# Exclude null sender messages from relaying via the smarthost
condition = ${if or {{!eq{$sender_address}{}} {!eq{$sender_host_address}{}}}}
headers_add = ${if !eq{$original_domain}{$domain}{X-Forwarded-For: $original_local_part@$original_domain}}n
X-AuthUser: $authenticated_id
transport = spamexperts_smarthost_transport
route_list = $domain mta.vhost.vn::587
no_more
Sau begin transports bổ sung đoạn code sau:
spamexperts_smarthost_transport:
driver = smtp
# In-case your server continues to send outbound over port 25 please add the below line
port = 587
hosts_require_tls = mta.vhost.vn
hosts_require_auth = *
Trong section begin authenticators bổ sung thêm:
spamexperts_login:
driver = plaintext
public_name = LOGIN
client_send = : username@example.com : yourUserPassword
Restart exim và kiểm tra lại.
service exim restart