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:
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.
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.
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.
Having fulfilled the aforementioned requirements (php-imap module, available mailbox, and safe mode disabled), let's edit config.php
to configure bounce processing:
config/config.php
and search for message_envelope
.$message_envelope = 'listbounces@yourdomain';
[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';
pop
access to your bounce mailboxdefine ("MANUALLY_PROCESS_BOUNCES",1);
$bounce_mailbox_host = 'localhost';
mail.mydomain.com
.$bounce_mailbox_user = 'popuser';
popuser
.$bounce_mailbox_password = 'password';
password!
$bounce_mailbox_port = "110/pop3/notls";
110/pop3
instead.$bounce_mailbox = '/var/spool/mail/listbounces';
$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;
0
, but under normal operation, it should remain at 1
.$bounce_mailbox_purge_unprocessed = 1;
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;
5)
consecutive bounces, a member will be automatically unsubscribed.3.136.18.141