Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sendmail question

Status
Not open for further replies.

ArizonaGeek

IS-IT--Management
Aug 21, 2006
768
US
I have a Fedora Core 4 box set up to relay reports sent to our clients but my boss came to me today and asked if I could provide a count of approx. how many emails we've sent in the last month through my server. However I can't seem to find a command to give me that count, anyone have any idea? Is there something I need to install that would give me that count for the next month? Thanks for any help!

Cheers
Rob

The answer is always "PEBKAC!
 
There's a statistics function in the sendmail system, but it's been too long, and it was kinda obscure. So...

It's been a while since I've done sendmail, but here's a generic approach that may prove useful. Linux and Linux applications keep logs, usually /var/log.

To be more specific, look for the word "accepted" (as in "accepted for delivery") in /var/log/maillog files. Fedora has a one week log rotation schedule, so this info is in maillog plus maillog.1 thru maillog.4 for previous weeks.

Try this comand, it will put the entries on a file:
grep "accepted" /var/log/maillog* > /tmp/mailcount.txt
 
Also, this will count the number of lines in the output file from aboveD
wc -l /tmp/mailcount.txt
 
I use a Perl script by Jeremy Reed called logproc.pl - you can tune it to give the statistics you're looking for. There may be a newer version under a new name - Google doesn't find much on it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top