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 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

 

转载于:https://www.cnblogs.com/lvsong/archive/2010/08/05/1793215.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值