$fail = false;
require_once 'Mail.php';
+ $core_domain = DB_DataObject::factory('core_domain');
+ if(!$core_domain->get('domain', $dom)){
+ $core_domain = DB_DataObject::factory('core_domain');
+ $core_domain->setFrom(array(
+ 'domain' => $dom
+ ));
+ $core_domain->insert();
+ }
+
foreach($mxs as $mx) {
if (!isset($ff->Mail['helo'])) {
continue;
}
- $core_domain = DB_DataObject::factory($core_domain);
- if(!$core_domain->get('domain', $dom)){
- $core_domain = DB_DataObject::factory($core_domain);
- $core_domain->setFrom(array(
- 'domain' => $dom
- ));
- $core_domain->insert();
- }
-
- $core_notify = DB_DataObject::factory('core_notify');
+ $core_notify = DB_DataObject::factory($this->table);
$core_notify->domain_id = $core_domain->id;
$core_notify->whereAdd("
sent >= NOW - INTERVAL 1 HOUR
$w->act_when = date("Y-m-d H:i:s", strtotime('+1 HOUR'));
$w->update($old);
$this->errorHandler(date('Y-m-d h:i:s ') . " Too many emails sent by {$dom}");
- return;
}
$mailer->host = $server;
$username = $settings['username'];
$password = $settings['password'];
-
break;
}
$w->sent = date('Y-m-d H:i:s');
$w->msgid = $email['headers']['Message-Id'];
$w->event_id = $ev->id; // sent ok.. - no need to record it..
+ $w->domain_id = $core_domain->id;
$w->update($ww);
// enable cc in notify..
//print_r($res);
$this->addEvent('NOTIFY', $w, 'GREYLISTED - ' . $errmsg);
$w->act_when = date('Y-m-d H:i:s', strtotime('NOW + ' . $retry . ' MINUTES'));
+ $w->domain_id = $core_domain->id;
$w->update($ww);
$w->sent = date('Y-m-d H:i:s');
$w->msgid = '';
$w->event_id = $ev->id;
+ $w->domain_id = $core_domain->id;
$w->update($ww);
$this->errorHandler(date('Y-m-d h:i:s') . ' - FAILED - '. ($fail ? $res->toString() : "RETRY TIME EXCEEDED\n"));
}
$w->sent = date('Y-m-d H:i:s');
$w->msgid = '';
$w->event_id = $ev->id;
+ $w->domain_id = $core_domain->id;
$w->update($ww);
$this->errorHandler(date('Y-m-d h:i:s') . " - FAILED - RETRY TIME EXCEEDED\n");
}
$this->addEvent('NOTIFY', $w, 'NO HOST CAN BE CONTACTED:' . $p->email);
$w->act_when = date('Y-m-d H:i:s', strtotime('NOW + 5 MINUTES'));
+ $w->domain_id = $core_domain->id;
$w->update($ww);
$this->errorHandler(date('Y-m-d h:i:s') ." - NO HOST AVAILABLE\n");