Skip to content
Permalink
Browse files

refined email bounce processing; update #44

  • Loading branch information...
following5 committed Jun 4, 2013
1 parent f1be4fd commit 75cad8f07f4f4565781bb9fc85c7ebb0de5b78a4
Showing with 5 additions and 9 deletions.
  1. +2 −5 htdocs/doc/sql/stored-proc/maintain.php
  2. +3 −4 htdocs/util/watchlist/runwatch.php
@@ -522,11 +522,8 @@
INSERT IGNORE INTO `notify_waiting` (`id`, `cache_id`, `user_id`, `type`)
SELECT NULL, nCacheId, `user`.`user_id`, 1 /* notify_new_cache */
FROM `user`
/* After reaching the 5-bounces limit, we try to send new cache notifications
in larger intervals for some more time, and at least on per year.
See also runwatch.php. */
WHERE (`email_problems` = 0 OR NOT `email` LIKE '%@aol.%') AND
(`email_problems` < 5 OR (`last_email_problem`-`first_email_problem` <= 90 AND NOW() > `last_email_problem` + INTERVAL 30 DAY))
/* Throttle email sending after undeliverable mails. See also runwatch.php. */
WHERE (`email_problems` = 0 OR DATEDIFF(NOW(),`last_email_problem`) > 1+DATEDIFF(`last_email_problem`,`first_email_problem`))
AND NOT ISNULL(`user`.`latitude`)
AND NOT ISNULL(`user`.`longitude`)
AND `user`.`notify_radius`>0
@@ -79,12 +79,11 @@
// Benachrichtigung speichern
sql("INSERT IGNORE INTO `watches_notified` (`user_id`, `object_id`, `object_type`, `date_created`) VALUES ('&1', '&2', 1, NOW())", $rcw['user_id'], $rcw['log_id']);
// Watch notifications are discarded if the user had some undeliverable emails.
// Throttle email sending after undeliverable mails. See also runwatch.php.
// See also stored procedure sp_notify_new_cache().
// See http://forum.opencaching-network.org/index.php?topic=3123.0 on AOL.
if (sqlValue("SELECT (`email_problems`=0 OR NOT `email` LIKE '%@aol.%')
AND (`email_problems`<5 OR `last_email_problem`-`first_email_problem` < 10)
FROM `user` WHERE `user_id`='" . sql_escape($rcw['user_id']) . "'", 0))
if (sqlValue("SELECT `email_problems` = 0 OR DATEDIFF(NOW(),`last_email_problem`) > 1+DATEDIFF(`last_email_problem`,`first_email_problem`)
FROM `user` WHERE `user_id`='" . sql_escape($rcw['user_id']) . "'", 1))
process_log_watch($rcw['user_id'], $rcw['log_id']);
sql("DELETE FROM `watches_logqueue` WHERE `log_id`='&1' AND `user_id`='&2'", $rcw['log_id'], $rcw['user_id']);

0 comments on commit 75cad8f

Please sign in to comment.
You can’t perform that action at this time.