Postfix 使用 LDAP 查找适用于 virtual_mailbox_maps,但无法查找 virtual_mailbox_domains

Postfix 使用 LDAP 查找适用于 virtual_mailbox_maps,但无法查找 virtual_mailbox_domains

我正在 Debian Squeeze 上设置 Postfix/Dovecot/LDAP 服务器,其中包含所有虚拟邮箱(而不是别名)。我已成功设置 Dovecot,并让 Postfix 正确地向 ldap 查找 virtual_mailbox_maps,但一旦我连接 virtual_mailbox_domains,就会出现这些错误,并且无法送达:

Jun  5 15:52:51 extranet postfix/smtpd[2090]: warning: problem talking to service rewrite: Success
Jun  5 15:52:51 extranet postfix/master[1432]: warning: process /usr/lib/postfix/trivial-rewrite pid 2219 killed by signal 6
Jun  5 15:52:51 extranet postfix/master[1432]: warning: /usr/lib/postfix/trivial-rewrite: bad command startup -- throttling

这里是postconf -d mail_version

# postconf -d mail_version
mail_version = 2.7.1

这里是postconf -n

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
allow_percent_hack = no
allow_untrusted_routing = yes
append_dot_mydomain = no
biff = no
bounce_queue_lifetime = 24h
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
debug_peer_level = 2
debug_peer_list = 124.149.148.61
delay_warning_time = 4h
disable_vrfy_command = yes
html_directory = /usr/share/doc/postfix/html
inet_interfaces = all
mailbox_size_limit = 0
maximal_queue_lifetime = 24h
mydestination = mail.example.com, extranet.example.com, localhost
myhostname = mail.example.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = /usr/share/doc/postfix
recipient_delimiter = +
relay_domains = $mydestination
relayhost = 
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_data_restrictions = reject_unauth_pipelining, permit
smtpd_helo_required = yes
smtpd_recipient_restrictions = reject_non_fqdn_recipient,
    permit_mynetworks, reject_unauth_destination,
    check_recipient_access hash:/etc/postfix/access,
    reject_non_fqdn_sender, check_sender_access hash:/etc/postfix/sender_access,
    reject_non_fqdn_hostname, reject_invalid_hostname, check_helo_access hash:/etc/postfix/helo_access,
    reject_rbl_client zen.spamhaus.org, reject_rbl_client bl.spamcop.net, permit
smtpd_sasl_auth_enable = no
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/certs/mail.example.com.2013.chain.pem
smtpd_tls_key_file = /etc/ssl/private/exampl.2013.key
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtpd_use_tls = no
virtual_mailbox_domains = ldap:/etc/postfix/ldap_virtual_domains.cf
virtual_mailbox_maps = ldap:/etc/postfix/ldap_virtual_maps.cf
virtual_transport = dovecot

/etc/postfix/ldap_virtual_maps.cf:

server_host = ldaps://mail.example.com/
search_base = ou=People,dc=example,dc=com
version = 3
bind_dn = uid=mail,ou=Services,dc=example,dc=com
bind_pw = *************
query_filter = (&(objectclass=inetOrgPerson)(mail=%s))
result_attribute = mail

这是 /etc/postfix/ldap_virtual_domains.cf:

server_host = ldaps://mail.example.com/
search_base = ou=Domains,dc=example,dc=com
version = 3
bind_dn = uid=mail,ou=Services,dc=example,dc=com
bind_pw = ************
query_filter = associatedDomain=%s
result_attribute = associatedDomain

如果我使用 postmap 运行手动检查,我会收到响应:

# postmap -q example.com ldap:/etc/postfix/ldap_virtual_domains.cf
example.com

手动 ldapsearches 也很好用。我对成功的 virtual_mailbox_maps 使用相同的凭据,它正在工作,所以我很困惑。

PS ldap 查找 virtual_mailbox_maps 也不起作用。dovecot virtual_transport 正常工作。出于某种原因,忽略了这一点,因此 postfix 中的 LDAP 查询不起作用,但它们对 postmap 起作用。

答案1

这只是一个有根据的猜测,但您可能遗漏了/dev/random或。/dev/urandom/var/spool/postfix

如您所见,trivial-rewrite 进程被 SIGABRT 终止,这通常发生在 Debian 和 Ubuntu 系统上(在 Postfix 上下文中),因为与 GnuTLS 链接的 libldap 未找到/dev/random/dev/urandom位于 Postfix chroot 目录中/var/spool/postfix。我过去也遇到过这个问题。

只需根据需要和即可,或者在中使用mkdir /var/spool/postfix/devmknod 。cp -a /dev/urandom /var/spool/postfix/devcp -a /dev/random /var/spool/postfix/dev/var/spool/postfix/dev

https://bugs.launchpad.net/ubuntu/+source/postfix/+bug/81242http://comments.gmane.org/gmane.mail.postfix.user/211261进行一些讨论。

相关内容