-
-
Notifications
You must be signed in to change notification settings - Fork 252
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
Misc changes #114
Misc changes #114
Conversation
Notices generates by c-client that wrapped by imap extensions, so no other way to solve that.
…ed with "UNKNOWN SEARCH CRITERION", may be there are any others, so throw general library exception.
…-Y \(H:i:s\) that throws exception, so use zero timestamp if no well-formatted date in message headers presented.
…han ENCOTHER. php imap returns encoding in between 6 and 10 if encoding is unsupported, so there is no way to decode just throws exception.
@@ -75,7 +75,7 @@ public function getMailbox($name) | |||
throw new MailboxDoesNotExistException($name); | |||
} | |||
|
|||
return new Mailbox($this->server . imap_utf7_encode($name), $this); | |||
return new Mailbox($this->server . mb_convert_encoding($name, "UTF7-IMAP", "UTF-8"), $this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented in #193 due to the heavy refactored code.
Thank you for your help
$decoded .= $part->text; | ||
} catch (\Ddeboer\Transcoder\Exception\IllegalCharacterException $ex) { | ||
// force transcoding using iconv and ignore. | ||
$decoded .= @iconv($charset, 'UTF-8//IGNORE', $part->text); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have any example for this case?
@@ -218,6 +219,11 @@ protected function parseStructure(\stdClass $structure) | |||
$this->type = self::TYPE_UNKNOWN; | |||
} | |||
|
|||
// fix strange encoding that more than ENCOTHER = 5 | |||
if ($structure->encoding > ENCOTHER) { | |||
throw new MessageUnsupportedEncodeException($this->messageNumber, $this->partNumber); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented in #197 thank you for your feedback
// Thus wait while php core team fix that, some guys waits about 5 year, ha-ha | ||
// @see http://php.net/manual/ru/function.imap-headerinfo.php#98809 | ||
$headers = imap_rfc822_parse_headers( | ||
imap_fetchheader($this->stream, imap_msgno($this->stream, $this->messageNumber)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partially implemented in #202 thank you
} else { | ||
throw new Exception($lastError); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented in https://github.com/ddeboer/imap/pull/198/files#diff-fd5d8baa93f5124ecb7ec0f13038e744R119 thank you
return new \DateTime($value); | ||
try { | ||
$dateTime = new \DateTime($value); | ||
} catch (\Exception $e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you provide dates that throw exceptions?
If you'll face date that get DateTime to throw exceptions please ping me or PR the case to the dedicated data set: Lines 320 to 330 in 0fee1a7
And we'll try to handle it as well. All other suggested edit were implemented in specific PR with related test. Thank you for you feedback. |
Misc changes with encodings, exceptions handle, new exceptions and so one, look at commit messages for details.