邮件服务器在本地交付的“虚拟邮箱表中的用户未知”上创build邮件帐户

我正在使用虚拟域运行一个较旧的Postfix和Courier邮件服务器。 我最近体验到,使用webmail对一个不存在的邮箱进行本地交付会导致创build实际的邮箱 – 比如/var/vmail/domain/notexistinguser – 包含邮件。 在我看来,邮件应该反弹给发件人。 来自外部系统的电子邮件确实会触发反弹。

我不太确定这个问题是否与我的服务器上运行的Postfix,Courier或其他服务有关。 因此,我愿意发送任何你可能需要的configuration,日志等来帮助我解决这个问题。

一些额外的信息

输出postconf -n (主机名已被隐私取代):

 alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases anvil_rate_time_unit = 43200 append_dot_mydomain = no biff = no body_checks = regexp:/etc/postfix/body_checks bounce_queue_lifetime = 1 broken_sasl_auth_clients = yes config_directory = /etc/postfix content_filter = amavis:[127.0.0.1]:10024 header_checks = regexp:/etc/postfix/header_checks html_directory = /usr/share/doc/postfix/html inet_interfaces = all mailbox_command = procmail -a "$EXTENSION" mailbox_size_limit = 0 maximal_queue_lifetime = 1 message_size_limit = 0 mime_header_checks = regexp:/etc/postfix/mime_header_checks mydestination = example.com, localhost, localhost.localdomain myhostname = example.com mynetworks = 127.0.0.0/8 [::1]/128 myorigin = /etc/mailname nested_header_checks = regexp:/etc/postfix/nested_header_checks 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 receive_override_options = no_address_mappings recipient_delimiter = + relay_domains = mysql:/etc/postfix/mysql-virtual_relaydomains.cf relay_recipient_maps = mysql:/etc/postfix/mysql-virtual_relayrecipientmaps.cf relayhost = smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtp_use_tls = yes smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU) smtpd_client_connection_count_limit = 5 smtpd_client_connection_rate_limit = 1000 smtpd_client_message_rate_limit = 1000 smtpd_client_recipient_rate_limit = 1000 smtpd_client_restrictions = check_client_access mysql:/etc/postfix/mysql-virtual_client.cf smtpd_error_sleep_time = 2s smtpd_hard_error_limit = 20 smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, reject_unauth_destination, reject_non_fqdn_sender, check_policy_service inet:127.0.0.1:10023, reject_rbl_client cbl.abuseat.org, reject_rbl_client bl.spamcop.net, reject_rbl_client zen.spamhaus.org smtpd_sasl_auth_enable = yes smtpd_sasl_authenticated_header = yes smtpd_sender_restrictions = check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf smtpd_soft_error_limit = 10 smtpd_tls_CAfile = /etc/ssl/local/ca-certs smtpd_tls_cert_file = /etc/ssl/local/certificate smtpd_tls_key_file = /etc/ssl/local/key smtpd_tls_mandatory_protocols = !SSLv2,!SSLv3 smtpd_tls_security_level = may 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 = /var/vmail virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf virtual_transport = maildrop virtual_uid_maps = static:5000 

从命令行发送邮件给我在邮件日志中的以下内容(主机名和域被隐私取代):

 Jan 26 13:33:01 myhost postfix/smtpd[25786]: 0F29E41134A62: client=localhost[127.0.0.1] Jan 26 13:33:01 myhost postfix/cleanup[8531]: 0F29E41134A62: message-id=<[email protected]> Jan 26 13:33:01 myhost postfix/qmgr[26331]: 0F29E41134A62: from=<[email protected]>, size=755, nrcpt=1 (queue active) Jan 26 13:33:01 myhost amavis[18765]: (18765-09) Passed CLEAN, <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: jgU7IihKWNMv, Hits: 1.044, size: 310, queued_as: 0F29E41134A62, 3470 ms Jan 26 13:33:01 myhost postfix/smtp[14895]: A808940E253C9: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=3.5, delays=0.04/0/0/3.5, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=18765-09, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 0F29E41134A62) Jan 26 13:33:01 myhost postfix/qmgr[26331]: A808940E253C9: removed Jan 26 13:33:02 myhost postfix/pipe[10437]: 0F29E41134A62: to=<[email protected]>, relay=maildrop, delay=1.3, delays=0.09/0/0/1.2, dsn=2.0.0, status=sent (delivered via maildrop service) Jan 26 13:33:02 myhost postfix/qmgr[26331]: 0F29E41134A62: removed 

查看/var/vmail/example.com显示用户已创build在相同的时间戳。 发送testing邮件之前,此用户不存在。

 drwx------ 5 vmail vmail 61 2015-01-26 13:33 unknown01 

一个解决方法是将发送方法的configuration从(发送)邮件更改为使用本地主机的SMTP。

  • 在圆形的方块上,你可以改变configuration

     $config['smtp_server'] = 'localhost'; 
  • 在Squirrelmail上,使用conf.pl脚本。 inputServer Settings然后在configuration服务器本地主机和端口25中selectSendmail or SMTP选项。


这种情况可能会发生,因为当传递电子邮件后缀负责检查用户的存在。 Maildrop本身不能为你做用户存在检查。 不幸的是,这个检查是在邮件发送时使用SMTP not mail命令执行的。 原因是mail命令只在localhost的一些进程中调用,所以postfix会信任它。

打开/closures用户存在检查的具体选项是smtpd_reject_unlisted_recipient 。 您可以阅读官方文档的文档 。

参考资料: 这个线程