Trying to process inbound mails that are bcc'd to [email protected] (Office 365).
Pasting the code we have at https://github.com/civicrm/civicrm-core/blob/master/CRM/Mailing/MailStore.php#L128-L138
$parser = new ezcMailParser();
//set property text attachment as file CRM-5408
$parser->options->parseTextAttachmentsAsFiles = TRUE;
foreach ($set->getMessageNumbers() as $nr) {
if ($this->_debug) {
print "retrieving message $nr\n";
}
$single = $parser->parseMail($this->_transport->fetchByMessageNr($nr));
$mails[$nr] = $single[0];
}
When a mail is bcc'd from a Gmail account to [email protected]
and Process Inbound Email
job is executed, $mails
correctly contain the email address in the bcc header.
But, when it is sent from an outlook account or Apple Mail, there is no bcc or any header that contains an information that our mail was bcc'd to [email protected]
.
Does our email parser strips bcc information if the input is from a server other than Gmail?
Update -
If mail is sent from Gmail, headers look like - https://gist.github.com/jitendrapurohit/fa6a115c18b8bcfbb8346f58cd1265c0
From Outlook - https://gist.github.com/jitendrapurohit/176eee759cfc9b3688682ea99b6c3460