使用LDAP查找的Postfix适用于virtual_mailbox_maps,但virtual_mailbox_domains失败

我在Debian Squeeze上设置了一个Postfix / Dovecot / LDAP服务器,使用所有虚拟邮箱(而不是别名)。 我已经成功地设置了Dovecot,并且让Postfix正确地查找了虚拟邮箱地址的ldap,但是一旦我连接了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 virtual_mailbox_maps的ldap查找也不起作用。 dovecot virtual_transport正在工作。 出于某种原因,这被忽视了,所以没有LDAP的查询工作从后缀,但他们正在后期工作。

这只是一个有教养的猜测,但是你可能会在/var/spool/postfix丢失/dev/random/dev/urandom

正如你所看到的,简单重写过程被SIGABRT杀死,这通常发生在Debian和Ubuntu系统(在Postfix的上下文中),因为与GnuTLS链接的libldap没有find/dev/random/dev/urandom在Postfix的chroot目录/var/spool/postfix 。 我也曾经遇到过这个问题。

只要mkdir /var/spool/postfix/devcp -a /dev/urandom /var/spool/postfix/devcp -a /dev/random /var/spool/postfix/dev ,或者使用mknod /var/spool/postfix/dev

有关讨论,请参阅https://bugs.launchpad.net/ubuntu/+source/postfix/+bug/81242和http://comments.gmane.org/gmane.mail.postfix.user/211261