主题: Postfix 如何查看单个用户某个时间段发送邮件的数量统计
今天业务要求检查某个员工邮件发送信息
做个简单统计:
此用户一周内发送邮件多少封,失败多少,成功多少,
此用户一周内接收邮件多少封.
本人通过pflogsumm 这个perl 脚本实现,不知大家有什么更好的办法实现 (期待交流)
首先切割出一个礼拜中的maillog日志,然后、通过shell 过滤出某个用户的发送的信息,如下:
1:cat maillog.1 |grep "server@domain.com" > server-maillog (不知这样过滤准确不?O(∩_∩)O~)
2:pflogsumm server-maillog
运行结果如下:
messages
10186 received
1383 delivered
0 forwarded
0 deferred
0 bounced
0 rejected (0%)
0 reject warnings
0 held
0 discarded (0%)
17812k bytes received
0 bytes delivered
1 senders
1 sending hosts/domains
1 recipients
1 recipient hosts/domains
Per-Day Traffic Summary
date received delivered deferred bounced rejected
--------------------------------------------------------------------
Dec 13 2009 1259 180
Dec 14 2009 1678 227
Dec 15 2009 1547 226
Dec 16 2009 1371 189
Dec 17 2009 1359 173
Dec 18 2009 1396 180
Dec 19 2009 1408 172
Dec 20 2009 168 36
以上基本实现了业务的要求/