【发布时间】:2021-10-06 23:13:32
【问题描述】:
我在 Server 2019 上有 postfix 3.3.0 和 Active Directory。我希望连接安全并验证服务器证书。
尝试发送电子邮件时,我无法在syslog 中看到它。
postfix/submission/smtpd[7432]: warning: dict_ldap_set_tls_options: Unable to allocate new TLS context -1: Can't contact LDAP server
这是/etc/postfix/ldap-users.cf的内容
bind = yes
bind_dn = {valid bind account}
bind_pw = {valid bind password}
version = 3
timeout = 20
size_limit = 1
expansion_limit = 0
start_tls = yes
tls_require_cert = yes
tls_ca_cert_file = /var/spool/postfix/mydomain.tld.crt
server_host = ldap://dc.mydomain.tld/
search_base = dc=mydomain,dc=tld
scope = sub
query_filter = (&(objectClass=person)(mail=%s))
result_attribute = mail
result_format = %s
使用此配置,postmap -q test@mydomain.tld ldap:/etc/postfix/ldap-users.cf 可以工作。 openssl s_client -starttls ldap -connect dc.mydomain.tld:389 也有效(没有验证错误)。即使使用tls_require_cert = no,它仍然失败。当start_tls = no 时,一切正常。
在我指定tls_ca_cert_file 之前,我将我的.crt 导入ca-certificates。我收到的错误是postfix/postmap[4994]: error: dict_ldap_connect: Unable to set STARTTLS: -11: Connect error。似乎 Postfix 没有从计算机证书存储中读取。在使用我的home 中的tls_ca_cert_file 进行测试后,它变成了我现在遇到的错误,-1。我首先尝试从/etc/postfix,然后现在 chroot home(基于 Internet 建议 Postfix 无法访问它)。
【问题讨论】:
标签: active-directory postfix-mta starttls