Properly directing bounces in PHPList withSMTP SES

Advanced Questions & Problems

Properly directing bounces in PHPList withSMTP SES

Postby tcibah » 4:15pm, Wed 18 Jul, 2012

Hello,

Below is the response from AWS SES staff re this question.

When using PHPList, the obvious workaround is to use the $bounce_mailbox_user as the From addess. But this way, we lose a major PHPList flexibility in sending from various From addresses.

Similarly, hard-coding a header with the From header in the header section is another inconvenient workaround.

Any suggestions?
Regards
---------------------
Properly directing bounces with SMTP SES
https://forums.aws.amazon.com/thread.jspa?messageID=310092

In case of SMTP endpoint, the bounces will be forwarded to address specified in the MAIL FROM command. To address your use case, you could use the following steps:

suppose that your bounce address is bounce@domain.com
suppose that your from address is from@domain.com
when issuing the MAIL FROM command, use your bounce address:
MAIL FROM: bounce@domain.com
explicitly specify the from header in the header section:
From: from@domain.com
tcibah
phpLister
 
Posts: 5
Joined: 7:52am, Thu 14 Apr, 2011

Re: Properly directing bounces in PHPList withSMTP SES

Postby duncanc » 6:14pm, Wed 18 Jul, 2012

You can use $message_envelope (not $bounce_mailbox_user) for the MAIL FROM command by the following change. The From: header will remain whatever you are sending from.

See file admin/sendemaillib.php. Line 605 is
Code: Select all
    $mail = new PHPlistMailer($messageid,$destinationemail);

then add
Code: Select all
    $mail->Sender = $GLOBALS['message_envelope'];
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: Properly directing bounces in PHPList withSMTP SES

Postby tcibah » 7:08am, Thu 19 Jul, 2012

Thanks duncan.

Added $mail->Sender = $GLOBALS['message_envelope']; after line 607 (V 2.10.18)
$mail = new PHPlistMailer($messageid,$destinationemail);

Tested, message went thru but no changes in message headers. Sender may be now $message_envelope. Have no time to further debug by creating/sending to a bounce destination- non-existing address for example. will update this post later.

Hope to have a way in the ui to do that rather than making changes in some files.
tcibah
phpLister
 
Posts: 5
Joined: 7:52am, Thu 14 Apr, 2011

Re: Properly directing bounces in PHPList withSMTP SES

Postby duncanc » 2:23pm, Thu 19 Jul, 2012

Have you actually set $message_envelope to the bounce address in your config.php file?

I did get different message headers:

Code: Select all
Return-Path: <listbounces@strontian.local>
...
From: admin@strontian.local
Errors-To: listbounces@strontian.local
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: Properly directing bounces in PHPList withSMTP SES

Postby tcibah » 8:46am, Sat 21 Jul, 2012

Yes. Both $message_envelope & $bounce_mailbox_user point to the same address

Did a quick test:

1) sent a message to a non-existing yahoo address (bounce):
Viewing bounce Bounce details show Envelope-to correctly pointing to the bounce address, From also correctly shown.

2) sent a message toa correct address 9not bounce0
Return-Path shows an amazon address; From correctly shown.

So, it seems the hack does work.
tcibah
phpLister
 
Posts: 5
Joined: 7:52am, Thu 14 Apr, 2011


Return to Advanced Questions & Problems

Who is online

Users browsing this forum: No registered users and 4 guests