Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bouncemgt - allowing processing only existing bounces + a related new rule action #1028

Merged
merged 7 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions public_html/lists/admin/bouncemgt.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
echo $spb.PageLink2('checkbouncerules', s('Check Current Bounce Rules')).$spe;

echo $spb.PageLink2('processbounces', s('Process Bounces')).$spe;
echo $spb.PageLink2('processbounces&justexisting=true', s('Reprocess Only Existing Bounces'), title: s('Reprocess Only Existing Bounces')).$spe;
lwcorp marked this conversation as resolved.
Show resolved Hide resolved

echo '</ul><br />';

Expand All @@ -24,3 +25,4 @@
echo '<p class="information text-warning"><big>'.s('You have already defined bounce rules in your system. Be careful with generating new ones, because these may interfere with the ones that exist.').'</big></p>';
}
echo '<br /><p class="button">'.PageLink2('generatebouncerules', s('Generate Bounce Rules')).'</p>';

1 change: 1 addition & 0 deletions public_html/lists/admin/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
'unconfirmuseranddeletebounce' => $GLOBALS['I18N']->get('unconfirm subscriber and delete bounce'),
'blacklistuseranddeletebounce' => $GLOBALS['I18N']->get('blacklist subscriber and delete bounce'),
'blacklistemailanddeletebounce' => $GLOBALS['I18N']->get('blacklist email address and delete bounce'),
'decreasecountconfirmuseranddeletebounce' => $GLOBALS['I18N']->get('decrease count and confirm subscriber and delete bounce'),
'deletebounce' => $GLOBALS['I18N']->get('delete bounce'),
);

Expand Down
20 changes: 19 additions & 1 deletion public_html/lists/admin/processbounces.php
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,8 @@ function processMessages($link, $max)
flushBrowser();

$download_report = '';
if (isset($_GET['justexisting']))
lwcorp marked this conversation as resolved.
Show resolved Hide resolved
goto aftermailbox;
switch ($bounce_protocol) {
case 'pop':
$download_report = processPop($bounce_mailbox_host, $bounce_mailbox_user, $bounce_mailbox_password);
Expand All @@ -524,7 +526,7 @@ function processMessages($link, $max)
return;
}
// now we have filled database with all available bounces

aftermailbox:
//# reprocess the unidentified ones, as the bounce detection has improved, so it might catch more

cl_output('reprocessing');
Expand Down Expand Up @@ -648,6 +650,22 @@ function processMessages($link, $max)
}
deleteBounce($row['bounce']);
break;
case 'decreasecountconfirmuseranddeletebounce':
Sql_Query(sprintf('update %s set bouncecount = bouncecount + %d where id = %d',
$GLOBALS['tables']['user'], '-1', $row['user']));
lwcorp marked this conversation as resolved.
Show resolved Hide resolved
if (!$confirmed) {
logEvent('User ' . $userdata['email'] . ' confirmed by bounce rule ' . PageLink2('bouncerule&amp;id=' . $rule['id'],
$rule['id']));
Sql_Query(sprintf('update %s set confirmed = 1 where id = %d', $GLOBALS['tables']['user'],
$row['user']));
$advanced_report .= 'User ' . $userdata['email'] . ' made confirmed by bounce rule ' . $rule['id'] . PHP_EOL;
$advanced_report .= 'User: ' . $report_linkroot . '/?page=user&amp;id=' . $userdata['id'] . PHP_EOL;
$advanced_report .= 'Rule: ' . $report_linkroot . '/?page=bouncerule&amp;id=' . $rule['id'] . PHP_EOL;
addUserHistory($userdata['email'], s('Auto confirmed'),
s('Subscriber auto confirmed for') . ' ' . $GLOBALS['I18N']->get('bounce rule') . ' ' . $rule['id']);
}
deleteBounce($row['bounce']);
break;
case 'blacklistuser':
if (!$blacklisted) {
logEvent('User ' . $userdata['email'] . ' blacklisted by bounce rule ' . PageLink2('bouncerule&amp;id=' . $rule['id'],
Expand Down
Loading