通过“Gmail”帐户发送电子邮件的Postfix错误

我试图通过我的个人“Gmail”帐户发送一封电子邮件到其他使用Fedora 23的“Gmail”帐户。这个想法是通过Postfix发送一个电子邮件(用于服务器警报),但我没有公司/个人域名。 我正在使用这个Postfixconfiguration:

alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases command_directory = /usr/sbin compatibility_level = 2 daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix debug_peer_level = 2 debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5 html_directory = no inet_interfaces = all inet_protocols = all mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man meta_directory = /etc/postfix mydestination = $myhostname, localhost.$mydomain, localhost mynetworks = 185.12.5.172 newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix/README_FILES relayhost = [smtp.gmail.com]:587 sample_directory = /usr/share/doc/postfix/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop shlib_directory = /usr/lib64/postfix smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt smtp_tls_policy_maps = hash:/etc/postfix/tls_policy smtp_use_tls = yes unknown_local_recipient_reject_code = 550 

另外我做一个文件的名称 – “sasl_password”:

 [smtp.gmail.com]:587 [email protected]:password 

但是由于“/ var / log / maillog”中的这些错误,Postfix无法发送它:

 Nov 29 19:35:37 domain postfix/qmgr[4911]: 4A7B318739D4: from=<>, size=2577, nrcpt=1 (queue active) Nov 29 19:35:37 domain postfix/smtp[6080]: cannot load Certification Authority data, CAfile="/etc/ssl/certs/ca-certificates.crt": disabling TLS support Nov 29 19:35:37 domain postfix/smtp[6080]: warning: TLS library problem: error:02001002:system library:fopen:No such file or directory:bss_file.c:168:fopen('/etc/ssl/certs/ca-certificates.crt','r'): Nov 29 19:35:37 domain postfix/smtp[6080]: warning: TLS library problem: error:2006D080:BIO routines:BIO_new_file:no such file:bss_file.c:171: Nov 29 19:35:37 domain postfix/smtp[6080]: warning: TLS library problem: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib:by_file.c:258: Nov 29 19:35:37 domain postfix/smtp[6080]: 4A7B318739D4: TLS is required, but our TLS engine is unavailable Nov 29 19:35:38 domain postfix/smtp[6080]: 4A7B318739D4: TLS is required, but our TLS engine is unavailable Nov 29 19:35:38 domain postfix/smtp[6080]: connect to smtp.gmail.com[2a00:1450:4010:c09::6d]:587: Network is unreachable Nov 29 19:35:38 domain postfix/smtp[6080]: 4A7B318739D4: to=<linuxuser@domain>, relay=none, delay=1801, delays=1800/0.03/0.34/0, dsn=4.4.1, status=deferred (connect to smtp.gmail.com[2a00:1450:4010:c09::6d]:587: Network is unreachable) Nov 29 19:38:44 domain postfix/smtpd[6162]: connect from localhost[::1] Nov 29 19:39:19 domain postfix/smtpd[6162]: NOQUEUE: reject: RCPT from localhost[::1]: 550 5.1.1 <[email protected]>: Recipient address rejected: User unknown in local recipient table; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<localhost> Nov 29 19:39:31 domain postfix/smtpd[6162]: disconnect from localhost[::1] ehlo=1 mail=1 rcpt=0/1 quit=1 commands=3/4 Nov 29 19:39:33 domain postfix/smtpd[6162]: connect from localhost[::1] Nov 29 19:40:04 domain postfix/smtpd[6162]: NOQUEUE: reject: RCPT from localhost[::1]: 550 5.1.1 <[email protected]>: Recipient address rejected: User unknown in local recipient table; from=<root@localhost> to=<[email protected]> proto=ESMTP helo=<localhost> Nov 29 19:41:50 domain postfix/smtpd[6162]: disconnect from localhost[::1] ehlo=1 mail=1 rcpt=0/1 quit=1 commands=3/4 Nov 29 19:45:10 domain postfix/anvil[6164]: statistics: max connection rate 2/60s for (smtp:::1) at Nov 29 19:39:33 Nov 29 19:45:10 domain postfix/anvil[6164]: statistics: max connection count 1 for (smtp:::1) at Nov 29 19:38:44 Nov 29 19:45:10 domain postfix/anvil[6164]: statistics: max cache size 1 at Nov 29 19:38:44 

编辑1:

在编辑SSLauthentication并设置我的Google帐户以降低安全性后,我成功修复了这个问题。 我使用这个教程:

https://community.runabove.com/kb/en/instances/how-to-relay-postfix-mails-via-smtp.gmail.com-on-ubuntu-14.04.html

首先,您已经强制TLS,但您的TLSconfiguration无效。 纠正您的TLSconfiguration或closuresTLS。

接下来,你的服务器不能联系Gmail。 这可能是因为它试图使用IPv6。 如果您没有IPv6连接,请在操作系统或后缀中closuresIPv6(在main.cf inet_protocolsall更改为ipv4

第三,你的服务器似乎认为它是权威的Gmail,但我不明白为什么。