Hướng dẫn cấu hình Email Relay trên các Mail Server thông dụng

Bài viết này sẽ hướng dẫn quý khách hàng cấu hình sử dụng dịch vụ Email Relay tại VinaHost. Bài viết cung cấp hướng dẫn cấu hình trên một số email server thông dụng, nếu email server của quý khách không nằm trong danh sách này, xin vui lòng liên hệ với phòng kỹ thuật của VinaHost để được hỗ trợ cấu hình.

1. Exim/cPanel

Đầu tiên, quý khách truy cập vào “Exim Configuration Manage” trên VHM. Chọn “Advanced Editor”.

– Tìm đến  “Section: ROUTERSTART” thêm vào nội dung như sau:

smarthost_dkim:
  driver = manualroute
  domains = !+local_domains
  require_files = “+/var/cpanel/domain_keys/private/${sender_address_domain}”
  # Exclude null sender messages from relaying via the smarthost
  condition = ${if or {{!eq{$sender_address}{}} {!eq{$sender_host_address}{}}}} 

  transport = remote_smtp_smart_dkim

  route_list = $domain smtp-sg.vinahost.vn ::25
smarthost_regular:
  driver = manualroute
  domains = !+local_domains
  # Exclude null sender messages from relaying via the smarthost
  condition = ${if or {{!eq{$sender_address}{}} {!eq{$sender_host_address}{}}}} 

  transport = remote_smtp_smart_regular

  route_list = $domain smtp-sg.vinahost.vn ::25

– Tìm đến  “Section: TRANSPORTSTART” thêm vào nội dung như sau:

remote_smtp_smart_dkim:
  driver = smtp
  hosts_require_tls = *
  interface = ${if exists {/etc/mailips}{${lookup{$sender_address_domain}lsearch*{/etc/mailips}{$value}{}}}{}}
  helo_data = ${if exists {/etc/mailhelo}{${lookup{$sender_address_domain}lsearch*{/etc/mailhelo}{$value}{$primary_hostname}}}{$primary_hostname}}
  dkim_domain = $sender_address_domain
  dkim_selector = default
  dkim_private_key = “/var/cpanel/domain_keys/private/${dkim_domain}”
  dkim_canon = relaxed
  headers_add = X-AuthUser: ${if match {$authenticated_id}{.*@.*}\
 {$authenticated_id} {${if match {$authenticated_id}{.+}\
 {$authenticated_id@$primary_hostname}{$authenticated_id}}}}

  # Uncomment the line below in case you use a login for authentication

  hosts_require_auth = *

remote_smtp_smart_regular:
  driver = smtp
  hosts_require_tls = *
  interface = ${if exists {/etc/mailips}{${lookup{$sender_address_domain}lsearch*{/etc/mailips}{$value}{}}}{}}
  helo_data = ${if exists {/etc/mailhelo}{${lookup{$sender_address_domain}lsearch*{/etc/mailhelo}{$value}{$primary_hostname}}}{$primary_hostname}}
  headers_add = X-AuthUser: ${if match {$authenticated_id}{.*@.*}\
  {$authenticated_id} {${if match {$authenticated_id}{.+}\

  {$authenticated_id@$primary_hostname}{$authenticated_id}}}}

  #Uncomment the line below in case you use a login for authentication

 hosts_require_auth = *

– Tìm đến  “Section: AUTH” và thêm vào nội dung sau

spamexperts_login:
  driver = plaintext

  public_name = LOGIN

  client_send = : user:password

Trong đó user và password quý khách thay thế bằng giá trị được cung cấp

2. Postfix

Các bạn ssh vào mail server sau đó cấu hình như sau:

# vi /etc/postfix/main.cf

relayhost = [e.vinahost.vn]:25

smtp_sasl_auth_enable = yes

smtp_sasl_password_maps = static:username:password

smtp_sasl_security_options = noanonymous

Ngoài ra nếu các bạn gặp lỗi “SASL authentication failed; cannot authenticate to server, no mechanism available” có thể fix bằng cách cài đặt thêm module cyrus-sasl-plain.

# yum -y install cyrus-sasl-plain

3. Exchange 2007/2010

Thực hiện cấu hình trên Hub Transport như sau:

– Open Exchange Management Console

– Click on the + next to Organization Configuration

– Select Hub Transport and select the Send Connectors tab:

– Right-click on the existing Send Connector, select Properties and go to the Network tab.

– Select “Route mail through the following smart hosts:” and click Add.

– Enter smtp-sg.vinahost.vn in the FQDN section

– Click ‘Change’ under the smart-host authentication

– Select ‘Basic Authentication’

– Add your username and password

– Click OK

4. MDaemon 12.0.x

Truy cập vào giao diện quản lý MDaemon và thực hiện như sau

– Click Setup

– Select Default Domain/Servers

– Click Delivery

– Select the option: “Send all outbound email to the ‘Server’ specified below”

– Tại phần “Server” điền vào giá trị: smtp-sg.vinahost.vn

– Click vào ” …requires authentication” và điền thông tin user và mật khẩu.

Chúc quý khách thành công. Nếu cần hỗ trợ, xin quý khách vui lòng liên hệ VinaHost qua Hotline 1900 6046 hoặc email về support@vinahost.vn.

Đánh giá bài viết
Was this article helpful?
Đánh giá
Đánh giá bài viết
Đăng ký nhận tin

Để không bỏ sót bất kỳ tin tức hoặc chương trình khuyến mãi từ Vinahost

    Bài viết liên quan
    Bình luận
    Theo dõi
    Thông báo của
    guest
    0 Góp ý
    Phản hồi nội tuyến
    Xem tất cả bình luận