+ function popQueueDomain($email)
+ {
+ $ea = explode('@',$email);
+ $dom = strtolower(array_pop($ea));
+ if (empty($this->domain_queue[$dom])) {
+ return;
+ }
+ array_unshift($this->queue, array_shift($this->domain_queue[$dom]));
+
+ }
+
+ function pushQueueDomain($e, $email)
+ {
+ if ($this->domain_queue === false) {
+ $this->next_queue[] = $e;
+ return;
+ }
+
+ $ea = explode('@',$email);
+ $dom = strtolower(array_pop($ea));
+ if (!isset($this->domain_queue[$dom])) {
+ $this->domain_queue[$dom] = array();
+ }
+ $this->domain_queue[$dom][] = $e;
+ }
+ function remainingDomainQueue()
+ {
+ $ret = array();
+ foreach($this->domain_queue as $dom => $ar) {
+ $ret = array_merge($ret, $ar);
+ }
+ $this->domain_queue = false;
+ return $ret;
+ }
+ function clearOld()
+ {
+ if ($this->server->isFirstServer()) {
+
+ $p = DB_DataObject::factory($this->table);
+ $p->whereAdd("
+ sent < '2000-01-01'
+ and
+ event_id = 0
+ and
+ act_start < NOW() - INTERVAL {$this->clear_interval}
+ ");
+ // $p->limit(1000);
+ if ($p->count()) {
+ $ev = $this->addEvent('NOTIFY', false, "RETRY TIME EXCEEDED");
+ $p = DB_DataObject::factory($this->table);
+ $p->query("
+ UPDATE
+ {$this->table}
+ SET
+ sent = NOW(),
+ msgid = '',
+ event_id = {$ev->id}
+ WHERE
+ sent < '2000-01-01'
+ and
+ event_id = 0
+ and
+ act_start < NOW() - INTERVAL {$this->clear_interval}
+ LIMIT
+ 1000
+ ");
+
+ }
+ }
+ }
+