[tutorial] How to get bounce handling to work

Solutions for other phpList version 2 users
Forum rules
Please do not ask questions here, this is for Solutions you have discovered or come across.

[tutorial] How to get bounce handling to work

Postby fivealive » 4:45pm, Fri 14 Mar, 2008

Tutorial on how to set up bounce handling

Ok, here's how I got bounces to work (yay!) My domain is on a shared server, which is why it wasn't working.

This tutorial will assume that you are a total noob.

With that in mind, here's an important point: this tutorial assumes you're going to create the email account no-reply@mydomain.com, but obviously do not create that account verbatim. For example, if you were Bill Gates, you might create no-reply@microsoft.com or maybe bounces@microsoft.com. If your website was www.ireallylovecoolcars.com, the email would be no-reply@ireallylovecoolcars.com

1) Set up a new email account on your domain. To do this, you would go to your web hosting control panel. You should have received this information when you first got your web hosting.

Use the control panel to set up a new email account (for example, no-reply@mydomain.com)

2) Check the "source" of an older email sent from phplist. The easiest way to do this is to use phplist to send a message to yourself. If you are using MS Outlook 2003, you just right-click on the message that you received from phplist, and choose "options." There is a box at the bottom labelled "Internet Headers."

Scroll through the headers and look for the line:
envelope-from <someaddress@somedomain.com>

and this line:
Return-Path: someaddress@somedomain.com

For example, before I fixed the bounces, my envelope was from the shared server, so it was something like this:
envelope-from <azkdh292@c12.hostingco.com>
Return-Path: azkdh292@c12.hostingco.com

Obviously this is not what we want. So...

3) Open your phplist config.php file. It is on your web server. If you installed phplist in the default folder, it would be:

Use FTP or your web host's control panel to download a copy of this file (config.php) and save it to your computer. Once you have it, open the file in a text editor. Windows notepad will NOT work. I use EmEditor Free for stuff like this, which is a great free unicode text editor.

4) Edit your phplist config file.
Scroll down to the "Settings for handling bouces" section of the file. As it has been said before:

Remove the "#" from this line and put the email account that you just created in there so that you change this:
Code: Select all
# $message_envelope = 'listbounces@yourdomain';

into this:
Code: Select all
$message_envelope = 'no-reply@mydomain.com';

Next, scroll down a bit and enter the information. Replace localhost with your email server (probably something like mail.mydomain.com), and then replace popuser with the user name that you use to log in to the new email account (no-reply@mydomain.com) and replace password with the password for the new account. For example, change the following:
Code: Select all
$bounce_mailbox_host = 'localhost';
$bounce_mailbox_user = 'popuser';
$bounce_mailbox_password = 'password';
to this:
Code: Select all
$bounce_mailbox_host = 'mail.mydomain.com';
$bounce_mailbox_user = 'no-reply+mydomain.com';
$bounce_mailbox_password = 'somestupidpassword';

Note that you SHOULD have received this information (mail server, username, and password) when you created the new email account no-reply@mydomain.com). This info is going to be different for everyone. For example, my hosting co uses the "+" sign instead of the "@" when you log in. Weird.

Now, save config.php and upload it to your web server using FTP or your web host's control panel. Replace (overwrite) the original config.php in the same folder.

5) Now, go into phplist and create a new list. Add your personal email to this list so you can check if it works. Also add some email that couldn't possibly exist, like: somecrazyguy@somereallylongwebsiteurlth ... yexist.com

This way, that email will get bounced and you can see if bounces are working.

6) Send a message to the new list. When you receive it at your personal email address, check the message header like you did before. You should now see:

envelope-from <no-reply@mydomain.com>)


Return-Path: no-reply@mydomain.com

7) Now go back into phpList. Go to "Process Bounces" on the right hand menu. Once this is done, go to "View Bounces" and you should see them pop up for the imaginary email address that couldn't possibly exist.

(I tried going to "View Bounces" first, but nothing happened. Bounces started working after I went to "Process Bounces." Now both "View" and "Process" work fine. I suspect that this is because phpList had to re-load the new config.php file).

8) (Optional). I also double-checked that bounces were being sent to no-reply@mydomain.com by logging into that email account via my web host's web-mail account. Yep! Works fine.

I hope this tutorial helps people who have this problem. It won't solve your problem if you have a web server that doesn't support php list because it's not running the latest version of php or something like that.
phpList newbie
Posts: 1
Joined: 3:58pm, Fri 14 Mar, 2008

Postby ericwilmoth » 10:18pm, Fri 14 Mar, 2008

Finally, something that makes sense and actually works :!:

Remove the "#" from this line and put the email account that you just created in there so that you change this:

I have mixed emotions right now--fivealive, I could kiss you for writing a clear, comprehensive and COMPLETE tutorial...

