-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
Multipart-Message Boundaries are empty #27
Comments
So i worked some time on this, i think i kinda got a fix, pull request incoming - but after my fix i get the mail as an attachment - still investigating |
Need to take a look into the Attachement Handling - i don't know why the text mail body gets handles as an attachment on my side (could be just me, need to validate) |
Sry didn't mean to close it.. |
You probably mean $this->fetchAttachment($part); If I remember correctly it's there because many plain text attachments don't have the required disposition and therefor get interpreted as part of the text body. But I see the problem - do you have any suggestion for a better handling? |
My best guess: private function fetchPart(Part $part) {
if ($part->type == IMAP::MESSAGE_TYPE_TEXT && ($part->ifdisposition == 0 || (empty($part->disposition) || !in_array(strtolower($part->disposition), ['attachment', 'inline'])) ) ) {
if (strtolower($part->subtype) == "plain" || strtolower($part->subtype) == "csv") {
[...]
if (isset($part->name) and !is_empty($part->name))
$this->fetchAttachment($part);
} elseif (isset($part->filename) and !is_empty($part->filename))
$this->fetchAttachment($part);
} else {
$this->bodies['text'] = $content;
}
} elseif {
[..] |
Hi @Webklex, To Reproduce
somewhat similar to #24 suggestion 1 private function parseSubtype(){
$content_type = $this->header->get("content-type");
// If its an array the mime needs to be in the first array, because it's in the same line as "content-type"
$content_type = (is_array($content_type)) ? $content_type[0] : $content_type;
if (($pos = strpos($content_type, "/")) !== false){
$this->subtype = substr($content_type, $pos + 1);
}
} or private function parseSubtype(){
$content_type = $this->header->get("content-type");
if (is_array($content_type)) {
foreach ($content_type as $part){
if ((strpos($part, "/")) !== false){
$content_type = $part;
break;
}
}
}
if (($pos = strpos($content_type, "/")) !== false){
$this->subtype = substr($content_type, $pos + 1);
}
} |
Describe the bug
Got an Email, where a parsed header contains a malformed header, so that somehow the
getBoundary()
method is called twice and returns the correct boundary in the first run, but a empty one in the secondsrc/Structure.php:99
:To Reproduce
Steps to reproduce the behavior:
Create an email where a the Header have a definition like this
Try to recive the said mail
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop / Server (please complete the following information):
Additional context
Another smaller Issue was that some boundary params were set without any qoute (") markers, could be fixed with an alternation on the regex =
boundary\=\"?(.*)\"?
The text was updated successfully, but these errors were encountered: