We are currently using Postfix as our SMTP server on a CentOS linux server. When we send out emails, some servers tell us immediately that the email address is bad. some take longer and send us an email with this information. We need to remove these failed email addresses while also receiving legitimate emails sent to that account.
We are looking for a perl programmer to write a PERL script, which we will run as a cronjob every hour that will help us process and filter our bounce back emails.
This script will go through our mail queue /var/mail/admin, look at a template file where we define what "phrases" constitute a hard bounce, soft bounce, transient bounce, challenge response, spam, OR other, sort them, extract the email addresses and append them to a text/CSV file for each of the categories, and then move the entire email from the original file to another file OR delete it-- depending on how we have it configured. (After we have tested it thoroughly, we will most likely delete all bounce back messages.)
There will be customer emails that are not buonce back messages and these need to be kept ALWAYS.
Since it may be difficult to determine what is a buonce back message and what is not, we propose using the from address (MAILER-DAEMON usually, although it can be smoething else),subject line (it may say Failure), and text in the body to determine this. Naturally, each mail server has a different way of indicating a failure, so we must have the ability to add more "phrases" and modify the configuration as time goes on. Eventually, with enough tweaking on our part, we hope we can get the bulk of the failures removed and sorted properly.
this script will need to run quickly as there can be up to tens of thuosands of emails (spam, bounces, legitimate emails)and the file can be up to 100 megabytes. This script will need to copy the file before processing it as processing the actual mail file may be time-consuming and corrupt incoming new emails.
Example of text in a bounce back message
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:
XXXX at [url removed, login to view]
mailbox is full
We need the emails sorted into Hard bounce, soft bounce, legitimate emails, challenge response emails, spam, and OTHER.
Each of these need to be defined by "phrases" and bits of text, wihch we will modify as we study each incoming email.
This is a small project and shouldn't take too much time as we will be the ones to tweak and refine the program.
We will pay through GAF and GAF escrow.
We are looking to have this project completed within 2 weeks.
We will provide sample postfix mailbox file for you to test on and work with.