我正在尝试在本地测试虚拟机上设置邮件中继服务器。我使用的是 Ubuntu 18.04。
当我使用我的 postfix 配置发送电子邮件时,邮件从未被收到,并且我在我的邮件日志中看到此条目:
status=sent (delivered to command: procmail -a "$EXTENSION")
这是我的 postfix 配置:
tdunphy@tdunphy-dev:~$ postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
compatibility_level = 2
inet_interfaces = all
inet_protocols = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = $myhostname, company.com, tdunphy-VirtualBox, localhost.localdomain, localhost
myhostname = noreply.company.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost = smtpout.us.companyworld.company.com
smtp_sasl_auth_enable = no
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
我正在使用以下命令在命令行上发送电子邮件:
mail -s "Test Subject" [email protected] < mail_test.txt
这是我在日志中看到的内容:
Jul 9 14:31:22 tdunphy-VirtualBox postfix/local[7906]: 1C485E36C: to=<[email protected]>, relay=local, delay=35, delays=35/0.01/0/0.02, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")
Jul 9 14:31:22 tdunphy-VirtualBox postfix/qmgr[7890]: 1C485E36C: removed
Jul 9 14:31:25 tdunphy-VirtualBox postfix/smtpd[7901]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 unknown=0/1 commands=5/6
但电子邮件始终未送达。我该如何解决?
答案1
您的邮件mydestination
已包含company.com
在其中。因此,所有发送到的邮件*@company.com
都在本地处理(relay=local
),而不是发送到中指定的服务器relayhost
。