diff --git a/public_html/lists/admin/bouncemgt.php b/public_html/lists/admin/bouncemgt.php index d27dcd7b5..734661f1a 100755 --- a/public_html/lists/admin/bouncemgt.php +++ b/public_html/lists/admin/bouncemgt.php @@ -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'), '', false, s('Reprocess Only Existing Bounces')).$spe; echo '
'; @@ -24,3 +25,4 @@ echo '

'.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.').'

'; } echo '

'.PageLink2('generatebouncerules', s('Generate Bounce Rules')).'

'; + diff --git a/public_html/lists/admin/lib.php b/public_html/lists/admin/lib.php index 8862710ef..587739ff3 100644 --- a/public_html/lists/admin/lib.php +++ b/public_html/lists/admin/lib.php @@ -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'), ); diff --git a/public_html/lists/admin/processbounces.php b/public_html/lists/admin/processbounces.php index 457ac7ec0..39fbdcdfa 100644 --- a/public_html/lists/admin/processbounces.php +++ b/public_html/lists/admin/processbounces.php @@ -505,26 +505,27 @@ function processMessages($link, $max) flushBrowser(); $download_report = ''; -switch ($bounce_protocol) { - case 'pop': - $download_report = processPop($bounce_mailbox_host, $bounce_mailbox_user, $bounce_mailbox_password); - break; - case 'mbox': - $download_report = processMbox($bounce_mailbox); - break; - default: - Error($GLOBALS['I18N']->get('bounce_protocol not supported')); +if (!isset($_GET['justexisting'])) { + switch ($bounce_protocol) { + case 'pop': + $download_report = processPop($bounce_mailbox_host, $bounce_mailbox_user, $bounce_mailbox_password); + break; + case 'mbox': + $download_report = processMbox($bounce_mailbox); + break; + default: + Error($GLOBALS['I18N']->get('bounce_protocol not supported')); - return; -} + return; + } -if ($GLOBALS['commandline'] && $download_report === false) { - cl_output(s('Download failed, exiting')); + if ($GLOBALS['commandline'] && $download_report === false) { + cl_output(s('Download failed, exiting')); - return; -} + return; + } // now we have filled database with all available bounces - +} //# reprocess the unidentified ones, as the bounce detection has improved, so it might catch more cl_output('reprocessing'); @@ -648,6 +649,22 @@ function processMessages($link, $max) } deleteBounce($row['bounce']); break; + case 'decreasecountconfirmuseranddeletebounce': + Sql_Query(sprintf('update %s set bouncecount = bouncecount -1 where id = %d', + $GLOBALS['tables']['user'], $row['user'])); + if (!$confirmed) { + logEvent('User ' . $userdata['email'] . ' confirmed by bounce rule ' . PageLink2('bouncerule&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&id=' . $userdata['id'] . PHP_EOL; + $advanced_report .= 'Rule: ' . $report_linkroot . '/?page=bouncerule&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&id=' . $rule['id'],