Postfix Mail Statistics
Server Training - Mail Server

Gathering Stats on Postfix

Understanding what is happening on the mail server is an important management tool.  Postfix provides log information but it is always beneficial if you can find a tool to parse that information into a more readable format.  Here is one option that can do just that, a perl script that will parse your logs and provide data on mail statistics.

Related Postfix Training
Postfix Configuration
Postfix Mail Server Design
Control SPAM with Postfix

postfix


Postfix Mailbox Changes
Postfix Mail Gateway
Postfix Mail Server Course
 Postfix Mail Statistics

8 Week Course for $499.95  ORDER NOW

 Don't Outsource Your Mail Server, Learn how to run it yourself!
Postfix Training

We specialize in helping companies become independent of outsourcing Linux services.
8 Week Course for $499.95  ORDER NOW

 

 

pflogsumm

pflogsumm.pl is designed to provide an over-view of postfix activity and produce a log summary of the data that is in the system logs.

You can download the script from here:

http://jimsun.linxnet.com/postfix_contrib.html

Pflogsumm requires the Date::Calc module. You can download and install the Date::Calc module from CPAN. It can be found at:

http://search.cpan.org/search?module=Date::Calc

Install required Perl Modules

You will need to answer a number of questions about the install process. Usually you will see the default and you can just hit ENTER to continue on. This is the initial command to get it going:

 

# perl -MCPAN -e shell;

 

Once you see this line:

cpan >

 

Enter this text for the modules you need.

Cpan :> install Date::Calc

 

This will take some time and you may be asked to install additional modules which you should do. In the end you should see this line:

/usr/bin/make – OK

That means it is complete and you can type quit to exit.


Usage
When you want to run the program just invoke the command and provide log that it should evaluate.

./pflogsumm.pl /var/log/maillog


Example Results

Grand Totals

------------

messages


144 received

159 delivered

0 forwarded

0 deferred

24 bounced

357 rejected (69%)

0 reject warnings

0 held

0 discarded (0%)


1219k bytes received

1070k bytes delivered

127 senders

108 sending hosts/domains

5 recipients

4 recipient hosts/domains



Per-Day Traffic Summary

date received delivered deferred bounced rejected

--------------------------------------------------------------------

Sep 7 2008 33 41 0 4 102

Sep 8 2008 70 76 0 10 202

Sep 9 2008 41 42 0 10 53


Per-Hour Traffic Daily Average

time received delivered deferred bounced rejected

--------------------------------------------------------------------

0000-0100 2 2 0 0 2

0100-0200 2 2 0 1 3

0200-0300 0 0 0 0 3

0300-0400 2 3 0 0 3

0400-0500 1 1 0 1 3

0500-0600 2 2 0 0 4

0600-0700 3 3 0 1 6

0700-0800 4 5 0 0 6

0800-0900 4 5 0 0 5

0900-1000 2 2 0 1 6

1000-1100 3 4 0 1 6

1100-1200 4 4 0 1 9

1200-1300 3 4 0 1 6

1300-1400 2 2 0 1 6

1400-1500 2 2 0 0 5

1500-1600 2 2 0 0 4

1600-1700 2 2 0 0 3

1700-1800 2 1 0 1 7

1800-1900 1 1 0 0 5

1900-2000 2 2 0 1 7

2000-2100 1 1 0 0 6

2100-2200 1 1 0 0 3

2200-2300 1 1 0 1 7

2300-2400 1 1 0 0 4


Host/Domain Summary: Message Delivery

sent cnt bytes defers avg dly max dly host/domain

-------- ------- ------- ------- ------- -----------

73 325657 0 11.9 s 57.0 s somedomain.net

71 679k 0 11.1 s 1.3 m gmail.com

14 72076 0 4.6 s 21.0 s hotmail.com

1 2053 0 1.0 s 1.0 s anotherdomain.com


Host/Domain Summary: Messages Received

msg cnt bytes host/domain

-------- ------- -----------

10 10580 mail.goo.ne.jp

8 21551 itextron.com

5 14784 paypal.com

3 12234 yeah.net

3 7758 ebay.com

3 6151 gmail.com

3 5754 yahoo.com

2 13567 yahoo.com.cn

2 10367 sales12.com

2 7080 hotmail.com

2 2607 waiuj.info

2 2470 gojen.info

2 1924 greatezleads.com

