krish – 起死回生 [Wake up from death & return to life.]

April 9, 2010

Mail reporting from postfix

Filed under: Free / Open Source — krish @ 12:36 pm
Tags: , , , ,

One of the good log analyzing scripts that I’ve come across is pflogsumm.
It designed to provide an over-view of postfix activity, with just enough detail to give the administrator a “heads up” for potential trouble spots.

Here’s how you get it running into your mail server:

1. Download the current production version from http://jimsun.linxnet.com/downloads/pflogsumm-1.1.1.tar.gz

2. Download the md5 hash from http://jimsun.linxnet.com/downloads/pflogsumm-1.1.1.tar.gz.md5

3. Check md5

# md5sum pflogsumm-1.1.1.tar.gz
2f570477b2e205f9dfc1df13f00b5c0d pflogsumm-1.1.1.tar.gz

# cat pflogsumm-1.1.1.tar.gz.md5
2f570477b2e205f9dfc1df13f00b5c0d pflogsumm-1.1.1.tar.gz

4. Copy the script to one of $PATH’s location and remove write access

# cp pflogsumm-1.1.1/pflogsumm.pl /usr/local/sbin/

# chmod 500 /usr/local/sbin/pflogsumm.pl

5. Write a script depending on whether you want to parse archived maillog or current maillog; I used current maillog

# vi /root/.krish_scripts/postfix_reporter.sh

#!/bin/bash
DATE=`date`
/usr/local/sbin/pflogsumm.pl -u 10 -h 10 --no_no_msg_size --no_deferral_detail --no_bounce_detail -q /var/log/maillog | mail -s "Hourly Mail Statistics for super secret mailserver $DATE" sysadmin@somedomain.com

6. Run the script hourly

# ln -s /root/.krish_scripts/postfix_reporter.sh /etc/cron.hourly/mailreport

7. Take a coffee break 😉

Best thing about this – It is licensed under GPL.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Please leave a Reply / Discuss this topic here :)

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

The Male Factor

On behalf of the ignored gender

Rough Draft

by Atteris Amarth and Darrek Ringo

The Kochi Post.

Read by all + Influenced by none

JumboMake

A signature of Kiran

SAAYAM CHEDDAM FOUNDATION

This blog is just for additional and extension share of it's main frames. No activity is planned from here

krish - 起死回生 [Wake up from death & return to life.]

Get a sneak peek into krish's life, work and passion.

WordPress.com

WordPress.com is the best place for your personal blog or business site.

A Tale of Two and a Half

Monika Amita Bakshi

%d bloggers like this: