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/>//' | \
sort | uniq > addresses.txt
Danny Angus
blog.killerbees.co.uk
Danny Angus
Independent IT Consultant
"start apache anyway. There's stuff, yeah, apparently"Labels
Wednesday, October 19, 2011
Note to self, how to get a list of recipients from the maillog
Further Reading
-
-
So It Has Come To This6 hours ago
-
-
-
View from a train6 days ago
-
-
-
-
-
-
-
A bacon spin on sushi: ikura baciri3 months ago
-
Twitter4 months ago
-
Worship me, for I am a xoogler7 months ago
-
-
Westin Tower - Atlanta1 year ago
-
-
Baseline 1.52 years ago
-
Boat For Sale5 years ago
I know nothing, I'm not a fortune teller, and you'd be insane to think that I am. This disclaimer was cribbed from an email footer I once received. It is so ridiculous I had to have it for myself.
Statements in this blog that are not purely historical are forward-looking statements including, without limitation, statements regarding my expectations, objectives, anticipations, plans, hopes, beliefs, intentions or strategies regarding the future. Factors that could cause actual results to differ materially from the forward looking statements include risks and uncertainties such as any unforeseen event or any unforeseen system failures, and other risks. It is important to note that actual outcomes could differ materially from those in such forward-looking statements.
Danny Angus Copyright © 2006-2010 (OMG that's four years of this nonsense)

Comments:
Post a Comment
blog comments powered by Disqus