zoukankan      html  css  js  c++  java
  • (转)postfix疯狂外发垃圾邮件之分析与解决

    从进程中看到,好像是postfix有问题。我这postfix主要是用来给程序发达邮件用的,如报警,程序外发邮件等。平时postfix进程不会像现在这样异常,这在postf主进程CPU占用高,其它的相关进程,也占用很高,如smtp,qmgr等。当然,也看到了不少error的进程,而且属主是postfix,所以可以判断是postfix出问题了,为了证实,把postfix服务停掉,观察top状态,服务器负载都下去了,而且磁盘写入,上下文切换都降低了,所以,postfix异常是正确的。

    这是刚停止postfix以后的vmstat

    procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----

    r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st

    1  0  88736 600328 448020 13682256    0    0     0     5    0    0  0  0 99  0  0

    0  0  88736 600164 448020 13682256    0    0     0     0 3500  725  0  0 99  0  0

    0  0  88736 600448 448020 13682256    0    0     0     0 4008  842  0  0 99  0  0

    0  0  88736 600544 448020 13682256    0    0     0     0 3197  668  0  0 100  0  0

    因为对postfix不是很熟悉,所以,在网上找了一篇文章:

    参考文档:http://www.myhack58.com/Article/60/sort095/2012/35334.htm

    按他的思路和方法,我打开maillog日志,发现日志是写入很快,用tail -f可以看是狂刷屏,而且日志文件有几个G大了。日志大概如上:

    Feb 28 10:08:27 mail postfix/error[10442]: DC467C1AE4: to=<gmiglicco@comcast.net>, relay=none, delay=12332, delays=12324/3.5/0/4, dsn=4.0.0, status=deferred (delivery temporarily suspended: host mx1.comcast.net[68.87.26.147] refused to talk to me: 554 imta33.westchester.pa.mail.comcast.net comcast 124.172.223.189 Comcast block for spam.  Please see http://postmaster.comcast.net/smtp-error-codes.php#BL000000)

    Feb 28 10:08:27 mail postfix/error[10943]: 6BA87C6222: to=<tinajones10@yahoo.com>, relay=none, delay=760, delays=751/9.2/0/0.18, dsn=4.4.2, status=deferred (delivery temporarily suspended: lost connection with mta5.am0.yahoodns.net[66.196.118.33] while sending RCPT TO)

    然后用postcat -q命令查看其中一封邮件的内容: 如 postcat -q 659D0C3636,可以看到,邮件是用test@xxx.com发送的,再仔细分析日志,确实是挺多from test@xxx.com记录。登陆test@xxx.com邮箱,发现有8000多封退信,而且还在增加中。到此,问题所在可以真正找出来了。因为test@xxx.com是以前开发程序时所创建的帐号,有可能是密码设的太简单,被人破解,被用于狂发邮件。果断把test@xxx.com封掉。然后再用postsuper -d ALL 把其它postfix缓存清空,到此故障完全排除。有些排查和解决步骤,那篇文章中出现的,我这里就没写出来了,思路是借鉴他的。

  • 相关阅读:
    安卓9.0内测的背后,是上万App开发者半年来的适配优化
    错误记录:vue跟vue编译器版本不一致
    jspdf简单使用
    vue input添加回车触发
    vue watch bug记录
    SecureCRT通过拷贝配置文件登陆
    仿射变换
    opencv图像的旋转
    图像旋转的原理
    CvScalar
  • 原文地址:https://www.cnblogs.com/hixiaowei/p/8446281.html
Copyright © 2011-2022 走看看