Ubuntu / Postfix不接收来自外部的电子邮件

我正在尝试将我的Amazon EC2实例configuration为接收带有Postfix的电子邮件。 我尝试了几个小时,但我从未收到一封电子邮件。 如果我从同一台服务器terminal发送电子邮件, 这是工作

echo "My message" | mail -s subject [email protected] 

但是,如果我尝试从外部发送电子邮件,如Gmail。 我没有收到它。 我的端口25打开。 我也没有收到任何交付失败的消息。 无法从后缀日志find任何相关的问题。 Appriciate如果有人可以帮助我找出问题。

这是我的后缀configuration文件。

 # 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 # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for # information on enabling SSL in the smtp client. smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination myhostname = example.com virtual_alias_maps = hash:/etc/postfix/virtual alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = example.com 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 alias_maps = hash:/etc/aliases 

在这里输入图像说明

Alexbuild议swaks输出如下。

 === Trying 52.62.94.158:25... === Connected to 52.62.94.158. <- 220 example.com ESMTP Postfix (Ubuntu) -> EHLO ip-172-31-21-89.ap-southeast-2.compute.internal <- 250-example.com <- 250-PIPELINING <- 250-SIZE 10240000 <- 250-VRFY <- 250-ETRN <- 250-STARTTLS <- 250-ENHANCEDSTATUSCODES <- 250-8BITMIME <- 250 DSN -> MAIL FROM:<[email protected]> <- 250 2.1.0 Ok -> RCPT TO:<[email protected]> <- 250 2.1.5 Ok -> DATA <- 354 End data with <CR><LF>.<CR><LF> -> Date: Sat, 12 Mar 2016 23:08:43 +1100 -> To: [email protected] -> From: [email protected] -> Subject: Test -> X-Mailer: swaks v20130209.0 jetmore.org/john/code/swaks/ -> -> This is a test mailing -> -> . <- 250 2.0.0 Ok: queued as E44EE642AD -> QUIT <- 221 2.0.0 Bye 

我收到了这封电子邮件。 然后我再次尝试从我的Gmail发送一封电子邮件。 不幸的是失败了。 而当我尝试从这里检查我的[email protected]电子邮件。 它说“不好” http://verify-email.org/

您的MXlogging指向名称smtp.example.com ,但是该名称没有任何地址logging。

 $ host example.com example.com has address 52.62.94.158 example.com mail is handled by 10 smtp.example.com. $ host smtp.example.com Host smtp.example.com not found: 3(NXDOMAIN) 

邮件为您的域名,因此无法投递。