-
-
Notifications
You must be signed in to change notification settings - Fork 373
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
Empty attachment with wrong size #646
Comments
Can you provide a sample app? I'm not sure how you are determining size. |
This comment has been minimized.
This comment has been minimized.
1 similar comment
Obtener Outlook para Android
|
That just gave me a file listing in a comment, but no actual source code that I can look at to see what you are doing so I can better understand the issue. |
@rqueizan I don't see it. You can't reply to GitHub notifications with attachments, it will only post the message text as a comment. |
For some reason looks like the mail fail when sent.
In the web I can't see the email, but in the client looks like was sent.
When I send email with old version, and read with old/new version work fine.
The problem is when with new version I send the email. The server report at empty attachment with 2 bytes of size.
See the document.
If you prefer code in place of picture, let me know.
In picture are more easy to read by the color assigned by the IDE.
|
It's best not to reply to these comments using your email client because GitHub doesn't handle emails very well. It's best to go to https://github.com/jstedfast/MailKit/issues/1136 and write your comment manually. |
Review the word document. I explain my way for fetch mails and how to build my own representations of the mail. |
I ran my tests with the old version, I send an empty attachment (an image, 0 bytes). |
This is what the latest version of MimeKit generates with an empty attachment:
There's no way to remove the blank line w/o causing invalid MIME. I also could not find any code changes to the way MIME is written out (lots of changes to the parser, though). That said, I don't think it's related to the parser changes either because you seem to be using MailKit's So I'm kind of confused... |
Can you verify that MimeKit 2.8.0 produces different output from 2.9.1? (or 2.10.x if you'd rather use 2.10 is fine). |
The four picture represent de comparative use of new library and old library. |
This are the complete logs: |
in the 2.10.x version (I assume that's what the "MKBnew.txt" file represents), I can definitely see that there are too many blank lines for an empty MIME part:
The image/png, for example, has 3 blank lines. It should only have 1 like my example a few comments above has. I'm not sure why you are getting 3. I can't seem to reproduce that here. How are you creating the image/png attachment? |
Okay, so my local test case was broken and now that I fixed it, I'm getting 2 blank lines. But I think that's still ok. The issue you are having is that you are getting 3 blank lines and I still can't figure out how that is happening for you. |
Does your empty.png have a newline in it? Or is it a 0-length file? |
Ok, so when using the BodyBuilder, I can reproduce this... |
Ah, ok, so in 2.9.0, I made the BodyBuilder.Attachments.Add() method always set the Content-Transfer-ENcoding to base64 for non-text content (based on mime-type), so the empty.png attachment went from not having an encoding to having an encoding. The base64 encoder would always flush the content with a new-line sequence, even if the content that was base64 encoded was 0-length. |
Yep, my patch fixes that issue. |
Describe the bug
In previous versions of the library, when an empty attachment (without content) was read, it came with zero size.
Previous Version: MailKit: 2.8.0, MimeKit: 2.9.1
In the new versions it returns with the size between 1 and 2 bytes (octets).
New Version: MailKit: 2.10.0-2.10.1, MimeKit: 2.10.0-2.10.1
I detect the bug when run the test that cover that scenary.
Platform (please complete the following information):
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The size of an empty attachment must be zero.
The text was updated successfully, but these errors were encountered: