getting phplist to recognize qmail bounces [solved]

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.

getting phplist to recognize qmail bounces [solved]

Postby accoladearts » 4:29pm, Sat 02 Feb, 2008

Hi all,

I'm new to phplist and the forums, and I have to say that I've got quite far along with just the phplist documentation and forum postings! I do have one situation now with a new installation that is frustrating to no end, hope that someone can help out.

I'm running two different installations of phplist, one of which is using qmail as the MTA. Both are running fine, except that the qmail-generated bounces it will not flag as legitimate bounces within phplist... the bounce queue runs and deletes everything in the inbox. On the other hand, my non-qmail installation recognizes the same bounces just fine and handles them correctly.

Opening up the source of the bounce emails, I noticed that the successful bounces (which employ Exim) include headers such as "X-Recipient-Failed". The qmail bounces don't include this information, but stick to the QSBMF protocol which tag the failed recipient in the first line of the message body between two brackets "<" and ">".

I've pulled apart processbounces.php and searched all over for someone having faced a similar problem, and am coming up blank. I'll include snippets of the successful and failed bounces below, perhaps someone will know how to tweak the processbounces script (or qmail!) to get this working right:

Successful bounce recognition: header
Return-path: <>
Delivery-date: Sat, 02 Feb 2008 00:45:28 -0500
Received: from mailnull by [mailserver].com with local [Exim 4.68]
id 1JLBBw-0004TM-9p
for; Sat, 02 Feb 2008 00:45:28 -0500
Auto-Submitted: auto-replied
From: Mail Delivery System <Mailer>
Subject: Mail delivery failed: returning message to sender
Message-Id: <E1JLBBw>
Date: Sat, 02 Feb 2008 00:45:28 -0500

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed:
The mail server could not deliver mail to The account or domain may not exist, they may be blacklisted, or missing the proper dns entries.

0 of 1 users processed
Identifying consecutive bounces
1 users processed

Unsuccessful bounce (with qmail): header
Return-Path: <>
Received: (qmail 19672 invoked for bounce); 2 Feb 2008 00:01:21 -0500
Date: 2 Feb 2008 00:01:21 -0500
From: MAILER-DAEMON@[mailserver].com
Subject: failure notice

Hi. This is the qmail-send program at [mailserver].com.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

Sorry, I couldn't find any host named (#5.1.2)

1 bounces to fetch from the mailbox
Please do not interrupt this process
Closing mailbox, and purging messages
Processing bounces based on active bounce rules
0 bounces processed by advanced processing
0 bounces were not matched by advanced processing rules
Identifying consecutive bounces
Nothing to do
Identifying consecutive bounces
0 users processed
phpList newbie
Posts: 1
Joined: 4:04pm, Sat 02 Feb, 2008

Re: getting phplist to recognize qmail bounces

Postby Diar » 11:20am, Thu 16 Apr, 2009

Hello all,

First off, yes, I do realize this post is well over a year old, and that I probably should not have bumped it to the top.

Second, I have the exact same problem, and I thought accoladearts explained so nicely, I would just add my own information to this topic and thus hopefully get a reply to get it working.

The difference between accoladearts and myself is that I only have 1 installation of phpList, not operational yet seeing my boss wants Bounce Processing to work first.

I have noticed I get the exact same message when trying to process bounces, it finds the bounces in the mailbox, downloads them into the database (using phpMyAdmin it's easy to check that), but doesn't match it to the user. Nor does it display the bounced messages under the "View Bounces" menu option.

I'm currently using Gmail for the bounce mailbox, and seeing it does actually download the bounces into the database, I'm assuming I have set everything correctly in the config.php and processbounces.php file (need to edit the port in there to make it work with Gmail, haven't edited anything else).

Upon request, I can also add the bounced message, my config.php settings for bounces and the header of the original message sent as I have also added 1 working account to the same test list.
PL Nut
Posts: 24
Joined: 1:16pm, Fri 06 Mar, 2009
Location: Holland ^_^

Re: getting phplist to recognize qmail bounces

Postby Diar » 8:30am, Mon 20 Apr, 2009

Right, I figured it out.

Such the idiot I am I had been reading extensively on these forums before sending out any real test messages.

That is when I read Hotmail "blocked" the phpList emails because of the custom header information (X- info), and I edited it out in class.phplistmailer.php, yes, I did so before even bothering to test it...

Today I'm reading through the processbounces.php file, and I see X-MessageId and X-ListMember there. Then I decide it might be a good idea to put them back into the emails and try again. And it worked. Ofcourse.

I have been trying to fix the bounces for about 2 weeks now, and it never occured to me before to read through the processbounces.php file before to see if there had been any comments obstructing the processing...

In short:
PhpList fetches bounces, but doesn't process them?

Check class.phplistmailer.php and sendemaillib.php to see if you commented any header information.
sendemaillib.php around line 592
class.phplistmailer.php around line 25

This extra header information NEEDS to be there in order for phpList to process the bounces correctly.

Have a nice day :)
PL Nut
Posts: 24
Joined: 1:16pm, Fri 06 Mar, 2009
Location: Holland ^_^

Return to Answers, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 4 guests