smtpd_tls_auth_only排除127.0.0.1

我configuration后缀强制使用TLS。 当外部客户端尝试使用此服务器发送电子邮件时,没有任何问题。 但是使用webmail(127.0.0.1)postfix希望TLS:

delivery temporarily suspended: TLS is required, but was not offered by host 127.0.0.1[127.0.0.1]) 

master.cf需要做哪些修改?

 smtp_use_tls = yes smtp_tls_security_level = encrypt smtpd_use_tls = yes smtpd_tls_auth_only = yes smtpd_tls_key_file = /etc/postfix/ssl/xxx.key smtpd_tls_cert_file = /etc/postfix/ssl/xxx.crt smtpd_tls_loglevel = 1 smtpd_tls_received_header = yes smtpd_tls_session_cache_timeout = 3600s tls_random_source = dev:/dev/urandom smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache 

你可以:

  1. smtp_tls_security_level = may
    这将允许您的服务器将邮件传递给不提供TLS的主机或带有错误证书的主机(因为它会以未encryption的方式重试)。
  2. smtpd_tls_security_level = may这将导致您的服务器在任何侦听端口上向客户端提供TLSencryption。
  3. smtpd_tls_security_level = encrypt这将导致您的服务器要求任何监听端口上的所有客户端进行TLSencryption。

对于互联网主机,通常做1和2,但你比我更了解你的要求。

我怀疑你可以做到这一点,而不运行postfix的第二个实例与smtpd_tls_auth_only设置为no,然后更改webmail软件发送邮件到该实例。

您可能会考虑重新configurationWebmail,以便尽可能使用TLS,或者直接在本地传递邮件,而不是使用TCP连接。

stunnel将解决这个问题。 它创build一个SSL(TLS)连接到后缀:

http://www.stunnel.org/examples/