linux无法发送邮件

来源:互联网 发布:java加载配置文件 编辑:程序博客网 时间:2024/06/02 11:06

20170320 今天redmine无法发送邮件

查看postfix运行状态正常 

查看日志  发现有提示file to large   

tail -f /var/log/maillogMar 20 11:31:02 ZQWY-COMMON-231 postfix/local[48952]: 8C9CA29F97E: to=<root@ZQWY-COMMON-231.localdomain>, relay=local, delay=0.23, delays=0.09/0/0/0.14, dsn=5.2.2, status=bounced (cannot update mailbox /var/mail/root for user root. error writing message: File too large)

解决方法 :清空 /var/mail/root文件

为了方便做了定时任务如下


[root@ZQWY-COMMON-231 mail]# crontab -l10 3 * * 1 /root/scripts/delmail.py脚本内容如下[root@ZQWY-COMMON-231 mail]# cat /root/scripts/delmail.py #!/usr/bin/python#file1=open('/tmp/mailtest.txt','wb')file1=open('/var/mail/root','wb')file1.truncate()file1=open('/var/mail/dev','wb')file1.truncate()


后来发现依然无法发送邮件  

查看/var/log/maillog有以下内容

Mar 20 11:34:39 ZQWY-COMMON-231 postfix/smtp[49387]: B912029F99A: to=<qixxxuchxxxen@imsa.org.cn>, relay=mxbiz1.qq.com[112.90.78.144]:25, delay=1.2, delays=0.14/0/0.33/0.73, dsn=2.0.0, status=sent (250 Ok: queued as )Mar 20 11:39:55 ZQWY-COMMON-231 postfix/smtp[49555]: 8FFE429F97E: to=<qixxxuchexxxxn@imsa.org.cn>, relay=mxbiz1.qq.com[163.177.89.176]:25, delay=0.8, delays=0.1/0.01/0.3/0.39, dsn=5.0.0, status=bounced (host mxbiz1.qq.com[163.177.89.176] said: 550 Sender frequency limited. http://service.exmail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000723 (in reply to MAIL FROM command))

应该是腾讯的收件服务器会check发件IP地址 发现不是受信任的发件箱  

测试发送到163正常

更改redmine里面配置的发件人为本服务器主机名即可

但是收件在垃圾箱里面还需要信任一下发件人


参考https://www.question-defense.com/2010/12/07/cannot-update-mailbox-varmailroot-for-user-root-error-writing-message-file-too-large

参考http://freehat.blog.51cto.com/1239536/589341     此文档提供另一种更改postfix配置的方法




0 0
原创粉丝点击