Skip to content
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

Emails with no body insert attachment as text. #15

Closed
krolaw opened this issue Dec 11, 2014 · 4 comments
Closed

Emails with no body insert attachment as text. #15

krolaw opened this issue Dec 11, 2014 · 4 comments
Labels

Comments

@krolaw
Copy link

krolaw commented Dec 11, 2014

I.E.

From: [email protected]
Subject: Invoice from My Apartment Motel
Date: 11 December 2014 2:42:59 pm NZDT
To: [email protected]

Content-Type: application/octet-stream
Content-Disposition: attachment;
filename="Invoice 2474.PDF"
Content-Id: <Invoice 2474.PDF>
Content-Transfer-Encoding: base64

JVBERi0xLjQKJaqrrK0KNCAwIG9iago8PAovQ3JlYXRvciAoQXBhY2hlIEZPUCBWZXJzaW9uIDEu
MCkKL1Byb2R1Y2VyIC...

@jordan-wright
Copy link
Owner

Hi @krolaw, thanks for trying out the library! Could you please expand a bit on this? I'm not sure what issue it is you're encountering.

From what I can see, it looks like you're creating an email with no body, only attaching a file. Then, after encoding is performed, the base64 encoding is actually interpreted as the email body text?

@krolaw
Copy link
Author

krolaw commented Dec 11, 2014

100% correct. Adding a single carriage return to content gets around the issue.

@cuonglm
Copy link

cuonglm commented Feb 17, 2020

@krolaw Which server generates above email content?

Here's an example from postfix:

MIME-Version: 1.0
Content-Type: multipart/mixed;
 boundary="------------364886E9732896FFFA961C46"
Content-Language: en-US

This is a multi-part message in MIME format.
--------------364886E9732896FFFA961C46
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit



--------------364886E9732896FFFA961C46
Content-Type: text/plain; charset=UTF-8;
 name="test.txt"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="test.txt"

MQo=
--------------364886E9732896FFFA961C46--

and it's parsed correctly after #89

@krolaw
Copy link
Author

krolaw commented Feb 17, 2020

I don't believe it was from any server. Possibly output from the library itself, but don't quote me, it was over 5 years ago. I'm betting the issue has long been fixed, so I'm closing it now.

@krolaw krolaw closed this as completed Feb 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants