安裝如下
# yum -y install postfix-pflogsumm
# vi /etc/crontab
#每日早上九點發送昨天的郵件Log分析報表到管理者信箱
0 9 * * * root /usr/sbin/pflogsumm /var/log/maillog -d yesterday /var/log/maillog | mail -s "Mail Report" root@router.abc.com
或是直接輸入today 、yesterday看近期報表
# pflogsumm /var/log/maillog -d today /var/log/maillog
# pflogsumm /var/log/maillog -d yesterday /var/log/maillog
報表內容如下所示
Postfix log summaries for Nov 29
Grand Totals
------------
messages
290 received
248 delivered
106 forwarded
0 deferred
106 bounced
2 rejected (0%)
0 reject warnings
0 held
0 discarded (0%)
18145k bytes received
40151k bytes delivered
10 senders
6 sending hosts/domains
15 recipients
6 recipient hosts/domains
Per-Hour Traffic Summary
time received delivered deferred bounced rejected
--------------------------------------------------------------------
0000-0100 0 0 0 0 0
0100-0200 0 0 0 0 0
0200-0300 0 0 0 0 0
0300-0400 12 6 0 12 0
0400-0500 0 0 0 0 0
0500-0600 0 0 0 0 0
0600-0700 0 0 0 0 0
0700-0800 0 0 0 0 0
0800-0900 8 8 0 0 0
0900-1000 4 4 0 0 0
1000-1100 0 0 0 0 0
1100-1200 0 0 0 0 0
1200-1300 0 0 0 0 0
1300-1400 0 0 0 0 2
1400-1500 0 0 0 0 0
1500-1600 0 0 0 0 0
1600-1700 0 0 0 0 0
1700-1800 0 0 0 0 0
1800-1900 76 84 0 0 0
1900-2000 28 28 0 0 0
2000-2100 0 0 0 0 0
2100-2200 146 108 0 82 0
2200-2300 16 10 0 12 0
2300-2400 0 0 0 0 0
Host/Domain Summary: Message Delivery
sent cnt bytes defers avg dly max dly host/domain
-------- ------- ------- ------- ------- -----------
142 8676k 0 1.2 s 5.2 s router.abc.com
54 63770 0 1.1 s 3.6 s mail.router.abc.com
24 62252 0 1.6 s 4.2 s gmail.com.biz
12 15678k 0 3.1 s 4.7 s gmail.com
12 7840k 0 1.8 s 2.9 s yahoo.com.tw
4 7832k 0 5.0 s 7.8 s hotmail.com
Host/Domain Summary: Messages Received
msg cnt bytes host/domain
-------- ------- -----------
72 168266 mail.router.abc.com
31 13757k router.abc.com
30 3981k gmail.com.biz
8 62980 gmail.com
2 182488 edm.17life.com.tw
2 3376 live.com
Senders by message count
------------------------
72 posoot@mail.router.abc.com
28 Mary@gmail.com.biz
19 Mary@router.abc.com
8 josh@router.abc.com
6 joshlin@gmail.com
4 coco@router.abc.com
2 c8koco@gmail.com.biz
2 Tonyle@gmail.com
2 roy.lee@live.com
2 Hi@edm.17life.com.tw
Recipients by message count
---------------------------
66 Mary@router.abc.com
54 root@mail.router.abc.com
36 josh@router.abc.com
20 coco@router.abc.com
12 Tonyle@gmail.com
12 whaha@yahoo.com.tw
8 Mary@gmail.com.biz
8 coco@gmail.com.biz
8 andy@router.abc.com
4 mikedai@gmail.com.biz
4 Mary@gmail.com.biz
4 whaha@hotmail.com
4 mike@router.abc.com
4 naoutmi@router.abc.com
4 roy@router.abc.com
Senders by message size
-----------------------
13737k Mary@router.abc.com
3974k Mary@gmail.com.biz
182488 Hi@edm.17life.com.tw
168266 root@mail.router.abc.com
51282 Tonyle@gmail.com
11828 coco@router.abc.com
11698 joshlin@gmail.com
8942 josh@router.abc.com
6458 coco@gmail.com.biz
3376 roy.lee@live.com
Recipients by message size
--------------------------
15678k Tonyle@gmail.com
8186k Mary@router.abc.com
7840k whaha@yahoo.com.tw
7832k whaha@hotmail.com
372716 andy@router.abc.com
63770 root@mail.router.abc.com
56792 josh@router.abc.com
43616 coco@router.abc.com
23656 coco@gmail.com.biz
13416 mikedai@gmail.com.biz
13400 Mary@gmail.com.biz
11780 Mary@gmail.com.biz
10772 muyike@router.abc.com
10772 naomi@router.abc.com
6752 rpuoy@router.abc.com
message deferral detail: none
message bounce detail (by relay)
--------------------------------
dovecot (total: 106)
106 user unknown
message reject detail
---------------------
RCPT
Recipient address rejected: Domain not found (total: 2)
2 dutradf@daaba.com.tw
message reject warning detail: none
沒有留言:
張貼留言