19 Oct 2011 Killerbees   » (Journeyer)

Note to self, how to get a list of recipients from the maillog

I spent a while figuring out how to get a list of email recipient addresses from the maillog, without duplicates, for a specific day on RHEL. In the end I distilled it into to one line.

I'm sure I will have to do it again, so I'm making a note of it here, meantime if you need to extract recipient addresses from maillog you're welcome to try it. just paste it onto the command line and hit the go button, its surpisingly quick.

cat /var/log/maillog | grep "Oct 19" |\ grep to= |cut -f5 -d":" | cut -f2 -d"=" | cut -f1 -d"," | \ sed 's/<//' | sed 's/&gt//' | \ sort | uniq > addresses.txt

Syndicated 2011-10-19 11:39:00 (Updated 2011-10-19 11:39:08) from Danny Angus

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!