Postfix无法接收外部邮件

我试图设置一个邮件服务器来接收电子邮件,我正在与一个Elastic IP和反向DNS查找指向我的域的Ubuntu EC2实例上的Postfix。

我能够在本地帐户之间发送和接收电子邮件,但无法接收外部电子邮件。

我已经设置了我的MXlogging,并能够telnet到端口25没有问题,但我仍然怀疑,如果我的MXlogging是正确的

A mail.example.in 123.123.3.11 (delete) 300 2010-10-12 03:37:24 A example.in 123.123.3.11 (delete) 300 2010-10-11 04:34:53 MX example.in mail.example.in (delete) 300 10 2010-10-12 02:03:03 A www.example.in 123.123.3.11 (delete) 300 2010-10-11 04:34:15 MX www.example.in mail.example.in (delete) 300 10 2010-10-12 02:12:51 

netstat -nl给我

 Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:2000 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN tcp6 0 0 :::22 :::* LISTEN tcp6 0 0 :::25 :::* LISTEN udp 0 0.0.0.0:68 0.0.0.0:* 

我的/etc/postfix/main.cf如下所示

 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-mail.pem smtpd_tls_key_file = /etc/ssl/private/ssl-mail.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. myhostname = www.example.in mydomain = example.in alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = $mydomain mydestination = $myhostname,localhost.$mydomain, localhost, $mydomain relayhost = #mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mynetworks_style = host mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all local_recipient_maps = virtual_alias_domains = www.example.in virtual_alias_maps = hash:/etc/postfix/virtual inet_protocols = all home_mailbox = Maildir/ smtpd_sasl_auth_enable = yes smtpd_sasl_type = dovecot smtpd_sasl_path = private/dovecot-auth smtpd_sasl_authenticated_header = yes smtpd_sasl_security_options = noanonymous smtpd_sasl_local_domain = $myhostname broken_sasl_auth_clients = yes smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination smtpd_sender_restrictions = reject_unknown_sender_domain mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/conf.d/01-dovecot-postfix.conf -n -m "${EXTENSION}" smtp_use_tls = yes smtpd_tls_received_header = yes smtpd_tls_mandatory_protocols = SSLv3, TLSv1 smtpd_tls_mandatory_ciphers = medium smtpd_tls_auth_only = yes tls_random_source = dev:/dev/urandom 

看到没有实际到达我的服务器的邮件的日志,没有在/ var / log / syslog的细节

我确定我缺less一些基本的东西,想要如何去设置这一点帮助。

我已经在/ etc / postfix / virtual中设置了一个可以在本地邮件中使用的ID。 我打算使用ruby处理传入的邮件,但是我一直无法启动和运行。

我的邮件不断收到以下消息

这是一个自动生成的传送状态通知

这仅是一个警告信息。

你不用重新发送你的讯息。

传递到下列收件人已被推迟:

信息将被重试2天(s)

临时失败的技术细节:
收件人服务器不接受我们的连接请求。 通过http://mail.google.com/support/bin/answer.py?answer=7720了解详情
 [mail.example.in。  (10):连接超时]

提前致谢

如果您可以通过IP从networking外部访问服务器,则MXlogging一定有问题。 谷歌的一个开放的中继testing仪,把你的IP在那里,看看它是否能够连接到服务器。

连接超时通常是由以下两种情况之一引起的:防火墙正在进行连接(可能位于服务器本身或networking防火墙上),或者IP地址错误,并指向没有任何可以拒绝连接的未使用的地址。 请注意,如果您只是更改了DNSconfiguration,具体取决于您的DNSlogging告诉每个人caching查找结果的时间长度,他们可能仍会使用旧信息一段时间。

如果IP从您的networking外部工作,并且从设置DNScaching已经更新了足够长的时间,那么在没有真实信息的情况下,弄清楚MXlogging出了什么问题并不容易。 MXlogging的唯一规则是
1)MXlogging必须包含一个主机名(不是IP)和
2)主机名必须有一个包含其IP(不是CNAME)的Alogging,
大多数邮件服务器识别一个完全无效的MXlogging,并popup消息说这样。

你最好的select是使用dig MX example.in应该产生类似的东西

 ;; ANSWER SECTION: example.in. 6400 IN MX mail.example.in. 

然后, dig A mail.example.in应该说类似的东西

 ;; ANSWER SECTION: mail.example.in. 6400 IN A xxx.xxx.xxx.xxx 

我唯一能想到的另一件事是,在你粘贴的匿名样本DNSconfiguration中,终止“。”。 是从主机名丢失,但我不知道是否是因为你的search和replace,或者是因为粘贴来自某种网页编辑器,可能是隐藏那些终止你的。 您粘贴的退回邮件使用“mail.example.in”。 所以我怀疑这只是隐藏。

如果IP不能从networking外部工作,那么你需要检查服务器防火墙(Linux上的iptables),以确保它不会阻塞连接。 如果可以从networking中的另一台计算机进行连接,则该端口将被networking防火墙/路由器阻止,或者您的ISP阻止了SMTP。

另外,请确保您的弹性IP与您的实例正确关联。 这看起来像一个非常复杂的操作根据这里的文档: http : //developer.amazonwebservices.com/connect/entry.jspa? externalID= 1346

你说你对你的MXlogging有怀疑。 在不知道域名的情况下检查它们并不容易,但可以尝试dig MX yourdomain.com以查看出现的情况。 如果这不是你的服务器的IP,那么你的问题。

如果你知道你的MX是正确的,接下来我要尝试的不仅仅是远程login到端口25,而是通过使用telnet来实际推送邮件消息。 SMTP协议是直接在命令中input命令的原因。 RFC 821具有协议的细节; 您只需发送EHLO,然后告诉您要邮寄给谁,邮件来自哪个地址,然后通过DATA开始发送文本。 接近。 在一行上,它应该接受消息或给你一个错误消息。

尽pipe如此,我还是在赌MXlogging。