diff --git a/e107_admin/cron.php b/e107_admin/cron.php
index 41ba77806..4b69cef94 100644
--- a/e107_admin/cron.php
+++ b/e107_admin/cron.php
@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org/).
|
| $Source: /cvs_backup/e107_0.8/e107_admin/cron.php,v $
-| $Revision: 1.23 $
-| $Date: 2009-11-22 14:10:05 $
-| $Author: e107coders $
+| $Revision: 1.24 $
+| $Date: 2009-11-27 21:42:46 $
+| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@@ -49,9 +49,11 @@ class cron
$mes = $mes = e107::getMessage();
$this->cronAction = e_QUERY;
+ // The 'available' flag only gives the option to configure the cron if the underlying feature is enabled
$this->coreCrons['_system_cron'] = array(
0 => array('name' => 'Test Email', 'function' => 'sendEmail', 'description' => 'Send a test email to '.$pref['siteadminemail'].'
Recommended to test the scheduling system.'),
1 => array('name' => 'Mail Queue', 'function' => 'procEmailQueue', 'description' => 'Process mail queue'),
+ 2 => array('name' => 'Mail Bounce Check', 'function' => 'procEmailBounce', 'description' => 'Check for bounced emails', 'available' => vartrue($pref['mail_bounce_auto'])),
// 1 => array('name'=>'User Purge', 'function' => 'userPurge', 'description'=>'Purge Unactivated Users'),
// 2 => array('name'=>'User UnActivated', 'function' => 'userUnactivated', 'description'=>'Resend activation email to unactivated users.'),
// 3 => array('name'=>'News Sticky', 'function' => 'newsPurge', 'description'=>'Remove Sticky News Items')
@@ -314,7 +316,7 @@ function setCronPwd()
{
global $pref;
- $core_cron = $this->coreCrons;
+ $core_cron = $this->coreCrons; // May need to check 'available' flag here
$new_cron = e107::getAddonConfig('e_cron');
$this->e_cron = array_merge($core_cron,$new_cron);
return;
@@ -370,143 +372,146 @@ function setCronPwd()
{
foreach($cfg as $class=>$cron)
{
- $c = $plug.'__'. $cron['function']; // class and function.
- $sep = array();
-
- list($sep['minute'],$sep['hour'],$sep['day'],$sep['month'],$sep['weekday']) = explode(" ",$cronpref[$c]['tab']);
-
- foreach($sep as $key=>$value)
+ if (!isset($cron['available']) || $cron['available']) // Only display cron functions which are available
{
- if($value=="")
+ $c = $plug.'__'. $cron['function']; // class and function.
+ $sep = array();
+
+ list($sep['minute'],$sep['hour'],$sep['day'],$sep['month'],$sep['weekday']) = explode(" ",$cronpref[$c]['tab']);
+
+ foreach($sep as $key=>$value)
{
- $sep[$key] = "*";
+ if($value=="")
+ {
+ $sep[$key] = "*";
+ }
}
+
+ $minute = explode(",",$sep['minute']);
+ $hour = explode(",",$sep['hour']);
+ $day = explode(",",$sep['day']);
+ $month = explode(",",$sep['month']);
+ $weekday = explode(",",$sep['weekday']);
+
+ $min_options = array(
+ "*" => LAN_CRON_11,
+ "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58" => LAN_CRON_12,
+ "0,5,10,15,20,25,30,35,40,45,50,55" => LAN_CRON_13,
+ "0,10,20,30,40,50" => LAN_CRON_14,
+ "0,15,30,45" => LAN_CRON_15
+ );
+
+ $hour_options = array(
+ "*" => LAN_CRON_16,
+ "0,2,4,6,8,10,12,14,16,18,20,22" => LAN_CRON_17,
+ "0,3,6,9,12,15,18,21" => LAN_CRON_18,
+ "0,6,12,18" => LAN_CRON_19
+ );
+
+ $text .= "
+ ".$cron['name']." |
+ ".$cron['description']." |
+
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+ ";
+ $checked = ($cronpref[$c]['active'] == 1) ? "checked='checked'" : "";
+ $text .= "
+ |
+
+ ".$frm->admin_button('execute['.$c.']', 'Run Now')." |
+
";
}
-
- $minute = explode(",",$sep['minute']);
- $hour = explode(",",$sep['hour']);
- $day = explode(",",$sep['day']);
- $month = explode(",",$sep['month']);
- $weekday = explode(",",$sep['weekday']);
-
- $min_options = array(
- "*" => LAN_CRON_11,
- "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58" => LAN_CRON_12,
- "0,5,10,15,20,25,30,35,40,45,50,55" => LAN_CRON_13,
- "0,10,20,30,40,50" => LAN_CRON_14,
- "0,15,30,45" => LAN_CRON_15
- );
-
- $hour_options = array(
- "*" => LAN_CRON_16,
- "0,2,4,6,8,10,12,14,16,18,20,22" => LAN_CRON_17,
- "0,3,6,9,12,15,18,21" => LAN_CRON_18,
- "0,6,12,18" => LAN_CRON_19
- );
-
- $text .= "
- ".$cron['name']." |
- ".$cron['description']." |
-
-
-
- |
-
-
- |
-
-
- |
-
-
- |
-
-
- |
- ";
- $checked = ($cronpref[$c]['active'] == 1) ? "checked='checked'" : "";
- $text .= "
- |
-
- ".$frm->admin_button('execute['.$c.']', 'Run Now')." |
-
";
}
}
$text .= "
diff --git a/e107_admin/mailout.php b/e107_admin/mailout.php
index 5687fe688..860204590 100644
--- a/e107_admin/mailout.php
+++ b/e107_admin/mailout.php
@@ -9,8 +9,8 @@
* Administration - Site Maintenance
*
* $Source: /cvs_backup/e107_0.8/e107_admin/mailout.php,v $
- * $Revision: 1.29 $
- * $Date: 2009-11-24 20:40:34 $
+ * $Revision: 1.30 $
+ * $Date: 2009-11-27 21:42:46 $
* $Author: e107steved $
*
*/
@@ -18,7 +18,7 @@
/*
TODO:
1. Improve maintenance page
- 2. Bounce handling
+ 2. Option to copy completed email to saved email page
*/
/*
@@ -89,8 +89,6 @@ if (!getperms('W'))
$e_sub_cat = 'mail';
-
-require_once(e_ADMIN.'auth.php');
require_once(e_HANDLER.'ren_help.php');
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_users.php');
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_mailout.php');
@@ -101,13 +99,6 @@ require_once(e_HANDLER.'mail_manager_class.php'); // Mail DB API
require_once (e_HANDLER.'message_handler.php');
$emessage = &eMessage :: getInstance();
-
-$action = $e107->tp->toDB(varset($_GET['mode'],'makemail'));
-$pageMode = varset($_GET['savepage'], $action); // Sometimes we need to know what brought us here - $action gets changed
-$mailId = intval(varset($_GET['m'],0));
-$targetId = intval(varset($_GET['t'],0));
-
-
// Create mail admin object, load all mail handlers
$mailAdmin = new mailoutAdminClass($action); // This decodes parts of the query using $_GET syntax
if ($mailAdmin->loadMailHandlers() == 0)
@@ -115,6 +106,16 @@ if ($mailAdmin->loadMailHandlers() == 0)
echo 'No mail handlers loaded!!';
exit;
}
+e107::setRegistry('_mailout_admin', $mailAdmin);
+
+require_once(e_ADMIN.'auth.php');
+
+$action = $e107->tp->toDB(varset($_GET['mode'],'makemail'));
+$pageMode = varset($_GET['savepage'], $action); // Sometimes we need to know what brought us here - $action gets changed
+$mailId = intval(varset($_GET['m'],0));
+$targetId = intval(varset($_GET['t'],0));
+
+
$errors = array();
@@ -418,7 +419,19 @@ switch ($midAction)
}
break;
case 'midMoveToSend' :
- if ($mailAdmin->activateEmail($mailId, FALSE))
+ $notify = isset($_POST['mail_notify_complete']) ? 3 : 2;
+ $first = 0;
+ $last = 0; // Set defaults for earliest and latest send times.
+ // TODO: Save these fields
+ if (isset($_POST['mail_earliest_time']))
+ {
+ $first = e107::getDateConvert()->decodeDateTime($_POST['mail_earliest_time'], 'datetime', 'dmy', FALSE);
+ }
+ if (isset($_POST['mail_latest_time']))
+ {
+ $last = e107::getDateConvert()->decodeDateTime($_POST['mail_earliest_time'], 'datetime', 'dmy', TRUE);
+ }
+ if ($mailAdmin->activateEmail($mailId, FALSE, $notify, $first, $last))
{
$emessage->add(LAN_MAILOUT_185, E_MESSAGE_SUCCESS);
$admin_log->log_event('MAIL_06','ID: '.$mailId,E_LOG_INFORMATIVE,'');
@@ -561,6 +574,7 @@ function saveMailPrefs(&$emessage)
break;
case 'mail' :
$temp['mail_bounce_email'] = $e107->tp->toDB($_POST['mail_bounce_email']);
+ $temp['mail_bounce_auto'] = intval($_POST['mail_bounce_auto']);
break;
}
$temp['mail_bounce_pop3'] = $e107->tp->toDB($_POST['mail_bounce_pop3']);
@@ -838,7 +852,10 @@ function show_prefs($mailAdmin)
";
$check = ($pref['mail_bounce_delete']==1) ? " checked='checked'" : "";
- $text .= "".LAN_MAILOUT_36." | |
+ $text .= "".LAN_MAILOUT_36." | |
";
+
+ $check = ($pref['mail_bounce_auto']==1) ? " checked='checked'" : "";
+ $text .= "".LAN_MAILOUT_245." | ".LAN_MAILOUT_246." |
@@ -975,6 +992,9 @@ function headerjs()
}
";
+ $mailAdmin = e107::getRegistry('_mailout_admin');
+ $text .= $mailAdmin->_cal->load_files();
+
return $text;
}
diff --git a/e107_admin/notify.php b/e107_admin/notify.php
index 53bf8f1e3..df9a020b3 100644
--- a/e107_admin/notify.php
+++ b/e107_admin/notify.php
@@ -9,9 +9,9 @@
*
*
* $Source: /cvs_backup/e107_0.8/e107_admin/notify.php,v $
- * $Revision: 1.11 $
- * $Date: 2009-11-18 01:04:26 $
- * $Author: e107coders $
+ * $Revision: 1.12 $
+ * $Date: 2009-11-27 21:42:46 $
+ * $Author: e107steved $
*/
require_once('../class2.php');
@@ -149,6 +149,18 @@ class notify_config
$text .= "
+ ";
+ $text .= $this->makeAdvancedOptions(TRUE); // Show the table of advanced options
+
$text .= "
+
+
";
$this->e107->ns->tablerender("".ADLAN_136." :: ".LAN_MAILOUT_179."
", $text);
@@ -1224,6 +1203,48 @@ class mailoutAdminClass extends e107MailManager
+ protected function makeAdvancedOptions($initHide = FALSE)
+ {
+ // Separate table for advanced mailout options
+ // mail_notify_complete field
+ $text = "
+
+ ";
+ return $text;
+ }
+
+
+
+ public function makeCalendar($calName, $calVal = '')
+ {
+ $calOptions = array(
+ 'showsTime' => TRUE,
+ 'showOthers' => false,
+ 'weekNumbers' => false,
+ 'ifFormat' => '%d/%m/%Y %H:%I'
+ );
+ $calAttrib = array(
+ 'class' => 'tbox',
+ 'size' => 15, // Number of characters
+ 'name' => $calName,
+ 'value' => (($calVal == '') ? '' : date('d/m/Y H:I',$calVal))
+ );
+ return $this->_cal->make_input_field($calOptions, $calAttrib);
+ }
/**
@@ -1372,6 +1393,8 @@ class mailoutAdminClass extends e107MailManager
$noError = TRUE;
$results = array();
$this->checkDB(2); // Make sure DB object created
+
+ // First thing, delete temporary records from both tables
if (($res = $this->db2->db_Delete('mail_content', '`mail_content_status` = '.MAIL_STATUS_TEMP)) === FALSE)
{
$results[] = 'Error '.$this->db2->mySQLlastErrNum.':'.$this->db2->mySQLlastErrText.' deleting temporary records from mail_content';
@@ -1407,7 +1430,7 @@ class mailoutAdminClass extends e107MailManager
// Scan content table for anomalies, out of time records
if (($res = $this->db2->db_Select_gen("SELECT * FROM `#mail_content`
WHERE (`mail_content_status` >".MAIL_STATUS_FAILED.") AND (`mail_content_status` <=".MAIL_STATUS_MAX_ACTIVE.")
- AND ((`mail_togo_count`=0) OR (`mail_last_date` < ".time()."))")) === FALSE)
+ AND ((`mail_togo_count`=0) OR ( (`mail_last_date` != 0) AND (`mail_last_date` < ".time().")))")) === FALSE)
{
$results[] = 'Error '.$this->db2->mySQLlastErrNum.':'.$this->db2->mySQLlastErrText.' checking bad status in mail_content';
$noError = FALSE;
@@ -1424,6 +1447,10 @@ class mailoutAdminClass extends e107MailManager
{
$results[] = 'Error cancelling email ref: '.$row['mail_source_id'];
}
+ else
+ {
+ $results[] = 'Email cancelled: '.$row['mail_source_id'];
+ }
}
}
if (count($items)) $results[] = str_replace(array('--COUNT--', '--RECORDS--'), array(count($items), implode(', ', $items)), LAN_MAILOUT_228);
@@ -1486,10 +1513,10 @@ class mailoutAdminClass extends e107MailManager
switch ($row['mail_status'])
{
case MAIL_STATUS_SENT : // Mail sent. Email handler happy, but may have bounced (or may be yet to bounce)
- $counters['mail_togo_count'] += $row['mr_count'];
+ $counters['mail_sent_count'] += $row['mr_count'];
break;
case MAIL_STATUS_BOUNCED :
- $counters['mail_togo_count'] += $row['mr_count']; // It was sent, so increment that counter
+ $counters['mail_sent_count'] += $row['mr_count']; // It was sent, so increment that counter
$counters['mail_bounce_count'] += $row['mr_count']; //...but bounced, so extra status
break;
case MAIL_STATUS_CANCELLED : // Cancelled email - treat as a failure
@@ -1506,7 +1533,7 @@ class mailoutAdminClass extends e107MailManager
}
}
}
- if ($changeCount) $results[] = str_replace('--COUNT--', $changeCount, LAN_MAILOUT_229);
+ if ($changeCount) $results[] = str_replace('--COUNT--', $changeCount, LAN_MAILOUT_237);
}
$this->e107->admin_log->log_event('MAIL_05', implode('[!br!]', $results), E_LOG_INFORMATIVE, '');
diff --git a/e107_handlers/notify_class.php b/e107_handlers/notify_class.php
index cf5d5505a..23e6bf971 100644
--- a/e107_handlers/notify_class.php
+++ b/e107_handlers/notify_class.php
@@ -9,8 +9,8 @@
* Forum plugin notify configuration
*
* $Source: /cvs_backup/e107_0.8/e107_handlers/notify_class.php,v $
-* $Revision: 1.9 $
-* $Date: 2009-11-19 20:24:21 $
+* $Revision: 1.10 $
+* $Date: 2009-11-27 21:42:46 $
* $Author: e107steved $
*
*/
@@ -112,6 +112,7 @@ class notify
'mail_sender_email' => $pref['siteadminemail'],
'mail_sender_name' => $pref['siteadmin'],
'mail_send_style' => 'textonly',
+ 'mail_notify_complete' => 0, // NEVER notify when this email sent!!!!!
'mail_body' => $message
);
$result = $mailer->saveEmail($mailData, TRUE);
@@ -255,6 +256,13 @@ function notify_newsdel($data)
}
+function notify_maildone($data)
+{
+ $message = ''.$data['mail_subject'].'
'.$data['mail_body'];
+ e107::getNotify()->send('maildone', NT_LAN_ML_1.': '.$data['mail_subject'], $message);
+}
+
+
function notify_fileupload($data)
{
global $nt;
@@ -262,6 +270,7 @@ function notify_fileupload($data)
$nt->send('fileupload', $data['upload_name'], $message);
}
+
if (isset($nt->notify_prefs['plugins']))
{
foreach ($nt->notify_prefs['plugins'] as $plugin_id => $plugin_settings)
diff --git a/e107_handlers/pop3_class.php b/e107_handlers/pop3_class.php
index f61b3c553..3c9d531d5 100644
--- a/e107_handlers/pop3_class.php
+++ b/e107_handlers/pop3_class.php
@@ -1,9 +1,9 @@
marubox=imap_open($this->server,$this->username,$this->password);
}
+
function getHeaders($mid) // Get Header info
{
$mail_header=imap_header($this->marubox,$mid);
@@ -69,6 +70,8 @@ class receiveMail
return $mail_details;
}
+
+
function get_mime_type(&$structure) //Get Mime type Internal Private Use
{
$primary_mime_type = array("TEXT", "MULTIPART", "MESSAGE", "APPLICATION", "AUDIO", "IMAGE", "VIDEO", "OTHER");
@@ -78,6 +81,8 @@ class receiveMail
}
return "TEXT/PLAIN";
}
+
+
function get_part($stream, $msg_number, $mime_type, $structure = false, $part_number = false) //Get Part Of Message Internal Private Use
{
if(!$structure) {
@@ -122,11 +127,15 @@ class receiveMail
}
return false;
}
+
+
function getTotalMails() //Get Total Number off Unread Email In Mailbox
{
$headers=imap_headers($this->marubox);
return count($headers);
}
+
+
function GetAttach($mid,$path) // Get Atteced File from Mail
{
$struckture = imap_fetchstructure($this->marubox,$mid);
@@ -159,6 +168,8 @@ class receiveMail
$ar=substr($ar,0,(strlen($ar)-1));
return $ar;
}
+
+
function getBody($mid,$mode="") // Get Message Body
{
if($mode != "plain")
@@ -172,10 +183,14 @@ class receiveMail
}
return $body;
}
+
+
function deleteMails($mid) // Delete That Mail
{
imap_delete($this->marubox,$mid);
}
+
+
function close_mailbox() //Close Mail Box
{
imap_close($this->marubox,CL_EXPUNGE);
diff --git a/e107_handlers/pop_bounce_handler.php b/e107_handlers/pop_bounce_handler.php
new file mode 100644
index 000000000..07d457bb1
--- /dev/null
+++ b/e107_handlers/pop_bounce_handler.php
@@ -0,0 +1,263 @@
+e107 = e107::getInstance();
+ if (($override === FALSE) || !is_array($override))
+ { // Set up from prefs
+ $override['mail_bounce_user'] = $pref['mail_bounce_user'];
+ $override['mail_bounce_pass'] = $pref['mail_bounce_pass'];
+ $override['mail_bounce_email'] = $pref['mail_bounce_email'];
+ $override['mail_bounce_pop3'] = $pref['mail_bounce_pop3'];
+ $override['mail_bounce_type'] = varset($pref['mail_bounce_type'],'pop3');
+ }
+
+ if($override['mail_bounce_type']=='imap')
+ {
+ $port = varset($override['mail_bounce_port'], '143');
+ $strConnect='{'.$override['mail_bounce_pop3'].':'.$port. '}INBOX';
+ }
+ else
+ {
+ $port = varset($override['mail_bounce_port'], '110'); // POP3 port
+ $servertype = '/'.varset($override['mail_bounce_type'], 'pop3');
+ $strConnect='{'.$override['mail_bounce_pop3'].':'.$port. $servertype.'}INBOX';
+ }
+ $this->server = $strConnect;
+ $this->username = $override['mail_bounce_user'];
+ $this->password = $override['mail_bounce_pass'];
+ $this->email = $override['mail_bounce_email'];
+
+ $this->delBounce = ($pref['mail_bounce_delete']) ? true : false;
+ }
+
+
+ function connect() //Connect To the Mail Box
+ {
+ $this->mailResource=imap_open($this->server,$this->username,$this->password);
+ }
+
+
+
+ function getTotalMails() //Get Total Number off Unread Email In Mailbox
+ {
+ $headers=imap_headers($this->mailResource);
+ return count($headers);
+ }
+
+
+
+ function getHeaders($mid) // Get Header info
+ {
+ $mail_header=imap_header($this->mailResource,$mid);
+ $sender=$mail_header->from[0];
+ $sender_replyto=$mail_header->reply_to[0];
+ $stat = (strtolower($sender->mailbox)!='mailer-daemon' && strtolower($sender->mailbox)!='postmaster') ? FALSE : TRUE;
+ if(strpos($mail_header->subject,"delayed"))
+ {
+ $stat = FALSE;
+ }
+ $mail_details=array(
+ 'from'=>strtolower($sender->mailbox).'@'.$sender->host,
+ 'fromName'=>$sender->personal,
+ 'toOth'=>strtolower($sender_replyto->mailbox).'@'.$sender_replyto->host,
+ 'toNameOth'=>$sender_replyto->personal,
+ 'subject'=>$mail_header->subject,
+ 'to'=>strtolower($mail_header->toaddress),
+ 'bounce'=>$stat,
+ 'date'=>$mail_header->date
+ );
+ return $mail_details;
+ }
+
+
+ protected function get_mime_type(&$structure) //Get Mime type Internal Private Use
+ {
+ $primary_mime_type = array("TEXT", "MULTIPART", "MESSAGE", "APPLICATION", "AUDIO", "IMAGE", "VIDEO", "OTHER");
+
+ if($structure->subtype)
+ {
+ return $primary_mime_type[(int) $structure->type] . '/' . $structure->subtype;
+ }
+ return "TEXT/PLAIN";
+ }
+
+
+ protected function get_part($stream, $msg_number, $mime_type, $structure = false, $part_number = false) //Get Part Of Message Internal Private Use
+ {
+ if(!$structure)
+ {
+ $structure = imap_fetchstructure($stream, $msg_number);
+ }
+ if($structure)
+ {
+ if($mime_type == $this->get_mime_type($structure))
+ {
+ if(!$part_number)
+ {
+ $part_number = '1';
+ }
+ $text = imap_fetchbody($stream, $msg_number, $part_number);
+ if($structure->encoding == 3)
+ {
+ return imap_base64($text);
+ }
+ else if($structure->encoding == 4)
+ {
+ return imap_qprint($text);
+ }
+ else
+ {
+ return $text;
+ }
+ }
+ if($structure->type == 1) /* multipart */
+ {
+ while(list($index, $sub_structure) = each($structure->parts))
+ {
+ if($part_number)
+ {
+ $prefix = $part_number . '.';
+ }
+ $data = $this->get_part($stream, $msg_number, $mime_type, $sub_structure, $prefix . ($index + 1));
+ if($data)
+ {
+ return $data;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+
+ function getBody($mid,$mode='') // Get Message Body
+ {
+ if($mode != 'plain')
+ {
+ $body = $this->get_part($this->mailResource, $mid, 'TEXT/HTML');
+ }
+ if (($body == '') || $mode == 'plain')
+ {
+ $body = $this->get_part($this->mailResource, $mid, 'TEXT/PLAIN');
+ }
+ if ($body == '')
+ {
+ return '';
+ }
+ return $body;
+ }
+
+
+ function deleteMails($mid) // Delete That Mail
+ {
+ imap_delete($this->mailResource,$mid);
+ }
+
+
+ function close_mailbox() //Close Mail Box
+ {
+ imap_close($this->mailResource,CL_EXPUNGE);
+ }
+
+
+
+ /**
+ * Loop reading all emails from the bounces mailbox. If an email address and/or e107 header are
+ * identified, process the bounce.
+ * Delete all emails after processing, if $pref flag is set.
+ *
+ * @return void
+ */
+ public function processBounces()
+ {
+ $this->connect();
+ $tot = $this->getTotalMails(); // Get all the emails
+ for ($i = 1; $i <= $tot; $i++)
+ {
+ $head = $this->getHeaders($i); // Get the headers
+ if ($head['bounce'])
+ {
+ //print_a($head);
+ $body = $this->getBody($i);
+ $e107Header = '';
+ if (preg_match('#.*X-e107-id:(.*?)[\n\r]#',$body, $result))
+ {
+ $e107Header = varset($result[1],'');
+ }
+ $emailAddress = '';
+ if (preg_match("/[\._a-zA-Z0-9-]+@[\._a-zA-Z0-9-]+/i",$body,$result))
+ {
+ $emailAddress = varset($result[0],'');
+ if ($emailAddress == $this->email)
+ {
+ $emailAddress = ''; // Email address found is that of the bounce email account
+ }
+ }
+ // Call the bounce handler here
+ if ($this->mailManager === FALSE)
+ {
+ require_once(e_HANDLER.'mail_manager_class.php');
+ $this->mailManager = new e107MailManager();
+ }
+ echo "Email: {$emailAddress}
Header: {$e107Header}
";
+ $this->mailManager->markBounce($e107Header, $emailAddress);
+ }
+ // Now delete the email, if option set (do it regardless of whether a bounce email)
+ if ($this->delBounce)
+ {
+ $this->deleteMails($i); // Not actually deleted until we close the mailbox
+ }
+ }
+ $this->close_mailbox();
+ }
+}
+
+
+?>
diff --git a/e107_languages/English/admin/lan_mailout.php b/e107_languages/English/admin/lan_mailout.php
index e4530accb..fd125dd1b 100644
--- a/e107_languages/English/admin/lan_mailout.php
+++ b/e107_languages/English/admin/lan_mailout.php
@@ -9,8 +9,8 @@
* Administration - Site Maintenance
*
* $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_mailout.php,v $
- * $Revision: 1.12 $
- * $Date: 2009-11-24 20:40:35 $
+ * $Revision: 1.13 $
+ * $Date: 2009-11-27 21:42:46 $
* $Author: e107steved $
*
*/
@@ -244,7 +244,7 @@ define('LAN_MAILOUT_222', 'Default email format');
define('LAN_MAILOUT_223', '(Used for some non-bulk emails)');
define('LAN_MAILOUT_224', 'Inc. Images');
define('LAN_MAILOUT_225', 'Include images in email');
-define('LAN_MAILOUT_226', '--COUNT-- orphaned recipient records removed');
+define('LAN_MAILOUT_226', '--COUNT-- orphaned recipient record(s) removed');
define('LAN_MAILOUT_227', 'Deleted --COUNT-- records from --TABLE--');
define('LAN_MAILOUT_228', '--COUNT-- anomalies in mail_content corrected; records: --RECORDS--');
define('LAN_MAILOUT_229', 'Email ID --ID-- put on hold');
@@ -255,10 +255,24 @@ define('LAN_MAILOUT_233', 'Auto-process script');
define('LAN_MAILOUT_234', 'Mail account');
define('LAN_MAILOUT_235', '(Your server has to be configured to use this script)');
define('LAN_MAILOUT_236', 'Last Bounce Processed');
-define('LAN_MAILOUT_237', '');
-define('LAN_MAILOUT_238', '');
-define('LAN_MAILOUT_239', '');
-define('LAN_MAILOUT_240', '');
+define('LAN_MAILOUT_237', 'Summary counters updated on --COUNT-- emails');
+define('LAN_MAILOUT_238', 'Earliest time to send');
+define('LAN_MAILOUT_239', 'Latest time to send');
+define('LAN_MAILOUT_240', 'Notify me when run complete');
+define('LAN_MAILOUT_241', ' (This is in addition to the standard e107 notify options)');
+define('LAN_MAILOUT_242', 'Additional options (only when sending)');
+define('LAN_MAILOUT_243', 'Notify');
+define('LAN_MAILOUT_244', 'Email sent: ');
+define('LAN_MAILOUT_245', 'Check for bounces automatically');
+define('LAN_MAILOUT_246', 'If checked, you will need to activate the task in the scheduler');
+define('LAN_MAILOUT_247', 'Email information:');
+define('LAN_MAILOUT_248', 'Completion status: ');
+define('LAN_MAILOUT_249', 'Send results:');
+define('LAN_MAILOUT_250', '--- End of notification ---');
+define('LAN_MAILOUT_251', '');
+define('LAN_MAILOUT_252', '');
+define('LAN_MAILOUT_253', '');
+define('LAN_MAILOUT_254', '');
define('LAN_SEND', 'Send');
diff --git a/e107_languages/English/admin/lan_notify.php b/e107_languages/English/admin/lan_notify.php
index 532b8104c..729083121 100644
--- a/e107_languages/English/admin/lan_notify.php
+++ b/e107_languages/English/admin/lan_notify.php
@@ -4,9 +4,9 @@
| e107 website system - Language File.
|
| $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_notify.php,v $
-| $Revision: 1.1.1.1 $
-| $Date: 2006-12-02 04:34:41 $
-| $Author: mcfly_e107 $
+| $Revision: 1.2 $
+| $Date: 2009-11-27 21:42:46 $
+| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@@ -32,6 +32,9 @@ define("NN_LAN_3", "News item posted by admin");
define("NN_LAN_4", "News item edited by admin");
define("NN_LAN_5", "News item deleted by admin");
+define('NM_LAN_1', 'Mail Events');
+define('NM_LAN_2', 'Bulk email run complete');
+
define("NF_LAN_1", "File Events");
define("NF_LAN_2", "File uploaded by user");
diff --git a/e107_languages/English/lan_notify.php b/e107_languages/English/lan_notify.php
index 0d1d412bd..c5d0835c9 100644
--- a/e107_languages/English/lan_notify.php
+++ b/e107_languages/English/lan_notify.php
@@ -4,9 +4,9 @@
| e107 website system - Language File.
|
| $Source: /cvs_backup/e107_0.8/e107_languages/English/lan_notify.php,v $
-| $Revision: 1.1.1.1 $
-| $Date: 2006-12-02 04:34:39 $
-| $Author: mcfly_e107 $
+| $Revision: 1.2 $
+| $Date: 2009-11-27 21:42:46 $
+| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@@ -28,6 +28,8 @@ define("NT_LAN_FL_2", "IP address banned for flooding");
define("NT_LAN_SN_1", "News Item Submitted");
+define('NT_LAN_ML_1', 'Bulk email send complete');
+
define("NT_LAN_NU_1", "Updated");
define("NT_LAN_ND_1", "News Item Deleted");