Skip to content
Snippets Groups Projects
Commit 553c81e5 authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #1914 from greezybacon/issue/bounce-no-body


email: Some bounce notices actually have rich content

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents 237e0077 282675dd
No related branches found
No related tags found
No related merge requests found
...@@ -297,7 +297,12 @@ class ApiController { ...@@ -297,7 +297,12 @@ class ApiController {
$msg.="\n*[".$_SERVER['HTTP_X_API_KEY']."]*\n"; $msg.="\n*[".$_SERVER['HTTP_X_API_KEY']."]*\n";
$ost->logWarning(__('API Error')." ($code)", $msg, false); $ost->logWarning(__('API Error')." ($code)", $msg, false);
$this->response($code, $error); //Responder should exit... if (PHP_SAPI == 'cli') {
fwrite(STDERR, "({$code}) $error\n");
}
else {
$this->response($code, $error); //Responder should exit...
}
return false; return false;
} }
......
...@@ -642,7 +642,7 @@ class MailFetcher { ...@@ -642,7 +642,7 @@ class MailFetcher {
$vars['in-reply-to'] = @$headers['in-reply-to'] ?: null; $vars['in-reply-to'] = @$headers['in-reply-to'] ?: null;
} }
// Fetch deliver status report // Fetch deliver status report
$vars['message'] = $this->getDeliveryStatusMessage($mid); $data['message'] = $this->getDeliveryStatusMessage($mid) ?: $this->getBody($mid);
$vars['thread-type'] = 'N'; $vars['thread-type'] = 'N';
$vars['flags']['bounce'] = true; $vars['flags']['bounce'] = true;
} }
......
...@@ -275,10 +275,9 @@ class Mail_Parse { ...@@ -275,10 +275,9 @@ class Mail_Parse {
&& isset($this->struct->ctype_parameters['report-type']) && isset($this->struct->ctype_parameters['report-type'])
&& $this->struct->ctype_parameters['report-type'] == 'delivery-status' && $this->struct->ctype_parameters['report-type'] == 'delivery-status'
) { ) {
return sprintf('<pre>%s</pre>', return new TextThreadBody(
Format::htmlchars( $this->getPart($this->struct, 'text/plain', 1)
$this->getPart($this->struct, 'text/plain', 1) );
));
} }
return false; return false;
} }
...@@ -657,7 +656,7 @@ class EmailDataParser { ...@@ -657,7 +656,7 @@ class EmailDataParser {
$data['in-reply-to'] = @$headers['in-reply-to'] ?: null; $data['in-reply-to'] = @$headers['in-reply-to'] ?: null;
} }
// Fetch deliver status report // Fetch deliver status report
$data['message'] = $parser->getDeliveryStatusMessage(); $data['message'] = $parser->getDeliveryStatusMessage() ?: $parser->getBody();
$data['thread-type'] = 'N'; $data['thread-type'] = 'N';
$data['flags']['bounce'] = true; $data['flags']['bounce'] = true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment