主题: 内部邮箱可以互发邮件,但不能向外网发邮件

==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:0.6.1
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):Mysql
- 使用的 Linux/BSD 发行版名称及版本号:Linux sgds 2.6.28-11-server #42-Ubuntu SMP Fri Apr 17 02:48:10 UTC 2009 i686 GNU/Linux
- 与您的问题相关的日志信息:F0EA3241C75     3573 Tue Dec 23 06:08:05  MAILER-DAEMON
                                                           (temporary failure)
                                         www-data@sgds.domain
====
这个服务器从2010年开始已经用了近五年了,向外发邮件没有问题,前几天断电重启后就出现了不能向外网发邮件的问题,但没有解决,用服务器的Ping命令可以通 baidu.com sina.com,说明网络没有问题,求救……

回复: 内部邮箱可以互发邮件,但不能向外网发邮件

看看 Postfix 的日志文件(/var/log/mail.log)里有什么错误信息。

3 最后由 whz (2014-12-25 08:39:01) 编辑

回复: 内部邮箱可以互发邮件,但不能向外网发邮件

在mail.log中主要的问题是:temporary failure. Command output: Failed to write to log file
但没有具体的文件名提示,可执行文件为 postfix/local ?也不知道去哪里找啊……

回复: 内部邮箱可以互发邮件,但不能向外网发邮件

ZhangHuangbin 写道:

看看 Postfix 的日志文件(/var/log/mail.log)里有什么错误信息。

Dec 25 08:38:05 sgds postfix/qmgr[3593]: 6DE67241C73: from=<www-data@sgds.domain>, size=1933, nrcpt=1 (queue active)
Dec 25 08:38:05 sgds postfix/qmgr[3593]: 4A65F241CAE: from=<www-data@sgds.domain>, size=1933, nrcpt=1 (queue active)
Dec 25 08:38:05 sgds postfix/qmgr[3593]: 4CAE6241CC3: from=<www-data@sgds.domain>, size=1933, nrcpt=1 (queue active)
Dec 25 08:38:05 sgds postfix/local[6973]: 2F82C241C30: to=<www-data@sgds.domain>, relay=local, delay=21484, delays=21484/0.01/0/0.01, dsn=4.3.0, status=deferred (temporary failure. Command output: Failed to write to log file)
Dec 25 08:38:05 sgds postfix/local[6974]: 24479241C01: to=<www-data@sgds.domain>, relay=local, delay=13083, delays=13083/0.01/0/0.01, dsn=4.3.0, status=deferred (temporary failure. Command output: Failed to write to log file)
Dec 25 08:38:05 sgds postfix/local[6974]: 56CA2241C2B: to=<www-data@sgds.domain>, relay=local, delay=24483, delays=24483/0.02/0/0, dsn=4.3.0, status=deferred (temporary failure. Command output: Failed to write to log file)
Dec 25 08:38:05 sgds postfix/local[6973]: E9FAF241C0A: to=<www-data@sgds.domain>, relay=local, delay=4684, delays=4684/0.02/0/0.01, dsn=4.3.0, status=deferred (temporary failure. Command output: Failed to write to log file)
Dec 25 08:38:05 sgds postfix/local[6980]: 556EF241C4B: to=<www-data@sgds.domain>, relay=local, delay=17283, delays=17283/0.02/0/0, dsn=4.3.0, status=deferred (temporary failure. Command output: Failed to write to log file)
Dec 25 08:38:05 sgds postfix/local[6974]: 6B039241C0D: to=<www-data@sgds.domain>, relay=local, delay=1083, delays=1083/0.02/0/0, dsn=4.3.0, status=deferred (temporary failure. Command output: Failed to write to log file)
Dec 25 08:38:05 sgds postfix/local[6973]: 6DE67241C73: to=<www-data@sgds.domain>, relay=local, delay=483, delays=483/0.03/0/0, dsn=4.3.0, status=deferred (temporary failure. Command output: Failed to write to log file)
Dec 25 08:38:05 sgds postfix/local[6980]: 4A65F241CAE: to=<www-data@sgds.domain>, relay=local, delay=8883, delays=8883/0.03/0/0, dsn=4.3.0, status=deferred (temporary failure. Command output: Failed to write to log file)
Dec 25 08:38:05 sgds postfix/local[6974]: 4CAE6241CC3: to=<www-data@sgds.domain>, relay=local, delay=2283, delays=2283/0.03/0/0, dsn=4.3.0, status=deferred (temporary failure. Command output: Failed to write to log file)

回复: 内部邮箱可以互发邮件,但不能向外网发邮件

自己解决了问题:参考http://www.iredmail.com/bbs/post9388.html
内部网上原来没有路由器,最近给财务室增加了一个路由器,而路由器默认开启了DHCP的功能,而Ubuntu服务器使用了自动分配IP的功能,我把/etc/resolv.conf这个文件改了,就出现了内网可发邮件,而不能给外网发送邮件的问题了。


经添加Google DNS 8.8.8.8解决

/var/spool/postfix/etc/resolv.conf
/etc/resolv.conf

2个文件中都添加