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

Attachements in Base64 are not downloaded correctly #24

Closed
oers opened this issue Jan 8, 2015 · 11 comments
Closed

Attachements in Base64 are not downloaded correctly #24

oers opened this issue Jan 8, 2015 · 11 comments
Labels

Comments

@oers
Copy link
Contributor

oers commented Jan 8, 2015

Excerpt from the source:
------=_Part_106_2085203044.1420709065643
Content-Type: application/pdf; name=2014826.001.pdf
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=2014826.001.pdf

JVBERi0xLjQKJaqrrK0KNCAwIG9iago8PAovQ3JlYXRvciAoQXBhY2hlIEZPUCBWZXJzaW9uIDEu
MSkKL1Byb2R1Y2VyIChBcGFjaGUgRk9QIFZlcnNpb24gMS4xKQovQ3JlYXRpb25EYXRlIChEOjIw
MTUwMTA4MTAyNDI1KzAxJzAwJykKPj4KZW5kb2JqCjUgMCBvYmoKPDwKICAvTiAzCiAgL0xlbmd0
aCAxMSAwIFIKICAvRmlsdGVyIC9GbGF0ZURlY29kZQo+PgpzdHJlYW0KeJydlndUU9kWh8+9N71Q
khCKlNBraFICSA29SJEuKjEJEErAkAAiNkRUcERRkaYIMijggKNDkbEiioUBUbHrBBlE1HFwFBuW
SWStGd+8ee/Nm98f935rn73P3Wfvfda6AJD8gwXCTFgJgAyhWBTh58WIjYtnYAcBDPAAA2wA4HCz
...

When Clicking the Download-Button it will just save the Base64 Characters in a textfile named 2014826.001.pdf and not create a valid pdf

@nexces
Copy link

nexces commented Jan 8, 2015

I can confirm that. First error is the empty line in the beginning of the file. When i remove that line i can decode few bytes and there is another problem (maybe newline related).

@nexces
Copy link

nexces commented Jan 8, 2015

It is newline related.
When i change newlines to from CRLF to LF and remove first empty line from downloaded data i can correctly base64 decode data into attachment.

@ian-kent
Copy link
Member

ian-kent commented Jan 8, 2015

Thanks @oers and @nexces, my bad! I "fixed" the newline handling in github.com/mailhog/smtp, but think I've probably applied it to content handled by the DATA command too

@ian-kent ian-kent added the bug label Jan 8, 2015
@ian-kent ian-kent added this to the Go-MailHog v0.2.0 milestone Jan 8, 2015
@oers
Copy link
Contributor Author

oers commented Jan 8, 2015

Will the fix ensure, that the bas64chars are transformed to bytes and a valid PDF is downloaded?

@ian-kent
Copy link
Member

ian-kent commented Jan 8, 2015

I hope so 😄

@nexces
Copy link

nexces commented Feb 13, 2015

BUMP

Making attachments readable out-of-the-box would speed up my workflow ;)

@huglester
Copy link

+1 on this. attachments should be human readable !:)

thanks for dependency-less mail catcher

@huglester
Copy link

Hello, can this be tagged maybe and build packages? thanks :)

@ian-kent
Copy link
Member

ian-kent commented Mar 1, 2015

Sorry, was hoping to get a few more fixes in before I did a release but run out of time! But no problem, I'll do it asap 😄

@huglester
Copy link

Sure! Have them fixed then:))) thought maybe you forgot about us :)))

@SalahAdDin
Copy link

it still does not enable us to download attachments.

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

5 participants