MailPress is the most powerful free self-hosted automatic newsletter and mailing list package for WordPress. If you don't believe me see my comparison with other WordPress newsletter plugins.
If you have a blog with many subscribers, you don't want to spend time handling bounce messages from readers who fall off the face of the earth, or from spammers who subscribe bad addresses for reasons that make no sense to me. To combat this, MailPress handles bounce messages automatically for you; but it can be a little tricky to set up.
MailPress has two different methods for handling bounce messages. The one described here uses a technique called Variable Envelope Return-Path (VERP) to identify where the bounce messages are coming from. The downside of this technique is that it relies on an address encoding trick that requires a mailbox which will catch all email addressed to a range of bounce addresses. Not all hosting services support this, and even on those that do I think the other method of bounce handling without using VERP is better; so I recommend you use that instead.
But if you really want to use VERP, here's a step-by-step guide to configuring it:
Create A Mailbox to Receive Bounce Messages
The simplest way to catch VERP bounce messages is to create a catch-all mailbox. If your hosting package uses CPanel, use Email Accounts on the Mail menu to create a mailbox named bounces@yourdomain, and assign it a password with the password generator. Note this password down as you'll be using it later.
Then select Default Address on the Mail menu and Send all unrouted email for yourdomain, selecting Forward to email address: bounces@yourdomain (the mailbox you just created).
Unfortunately this option will capture all email to your domain that isn't addressed to an existing mailbox, including messages to bad addresses that should really generate a failure notice back to their sender. If one of your friends mistypes your name, they'll never find out now. It would be better if you could specify a regular expression pattern that only captured messages to addresses beginning with bounces... but that seems impossible in CPanel, and MailPress doesn't yet support any other form of bounce address identification other than VERP.
Check that the default address works by sending a test email to bounces+42+69@yourdomain. Log into Webmail with the address bounces@yourdomain, and check that the test mail is in the inbox.
If you're with HostGator, you'll need to start an online chat session and ask the technician to enable the Default Address option, as it is disabled by default.
Activate and Configure The Bounce_handling Add-On
On the WordPress dashboard, select MailPress Add-Ons under the Plugins menu.
Activate the Bounce_handling add-on.
Click Settings underneath Bounce_handling to go to the MailPress Settings page opened at the Batches tab.
Under Handling Bounces set:
- Return-Path: bounces@yourdomain, the name of the mailbox you created earlier.
- Max bounces per user: 3.
- Bounce in mailbox: delete.
- Submit Batch with: other. And take a note of the sample path which is something like: /home/username/public_html/wp-content/plugins/mailpress/mp-content/xtras/mp_bounce_handling. You'll need this later too.
- Save Changes.
Then switch to the POP3 tab under MailPress Settings to configure the bounce mailbox as:
- POP3 Server: mail.yourdomain
- Port: 110
- Username: bounces@yourdomain, the name of the mailbox created earlier. Note that low-cost hosting providers like HostGator use a shared email server where the username includes the domain name.
- Password: the password you generated earlier.
- Save Changes.
Enable Bounce Logging
Under Settings, MailPress choose the Logs tab, and select Bounces Logging Level: E_ALL, Number of Bounces log files: 7, which will keep the log for a week.
Set Up A Cron Task To Run Bounce Handling Daily
On your CPanel Advanced menu, choose Cron jobs.
Check that the Cron Email address is set to an address that you read regularly.
Under Add New Cron Job, choose Common Settings: Once a day.
Command: path-to-php -f sample-path-from-earlier/cron.php >/dev/null
On HostGator for example this looks like: /usr/bin/php -f /home/username/public_html/wp-content/plugins/mailpress/mp-content/xtras/mp_bounce_handling/cron.php >/dev/null
This command must be all on one long line.
The purpose of the >/dev/null is to discard the output of the cron job so you don't routinely receive pointless emails. I recommend you test this initially by omitting the >/dev/null, and checking that you get an email when the job runs. Temporarily change the job to run more often while you're testing. If all is working, you should receive an email containing a '1'. Add the >/dev/null later once you've checked everything is working so you don't end up with a useless daily email.
If you don't already have bad addresses subscribed to your newsletter, add one manually using Mails, Users, Bulk Add (click the box at the bottom of the list) and selecting Activate. Post as many articles to your blog as you specified in Max bounces per user earlier, and wait for them to be sent to the bogus address(es).
Check The Logs
After the cron job has run at least once, you can check the bounce processing log in MailPress under Mails, Logs and looking for Name: MP_Log_x_MP_Bounce_mp_process_bounce_handling_yyyymmdd.txt
Examine the log and check that MailPress is establishing a connection to the mail server correctly, reading the bounce messages and marking the offending user as bounced once the specified number of bounces has been reached.
If the log file shows -ERR Authentication failed when connecting to the mail server, double check that you included @yourdomain in the Settings, MailPress, POP3, Username field if you're on a shared email server. Also check that you pasted the password correctly.
W3-Total-Cache Users Note
There is a problem running cron jobs using W3-total-cache, which you can fix in MailPress 5.0.1 by adding this line to cron.php:
<?php define('DOING_CRON', true); ...
This issue is already fixed for you in MailPress 5.1 and later.