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

fix: Reject invalid MIME header name characters to support Go 1.20 #270

Merged
merged 3 commits into from
Feb 2, 2023

Conversation

jhillyerd
Copy link
Owner

Fixes #269

@kayabe
Copy link

kayabe commented Jan 27, 2023

test fails because of this commit golang/go@a6642e6, = doesnt seem to be permitted

@jhillyerd
Copy link
Owner Author

Yes, as seems to be the usual with enmime, we have to decide how to handle malformed email in an elegant way.

It does not appear there is an official way to escape characters in mime header names. The easiest would probably be to convert the equals to a dash. I could imagine that being exploited, so perhaps a double dash would be better. Might also provide a strict mode to discard that particular header line instead.

@jhillyerd jhillyerd self-assigned this Jan 27, 2023
@jhillyerd jhillyerd marked this pull request as ready for review January 30, 2023 23:48
@jhillyerd jhillyerd changed the title fix: Go 1.20 support fix: Reject invalid MIME header name characters to support Go 1.20 Jan 31, 2023
@rjbordon
Copy link

rjbordon commented Feb 25, 2023

Hi @jhillyerd, first of all, thanks for this awesome library!

I have been testing the latest and greatest in the master branch (this PR included) with go1.20.1 and it works out as expected. Could you kindly create a new release from the master branch? I think the last one available goes until Sept 2022.

Thanks.

@jhillyerd
Copy link
Owner Author

done, v0.11.0 tagged

@rjbordon
Copy link

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestReadHeader/equals_in_name fails on Go1.20
3 participants