From: Alan Date: Thu, 2 Nov 2023 07:59:54 +0000 (+0800) Subject: sync X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=ca5ff80559686911f20afd1f4624baa4be0bfffb sync --- diff --git a/DataObjects/Core_notify_sender_blacklist.php b/DataObjects/Core_notify_sender_blacklist.php new file mode 100644 index 00000000..9c27a566 --- /dev/null +++ b/DataObjects/Core_notify_sender_blacklist.php @@ -0,0 +1,41 @@ +query(" + DELETE FROM {$this->tableName()} where added_dt < NOW() - INTERVAL 1 WEEK + "); + + } + +} \ No newline at end of file diff --git a/NotifySend.php b/NotifySend.php index e9c37a0f..0621f3da 100644 --- a/NotifySend.php +++ b/NotifySend.php @@ -367,7 +367,8 @@ class Pman_Core_NotifySend extends Pman $this->errorHandler("config Mail[helo] is not set"); } - + $email = DB_DataObject::factory('core_notify_sender')->filterEmail($email, $w); + foreach($mxs as $mx) { @@ -443,6 +444,8 @@ class Pman_Core_NotifySend extends Pman } + + $res = $mailer->send($p->email, $email['headers'], $email['body']); if (is_object($res)) { @@ -535,7 +538,11 @@ class Pman_Core_NotifySend extends Pman $errmsg= $res->userinfo['smtpcode'] . ':' . $res->userinfo['smtptext']; } - if ($res->userinfo['smtpcode'] == 550) { + if ( $res->userinfo['smtpcode']> 500 ) { + + DB_DataObject::factory('core_notify_sender')->checkSmtpResponse($email, $w, $errmsg); + + if ($this->server->checkSmtpResponse($errmsg, $core_domain)) { $ev = $this->addEvent('NOTIFY', $w, 'BLACKLISTED - ' . $errmsg); $this->server->updateNotifyToNextServer($w, $retry_when,true);