无法发送带有本地部分分隔符的电子邮件(Postfix + LDAP)

无法发送带有本地部分分隔符的电子邮件(Postfix + LDAP)

我刚刚移动了我的邮件服务器。随着移动,Postfix 从 3.1 更新到了 3.4(Ubuntu 16.04 更新到了 20.04)。

在 Postfix 3.1 安装中,我能够+使用本地部分的分隔符发送和接收电子邮件。使用 Postfix 3.4 的相同配置,我收到电子邮件+在本地部分,但当我尝试发送一封电子邮件+(例如[电子邮件保护])服务器返回

5.7.1 <holger+testmail@[redacted]>: Sender address rejected: not owned by user

在我的主配置文件,虚拟地图的映射如下:

virtual_alias_maps = 
  hash:/etc/aliases,
  proxy:ldap:/etc/postfix/ldap-forwarding.cf, 
  proxy:ldap:/etc/postfix/ldap-aliases.cf
virtual_mailbox_domains = proxy:ldap:/etc/postfix/ldap-domains.cf
virtual_mailbox_maps = ldap:/etc/postfix/ldap-virtual-maps.cf

发件人限制如下:

smtpd_sender_login_maps = unionmap:{proxy:ldap:/etc/postfix/ldap-aliases.cf,pcre:/etc/postfix/sender_login_override.pcre}
smtpd_sender_restrictions = permit_mynetworks, 
  reject_authenticated_sender_login_mismatch, 
  permit_sasl_authenticated, 
  reject_non_fqdn_sender, 
  reject_unknown_sender_domain, 
  reject_unlisted_sender,
  reject_unauth_pipelining, 
  reject_unknown_reverse_client_hostname, 
  reject_unknown_client_hostname, 

当然,还设置了分隔符:

recipient_delimiter = +

ldap-转发.cf

version = 3
server_host = localhost
server_port = 389

bind_dn = [redacted]
bind_pw = [redacted]
search_base = ou=Users,dc=[redacted]
query_filter = (&(|(uid=%u)(mail=%s)(mailAlternateAddress=%s))(objectClass=qmailUser)(accountStatus=forward))
result_attribute = mailForwardingAddress

ldap_aliases.cf

version = 3
server_host = localhost
server_port = 389

bind_dn = [redacted]
bind_pw = [redacted]
search_base = ou=Users,dc=[redacted]
query_filter = (&(|(uid=%u)(mailAlternateAddress=%s)(mail=%s))(objectClass=qmailUser)(|(accountStatus=active)(accountStatus=shared)(accountStatus=forward)))
result_attribute = uid
result_format = %u

ldap-域.cf

version = 3
server_host = localhost
server_port = 389

bind_dn = [redacted]
bind_pw = [redacted]
search_base = ou=DNS,ou=System,dc=[redacted]
query_filter = (associatedDomain=%s)
result_attribute = associatedDomain

ldap-虚拟地图.cf

version = 3
server_host = localhost
server_port = 389

bind_dn = [redacted]
bind_pw = [redacted]
search_base = ou=Users,dc=[redacted]
query_filter = (&(|(mail=%s)(mailAlternateAddress=%s))(|(accountStatus=active)(accountStatus=shared)))
result_attribute = mailMessageStore

我似乎找不到问题所在。任何提示都非常感谢。此外,如果需要任何进一步的信息,我很乐意添加。

更新 1,2021-01-27,21:24 CET: 好的,我首先找到了导致问题的原因:

unionmap:{proxy:ldap:/etc/postfix/ldap-aliases.cf,pcre:/etc/postfix/sender_login_override.pcre}

将其更改为

proxy:ldap:/etc/postfix/ldap-aliases.cf

让我+再次使用它发送邮件。现在的问题是,这应该发生吗?如果是这样,我该如何定义一般规则的例外情况?

相关内容