function __construct($argv) { parent::__construct('mle'); $this->mail_log = $argv[2]; $this->headers = 'From: procbounce <*****@*****.**>'; $this->pinged = 0; if (is_file('/root/kill_procbounce')) { exit("NOTICE: Exiting per kill_procbounce request at start up ... exiting\n"); } if ($argv[1] != 'cron') { exit("ERROR: Must be run as a cronjob ... exiting\n"); } if (!is_file($this->mail_log)) { exit("ERROR: mail_log:{$this->mail_log} not found ... exiting\n"); } // start_program() is helper function from config.inc if ($is_running = start_program('procbounce.php cron')) { exit("NOTICE: {$is_running}:procbounce.php already operating ... exiting\n"); } $this->GetDynamicVars(); $this->RestartRsyslog(); if (!($this->p = popen('/usr/bin/tail -F ' . $this->mail_log, 'r'))) { exit("ERROR: procbounce.php: Unable to popen() ... exiting\n"); } $this->Query("DELETE FROM bounced WHERE datelogged < DATE_SUB(NOW(), INTERVAL 14 DAY)"); echo "INFO: Started procbounce.php Daemon for a runtime of {$this->D_time_max} seconds ...\n"; }
function __construct($db, $argv, $postfix_queue) { $this->postfix_queue = $postfix_queue; $this->queue_max = 2000; $this->lifecycle = 50; $this->lifecycle_counter = 0; $this->totalmailed = 0; $this->prevmailed = array(); $this->fnames = array('[fname]', '[first-name]', '[first_name]', '[firstname]', '%firstname%', '{firstname}', '{first_name}', '{!firstname}', '(firstname)', '(first_name)', 'first-name', 'first_name', 'firstname', 'fname'); if (is_file('/root/kill_sendqueue')) { exit("not running per kill_sendqueue request ... exiting\n"); } if ($argv[1] != 'cron') { exit("ERROR: Must be run as a cronjob!\n"); } if ($is_running = start_program('sendqueue.php cron')) { exit("{$is_running}:sendqueue.php is already operating ... exiting\n"); } if (date('G') == 0 and date('i') < 5) { exit("It is midnight. Give time for all cronjobs to finish ... exiting\n"); } $this->db = $db; }