LDAP 后缀“用户不存在”

LDAP 后缀“用户不存在”

我有一台 Postfix 服务器,它通过 LMTP 将所有电子邮件转发到 Dovecot 服务器。用户名/组保存在 389 目录服务器 (LDAP) 中

在 /etc/postfix/transport 中我有几行(每个我托管的域一行):

mydomain.com                   lmtp:inet:[192.168.50.223]:10025

在 /etc/postfix/main.cf 中我有:

relay_recipient_maps = proxy:ldap:/etc/postfix/ldap-users-389.cf
...
virtual_alias_maps = ldap:/etc/postfix/ldap-groups-389.cf
...
transport_maps = hash:/etc/postfix/transport

在 /etc/postfix/ldap-users-389.cf 中:

server_host = ds
search_base = ou=people,dc=adomaine,dc=tld
version = 3
query_filter = (&(objectClass=nsPerson)(|(mail=%s)(mailAlternateAddress=%s)))
result_attribute = mail
#result_filter = OK
bind = yes
bind_dn = cn=Directory Manager
bind_pw = XXXXXXXXXX

在 /etc/postfix/ldap-groups-389.cf 中:

server_host = ds
search_base = ou=groups,dc=adomain,dc=tld
version = 3
query_filter = (&(objectClass=mailgroup)(|(mail=%s)(mail=%d)))
leaf_result_attribute = mail
special_result_attribute = uniqueMember
bind = yes
bind_dn = cn=Directory Manager
bind_pw = XXXXXXXX

我在 LDAP 中设置了一个“人员”:

dn=cn=myname,ou=people,dc=yellowgnu,dc=net

具有以下属性:

objectClass top
objectClass nsPerson
objectClass nsAccount
objectClass nsOrgPerson
objectClass posixAccount
objectClass mailrecipient
cn  myname
mail    [email protected]
mailAlternateAddress    [email protected]

我在 Postfix 服务器的 /var/log/maillog 中看到的错误是:

May  7 18:33:54 mx postfix/lmtp[16088]: D29FE60E5173: to=<[email protected]>, relay=192.168.50.223[192.168.50.223]:10025, delay=39, delays=33/0.01/0.01/5.9, dsn=5.1.1, status=bounced (host 192.168.50.223[192.168.50.223] said: 550 5.1.1 <[email protected]> User doesn't exist: [email protected] (in reply to RCPT TO command))

即使在 LDAP 日志中我也看到类似的内容:

[07/May/2023:18:33:34.962281900 +0300] conn=235 op=21 SRCH base="ou=people,dc=adomain,dc=tld" scope=2 filter="(&(objectClass=nsPerson)(|([email protected])(mailAlternateAddress=
[email protected])))" attrs="mail"
[07/May/2023:18:33:36.665394512 +0300] conn=235 op=21 ENTRY dn="cn=myname,ou=people,dc=adomaine,dc=tld"
[07/May/2023:18:33:36.866690132 +0300] conn=235 op=21 RESULT err=0 tag=101 nentries=1 wtime=1.014704138 optime=1.951879611 etime=2.966580180

并且,当我在 Postfix 服务器上运行以下命令时,它会生成我期望电子邮件传送到的实际电子邮件地址:

# postmap -q [email protected] ldap:/etc/postfix/ldap-users-389.cf
[email protected]

谢谢 !

相关内容