SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Addict
    Join Date
    Feb 2003
    Location
    Berlin
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Email Bounce Handler

    Hi,

    unfortunately our newsletter is sent to to many people, with inactive mail adresses thus we got blocked by some providers.

    What I do need now, ist some email bounce handler script.

    Does anyone know a good tutorial how to write this, or is there some good and simple script, that could integrate into our cms?

    Thanks for any help!

    Regards
    Fl÷zen

  2. #2
    PHP Guru lampcms.com's Avatar
    Join Date
    Jan 2009
    Posts
    921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Floezen View Post
    Hi,

    unfortunately our newsletter is sent to to many people, with inactive mail adresses thus we got blocked by some providers.

    What I do need now, ist some email bounce handler script.

    Does anyone know a good tutorial how to write this, or is there some good and simple script, that could integrate into our cms?

    Thanks for any help!

    Regards
    Fl÷zen
    Its not an easy topic.

    I wrote a couple of those but have not yet perfected it, I will when I have more time. The problem is that you dont want to just mark the address as bounce if it comes back as bounced just once.

    You need to monitor the address for several bounces, maybe at least 3 times

    And its also a good practice to wait a couple of days and send a test email to the same user to see if it comes back as bounced again.

    For a high volume email list you also should have your bounce filter as a daemon and not just a script.

  3. #3
    SitePoint Addict
    Join Date
    Feb 2003
    Location
    Berlin
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How can I differentiate between hard and soft bounces?
    Hard bounced mail adresses could be deleted for shure - or?

    Fl÷zen

  4. #4
    PHP Guru lampcms.com's Avatar
    Join Date
    Jan 2009
    Posts
    921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Floezen View Post
    How can I differentiate between hard and soft bounces?
    Hard bounced mail adresses could be deleted for shure - or?

    Fl÷zen
    its in the error code reported by SMTP transport. Hard bounces start with 5, soft with 4

    the problem is that these codes are not always reliable, it's up to the individual email server admin to configure the error reporting codes and sometimes they are configured incorrectly and soft bounces reported as hard bounces.

    Relying on codes along is not good enough. You need to try to actually parse the text of error code, and that's where it can get tricky.

  5. #5
    SitePoint Wizard wheeler's Avatar
    Join Date
    Mar 2006
    Location
    Gold Coast, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I want to do this as well - although I think I would be comfortable disabling addresses that return a hard bounce where it says the address has permanent problems. I don't think I would bother going to the trouble of trying to parse the text, but I guess each to their own.
    Studiotime - Time Management for Web Developers
    to-do's, messages, invoicing, reporting - 30 day free trial!
    Thomas Multimedia Web Development

  6. #6
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So how is this done with PHP? Are you connecting to the mail server or something in PHP, if is there a way to do this without having to download the mail from the server if you don't run an IMAP server.

  7. #7
    SitePoint Addict
    Join Date
    Feb 2003
    Location
    Berlin
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does anyone have experience with PHPMailer BMH (http://phpmailer.codeworxtech.com/index.php?pg=bmh) - Bounce Mail Handler...?

  8. #8
    PHP Guru lampcms.com's Avatar
    Join Date
    Jan 2009
    Posts
    921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by atlantadental View Post
    So how is this done with PHP? Are you connecting to the mail server or something in PHP, if is there a way to do this without having to download the mail from the server if you don't run an IMAP server.
    I have done this with postfix, so I don't know about other type of mail server.
    Basically the easy way to go about this is to use VERP
    You can find out how to enable VERP in your mail transport.

    This is how I do it using pear MAIL package:

    $arrParams['sendmail_path'] = '/usr/sbin/sendmail'; // this is actually a path to postfix. The sendmail is alias for a postfix program on many servers
    $arrParams['sendmail_args'] = "-i -XV -f $strFromEmail"; // these are ONLY for Postfix!
    $objMail = Mail::factory('sendmail', $arrParams);
    $objMail->send($address, $arrHeaders, $strEmail);

    Then the bounce emails will come back with VERP-style addresses that are easy to parse.

    Here is some helpful info about using VERP style addresses and how easy it becomes to parse bounces with it
    (this is for postfix only)

    http://www.postfix.org/VERP_README.html

  9. #9
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Sharedlog.com, that is really helpful. I'll have to check that out. I'm not sure I have postfix though. Just in case does anyone else have any other ideas on how to do that?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •