运行Ubuntu 12.04并尝试configurationpostfix通过GMAIL中继发送和接收。 我遇到了连接问题,特别是TLS。 已经尝试了一堆故障排除解决scheme,并已改变我的main.cf来解决TLS,但仍然收到以下错误。
试图debugging连接问题:
`root@mailservice:/etc/postfix# openssl s_client -connect localhost:587 -starttls smtp`
我承认这些错误
`connect: Connection refused' 'connect:errno=111`
在我的日志中我看到:
Jun 11 13:54:31 mailservice postfix/smtp[3765]: warning: cannot get RSA certificate from file /etc/postfix/cert.pem: disabling TLS support Jun 11 13:54:31 mailservice postfix/smtp[3765]: warning: TLS library problem: 3765:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:696:Expecting: TRUSTED CERTIFICATE: Jun 11 13:54:31 mailservice postfix/smtp[3765]: warning: TLS library problem: 3765:error:140DC009:SSL routines:SSL_CTX_use_certificate_chain_file:PEM lib:ssl_rsa.c:729: Jun 11 13:54:31 mailservice postfix/smtp[3765]: 9986B6846A: to= <[email protected]>, relay=smtp.gmail.com[173.194.77.109]:587, delay=0.15, delays=0.02/0.02/0.09/0.02, dsn=5.7.0, status=bounced (host smtp.gmail.com[173.194.77.109] said: 530 5.7.0 Must issue a STARTTLS command first. hd9sm12170509obc.6 (in reply to MAIL FROM command))
我的main.cf(属于TLS)的内容如下所示:
#TLS Parameters smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache #TLS Settings smtp_use_tls = yes smtp_tls_security_level = may smtp_tls_loglevel = 1 smtp_enforce_tls = yes smtp_tls_CAfile = /etc/postfix/cacert.pem smtp_tls_cert_file = /etc/postfix/cert.pem smtp_tls_key_file = $smtp_tls_cert_file smtp_tls_session_cache_dataabase = btree:/var/run/smtp_tls_session_cache smtp_tls_note_starttls_offer = yes smtpd_use_tls = yes smtpd_tls_security)level = may smtpd_tls_auth_only = no smtpd_tls_CAfile = /etc/postfix/cacert.pem smtpd_tls_cert_file = /etc/postfix/cert.pem smtpd_tls_key_file = /etc/postfix/key.pem smtpd_tls_received_header = yes smtpd_tls_session_cache_database = btree:/var/run/smtpd_tls_session_cache smtpd_tls_session_cache_timeout = 3600s tls_random_source = dev:/dev/urandom
据我可以告诉一切都是为了一个适当的TLS连接,我不确定什么需要改变在main.cf或其他地方邮件发送。
Postix表示,它无法访问证书。 它们不会被创build或存储的权限过于限制。
你需要检查所有的文件是由postfix有限的用户访问。 您可以检查哪个用户后缀运行如下:
postconf mail_owner
之后,你应该让这个用户访问你的configuration文件中提到的所有密钥/证书。
例如我的键看起来像:
-r--r----- 1 postfix cyrus 668 4 Apr 13:17 somehost.pk
来自: http : //www.postfix.org/TLS_README.html …
服务器端TLS活动日志logging…
仅在出现问题时才使用日志级别3。
更多…
要获得有关Postfix SMTP服务器TLS活动的更多信息,您可以将日志级别从0..4增加。 每个日志logging级别还包括以较低日志logging级别logging的信息。
级别Postfix 2.9及更高版本早期版本。
仅在出现问题时才使用日志级别3。 强烈build议不要使用日志级别4。