PostFix的电子邮件日志脚本的提示



我写了一个简单的脚本,显示了从mail.log发送的电子邮件。它使用grc为结果着色。

log='/var/log/mail.log'
grc grep "status=sent" $log | 
egrep -ve 'postfix/(cleanup|pickup|master|qmgr|smtpd|local|pipe)'

它运行良好,但我想滤除一些noice。我该如何过滤掉这样的东西...

delay=0.34, delays=0.01/0.02/0.14/0.16, dsn=2.0.0,

这适用于Postfix/debian上的发送电子邮件:

# Script to list sent emails on Postfix/Debian
log='/var/log/mail.log'
grep "status=sent" $log | 
egrep -ve 'postfix/(cleanup|pickup|master|qmgr|smtpd|local|pipe)' | cut -f2 -d"="  | cut -f1 -d">" | cut -c2-

这对于Postfix/debian上的传入电子邮件非常有效:

# Script to list recived emails
log='/var/log/mail.log'
grep "from=" $log | 
egrep -ve 'postfix/(submission|cleanup|pickup|master|smtps|smtpd|local|pipe)' | cut -f2 -d"="  | cut -f1 -d">" | cut -c2-

最新更新