我有一个带有 Postfix 和 DBmail 的 FreeBSD 服务器。邮件系统工作正常,除了一件事:如果它们都托管在同一服务器上(或者从网站的 PHP 邮件系统到本地托管邮件地址),我无法从 domain1.com 向 domain2.com 发送电子邮件。我只想将电子邮件从本地域发送到另一个本地域。
这是我的 main.cf 文件
queue_directory = /var/spool/postfix
command_directory = /usr/local/sbin
daemon_directory = /usr/local/libexec/postfix
data_directory = /var/db/postfix
# Permissions
mail_owner = postfix
default_privs = nobody
# Network
myhostname = hostname.domain.nl
mydomain = domain.nl
myorigin = $mydomain
inet_interfaces = all
# Recipients
virtual_transport = dbmail-lmtp:localhost:24
virtual_mailbox_domains = mysql:/usr/local/etc/postfix/mail_domains.cf
#virtual_mailbox_maps = mysql:$config_directory/sql-virtual_mailbox_maps.cf
unknown_local_recipient_reject_code = 550
# Security
mynetworks = 127.0.0.0/8 [::1]/128 mysql:/usr/local/etc/postfix/sql-pop_before_smtp.cf
#body_checks = regexp:$config_directory/body_checks
#header_checks = regexp:$config_directory/header_checks
# Misc
smtpd_helo_required = yes
strict_rfc821_envelopes = yes
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/local/sbin/sendmail
newaliases_path = /usr/local/bin/newaliases
mailq_path = /usr/local/bin/mailq
setgid_group = maildrop
html_directory = /usr/local/share/doc/postfix
manpage_directory = /usr/local/man
sample_directory = /usr/local/etc/postfix
readme_directory = /usr/local/share/doc/postfix
inet_protocols = ipv4
smtpd_recipient_restrictions = permit_sasl_authenticated permit_mynetworks reject_unauth_destination
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks
登录时出现此错误/var/log/maillog
Mar 14 23:15:06 keroth postfix/smtp[4495]: warning: host mail.domain2.nl[***.***.***.***]:25 greeted me with my own hostname hostname.domain1.nl
Mar 14 23:15:06 keroth postfix/smtp[4495]: warning: host mail.domain2.nl[***.***.***.***]:25 replied to HELO/EHLO with my own hostname hostname.domain1.nl
Mar 14 23:15:06 keroth postfix/smtp[4495]: 821049CC06F: to=<[email protected]>, relay=mail.domain1.nl[***.***.***.***]:25, delay=2.4, delays=0.02/0.01/2.4/0, dsn=5.4.6, status=bounced (mail for domain1.nl loops back to myself)
Mar 14 23:15:06 keroth postfix/smtpd[4497]: disconnect from ***.***.***.***[***.***.***.***]
Mar 14 23:15:06 keroth postfix/cleanup[4493]: DFBDB9CC073: message-id=<[email protected]>
Mar 14 23:15:06 keroth postfix/bounce[4500]: 821049CC06F: sender non-delivery notification: DFBDB9CC073
Mar 14 23:15:06 keroth postfix/qmgr[4479]: DFBDB9CC073: from=<>, size=2145, nrcpt=1 (queue active)
Mar 14 23:15:06 keroth postfix/qmgr[4479]: 821049CC06F: removed
Mar 14 23:15:07 keroth postfix/lmtp[4501]: DFBDB9CC073: to=<[email protected]>, relay=localhost[127.0.0.1]:24, delay=0.12, delays=0/0.01/0/0.11, dsn=5.0.0, status=bounced (host localhost[127.0.0.1] said: 550 Recipient <[email protected]> FAIL (in reply to RCPT TO command))
Mar 14 23:15:07 keroth postfix/qmgr[4479]: DFBDB9CC073: removed