当前位置: 洪哥笔记 > 邮箱 > Postfix 日志脚本

 

Postfix 日志脚本


关键词

Postfix 日志脚本

摘要

# statistic recipient
echo "Part one : - Top 10 Recipient domain "
fgrep to= /var/log/maillog | cut -d\< -f2 | cut -d\> -f1 | cut -d@ -f2 | sort | uniq -c | sort -nr |head

# statistic recipient
echo "Part one : - Top 10 Recipient domain "
fgrep to= /var/log/maillog | cut -d\< -f2 | cut -d\> -f1 | cut -d@ -f2 | sort | uniq -c | sort -nr |head

# statistic sender
echo "Part two: - Top 10 Sender domain "
fgrep from= /var/log/maillog | cut -d\< -f2 | cut -d\> -f1 | cut -d@ -f2 | sort | uniq -c | sort -nr | head

# statistic destination mail total count
echo "Part three: Total lines and sizes of log, And total mail sent"
cat /var/log/maillog | fgrep status=sent | wc -l | awk '{ print $1 }'

echo ""; echo "Scanning maillog for rejections:"
cat -fc /var/log/maillog | egrep reject: | cut -d : -f 5- | sort | uniq -c | sort -nr | grep -v '^  *[1-2]  *[^ ]* [^ ]* from [^ ]*: 450 '

echo "Scanning maillog for warnings:"
cat /var/log/maillog | egrep warning: | cut -d : -f 5- | sort | uniq -c

echo "Scanning maillog for trouble:"
cat /var/log/maillog | egrep '(fatal|panic):'

检查hash文件结果的命令
postmap -q xxxxxx@163.com hash:permited_sender
postmap -q "xxxxxx@163.com" mysql:/usr/local/etc/postfix/mysql-sender.cf

 

要饭二维码

洪哥写文章很苦逼,如果本文对您略有帮助,可以扫描下方二维码支持洪哥!金额随意,先行谢过!大家的支持是我前进的动力!

文章的版权

本文属于“洪哥笔记”原创文章,转载请注明来源地址:Postfix 日志脚本:http://www.splaybow.com/post/130507240120082730.html

如果您在服务器运维、网络管理、网站或系统开发过程有需要提供收费服务,请加QQ:8771947!十年运维经验,帮您省钱、让您放心!
亲,如果有需要,先存起来,方便以后再看啊!加入收藏夹的话,按Ctrl+D

« 邮件帐号管理的shell script debian31r2 postfix automatic setup script »

相关文章:

腾讯企业邮箱POP,SMTP分别是什么  (2014/9/4 8:23:19)

邮件服务器架设  (2014/3/9 13:27:43)

winwebmail邮局附件大小  (2014/3/8 10:13:12)

Exchange服务器快速恢复的步骤  (2013/10/24 14:04:36)

使域名DNS解析支持DKIM  (2013/5/27 16:45:56)

邮局使用SPF  (2013/5/24 12:27:46)

用telnet来理解SMTP协议  (2013/5/24 12:23:38)

qmail+vpopmail+squirrelmail 安装经验谈  (2013/9/6 10:59:41)

LINUX中的QMail邮件安全问题  (2013/9/5 10:59:12)

用qmail/vpopmail/courier-imap/qmail-scanner/igenus打造邮件系统  (2013/8/31 10:59:13)