Skip to content
Snippets Groups Projects
Unverified Commit f16830d1 authored by Peter Rotich's avatar Peter Rotich Committed by GitHub
Browse files

Merge pull request #4894 from aydreeihn/issue/incorrect-reply-to

Reformat Incorrect Reply-To Headers
parents 40ad7c2a e9dda94a
No related branches found
No related tags found
No related merge requests found
...@@ -671,6 +671,18 @@ class MailFetcher { ...@@ -671,6 +671,18 @@ class MailFetcher {
// attachment. Download the body and pass it along to the mail // attachment. Download the body and pass it along to the mail
// parsing engine. // parsing engine.
$info = Mail_Parse::splitHeaders($mailinfo['header']); $info = Mail_Parse::splitHeaders($mailinfo['header']);
//make sure reply-to headers are correctly formatted
if ($mailinfo['reply-to'] && !Validator::is_email($mailinfo['reply-to']) && $info['Reply-To']) {
$replyto = Mail_Parse::parseAddressList($info['Reply-To']);
if ($replyto[0]) {
$mailinfo['reply-to'] = sprintf('%s@%s', $replyto[0]->mailbox, $replyto[0]->host);
$mailinfo['reply-to-name'] = $replyto[0]->personal;
} else {
$mailinfo['reply-to'] = null;
}
}
if (strtolower($info['Content-Type']) == 'message/rfc822') { if (strtolower($info['Content-Type']) == 'message/rfc822') {
if ($wrapped = $this->getPart($mid, 'message/rfc822')) { if ($wrapped = $this->getPart($mid, 'message/rfc822')) {
require_once INCLUDE_DIR.'api.tickets.php'; require_once INCLUDE_DIR.'api.tickets.php';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment