我正在尝试按照本指南在Ubuntu 12.04中设置postfix和dovecot的邮件服务器。 似乎所有的工作正确,当我尝试这个echo test | mail [email protected] echo test | mail [email protected]一切按预期运作。 但是,当我尝试从我的Gmail帐户发送邮件到服务器,我得到这个错误
Delivery to the following recipient failed permanently: [email protected] Technical details of permanent failure: Google tried to deliver your message, but it was rejected by the server for the recipient domain example.org by aspmx.l.google.com. [2607:f8b0:4001:c05::1a]. The error that the other server returned was: 550-5.1.1 The email account that you tried to reach does not exist. Please try 550-5.1.1 double-checking the recipient's email address for typos or 550-5.1.1 unnecessary spaces. Learn more at 550 5.1.1 http://support.google.com/mail/bin/answer.py?answer=6596 m1si13660174ige.61 - gsmtp
我试图用这个testing邮件服务器,我得到了1个错误,因为我的HTTPS证书是无效的,7个警告因为我的自定义SMTP横幅和缺lessSPFlogging。 关于如何更改我的HTTPS证书的任何想法,如果它有与Gmail的问题?
我也尝试从这里在线发送邮件,我得到了这个结果:
Resolving hostname... Connecting... SMTP -> FROM SERVER: 220 floatnet.org ESMTP Postfix (Ubuntu) SMTP -> FROM SERVER: 250-floatnet.org 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-STARTTLS 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN MAIL FROM: [email protected] SMTP -> FROM SERVER: 530 5.7.0 Must issue a STARTTLS command first SMTP -> ERROR: MAIL not accepted from server: 530 5.7.0 Must issue a STARTTLS command first RCPT TO: [email protected] SMTP -> FROM SERVER: 530 5.7.0 Must issue a STARTTLS command first SMTP -> ERROR: RCPT not accepted from server: 530 5.7.0 Must issue a STARTTLS command first Message sending failed.
这是我的main.cf文件:
# See /usr/share/postfix/main.cf.dist for a commented, more complete version # Debian specific: Specifying a file name will cause the first # line of that file to be used as the name. The Debian default # is /etc/mailname. #myorigin = /etc/mailname smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) biff = no # appending .domain is the MUA's job. append_dot_mydomain = no # Uncomment the next line to generate "delayed mail" warnings #delay_warning_time = 4h readme_directory = no # 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_use_tls=yes #smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache #smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_tls_cert_file=/etc/ssl/certs/dovecot.pem smtpd_tls_key_file=/etc/ssl/private/dovecot.pem smtpd_use_tls=yes smtpd_tls_auth_only = yes smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth smtpd_sasl_auth_enable = yes smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination #smtpd_reject_unlisted_sender = no # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for # information on enabling SSL in the smtp client. myhostname = floatnet.org alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname #mydestination = floatnet.org, vps2473.directvps.nl, localhost.directvps.nl, localhost mydestination = localhost virtual_transport = lmtp:unix:private/dovecot-lmtp virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf relayhost = mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all inet_protocols = all #smtpd_sasl_type = dovecot #smtpd_sasl_path = private/auth-client #smtpd_sasl_auth_enable = yes #smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
其实有两个不同的错误信息,虽然问题是一样的: 无法接收电子邮件 。
第一个错误是当你从GMAIL发送电子邮件。 这是错误的失败
Technical details of permanent failure: Google tried to deliver your message, but it was rejected by the server for the recipient domain domain.org by aspmx.l.google.com. [2607:f8b0:4001:c05::1a].
谷歌拒绝你的电子邮件的原因是因为floatnet.org的MXlogging被指向Gmail服务器而不是Postfix服务器。
$ dig floatnet.org MX +short 20 ALT2.ASPMX.L.GOOGLE.COM. 30 ASPMX4.GOOGLEMAIL.COM. 30 ASPMX3.GOOGLEMAIL.COM. 30 ASPMX5.GOOGLEMAIL.COM. 30 ASPMX2.GOOGLEMAIL.COM. 20 ALT1.ASPMX.L.GOOGLE.COM. 10 ASPMX.L.GOOGLE.COM.
解决scheme: 修复您的MXlogging 。
第二个错误是当你testing你的SMTP服务器时显示的。
Must issue a STARTTLS command first
这个错误是可能的重复的这个问题postfix TLSconfiguration传入gmx邮件 。 build议的解决scheme是将smtpd_tls_security_level更改为“可以”而不是“encryption”。
您的参数 smtpd_tls_auth_only = yes不允许您跳过TLS通讯。 因此,如果SMTP客户端无法(或拒绝)执行TLS,您的MTA将拒绝连接。 例如,您的telnet会话是明文(不是TLS)。
您可能会在 /etc/posfix/main.cf缺lesssmtp_use_tls=yes