我最近更改了我的网站的托管,我必须做的事情之一就是移动电子邮件服务器(使用新的 IP 和 MX 记录更新 DNS...)我在 CentOS 5.8 上使用 Postfix + Dovecot。电子邮件客户端是部署在 Apache 服务器上的 Squirrelmail。我注意到以下问题:
我可以从 Squirrelmail 向我的 gmail 帐户发送电子邮件,但无法从我的 gmail 帐户发送电子邮件到[电子邮件保护]。我没有收到任何错误,但消息从未到达或 Squirrelmain 无法看到它。
我可以通过端口 25 (smtp) 连接到 Postfix,但只能从本地主机连接。我发现这里可能有两个原因:
- Postfix 配置错误;我在 main.cf 中设置了 inet_interfaces = all
- 防火墙设置;自从我购买了 VPS 以来,我从未更改过默认防火墙配置
GoDaddy 导出的 DNS 区域是:
; SOA Record
MYDOMAIN.COM. 3600 IN SOA ns05.domaincontrol.com. dns.jomax.net (
2012050704
28800
7200
604800
3600
)
; A Records
@ 3600 IN A my_host_ip
www 3600 IN A my_host_ip
mail 3600 IN A my_host_ip
; MX Records
@ 3600 IN MX 0 mail.mydomain.com
; NS Records
@ 3600 IN NS ns05.domaincontrol.com
@ 3600 IN NS ns06.domaincontrol.com
我感谢任何帮助。
更新:
main.cf 文件
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
myhostname = mail.mydomain.com
mydomain = mydomain.com
myorigin = $mydomain
inet_interfaces = all
inet_interfaces = localhost
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
unknown_local_recipient_reject_code = 550
mynetworks = 192.168.0.0/24, 127.0.0.0/8
relay_domains =
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
home_mailbox = Maildir/
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.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.3.3/samples
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
master.cf 文件
smtp inet n - n - - smtpd
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
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
smtp unix - - n - - smtp
relay unix - - n - - smtp
-o fallback_relay=
showq unix n - n - - showq
error 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
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
old-cyrus unix - n n - - pipe
flags=R user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -m ${extension} ${user}
cyrus unix - n n - - pipe
user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
感谢您的帮助。
答案1
似乎不知怎的,我最终在 main.cf 中遇到了这个问题
inet_interfaces = all
inet_interfaces = localhost
最后一个是实际考虑到的,所以我不得不对其进行评论并只留下:
inet_interfaces = 全部
问题解决了。谢谢大家的帮助。