...and i am unbelievably shocked and a bit pissed that the documentation has not taken these things into consideration. It needs to be updated for people who don't comprehend that the "#" is the thing blocking the message_envelope from working!!! :evil:
# Message envelope. This is the email that system messages come from
# it is useful to make this one where you can process the bounces on
# you will probably get a X-Authentication-Warning in your message
# when using this with sendmail
# NOTE: this is *very* different from the From: line in a message
# to use this feature, uncomment the following line, and change the email address
# to some existing account on your system
# requires PHP version > "4.0.5" and "4.3.1+" without safe_mode
$message_envelope = 'User @ Domain. com';

If i'd known what "uncomment" meant i never would have had this trouble. I mean, lower down in the config file, when the port is discussed, the time was taken to actually spell it out for people, so why not the F@CK here?!?!?!??!?!


also, Incidentally--in case this helps anyone else encountering the same issue--i am using outlook 2003, and the one thing that i had to do differently to view the internet headers was actually go to 'VIEW' in the toolbar and then go down to options, and the window that opens has the Internet Headers at the bottom.
PL Nut
Posts: 17
Joined: 3:02pm, Mon 10 Mar, 2008

Postby rdohn » 12:58am, Tue 25 Mar, 2008

Yep, I noticed the difference in the little pound sign was messing up the config file...change and presto!

I have bounces working!!! :lol: :lol:
Posts: 9
Joined: 7:56am, Mon 17 Mar, 2008

Still not working

Postby Guest » 6:36am, Sun 02 Nov, 2008

I have followed the tutorial and here are my settings:
Code: Select all
$message_envelope = 'bounces@freenclearstuffnewsletter.com';

$bounce_protocol = 'pop';


$bounce_mailbox_host = 'mail.freenclearstuffnewsletter.com';
$bounce_mailbox_user = 'bounces@freenclearstuffnewsletter.com';
$bounce_mailbox_password = 'password';

Here are the headers from my PHPlist generated email to myself:
Code: Select all
X-Message-Delivery: Vj0xLjE7dXM9MDtsPTA7YT0wO0Q9MjtTQ0w9Ng==
X-Message-Status: n:0
X-SID-PRA: Amber@freenclearstuffnewsletter.com <Amber>
X-Message-Info: 6sSXyD95QpVT00fDwBTi3plTkvd4yyFw82G6OgIOLqkm8vGZimr/6KZUg7njF+1uiN
Received: from freenclearstuffnewsletter.com ([]) by bay0-mc7-f18.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668);
    Sat, 1 Nov 2008 19:27:03 -0700
Received-SPF: pass (freenclearstuffnewsletter.com: domain of newsletter@freenclearstuffnewsletter.com designates as permitted sender) receiver=freenclearstuffnewsletter.com; client-ip=; helo=freenclearstuffnewsletter.com; envelope-from=newsletter@freenclearstuffnewsletter.com; x-software=spfmilter 0.97 http://www.acme.com/software/spfmilter/ with libspf2-1.0.0;
Received: from freenclearstuffnewsletter.com (localhost.localdomain [])
   by freenclearstuffnewsletter.com (8.14.2/8.14.2) with ESMTP id mA22R3cO017745
   for <FreeNClearstuff>; Sat, 1 Nov 2008 22:27:03 -0400
Received: (from apache@localhost)
   by freenclearstuffnewsletter.com (8.14.2/8.14.2/Submit) id mA22R3i0017742;
   Sat, 1 Nov 2008 22:27:03 -0400
X-Authentication-Warning: freenclearstuffnewsletter.com: apache set sender to newsletter@freenclearstuffnewsletter.com using -f
To: FreeNClearstuff@hotmail.com
Subject: Ensure and Perfume samples & birthday pics
Date: Sat, 1 Nov 2008 22:27:03 -0400
From: "Amber@freenclearstuffnewsletter.com" <Amber>
Message-ID: <7e63f716a1e98a19a809c74448e85b2a>
X-Priority: 3
X-Mailer: PHPMailer [version 1.73]
X-Mailer: phplist v2.10.5
X-MessageID: 2
X-ListMember: FreeNClearstuff@hotmail.com
Precedence: bulk
Errors-To: newsletter@freenclearstuffnewsletter.com
MIME-Version: 1.0
Content-Type: multipart/related;
Return-Path: newsletter@freenclearstuffnewsletter.com
X-OriginalArrivalTime: 02 Nov 2008 02:27:04.0092 (UTC) FILETIME=[7E6FD5C0:01C93C92]

Can someone look at that and see if anything looks wrong? I am at a loss.

Postby H2B2 » 5:24pm, Mon 03 Nov, 2008

Your message envelope setting (bounces@freenclearstuffnewsletter.com) does not seem to have any effect on the Return-path header field (newsletter@freenclearstuffnewsletter.com).

Did you check which of both mail accounts actually receives the bounces? As mentioned in the tutorial, you can check this by logging in to these accounts using a webmail client.
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Postby Guest » 9:42pm, Mon 03 Nov, 2008

Yes - I checked - and neither account is getting the bounced messages.[/code]

Postby H2B2 » 7:33am, Tue 04 Nov, 2008