2 1767 infoseek.jp

1 170371 mail333.com


Senders by message count

------------------------

8 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

3 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

3 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

2 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

2 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

2 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

2 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

2 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

1 This e-mail address is being protected from spambots. You need JavaScript enabled to view it


Recipients by message count

---------------------------

73 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

44 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

27 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

14 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

 

Senders by message size

-----------------------

170371 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

147883 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

107654 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

68373 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

59184 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

45149 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

43467 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

39630 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

29044 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

28028 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

26748 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

23793 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

23547 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

21551 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

 

Recipients by message size

--------------------------

402222 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

325657 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

293876 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

72076 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

 

message deferral detail: none

message bounce detail (by relay)

--------------------------------

somedomain.net.s6a1.psmtp.com[164.18.15.160]:25 (total: 11)

2 MAIL FROM:< This e-mail address is being protected from spambots. You need JavaScript enabled to view it > (in reply to RCPT TO command)

1 < This e-mail address is being protected from spambots. You need JavaScript enabled to view it > (in reply to RCPT TO command)

1 MAIL FROM:< This e-mail address is being protected from spambots. You need JavaScript enabled to view it > (in reply to RCPT TO command)

1 MAIL FROM:< This e-mail address is being protected from spambots. You need JavaScript enabled to view it > (in reply to RCPT TO command)

1 MAIL FROM:< This e-mail address is being protected from spambots. You need JavaScript enabled to view it > (in reply to RCPT TO command)

1 MAIL FROM:< This e-mail address is being protected from spambots. You need JavaScript enabled to view it > (in reply to RCPT TO command)

1 MAIL FROM:< This e-mail address is being protected from spambots. You need JavaScript enabled to view it > (in reply to RCPT TO command)

1 MAIL FROM:< This e-mail address is being protected from spambots. You need JavaScript enabled to view it > (in reply to RCPT TO command)

1 MAIL FROM:< This e-mail address is being protected from spambots. You need JavaScript enabled to view it > (in reply to RCPT TO command)

1 < This e-mail address is being protected from spambots. You need JavaScript enabled to view it > (in reply to RCPT TO comm...

 

none (total: 12)

9 Host not found

3 Host found but no data record of requested type


message reject detail

---------------------

RCPT

blocked using sbl-xbl.spamhaus.org (total: 234)

16 125.187.32.174

11 rr.com

9 verizon.net

5 qwest.net

4 66.199.236.122

4 charter.com

 

Helo command rejected: need fully-qualified hostname (total: 46)

3 117.104.245.36

2 219.130.135.222

2 24.139.224.228

2 117.104.245.37

 

Recipient address rejected: User unknown in virtual alias table (total: 32)

4 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

4 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

3 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

2 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

2 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

Recipient address rejected: User unknown in virtual mailbox table (total: 1)

1 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

Relay access denied (total: 39)

4 samsung.co.kr

3 hundred-acre-retrievers.com

3 ppp83-237-120-194.pppoe.mtu-net.ru

2 147.202.65.172

2 google.com

2 adsl-dyn213.78-98-40.t-com.sk

1 64.18.134.189

1 220.248.128.162

 

Sender address rejected: Bad Network (total: 5)

1 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

1 This e-mail address is being protected from spambots. You need JavaScript enabled to view it

1 This e-mail address is being protected from spambots. You need JavaScript enabled to view it


message reject warning detail: none


message hold detail: none


message discard detail: none


smtp delivery failures: none


Warnings

--------

smtpd (total: 152)

4 66.199.236.122: hostname 66-199-236-122.reverse.ezzi.net verifi...

4 61.29.115.50: hostname dsl-61-29-115-50.request.com.au verifica...

4 Unable to look up MX host for yamabiko-do.net: Host not found

3 117.104.245.36: hostname 36.245.104.117.ids.service.eastern-tel...

3 Unable to look up MX host for pure1-mail.net: Host not found

3 Unable to look up MX host for treasure-boxes.jp: Host not found

1 Unable to look up MX host imail.interainc.com for Sender addres...

 

trivial-rewrite (total: 423)

 

virtual (total: 2)

1 database /etc/postfix/virtual_gid_map.db is older than source f...

1 database /etc/postfix/virtual_uid_map.db is older than source f...


Fatal Errors: none


Panics: none


Master daemon messages

----------------------

1 reload configuration /etc/postfix