Mình có cấu hình một server email bằng CentOS + Postfix + Dovecot + Sasl + OpenSSL.
Sau khi cấu hình xong thì dùng tài khoản đứng trên server gửi và nhận email bình thường trên tất cả các server mail hiện tại như gmail,yahoo,hotmail.
Nhưng khi dùng email client như outlook thì chỉ có thể nhận được email do các mail server kia gửi nhưng không thể gửi ngược lại cho các email server đó được.
Đây là log khi mình gửi email cho server mail Yahoo bằng outlook:
Code:
Aug 17 16:05:02 s2 postfix/smtp[3947]: connect to yahoo.com[206.190.36.45]:25: Connection timed out
Aug 17 16:05:02 s2 postfix/smtp[3947]: 5D09B3142D79: to=<quanvq89@yahoo.com>, relay=none, delay=91, delays=0.74/0.01/90/0, dsn=4.4.1, status=deferred (connect to yahoo.com[206.190.36.45]:25: Connection timed out)
Đây là cho gmail:
Code:
Aug 17 16:11:40 s2 postfix/smtp[3982]: connect to gmail.com[74.125.224.86]:25: Connection timed out
Aug 17 16:11:40 s2 postfix/smtp[3982]: 9ADF83142D7D: to=<quanvq89@gmail.com>, relay=none, delay=91, delays=0.91/0/90/0, dsn=4.4.1, status=deferred (connect to gmail.com[74.125.224.86]:25: Connection timed out)
Đây là config trên file: /etc/postfix/main.cf:
Code:
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
myhostname = mail.sisopen.com
mydomain = sisopen.com
myorigin = $mydomain
inet_interfaces = all
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
unknown_local_recipient_reject_code = 550
mynetworks_style = class
mynetworks_style = subnet
mynetworks = 0.0.0.0/0, 127.0.0.0/8
relay_domains = $mydestination
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
home_mailbox = Maildir/
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.6.6/samples
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
disable_dns_lookups = yes
File: /etc/postfix/master.cf:
Code:
smtp inet n - n - - smtpd
submission inet n - n - - smtpd
-o smtpd_tls_security_level=encrypt
-o smtpd_sasl_auth_enable=yes
-o smtpd_sasl_type=dovecot
-o smtpd_sasl_path=private/auth
-o smtpd_sasl_security_options=noanonymous
-o smtpd_sasl_local_domain=$myhostname
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
-o smtpd_sender_login_maps=hash:/etc/postfix/virtual
-o smtpd_sender_restrictions=reject_sender_login_mismatch
-o smtpd_recipient_restrictions=reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_sasl_authenticated,reject
#628 inet n - n - - qmqpd
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
#qmgr fifo n - n 300 1 oqmgr
tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - n - - smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay unix - - n - - smtp
-o smtp_fallback_relay=
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - n - - showq
error unix - - n - - error
retry unix - - n - - error
discard unix - - n - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
scache unix - - n - 1 scache
Mong được mọi người giúp đỡ.
thanks,
quanvq,