![具有虚拟用户的 Postfix 不会向服务器上的域名发送邮件](https://linux22.com/image/626946/%E5%85%B7%E6%9C%89%E8%99%9A%E6%8B%9F%E7%94%A8%E6%88%B7%E7%9A%84%20Postfix%20%E4%B8%8D%E4%BC%9A%E5%90%91%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8A%E7%9A%84%E5%9F%9F%E5%90%8D%E5%8F%91%E9%80%81%E9%82%AE%E4%BB%B6.png)
带有 postfix 和 courier 的 debian 邮件服务器能够毫无问题地接收和发送 virtual_mailbox_domains 中列出的域的邮件。但如果在服务器安装期间使用邮件地址作为服务器名称,则会出现这种情况。
# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
html_directory = /usr/share/doc/postfix/html
inet_interfaces = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = localhost.$mydomain, localhost, mail.osbournia.com
myhostname = localhost
mynetworks = 127.0.0.0/8
myorigin = /etc/mailname
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
readme_directory = /usr/share/doc/postfix
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_maildir_extended = yes
virtual_maildir_limit_message = "The user you are trying to reach is over quota."
virtual_overquota_bounce = yes
virtual_uid_maps = static:5000
日志文件 /var/log/mail.log
Feb 14 20:56:14 Groudon postfix/pickup[31343]: 7AFA7560F31: uid=1002 from=<jari>
Feb 14 20:56:14 Groudon postfix/cleanup[31442]: 7AFA7560F31: message-id=<20140214195614.7AFA7560F31@localhost>
Feb 14 20:56:14 Groudon postfix/qmgr[31344]: 7AFA7560F31: from=<[email protected]>, size=296, nrcpt=1 (queue active)
Feb 14 20:56:14 Groudon postfix/smtp[31447]: 7AFA7560F31: to=<[email protected]>, relay=none, delay=0.04, delays=0.03/0.01/0.01/0, dsn=5.4.6, status=bounced (mail for osbournia.com loops back to myself)
Feb 14 20:56:14 Groudon postfix/cleanup[31442]: 8334E560F32: message-id=<20140214195614.8334E560F32@localhost>
Feb 14 20:56:14 Groudon postfix/qmgr[31344]: 8334E560F32: from=<>, size=1999, nrcpt=1 (queue active)
Feb 14 20:56:14 Groudon postfix/bounce[31448]: 7AFA7560F31: sender non-delivery notification: 8334E560F32
Feb 14 20:56:14 Groudon postfix/qmgr[31344]: 7AFA7560F31: removed
Feb 14 20:56:14 Groudon postfix/smtp[31447]: 8334E560F32: to=<[email protected]>, relay=none, delay=0.01, delays=0/0/0/0, dsn=5.4.6, status=bounced (mail for osbournia.com loops back to myself)
Feb 14 20:56:14 Groudon postfix/qmgr[31344]: 8334E560F32: removed
导致该错误的原因是什么以及如何解决?
答案1
您应该检查以下步骤
- myhostname 应该是 FQDN,因为我看到您使用的是 localhost。我建议将其替换为 mail.osbournia.com
- 切勿将虚拟邮箱域名列为我的目标域!
- 切勿将虚拟 MAILBOX 域名列为虚拟 ALIAS 域!