keiusui has asked for the wisdom of the Perl Monks concerning the following question:

I use Perl and sendmail to send out a weekly newsletter to about 10,000 e-mail addresses. Don't worry - the newsletter is completely legitimate, and everyone has signed up with a double-opt-in.

Every week about 500 (5%) of those e-mail addresses bounce back.

Is there any way, using sendmail, qmail or any other module, that I can automatically unsubscribe e-mail addresses that bounce?

Currently, whenever an e-mail bounces, I manually (and tediously) go into the database of e-mail addresses and delete the entry.

Thanks so much!

  • Comment on detecting valid e-mail addresses using sendmail

Replies are listed 'Best First'.
Re: detecting valid e-mail addresses using sendmail
by merlyn (Sage) on Jun 06, 2006 at 01:27 UTC

      Perhaps using Mail::Verify on addresses prior to sending mails would remove the need to process so many bounces?

      Steve
      --
Re: detecting valid e-mail addresses using sendmail
by sgifford (Prior) on Jun 06, 2006 at 02:33 UTC
    If you use VERPs, you'll be able to determine where the bounce came from by who the bounce is sent to, which is much easier than trying to parse bounce messages. You can catch the bounces in a .forward file which runs a program to remove them from the database.

    qmail has good support for VERPs, and it's easy to hack it together with Perl for other MTAs.

Re: detecting valid e-mail addresses using sendmail
by liverpole (Monsignor) on Jun 06, 2006 at 00:59 UTC
    Hi keiusui,

    I don't know if this is exactly what you want, but if I were doing it, I'd write a daemon that periodically checks your mail server, and when it finds an email message that "matches" the criteria for a "bounced" message, takes the appropriate action on unsubscribing whomever it was you had written to.

    Is that the kind of thing you're trying to do?  If so, let me know, and I'll dig up the code I wrote maybe half a year ago for doing my own "biff" (automated checking of the mail server with user notification for new messages, etc.)  Then you can modify it to your needs as far as what action needs to be taken on "bounced messages".


    s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/