在Postfix 2.10.2中,我有一个具有多个域和几个虚拟别名的设置,用于将邮件地址分配给本地用户。只要我不添加包包,它就可以正常工作。
在使用虚拟别名之前,我先定义了一个
local_recipient_maps =
luser_relay = catchall
但是由于我需要整理来自不同域的邮件地址,因此不得不使用虚拟别名。
现在,postfix.org说我应该这样做,我这样做了:
/etc/postfix/main.cf:
virtual_alias_domains = example.com
virtual_alias_maps = hash:/etc/postfix/virtual
/ etc / postfix / virtual:
postmaster@example.com account1
info@example.com account1
sales@example.com account2
@example.com catchall
但是,如果这样做,全部接收地址将捕获我的所有邮件,而不只是邮件到未明确定义的地址。为什么会这样,我该如何更改?
我做了虚拟的Postmap,也重新启动了Postfix。日志中没有错误,它只是将交付记录到综合地址。并且有一个警告“不要在mydestination和virtual_alias_domains中都列出域example.com”,但是我没有这样做!我什至没有mydestination指令。(下面的配置中有一个,但是我在NickW建议之后添加了它。)
这是我完整的conf:
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
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = all
mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/dovecot.conf -m "${EXTENSION}"
mailbox_size_limit = 0
mydestination = $myhostname
myhostname = mydomain.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/dovecot-auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = reject_unknown_sender_domain
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/dovecot/dovecot.pem
smtpd_tls_key_file = /etc/dovecot/private/dovecot.pem
smtpd_tls_mandatory_ciphers = medium
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
virtual_alias_domains = $myhostname, myotherdomain.com
virtual_alias_maps = hash:/etc/postfix/virtual