Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Underliverable management

Status
Not open for further replies.

PBMAN

IS-IT--Management
Jul 27, 2010
1
US
I inherited a system that uses postfix as the front end to send email to users to notify them of leads or other important information in our system (automated processes). The database of users is in the 100,000+. This database has not been maintained well and contains many now undeliverable email addresses.

I'm wondering if there is a preferred method for dealing with this on the postfix level? For example, any mail returned with a 500 level error, add it to a db and do not deliver mail to this address anymore. I could then take that db table and flag the email addresses and get them to the appropriate people to fix/delete, etc.

Thank you for your advice.
 
I can't think of any way to automate the task via postfix, but using a little creativity I think you can make a script file that will be automated.

What I would suggest is that you use a program like SED, or perhaps AWK to use a regular expression that finds the lines with the 500 level error code and then extracts the email address as one of the fields. Run the script on your mail.log. Have it then create a file with the list of email addresses that you want to remove.

Then create a script that reads each of these email addresses and connects to the database and drops the entries from the table where the email address matches the list.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top