mysql 后缀:虚拟域、邮箱、别名:本地生成邮件的未知用户(使用sendmail)

kqhtkvqz  于 2023-02-03  发布在  Mysql
关注(0)|答案(1)|浏览(181)

我有一个服务器与Postfix 2.9.6和虚拟用户,域和别名与MySQL.当我发送邮件到别名从另一个邮件服务器或使用系统的MUA(Squirrel或Thunderbird),邮件会正确地传递到别名的GOTO。但当邮件从服务器发送时(例如,使用fail2ban的mail操作,或仅使用sendmail),服务器将以"未送达邮件返回给发件人"和unknown user作为描述进行响应。
我做错了什么?我可以在哪里继续调试?(我已经做了很多测试和搜索,没有胶水)。
我相信MySQL的配置文件是不需要的,因为当邮件来自服务器外部,甚至来自使用任何MUA的现有本地用户时,它们都能很好地工作。无论哪种方式,它们都是虚拟用户的标准,到MySQL的连接肯定是工作的。

    • 一个月一个月:**
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
default_destination_concurrency_limit = 20
default_destination_recipient_limit = 600
defer_transports = hold
disable_vrfy_command = no
header_size_limit = 102400
hopcount_limit = 50
html_directory = /usr/share/doc/postfix/html
inet_interfaces = all
inet_protocols = all
initial_destination_concurrency = 35
local_destination_concurrency_limit = 20
mailbox_size_limit = 0
maximal_queue_lifetime = 2d
message_size_limit = 36909875
mydestination = MY-HOSTNAME.example.com, old-name.example.com, localhost.localdomain, localhost
myhostname = MY-HOSTNAME.example.com
mynetworks = 127.0.0.0/8
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_bcc_maps = regexp:/etc/postfix/recipient_bcc
recipient_delimiter = +
relayhost =
sender_bcc_maps = regexp:/etc/postfix/sender_bcc
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP
smtpd_client_restrictions = permit_sasl_authenticated check_client_access hash:/etc/postfix/access_client reject_rbl_client sbl-xbl.spamhaus.org reject_rbl_client bl.spamcop.net reject_rbl_client cbl.abuseat.org
smtpd_data_restrictions = permit_mynetworks permit_sasl_authenticated check_client_access regexp:/etc/postfix/add_auth_header.regexp reject_unauth_pipelining
smtpd_delay_reject = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated check_recipient_access hash:/etc/postfix/access_recipient check_recipient_access regexp:/etc/postfix/filter-filtra.regexp reject_non_fqdn_recipient reject_unknown_recipient_domain reject_unauth_destination reject_unverified_recipient check_policy_service inet:127.0.0.1:60000
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sender_restrictions = permit_mynetworks permit_sasl_authenticated check_client_access hash:/etc/postfix/access_client check_sender_access hash:/etc/postfix/access_sender reject_rbl_client bl.spamcop.net reject_rbl_client sbl-xbl.spamhaus.org reject_non_fqdn_sender reject_rbl_client bb.barracudacentral.org reject_unknown_sender_domain
smtpd_tls_cert_file = /etc/ssl/private/multidomain.pem
smtpd_tls_key_file = /etc/ssl/private/multidomain.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
tcp_windowsize = 14000
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
unknown_relay_recipient_reject_code = 550
unknown_virtual_alias_reject_code = 550
unknown_virtual_mailbox_reject_code = 550
unverified_recipient_reject_code = 550
unverified_sender_reject_code = 450
vacation_destination_recipient_limit = 1
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql_virtual_alias_maps.cf regexp:/etc/postfix/aliases-regexp
virtual_gid_maps = static:89
virtual_mailbox_base = /home/vpopmail/domains
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_limit = 1024000000
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_mailbox_maps.cf
virtual_maildir_extended = yes
virtual_maildir_limit_message = Sorry, the user's maildir has no space available in their inbox.
virtual_minimum_uid = 89
virtual_overquota_bounce = yes
virtual_transport = virtual
virtual_uid_maps = static:89
  • /etc/后缀/传输:*
autoreply.example.com        vacation:
  • /etc/后缀/别名-正则表达式:*
/user[0-9]{4}@example\.com/ user@example.com
  • /etc/后缀/筛选器-筛选器正则表达式:*
/user1@example.com/ FILTER smtp-amavis:[127.0.0.1]:10026
/^/ FILTER smtp-amavis:[127.0.0.1]:10024
e4eetjau

e4eetjau1#

我自己发现了问题(和解决方案!):)
master.cf中,pickup服务有一个额外的配置选项,该选项将cleanup重定向到pre-cleanuppre-cleanup禁用了虚拟别名(类似于https://amavis.org/README.postfix.html#d0e1038)。只需注解pre-cleanup选项(允许拾取使用正常的cleanup服务)即可解决该问题。
变更前(错误):

pickup  fifo    n       -       -       60      1       pickup
   -o cleanup_service_name=pre-cleanup

变更后(正确):

pickup  fifo    n       -       -       60      1       pickup
#   -o cleanup_service_name=pre-cleanup

相关问题