WhoSentMail

A simple command-line-driven set of two utilities written in Perl for the purpose of examining who sent or received emails to/from whoever. It has no dependencies apart from having Perl installed of course, and to have access to a Sendmail log file. The two scripts are as follows:

ws2w.pl: 'Who Sent 2 Who', takes the name of the Sendmail logfile and the email address of the sender to produce a list of emails sent from that sender. For example, if you wanted to see who user 'joe.bloggs@domain.com' was sending mail to, you could type 'perl ws2w.pl maillog jog.bloggs@domain.com'. The output would be similar to the following:

Analysing log file...
Found 2 entries...
Sep 26 10:02:54 from=<joe.bloggs@domain.com>,to=<recipient1@outside.com>,
Sep 26 12:05:16 from=<joe.bloggs@domain.com>,to=<recipient2@place.net>,
...

wrfw.pl: 'Who Received From Who', takes the name of the Sendmail logfile and the email address of the sender to produce a list of emails sent to that recipient. For example, if you wanted to see who sent emails to user 'joe.bloggs@domain.com', you could type 'perl wrfw.pl maillog jog.bloggs@domain.com'. The output would be similar to the following:

Analysing log file...
Found 6 entries...
Sep 26 10:21:55 from=<sender1@out.com>,to=<joe.bloggs@domain.com>,
Sep 26 10:23:12 from=<sender2@there.com>,to=<joe.bloggs@domain.com>,
...

There is still some work to be done on some parts of the scripts, such as the transaction counter and to include a case-insensitive option. Otherwise, these Perl scripts are released under the GPL, come with no warranty and should be used at your own risk.

Download here