Gmail 收不到 Centos Postfix 邮件

Centos Postfix mail not received in gmail

简单用例但不起作用。

我有一个 Web 应用程序,想配置 SMTP 服务器以从应用程序发送电子邮件。

已按照 link - http://tecadmin.net/bash-mail-command-not-found/ 安装了 mailx 一切顺利。

Test Sending email as:  echo "This is a test email body  " | mail -s "This is a test email " dk@xxx.com

现在我在日志中得到以下内容:

root@/var/log $ tail -f /var/log/maillog
Jul 19 16:47:57 bridgeapps-dev01 postfix/postfix-script[23104]: stopping the Postfix mail system
Jul 19 16:47:57 bridgeapps-dev01 postfix/master[1466]: terminating on signal 15
Jul 19 16:47:57 bridgeapps-dev01 postfix/postfix-script[23184]: starting the Postfix mail system
Jul 19 16:47:57 bridgeapps-dev01 postfix/master[23186]: daemon started -- version 2.10.1, configuration /etc/postfix
Jul 19 16:48:12 bridgeapps-dev01 postfix/pickup[23187]: 4163841204: uid=0 from=<root>
Jul 19 16:48:12 bridgeapps-dev01 postfix/cleanup[23194]: 4163841204: message-id=<20160719154812.4163841204@bridgeapps-dev01.localdomain>
Jul 19 16:48:12 bridgeapps-dev01 postfix/qmgr[23188]: 4163841204: from=<root@bridgeapps-dev01.localdomain>, size=582, nrcpt=1 (queue active)
Jul 19 16:48:12 bridgeapps-dev01 postfix/smtp[23196]: connect to ASPMX.L.GOOGLE.com[2a00:1450:400c:c09::1b]:25: Network is unreachable
Jul 19 16:48:12 bridgeapps-dev01 postfix/smtp[23196]: 4163841204: to=<dk@xxx.com>, relay=ASPMX.L.GOOGLE.com[64.233.166.26]:25, delay=0.47, delays=0.02/0.01/0.24/0.2, dsn=2.0.0, status=sent (250 2.0.0 OK 1468943292 l4si11397516wmf.56 - gsmtp)
Jul 19 16:48:12 bridgeapps-dev01 postfix/qmgr[23188]: 4163841204: removed

全绿色,没有错误,就像事情好得令人难以置信,我从来没有在 gmail 中收到这封邮件。

我错过了什么?

谢谢,

首先,您无法从本地主机发送电子邮件。你需要一个邮件中继。由于您已经在使用 gmail,我会推荐这个:

https://www.howtoforge.com/tutorial/configure-postfix-to-use-gmail-as-a-mail-relay/