In that case I don't think the main problem is with your phplist configuration. Since there are no bounces to retrieve in either of the above email accounts, you would first have to find out what is happening with bounced messages when they arrive on your mail server. Check for instance if your (spam)/mail filters have an influence on how the bounces are handled on your server. If you are on a shared host, you could ask your ISP.
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Postby flasher » 8:09pm, Fri 13 Mar, 2009

Cannot create POP3 connection to mail.mydomain.com: Certificate failure for mail.mydomain.com: self signed certificate: /C=US/ST=Unknown/L=Unknown/O=Unknown/OU=Unknown/CN=ls.mihost.com/emailAddress=ssl@ls.myhost.com
Identifying consecutive bounces
Nothing to do
Identifying consecutive bounces
0 users processed

Anyone have a clue why im getting this error when i try to process my bounces???
PL Nut
Posts: 15
Joined: 11:54pm, Wed 04 Feb, 2009

Postby flasher » 8:13pm, Fri 13 Mar, 2009

Nevermind... i found the problem...

I had on my config.php

#$bounce_mailbox_port = "110/pop3/notls";
$bounce_mailbox_port = "110/pop3";

Change it to

$bounce_mailbox_port = "110/pop3/notls";
#$bounce_mailbox_port = "110/pop3";

PL Nut
Posts: 15
Joined: 11:54pm, Wed 04 Feb, 2009

Postby mjstehn » 8:43pm, Sat 14 Mar, 2009

What if you are using mbox (IMAP) for you bounces? What changes need to be made here? Thanks,
phpList newbie
Posts: 4
Joined: 4:37pm, Fri 13 Mar, 2009

Postby CS2 » 1:29am, Sun 15 Mar, 2009

I've only been able to get bounce processing to work with pop3 boxes.
PL Master
Posts: 216
Joined: 2:20am, Wed 04 Feb, 2009

Re: [tutorial] How to get bounce handling to work

Postby pvener » 6:21pm, Sat 16 May, 2009

Who knew that shared servers required extra handling? This lovely, clear tutorial should definitely be inlcuded in the Wiki!

Posts: 11
Joined: 6:51pm, Fri 08 May, 2009

Re: [tutorial] How to get bounce handling to work

Postby mckeephoto » 5:54pm, Tue 19 May, 2009

Excellent tutorial. I followed it to the letter and now my bounces are working.

Thank you!
PL Nut
Posts: 27
Joined: 5:16pm, Thu 29 Jan, 2009

Re: [tutorial] How to get bounce handling to work

Postby DarkArchon » 11:24pm, Wed 20 May, 2009

Alright, I'm getting really close to getting bounces to work, but they aren't quite doing it. I have the feeling I know why, but hopefully someone on here can help me.

First of all, part of the problem -may- be that my email server and the server with PHPList on it are two separate servers. PHPList is on mydomain.com, email is on mydomain.info. I know that makes things a little difficult to follow, but it should be easy enough, I edit the config.php on mydomain.com to say....

Code: Select all
 81 # when the protocol is pop, specify these three
 82 $bounce_mailbox_host = 'mail.mydomain.info';
 83 $bounce_mailbox_user = 'bounces@mydomain.info';
 84 $bounce_mailbox_password = 'password';

And everything looks like it processes fine. If I hit process bounces I get an error free menu telling me 0 bounces have been processed. If I log into the webmail for bounces@mydomain.info and send a message to a fake address, get a bounce back, then go on PHPList and hit process bounces, it processes a bounce.

That's as far as it goes. If I create a fake email on PHPList, send a message to it, I get no bounce message in bounces@mydomain.info After reading this guide, I looked at the headers on a message sent to my good account. (in Thunderbird)

Errors-To: bounces@mydomain.info
AND, buried in the Received line...
envelope-from <nobody@myhost.namehere.host>

So, when I set my $message_envelope line, it did change the Errors-To header on my email, however, it did not change the Return-Path or Envelope-From path, which I assume is where bounced emails are going. Does anyone know how to change these two paths? Preferably only for PHPList, however, if necessary its a RHEL5 server that I have root access on, so if I need to change something in apache, etc. it can be done. Thanks for any help you guys can give me.

Edit: On second though, yes, I can do it at server level, but I would MUCH rather change it for just PHPList. Our server gets hundreds of bounced and status messages from various areas. I would much rather all those say where they are, and only the PHPList ones go somewhere.
phpList newbie
Posts: 3
Joined: 6:09pm, Tue 19 May, 2009

Re: [tutorial] How to get bounce handling to work

Postby DarkArchon » 4:08pm, Thu 21 May, 2009

fix'd, for anyone else that might be having this problem...

Code: Select all
644 # If you want to use the PHPMailer class from phpmailer.sourceforge.net, set the following
645 # to 1. If you tend to send out html emails, it is recommended to do so.
646 define("PHPMAILER",1);

^^ change the 1 there to a 0 and see if that works...

So much effort, such a little fix, such is life.
phpList newbie
Posts: 3
Joined: 6:09pm, Tue 19 May, 2009


Return to Answers, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 2 guests