[NTLUG:Discuss] quickest way to get bounced email address list.
Fred James
fredjame at fredjame.cnc.net
Fri Oct 20 11:48:00 CDT 2006
m m wrote:
>All:
>
>My company send a lot of emails to the customers, and unfortunately, there
>are a lot of return/reject email send back to the server.
>
>What is the best/quickest way to get a list of bounced email address from a
>mail box?
>
>We use sandmail as mail server on fedora core 5. the bounced emails went to
>the root account.
>Any one has an idea? thanks.
>
>
>
MM
A mail boxes is generally a text file, frequently a single text file
containing all mail (maybe someone could correct me on that). Find the
text file and
(Method 1) grep it for a common regular expression - perhaps the special
character '@' (at)? Often by reading/viewing a portion of the text
file(s) in question, one can see some common regular expression that
will fit one's needs.
Once grep'd and redirected to another file, that new file can be edited
(sed/ex/awk/gawk/whatever) to produce a file with only the email addresses.
(Method 2) use the steps in Method 1, but 'pipe' the two together and
produce the final file in one pass
(Method 3) process the original mail file with an awk/nawk/gawk script
to produce the final file - particularly useful if the file is more
complex than simple
Hope this helps
Regards
Fred James
More information about the Discuss
mailing list