在更改“Mail For Domain”模板下的“包含域的用户名格式”后,我无法使用 postfix 发送邮件。基本上,我一切都正常,但后来将默认用户名从 更改为user.domain
,[email protected]
然后删除并重新创建了我的电子邮件帐户(包括主目录中的关联文件),并采用新格式。完成此操作后,我无法发送任何电子邮件,无论是从我重新创建的帐户还是从全新的帐户。我恢复了以前的模板设置并重新创建了帐户,但还是不起作用。
/var/log/mail.log
下面是我尝试发送电子邮件时出现的情况的示例。
Jul 16 19:02:17 host postfix/smtpd[11772]: connect from localhost.localdomain[127.0.0.1]
Jul 16 19:02:17 host postfix/smtpd[11772]: 691B9138176E: client=localhost.localdomain[127.0.0.1]
Jul 16 19:02:17 host postfix/cleanup[11775]: 691B9138176E: message-id=<[email protected]>
Jul 16 19:02:17 host postfix/smtpd[11772]: disconnect from localhost.localdomain[127.0.0.1]
Jul 16 19:02:17 host postfix/qmgr[10765]: 691B9138176E: from=<[email protected]>, size=666, nrcpt=1 (queue active)
Jul 16 19:02:17 host postfix/qmgr[10765]: warning: connect to transport private/sam-domain.co: No such file or directory
Jul 16 19:02:17 host postfix/error[11735]: 691B9138176E: to=<[email protected]>, relay=none, delay=0.05, delays=0.04/0/0/0, dsn=4.3.0, status=deferred (mail transport unavailable)
另外,这是我的postconf -n
:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
allow_percent_hack = no
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
home_mailbox = Maildir/
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
mailbox_size_limit = 0
mydestination = domain.co, localhost.domain.co, localhost
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
sender_bcc_maps = hash:/etc/postfix/bcc
sender_dependent_default_transport_maps = hash:/etc/postfix/virtual
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_tls_cert_file = /etc/postfix/postfix.cert.pem
smtpd_tls_key_file = /etc/postfix/postfix.key.pem
smtpd_tls_mandatory_ciphers = high
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = hash:/etc/postfix/virtual
任何建议,将不胜感激。
答案1
我有一个回复在 Virtualmin 论坛上,它发挥了神奇的作用。
总而言之,问题确实出在/etc/postfix/main.cf
,正如上面的人所建议的那样。我最终注释掉了以下行:
#sender_dependent_default_transport_maps = hash:/etc/postfix/virtual
做了一个service postfix restart
,现在我的电子邮件运行正常。
感谢以上评论,希望这能对将来的某人有所帮助。