Some filter spam (as mailinblack.com) are sending back a base64’s encode messaqe to any campaign, waiting an action.
My problem is th fact that when i process bounce, phplist canno’t process it,
When i go to “unidentified bounce” i see the message but canno’t read it.
You would want to look at the header of returned email…
I have had luck reading the bounce mailbox with a client such as Thunderbird, and ‘view source’, and it decodes the message. Copy the unsubscribe url to a web browser, and it will unsubscribe the user.
if (preg_match('/Content-Transfer-Encoding: ([\w-]+)/i', $bounce['header'], $regs)) {
$transfer_encoding = strtolower($regs[1]);
} elseif (preg_match('/Content-Type: multipart\/mixed;\s+boundary="([^"]+)"/im', $bounce['header'], $regs)) {
//# @TODO, this needs more work, but probably easier to find a class that can
//# split is all into itś parts
//print "BOUNDARY: " . $regs[1];
$multi_part_boundary = $regs[1];
$parts = explode($multi_part_boundary, $bounce['data']);
//var_dump($parts);
if (preg_match('/Content-Transfer-Encoding: ([\w-]+)/i', $bounce['data'], $regs)) {
// var_dump($regs);
$transfer_encoding = strtolower($regs[1]);
}
}
switch ($transfer_encoding) {
case 'quoted-printable':
$bounceBody = nl2br(htmlspecialchars(imap_qprint($bounce['data'])));
break;
case 'base64':
$bounceBody = imap_qprint($bounce['data']);
$pos = strpos($bounceBody, "Content-Disposition: inline") + 31;
$bounceBody = base64_decode(substr($bounceBody, $pos, -99)); //
break;
case '7bit':
case '8bit':
default:
$bounceBody = nl2br(htmlspecialchars($bounce['data']));
}
if (!empty($_SESSION['hidebounceheader'])) {
$bounce['header'] = '';
}
$bouncedetail = sprintf('
<div class="fleft"><div class="label">' . $GLOBALS['I18N']->get('ID') . '</div><div class="content">%d</div></div>
<div class="fleft"><div class="label">' . $GLOBALS['I18N']->get('Date') . '</div><div class="content">%s</div></div>
<div class="fleft"><div class="label">' . $GLOBALS['I18N']->get('Status') . '</div><div class="content">%s</div></div>
<div class="clear"></div><br />
<div class="label">' . $GLOBALS['I18N']->get('Comment') . '</div><div class="content">%s</div><br />
<div class="label">' . $GLOBALS['I18N']->get('Header') . '</div>' . '<div class="content">' . PageLinkAjax('bounce&hideheader=1',
'Close', '', 'hide') . '%s</div><br />
<div class="label">' . $GLOBALS['I18N']->get('Body') . '</div><div class="content">%s</div>', $id,
$bounce['date'], $bounce['status'], $bounce['comment'],
nl2br(htmlspecialchars($bounce['header'])), $bounceBody);
// print '<tr><td colspan="2"><p class="submit"><input type="submit" name=change value="Save Changes"></p>';
$p = new UIPanel(s('Bounce Details'), $bouncedetail);
echo $p->display();
// if (USE_ADVANCED_BOUNCEHANDLING) {
$p = new UIPanel(s('New Rule') . '<a name="newrule"></a>', $newruleform);
echo $p->display();
// }
}
with
a change of
} elseif (0 && preg_match('/Content-Type: multipart\/mixed;\s+boundary="([^"]+)"/im', $bounce['header'], $regs)) {
//# @TODO, this needs more work, but probably easier to find a class that can
//# split is all into itś parts