New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
imap processing error when "from" field is utf8 encoded #850
Comments
Unfortunately, even with imap_rfc822_parse_headers, the from address will still be invalid email as required by osTicket. |
couldn't that be handled by doing something like: sorry about the formatting of the regex, it gets messed because of the markup, the pattern before and after the @ is [a-z0-9._-] |
Would you consider posting the entire, unparsed (raw) email and headers, so I could take a closer look at the parser? |
of course, the output of var_dump(imap_fetchheader($this->mbox, $mid)); is the following: string(655) "Return-Path: <> " |
Can this issue be re-opened? This has been causing problems processing emails, in the meantime we have to maintain our own patch to osticket using |
When an email is received with the "from" header encoded (for example "From: =?utf-8?q?D=C3=A9tection_de_spam_=3Cnoreply=401and1=2Efr=3E?="), the email is badly parsed, generating the following notification "Excessive errors processing emails for imap.1und1.de/support@xxx.com. Please manually check the inbox".
This is caused by the call of imap_headerinfo in class.mailfetch.php, returning a variable without any "from" nor "fromaddress" field.
In this case, the "from" can be read by calling imap_rfc822_parse_headers(imap_fetchheader(...)) which gives a result with the following fields:
...
["fromaddress"]=>
string(69) "=?utf-8?q?D=C3=A9tection_de_spam_=3Cnoreply=401and1=2Efr=3E?=@unknown"
["from"]=>
array(1) {
[0]=>
object(stdClass)#29 (2) {
["mailbox"]=>
string(61) "=?utf-8?q?D=C3=A9tection_de_spam_=3Cnoreply=401and1=2Efr=3E?="
["host"]=>
string(7) "UNKNOWN"
}
}
...
The from->mailbox and from->host would still have to be adapted after that
The text was updated successfully, but these errors were encountered: