#!/usr/bin/php -q <?php // WARNING, any echoed output from this script will be returned to the sender as a bounce message. $_E107['debug'] = true; if (!defined('e107_INIT')) { $_E107['cli'] = true; $_E107['allow_guest'] = true; // allow to run while in members-only mode. $_E107['no_forceuserupdate'] = true; $_E107['no_maintenance'] = true; $class2 = realpath(dirname(__FILE__) . "/../") . "/class2.php"; @(require_once $class2); } $bnc = new e107Bounce(); $bnc->process(); class e107Bounce { private $debug = false; private $source = false; function __construct() { if (ADMIN && vartrue($_GET['eml'])) { $this->debug = 2; // mode2 - via browser for admin. $this->source = $_GET['eml'] . ".eml"; } } function process($source = '') { $pref = e107::getPref(); e107::getCache()->CachePageMD5 = '_';
#!/usr/bin/php -q <?php // WARNING, any echoed output from this script will be returned to the sender as a bounce message. $_E107['debug'] = FALSE; if (!defined('e107_INIT')) { $_E107['cli'] = TRUE; $class2 = realpath(dirname(__FILE__) . "/../") . "/class2.php"; require_once $class2; } $bnc = new e107Bounce(); $process = varset($_GET['eml']) && $_E107['debug'] ? $_GET['eml'] . ".eml" : FALSE; $bnc->process($process); class e107Bounce { function process($source = '') { global $_E107, $pref; e107::getCache()->CachePageMD5 = '_'; e107::getCache()->set('emailLastBounce', time(), TRUE, FALSE, TRUE); $strEmail = !$source ? $this->mailRead(-1) : file_get_contents(e_HANDLER . "eml/" . $source); if (!$strEmail) { return; } $multiArray = Bouncehandler::get_the_facts($strEmail); $head = BounceHandler::parse_head($strEmail); $e107_userid = isset($head['X-e107-id']) ? intval($head['X-e107-id']) : $this->getHeader($strEmail, 'X-e107-id'); if ($_E107['debug']) { require_once e_HANDLER . "mail.php"; $message = "Your Bounce Handler is working. The data of the email you sent is displayed below.<br />"; if ($e107_userid) { $message .= "A user-id was detected in the email you sent: <b>" . $e107_userid . "</b><br />";