Forum Moderators: coopster

Message Too Old, No Replies

Parsing mail server bounces

         

baertyp

12:40 am on Nov 21, 2004 (gmt 0)

10+ Year Member



Hi everyone,

I'm running a mid-size community site with round-about 35.000 members as of today. With popularity increasing this number is growing faster than expected. The most used part of the site is around classified ads. The users' email adresses are not revealed to the public. Answers to the classifieds are composed through forms and sent by our server to the email-adress the member presented at sign-up time. Signup is double opt-in, so the email adress is valid at signup time.

I see an increasing number of members cancelling their email-adress with their provider but not changing or deleting their account at our site. I catch these because I receive the mail server bounces when someone answers a classified and my server sends mail to an invalid destination address. I am planning to send out periodic "are you still alive?" mails to catch all stale addresses.

Now for the actual question: Is there any reliable means of scanning these bounces as part of the nightly housekeeping cron job and set a flag for the user waving at him at his next login? For obvious reasons I cannot inform the user by email ...

Some servers reject invalid recipients during SMTP handshake, leaving me with the message from my MTA, but most of them accept mail for any recipient and send the bounce themselves if necessary. The format (subject and body) of the server bounces varies greatly between the major email providers and I simply cannot find the common denominator. Doing this manually is a tiring task and hardly feasible. Not doing this at all results in decreasing user satisfaction, which is equally undesired.

My basic approach would be:
1. Setup a specific mail address for the bounces (postmaster@mysite.com), this is accomplished.

As part of the nightly cron job
2. POP3-connect to the above account and retrieve mails
3. Scan the mails for the magic bits
4. Update DB tables accordingly.

Any suggestions on item 3? Maybe even some code snippets?

Best regards
Markus

jatar_k

5:34 pm on Nov 21, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



we use Procmail [procmail.org] to process emails and insert into a db, the same could be done to check the email and set a flag in the user info.