Chapter 3. Setting up E-mail Bounce Handling

Now that we have forms enabling our subscribers to sign up, we need to keep our lists clean by implementing bounce handling. A bounce is an e-mail message which is returned because it is unable to be delivered.

In this chapter, you will learn how to configure and manage e-mail bounce handling including:

  • Basic bounce settings
  • Manually processing bounces
  • Reviewing and acting on bounces

E-mail bounce handling

phpList includes a robust bounce-handling system. It uses the "return-path" header of an e-mail to tell automated systems (that is, our subscribers' mail servers) who to inform about the failure to deliver our messages. This can be different from the "From" header in the e-mail, which is what the user sees when he/she reads our e-mail, and where out-of-office responses are sent.

Requirements

phpList's bounce handling code requires the PHP "IMAP" module. This module implements functions in PHP for opening POP/IMAP mailboxes, and is a requirement for bounce handling. Ensure that your hosting provider includes this module.

You will also need a mailbox for the bounces to be delivered to. Depending on your server configuration, this could be a local or remote POP3, or (under certain special circumstances) simply a mailbox file.

Finally, for PHP 4.2.3 and greater, "safe mode" will need to be disabled.

Note

The PHP safe mode is an attempt to solve the shared-server security problem. It is architecturally incorrect to try to solve this problem at the PHP level, but since the alternatives at the web server and OS-levels aren't very realistic, many people, especially ISPs, use safe mode for now—http://php.net/manual/en/features.safe-mode.php.

Configuring basic bounce settings

Having fulfilled the aforementioned requirements (php-imap module, available mailbox, and safe mode disabled), let's edit config.php to configure bounce processing:

  1. Edit config/config.php and search for message_envelope.
  2. From this section downwards, uncomment (remove the "#" in front of the line) and customize the following variables, so that phpList knows where to find the bounce e-mails:
    $message_envelope = 'listbounces@yourdomain';
    
  3. Change this to your bounce e-mail address. For example, [email protected]. This won't replace the "from" address, but will be the "return-path" address on the e-mail headers. (The bounce address is used for replies, but the return-path address is used by e-mail systems for bounces:)
    $bounce_protocol = 'pop';
    
  4. In most cases, you will leave this unchanged. Only modify this if you don't have pop access to your bounce mailbox
    define ("MANUALLY_PROCESS_BOUNCES",1);
    
  5. This controls whether or not we have an option in the admin sidebar to process bounces. Let's leave this unchanged for now
    $bounce_mailbox_host = 'localhost';
    
  6. Assuming we're using a POP mailbox, this refers to the mail host on which the mailbox is located. If your mail host is the same as your phpList host, then leaving this unchanged will work; else you might change it to whatever mail host your provider has set up, that is, mail.mydomain.com.
    $bounce_mailbox_user = 'popuser';
    
  7. This is the mailbox username. You'll want to change this, unless your bounce user is really called popuser.
    $bounce_mailbox_password = 'password';
    
  8. Likewise, you'll almost certainly want to change this from the default of password!
    $bounce_mailbox_port = "110/pop3/notls";
    
  9. This specifies the protocol used (by default, unencrypted POP3) to access the mailbox. You'll want to leave this unchanged unless (a) you experience problems or (b) your provider requires transmission encryption on POP3 connections; in that case, try changing it to 110/pop3 instead.
    $bounce_mailbox = '/var/spool/mail/listbounces';
    
  10. If you set $bounce_protocol above mailbox, then this is the location to your mailbox file on the server's filesystem. If not, you can safely ignore this one.
    $bounce_mailbox_purge = 1;
    
  11. Sometimes, for testing purposes, you might want to process and re-process the same bounces in the mailbox. If this is the case, you'll set this value to 0, but under normal operation, it should remain at 1.
    $bounce_mailbox_purge_unprocessed = 1;
    
  12. This (advanced) option will leave "unprocessed" bounces (those which could not be matched to a user) in the mailbox. Change this to 0 if you intend to manually review these unprocessed bounces using a mail client; or else leave this at the default of 1.
    $bounce_unsubscribe_threshold = 5;
    
  13. The "Bounce Threshold" is probably the only field which may require tweaking— this defines the number of "strikes-before-you're-out" on bounces. That is, after this many (default 5) consecutive bounces, a member will be automatically unsubscribed.

    Note

    In versions of phpList prior to 2.10.2, this variable was incorrectly named $bounce_unsubscribe_treshold (the first h of "threshold" was missing).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.136.18.141