projects
/
civicrm-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d336d1f
)
CRM-19215. Handle peculiar format of From header.
author
Chris Burgess
<chris@giantrobot.co.nz>
Thu, 11 Aug 2016 00:22:48 +0000
(12:22 +1200)
committer
Chris Burgess
<chris@giantrobot.co.nz>
Thu, 11 Aug 2016 00:22:48 +0000
(12:22 +1200)
CRM/Utils/Mail/Incoming.php
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Utils/Mail/Incoming.php
b/CRM/Utils/Mail/Incoming.php
index a3c869402eb1b1848aac7ecafca3f939626af598..cc652f0fdc409dd420ba4163ab7513488a7f2071 100644
(file)
--- a/
CRM/Utils/Mail/Incoming.php
+++ b/
CRM/Utils/Mail/Incoming.php
@@
-318,6
+318,14
@@
class CRM_Utils_Mail_Incoming {
// and put it in a standardized format
$params = array('is_error' => 0);
+ // Sometimes $mail->from is unset because ezcMail didn't handle format
+ // of From header. CRM-19215.
+ if (!isset($mail->from)) {
+ if (preg_match('/^([^ ]*)( (.*))?$/', $mail->getHeader('from'), $matches)) {
+ $mail->from = new ezcMailAddress($matches[1], trim($matches[2]));
+ }
+ }
+
$params['from'] = array();
self::parseAddress($mail->from, $field, $params['from'], $mail);