var $evtype = ''; // any notification...
// this script should only handle EMAIL notifications..
-
+
+ var $server_id;
+
+
var $opts;
var $force = false;
function getAuth()
var $queue = array();
var $domain_queue = array(); // false to use nextquee
var $next_queue = array();
- var $server_id;
+
function get($r,$opts=array())
{
$w->autoJoin();
$total = $w->find();
+ if (empty($total)) {
+ $this->logecho("Nothing In Queue - DONE");
+ exit;
+ }
if (!empty($opts['list'])) {
function isBlacklisted($email)
{
// return current server id..
+ $ff = HTML_FlexyFramework::get();
+ //$this->logecho("CHECK BLACKLISTED - {$email}");
if (empty($ff->Core_Notify['servers'])) {
return false;
}
// get the domain..
$ea = explode('@',$email);
$dom = strtolower(array_pop($ea));
+
+ //$this->logecho("CHECK BLACKLISTED DOM - {$dom}");
if (!in_array($dom, $ff->Core_Notify['servers'][gethostname()]['blacklisted'] )) {
return false;
}
+ //$this->logecho("RETURN BLACKLISTED TRUE");
return array_search(gethostname(),array_keys($ff->Core_Notify['servers']));
}
// this sequentially distributes requeued emails.. - to other servers. (can exclude current one if we have that flagged.)
- function updateServer($w, $exclude = -1)
+ function updateServer($ww, $exclude = -1)
{
+ $w = DB_DataObject::factory($ww->tableName());
+ $w->get($ww->id);
+
$ff = HTML_FlexyFramework::get();
static $num = 0;
if (empty($ff->Core_Notify['servers'])) {
$pp = clone($w);
$w->server_id = $num;
- $w->act_when = $w->sqlValue('NOW + INTERVAL 1 MINUTE');
+ $w->act_when = $w->sqlValue('NOW() + INTERVAL 1 MINUTE');
$w->update($pp);
return;
}
+ if (isset($ff->Core_Notify['servers-non-pool'][gethostname()])) {
+ return;
+ }
+
if (!isset($ff->Core_Notify['servers'][gethostname()])) {
+
$this->jerr("Core_Notify['servers']['" . gethostname() ."'] is not set");
}
// only run this on the main server...
{
echo date("Y-m-d H:i:s - ") . $str . "\n";
}
-}
\ No newline at end of file
+}