我在 virtual_alias_maps 中有以下条目:
[email protected]: [email protected]
但是如果我发送电子邮件至[电子邮件保护],它失败了虚拟邮箱表中的用户未知:
Jun 25 21:53:50 zg-3 postfix/smtpd[6071]: NOQUEUE: reject: RCPT from smtp4.enternet.hu[62.112.192.37]: 550 5.1.1 <[email protected]>: Recipient address rejected: User unknown in virtual mailbox table; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<smtp4.enternet.hu>
如果我发送电子邮件至[电子邮件保护]它运行完美。可能有什么问题?当然,我已经运行了 postmap 来更新 virtual.db,并且还重新启动了 postfix。
这是我的main.cf:
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
myhostname = zg-3.softxs.ch
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = softxs.ch
mydestination = zg-3.softxs.ch, localhost.softxs.ch, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 94.231.88.102 172.16.0.0/16
# 50 MB
message_size_limit = 52428800
### TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.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
### Dovecot SMTP authentication
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
# With Postfix version before 2.10, use smtpd_recipient_restrictions
#smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
# Milter configuration
# OpenDKIM
milter_default_action = accept
milter_protocol = 6
smtpd_milters = local:/opendkim/opendkim.sock
non_smtpd_milters = local:/opendkim/opendkim.sock
### Virtual aliases to push emails into V2 systems:
# 1. virtual alias to <system_name>.email_address@localhost
# 2. alias <system_name>.email_address@localhost |"/usr/local/v2_mail/v2/script/email_handler.sh..."
# See http://www.postfix.org/VIRTUAL_README.html#virtual_alias for virtual aliases
virtual_alias_domains =
# can be used more than one e.g. for different domains
virtual_alias_maps = hash:/etc/postfix/virtual
mailbox_size_limit = 0
virtual_mailbox_limit = 0
recipient_delimiter = +
inet_interfaces = all
### Configuration for virtual mailboxes
home_mailbox = Maildir/
virtual_mailbox_domains = /etc/postfix/vhosts
virtual_mailbox_base = /home/vmail
virtual_mailbox_maps = hash:/etc/postfix/vmaps
virtual_minimum_uid = 1000
virtual_uid_maps = static:1002
virtual_gid_maps = static:1002
答案1
virtual_alias_maps 不需要冒号,而普通别名需要。因此 virtual_alias_maps 条目正确:
[email protected] [email protected]