mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
Fix for bounce-handler failure.
This commit is contained in:
@@ -212,7 +212,7 @@ $EMAIL_TEMPLATE['notify']['header'] = "<!DOCTYPE html PUBLIC \"-//W3C//
|
|||||||
h2 a { text-decoration: none; margin-bottom:5px }
|
h2 a { text-decoration: none; margin-bottom:5px }
|
||||||
h4 { margin-bottom: 3px }
|
h4 { margin-bottom: 3px }
|
||||||
a { color: #428BCA }
|
a { color: #428BCA }
|
||||||
.datestamp { float: right; padding-top:8px }
|
.datestamp { float: right; padding-top:10px }
|
||||||
.author { font-style: italic ; color: #cccccc}
|
.author { font-style: italic ; color: #cccccc}
|
||||||
.summary { padding:5px 0; }
|
.summary { padding:5px 0; }
|
||||||
.btn {
|
.btn {
|
||||||
@@ -240,7 +240,7 @@ $EMAIL_TEMPLATE['notify']['header'] = "<!DOCTYPE html PUBLIC \"-//W3C//
|
|||||||
}
|
}
|
||||||
|
|
||||||
td { padding:5px; vertical-align: top }
|
td { padding:5px; vertical-align: top }
|
||||||
td.media { width: 200px }
|
td.body { width:80% }
|
||||||
table { width: 100%; margin-top:8px; border-top: 1px solid #cccccc; border-bottom: 1px solid #cccccc;padding:10px }
|
table { width: 100%; margin-top:8px; border-top: 1px solid #cccccc; border-bottom: 1px solid #cccccc;padding:10px }
|
||||||
.unsubscribe { font-size:11px; color:#aaaaaa; margin-top:20px; padding:20px 0; border-top:solid 1px #e5e5e5; }
|
.unsubscribe { font-size:11px; color:#aaaaaa; margin-top:20px; padding:20px 0; border-top:solid 1px #e5e5e5; }
|
||||||
</style>
|
</style>
|
||||||
@@ -249,7 +249,7 @@ $EMAIL_TEMPLATE['notify']['header'] = "<!DOCTYPE html PUBLIC \"-//W3C//
|
|||||||
<body>
|
<body>
|
||||||
<div id='body'>
|
<div id='body'>
|
||||||
";
|
";
|
||||||
$EMAIL_TEMPLATE['notify']['body'] = "<h2>{SITENAME=link} <small class='text-muted datestamp'>{DATE_LONG}</small></h2><table><tr><td class='media'>{MEDIA1}</td><td>{BODY}</td></tr></table>";
|
$EMAIL_TEMPLATE['notify']['body'] = "<h2>{SITENAME=link} <small class='text-muted datestamp'>{DATE_LONG}</small></h2><table><tr><td class='media'>{MEDIA1}</td><td class='body'>{BODY}</td></tr></table>";
|
||||||
$EMAIL_TEMPLATE['notify']['footer'] = "<br /><br />
|
$EMAIL_TEMPLATE['notify']['footer'] = "<br /><br />
|
||||||
|
|
||||||
|
|
||||||
|
@@ -116,7 +116,19 @@ class e107Bounce
|
|||||||
|
|
||||||
if(!empty($message))
|
if(!empty($message))
|
||||||
{
|
{
|
||||||
sendemail($pref['siteadminemail'], SITENAME." :: Bounce-Handler.", $message, $pref['siteadmin'],$pref['siteadminemail'], $pref['siteadmin']);
|
|
||||||
|
$eml = array(
|
||||||
|
'subject' => "Bounce-Handler : ",
|
||||||
|
'sender_email' => $pref['siteadminemail'],
|
||||||
|
'sender_name' => $pref['siteadmin'],
|
||||||
|
// 'replyto' => $email,
|
||||||
|
'html' => true,
|
||||||
|
'template' => 'default',
|
||||||
|
'body' => $message
|
||||||
|
);
|
||||||
|
|
||||||
|
e107::getEmail()->sendEmail($pref['siteadminemail'], SITENAME." :: Bounce-Handler.", $eml);
|
||||||
|
// e107::getEmail()->sendEmail($pref['siteadminemail'], SITENAME." :: Bounce-Handler.", $message, $pref['siteadmin'],$pref['siteadminemail'], $pref['siteadmin']);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -205,25 +217,41 @@ class e107Bounce
|
|||||||
*/
|
*/
|
||||||
function mailRead($iKlimit = 4096)
|
function mailRead($iKlimit = 4096)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sErrorSTDINFail = "Error - failed to read mail from STDIN!";
|
|
||||||
$fp = fopen("php://stdin", "r");
|
$fp = fopen("php://stdin", "r");
|
||||||
|
|
||||||
if (!$fp)
|
if (!$fp)
|
||||||
{
|
{
|
||||||
mail("adminaddress@something.com","Bounce-Processing - Bounce-Processing",$sErrorSTDINFail,$headers);
|
$pref = e107::getPref();
|
||||||
|
|
||||||
|
$eml = array(
|
||||||
|
'subject' => "Bounce-Handler-Error :",
|
||||||
|
'sender_email' => $pref['siteadminemail'],
|
||||||
|
'sender_name' => $pref['siteadmin'],
|
||||||
|
// 'replyto' => $email,
|
||||||
|
'html' => true,
|
||||||
|
'template' => 'default',
|
||||||
|
'body' => "Error - failed to read mail from STDIN! : ".__FILE__." (".__LINE__.")"
|
||||||
|
);
|
||||||
|
|
||||||
|
e107::getEmail()->sendEmail($pref['siteadminemail'], SITENAME." :: Bounce-Handler.", $eml);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create empty string for storing message
|
// Create empty string for storing message
|
||||||
$sEmail = "";
|
$sEmail = "";
|
||||||
|
$i_limit = 0;
|
||||||
|
|
||||||
if ($iKlimit == -1) {
|
if ($iKlimit == -1)
|
||||||
while (!feof($fp)) {
|
{
|
||||||
|
while (!feof($fp))
|
||||||
|
{
|
||||||
$sEmail .= fread($fp, 1024);
|
$sEmail .= fread($fp, 1024);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
while (!feof($fp) && $i_limit < $iKlimit) {
|
else
|
||||||
|
{
|
||||||
|
while (!feof($fp) && $i_limit < $iKlimit)
|
||||||
|
{
|
||||||
$sEmail .= fread($fp, 1024);
|
$sEmail .= fread($fp, 1024);
|
||||||
$i_limit++;
|
$i_limit++;
|
||||||
}
|
}
|
||||||
@@ -439,7 +467,7 @@ class BounceHandler{
|
|||||||
// this is the most commonly used public method
|
// this is the most commonly used public method
|
||||||
// quick and dirty
|
// quick and dirty
|
||||||
// useage: $multiArray = Bouncehandler::get_the_facts($strEmail);
|
// useage: $multiArray = Bouncehandler::get_the_facts($strEmail);
|
||||||
function get_the_facts($eml){
|
static function get_the_facts($eml){
|
||||||
// fluff up the email
|
// fluff up the email
|
||||||
$bounce = BounceHandler::init_bouncehandler($eml);
|
$bounce = BounceHandler::init_bouncehandler($eml);
|
||||||
list($head, $body) = preg_split("/\r\n\r\n/", $bounce, 2);
|
list($head, $body) = preg_split("/\r\n\r\n/", $bounce, 2);
|
||||||
@@ -659,7 +687,7 @@ class BounceHandler{
|
|||||||
&& $head_hash['Content-type']['boundary']!=='';
|
&& $head_hash['Content-type']['boundary']!=='';
|
||||||
}
|
}
|
||||||
|
|
||||||
function parse_head($headers){
|
static function parse_head($headers){
|
||||||
if(!is_array($headers)) $headers = explode("\r\n", $headers);
|
if(!is_array($headers)) $headers = explode("\r\n", $headers);
|
||||||
$hash = BounceHandler::standard_parser($headers);
|
$hash = BounceHandler::standard_parser($headers);
|
||||||
// get a little more complex
|
// get a little more complex
|
||||||
|
Reference in New Issue
Block a user