[thelist] Handling bounced mail

Sean G. ethanol at mathlab.sunysb.edu
Wed Oct 23 09:59:01 CDT 2002


You can also do this reading the email through LDAP, but the basic process
is the same.

Compile a list of the various messages you'll get with the returned mail
(User unknown, mailbox full, etc.) from various mail servers.  You don't
need the entire email, just a word or phase that will identify the reason
the newsletter came back undelivered.

When your process goes through an email, regex for each of your identifying
words and phrases until you get a hit, then regex for the email.  You'll
probably also want to track the format of the various rejected email
messages for the location of the offending email.  You'll see messages such
as, "Your email to john at smith.com was rejected.  Contact help at smith.com if
you have any questions."  You want to make sure you're grabbing
john at smith.com, not help at smith.com.

At that point you have the error notification email, you have the address
that produced the error, and you have the type of error (based on the
matching phrase from your rejected email message templates database).  Then
you just clean up--update your customer list and archive or delete the email
message.  There will be messages you'll want cleaned out without any action
on the customer side, such as those "warning, your message was not
delivered.  I will keep trying.  do not resend."

Someone should manually check this mailbox occasionally for messages that
for whatever reason were not picked up by the automated process.

I was able to implement this type of system with Cold Fusion and MS Exchange
5.5, so you shouldn't have too much trouble.  When you regex for email
addresses, remember the new TLDs such as .name and .museum.  You can't
expect the part of the address after the last . to be only 2 or 3 letters.


Sean G.

"Liam Delahunty" <ldelahunty at britstream.com> wrote in message
news:MGEKLGHDNCCOJEHBAIKEGEPMDJAA.ldelahunty at britstream.com...
> Steve Cook wrote:
> >we have offered a client a system for sending a mail newsletter to their
> >customer club members. They have said that we get the job if we can help
> >clean up their database after we send the first mail. They expect that as
> >many as 5000 of the addresses they have will bounce when we send the
> >mail and they want us to be able to assemble a list of customer numbers
> from
> >the bounced mails so they can clean up their database.
> Move all the bounced mail into various folders for an IMAP account, I was
> Linux so I then grepped the files for @. (I used IMAP so there would be
> big file containing all the email for each folder. I'm sure there are
> solutions.) There must be something similar to grep for MS, at the very
> least you could sort the file and perhaps do a regex on each line of
> to grab the email address? Anyway, then I sorted the results and removed
> duplicates with a simple loop.

More information about the thelist mailing list