为什么Postfix不能从本地账户交付给本地账户?

我有一个名为smtp.mydomain.com的机器上安装了一个虚拟域名为mydomain.com postfix。 如果有任何电子邮件从外部 SMTP服务器到达该机器上的本地用户的smtp.mydomain.com ,则会按预期方式在本地交付。

但是,如果[email protected]使用smtp.mydomain.com发送到[email protected]那么电子邮件不会按照预期在本地交付给user2,而是中继到域mydomain的所有别名[email protected] 。 COM。

所以基本上本地用户使用Postfix机器的本地用户不起作用。 任何build议如何解决或诊断? 它必须是非常明显的东西。

我在这里发布我的configuration,以防万一:

postconf -n

 alias_maps = hash:/etc/aliases broken_sasl_auth_clients = yes command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix debug_peer_level = 2 html_directory = no mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man myhostname = smtp.mydomain.com myorigin = mydomain.com newaliases_path = /usr/bin/newaliases.postfix readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES sample_directory = /usr/share/doc/postfix-2.3.3/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop smtp_tls_note_starttls_offer = yes smtp_use_tls = yes smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination check_policy_service inet:127.0.0.1:10023 reject_unknown_reverse_client_hostname smtpd_sasl_auth_enable = yes smtpd_sasl_path = private/auth smtpd_sasl_security_options = noanonymous noplaintext smtpd_sasl_type = dovecot smtpd_tls_auth_only = yes smtpd_tls_cert_file = /etc/pki/tls/certs/smtp.mydomain.com.cert smtpd_tls_key_file = /etc/pki/tls/private/smtp.mydomain.com.key smtpd_tls_loglevel = 1 smtpd_tls_received_header = yes smtpd_tls_session_cache_database = btree:/var/spool/postfix/smtpd_tls_cache smtpd_tls_session_cache_timeout = 3600s smtpd_use_tls = no tls_random_source = dev:/dev/urandom unknown_local_recipient_reject_code = 550 virtual_alias_maps = hash:/etc/postfix/virtual 

cat /etc/postfix/virtual

 mydomain.com mydomain.com @mydomain.com [email protected] [email protected] user1.mydomain.com [email protected] user2.mydomain.com 

将行@mydomain.com [email protected]移动到文件末尾。 就这样。

哦,我现在看到:目标地址应该是@ 。 所以你的文件应该是这样的:

 mydomain.com mydomain.com [email protected] [email protected] [email protected] [email protected] @mydomain.com [email protected]