Hi Kieran,
Here's more or less how I extract email addresses
with egrep on the command line.
$ cat /var/mail/<username> | egrep -o "[a-zA-Z0-9_.-]+@[a-zA-Z0-9.-]{3,}\.[a-zA-Z0-9-]{2,}" | tr [:upper:] [:lower:] | sort | uniq
I hope that helps,
~K
PS: Please don't spam anyone.
On 03/30/11 23:31, Kieran O'Sullivan wrote:
> Hi
> I have a bunch of delivery failures which I want to extract the failed
> e-mail addresses from. My problem is that every mail server sends a
> different message back.
> Has anyone got a script (php would be nice) that can read a file e.g.
> /var/mail/<username> and extract the e-mail addresses of the permenant
> failed addresses?
>> I understand the principle behind this it is just string searching my
> problem is all the combinations of strings to search for.
>> Thanks.
>>>>>> --
> Irish Linux Users' Group mailing list
> About this list : http://mail.linux.ie/mailman/listinfo/ilug> Who we are : http://www.linux.ie/> Where we are : http://www.linux.ie/map/
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!