You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for this imap class. So far it has been very useful.
However, I have found an issue while parsing mails from Yahoo which took me a while to understand.
The imap_search() charset you are using by default is "utf-8" but for some reason the yahoo imap stream expect the charset to be uppercase "UTF-8". When using imap_seach() on a yahoo stream with lowercase utf-8 the result is false while with uppercase we get the expected IDs back.
So may be we should always uppercase charset name? The question is if UTF-8 will works with other mail servers, like utf-8. Could you please check this?
I can not find a RFC document describing the use of charset for imap.
However, in every RFC document describing the imap protocol and the charset, I can see that they use the uppercase version.
Hi,
Thank you for this imap class. So far it has been very useful.
However, I have found an issue while parsing mails from Yahoo which took me a while to understand.
The imap_search() charset you are using by default is "utf-8" but for some reason the yahoo imap stream expect the charset to be uppercase "UTF-8". When using imap_seach() on a yahoo stream with lowercase utf-8 the result is false while with uppercase we get the expected IDs back.
Here is a quick sample:
$sevrer = "{imap.mail.yahoo.com:993/imap/ssl}INBOX";
$username = "";
$password = "";
// open connection
$imapStream = imap_open($sevrer, $username, $password);
// check connection
if (! $imapStream) {
throw new Exception('Connection error: ' . imap_last_error());
}
$criteria = "SINCE 01-Jan-2015";
var_dump(imap_search($imapStream, $criteria, SE_UID, 'utf-8')); // false
var_dump(imap_search($imapStream, $criteria, SE_UID, 'UTF-8')); // array of message numbers or UIDs
// close connection
if ($imapStream && is_resource($imapStream)) {
imap_close($imapStream, CL_EXPUNGE);
}
Cheers
The text was updated successfully, but these errors were encountered: