This blog is now hosted at

Wednesday, February 25, 2009

Duplicate message ids in the sendmail log

Here's a quick little perl script that can help you find duplicate message ids in your sendmail log. Script and explanation after the break.


while (<>) {
($_ =~ /msgid=\<(.*?)\>?,/) && ($msgid = $1);
print $msgid . "\n" if ($ids{$msgid} == 2);

Where to use this script? Let's say, hypothetically, that you have email coming in that is causing the mail server to tempfail a message (over and over). Or you have a server that is sending a mail message over and over. This script can help you find those messages quickly.

No comments: