projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4ec3787
)
set server to 0 if no servers available
author
Alan
<alan@roojs.com>
Thu, 2 Nov 2023 08:31:01 +0000
(16:31 +0800)
committer
Alan
<alan@roojs.com>
Thu, 2 Nov 2023 08:31:01 +0000
(16:31 +0800)
DataObjects/Core_notify_server.php
patch
|
blob
|
history
NotifySend.php
patch
|
blob
|
history
diff --git
a/DataObjects/Core_notify_server.php
b/DataObjects/Core_notify_server.php
index
da6b946
..
33b73d1
100644
(file)
--- a/
DataObjects/Core_notify_server.php
+++ b/
DataObjects/Core_notify_server.php
@@
-84,6
+84,11
@@
class Pman_Core_DataObjects_Core_notify_server extends DB_DataObject
}
$ns = DB_DataObject::factory('core_notify_server');
}
$ns = DB_DataObject::factory('core_notify_server');
+ if (!$ns->count()) {
+ $ns->id = 0;
+ return $ns;
+ }
+
$ns->poolname = $notify->poolname;
$ns->is_active = 1;
$ns->poolname = $notify->poolname;
$ns->is_active = 1;
@@
-111,6
+116,10
@@
class Pman_Core_DataObjects_Core_notify_server extends DB_DataObject
function isFirstServer()
{
function isFirstServer()
{
+ if (!$this->id) {
+ return true;
+ }
+
$servers = $this->availableServers();
if (empty($servers)) {
return false;
$servers = $this->availableServers();
if (empty($servers)) {
return false;
@@
-123,7
+132,9
@@
class Pman_Core_DataObjects_Core_notify_server extends DB_DataObject
// called on current server.
function assignQueues($notify)
{
// called on current server.
function assignQueues($notify)
{
-
+ if (!$this->id) {
+ return true;
+ }
$servers = $this->availableServers();
$ids = array();
$servers = $this->availableServers();
$ids = array();
@@
-265,6
+276,10
@@
class Pman_Core_DataObjects_Core_notify_server extends DB_DataObject
function updateNotifyToNextServer( $cn , $when = false, $allow_same = false)
{
function updateNotifyToNextServer( $cn , $when = false, $allow_same = false)
{
+ if (!$this->id) {
+ return;
+ }
+
// fixme - this should take into account blacklisted - and return false if no more servers are available
$email = empty($cn->to_email) ? ($cn->person() ? $cn->person()->email : $cn->to_email) : $cn->to_email;
// fixme - this should take into account blacklisted - and return false if no more servers are available
$email = empty($cn->to_email) ? ($cn->person() ? $cn->person()->email : $cn->to_email) : $cn->to_email;
@@
-310,6
+325,10
@@
class Pman_Core_DataObjects_Core_notify_server extends DB_DataObject
function isBlacklisted($email)
{
function isBlacklisted($email)
{
+ if (!$this->id) {
+ return false;
+ }
+
// return current server id..
static $cache = array();
// get the domain..
// return current server id..
static $cache = array();
// get the domain..
@@
-333,12
+352,18
@@
class Pman_Core_DataObjects_Core_notify_server extends DB_DataObject
}
function initHelo()
{
}
function initHelo()
{
+ if (!$this->id) {
+ return;
+ }
$ff = HTML_FlexyFramework::get();
$ff->Mail['helo'] = $this->helo;
}
function checkSmtpResponse($errmsg, $core_domain)
{
$ff = HTML_FlexyFramework::get();
$ff->Mail['helo'] = $this->helo;
}
function checkSmtpResponse($errmsg, $core_domain)
{
+ if (!$this->id) {
+ return false;
+ }
$bl = DB_DataObject::factory('core_notify_blacklist');
$bl->server_id = $this->id;
$bl->domain_id = $core_domain->id;
$bl = DB_DataObject::factory('core_notify_blacklist');
$bl->server_id = $this->id;
$bl->domain_id = $core_domain->id;
diff --git
a/NotifySend.php
b/NotifySend.php
index
0621f3d
..
0ba7692
100644
(file)
--- a/
NotifySend.php
+++ b/
NotifySend.php
@@
-242,7
+242,7
@@
class Pman_Core_NotifySend extends Pman
if (isset($email['later'])) {
if (isset($email['later'])) {
-
+
$this->server->updateNotifyToNextServer($w, $email['later'],true);
$this->errorHandler("Delivery postponed by email creator to {$email['later']}");
$this->server->updateNotifyToNextServer($w, $email['later'],true);
$this->errorHandler("Delivery postponed by email creator to {$email['later']}");