邮件不会转发到外部电子邮件帐户

时间:2017-04-07 06:53:54

标签: ubuntu-16.04 postfix-mta postfix

我是使用postfix的新手。尝试将postfix安装为我的ubuntu服务器的MTA。 main.cf如下所示:

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no

smtpd_tls_cert_file = /etc/ssl/certs/smtpd.crt
smtpd_tls_key_file = /etc/ssl/private/smtpd.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = ubuntu
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, ubuntu, localhost.localdomain, , localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
myorigin = 
home_mailbox = Maildir/
mailbox_command =
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtp_tls_security_level = may
smtpd_tls_security_level = may
smtpd_tls_auth_only = no
smtp_tls_note_starttls_offer = yes
smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

但是,在使用mail -s向我的个人邮件发送电子邮件时,我会看到以下

Apr 07 00:56:52 ubuntu postfix/pickup[3901]: 4C0E8BA0029: uid=1000 from=<ubuntu@ubuntu>
Apr 07 00:56:52 ubuntu postfix/cleanup[7717]: 4C0E8BA0029: message-id=<20170407045652.4C0E8BA0029@ubuntu>
Apr 07 00:56:52 ubuntu postfix/qmgr[4899]: 4C0E8BA0029: from=<ubuntu@ubuntu>, size=322, nrcpt=1 (queue active)
Apr 07 00:56:52 ubuntu postfix/smtp[7719]: 4C0E8BA0029: to=<xxxx.xxxx@xxxx.com>, relay=xx.xxxxxxxx.xxxx.com[xx.xxx.xxx.xxx]:25, delay=0.35, delays=0.07/0/0.19/0.08, dsn=2.0.0, status=sent (250 ok:  Message 84730726 accepted)
Apr 07 00:56:52 ubuntu postfix/qmgr[4899]: 4C0E8BA0029: removed

但邮件从未发送到我的个人信箱。欣赏输入。

1 个答案:

答案 0 :(得分:0)

问题是服务器缺少FQDN。我确实在hosts文件中设置了它并使用“hostname ubuntu.local”进行设置。邮件转发工作正常。