- // handle no host availalbe forever...
- if (strtotime($w->act_start) < strtotime('NOW - 3 DAYS')) {
- $ev = $this->addEvent('NOTIFYFAIL', $w, "RETRY TIME EXCEEDED - ". $p->email);
- $w->sent = (!$w->sent || $w->sent == '0000-00-00 00:00:00') ? $w->sqlValue('NOW()') : $w->sent; // do not update if sent.....
- $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");
+ if ($fail) { //// !!!!<<< BLACKLIST DETECT?
+ // fail.. = log and give up..
+ $errmsg= $res->userinfo['smtpcode'] . ': ' .$res->toString();
+ if (isset($res->userinfo['smtptext'])) {
+ $errmsg= $res->userinfo['smtpcode'] . ':' . $res->userinfo['smtptext'];
+ }
+
+ 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);
+ $this->errorHandler( $ev->remarks);
+ }
+ }
+
+ $ev = $this->addEvent('NOTIFYFAIL', $w, ($fail ? "FAILED - " : "RETRY TIME EXCEEDED - ") . $errmsg);
+ $w->flagDone($ev, '');
+
+ $this->errorHandler( $ev->remarks);