Question : Sendmail logs - how to find failed emails

Hi experts,

I sent out a lot of email for a transportation authority, and now need to clean up my email db. I need a list of failed addresses. I know where all the logs are, and I also have all returned emails.

But returned emails have to be processed one by one, so I am turning to the logs.

What do I do with the sendmail logs to give me a list of all failed email addresses?

Thank you.

Answer : Sendmail logs - how to find failed emails

if the lines are returned in the exact nature that you have posted then

grep "error message here" /var/log/maillog | grep "Final-Recipient"

the above command should return only those lines

however i am afraid that is not the way it would return the lines. can you post the actual lines instead of formatting them

if you have not formatted them then

grep "error message here" /var/log/maillog | grep "Final-Recipient" | tr -d "Final-Recipient: RFC822; "

should return only the email addresses
Random Solutions  
 
programming4us programming4us