mailgun / flanker

Python email address and Mime parsing library
http://www.mailgun.com
Apache License 2.0
1.63k stars 204 forks source link

Accept non-ascii attachment name #171

Closed carsonip closed 6 years ago

carsonip commented 7 years ago

Non-ascii param will no longer raise DecodingError, as shown in the old broken_ctype_test. This bug can be reproduced by sending an attachment in gmail with non-ascii name. The bug is fixed by tuning regex. Non-ascii params still have to be double quoted.

mailgun-ci commented 7 years ago

Can one of the admins verify this patch?

horkhe commented 7 years ago

Please make sure that all tests pass.

carsonip commented 7 years ago

The test is fixed but it isn't neat. In parse_header_value, non-ascii value will actually be handled and it will raise DecodeError.

horkhe commented 7 years ago

I do not quite get what the bug is. Are you saying that a unicode attachment name is not properly encoded by the library?

carsonip commented 7 years ago

Sometimes email providers don't handle unicode attachment names properly and send them out directly as unicode characters in 'name' or 'filename' parameters. Flanker should be able to handle these cases and decode them properly.

b0d0nne11 commented 6 years ago

Hey @carsonip sorry for letting this slip. Can you rebase it so I can merge?

carsonip commented 6 years ago

Rebased. Did a force push. Please check.

powellchristoph commented 6 years ago

@mailgun-ci test this please

powellchristoph commented 6 years ago

@mailgun-ci retest this please

b0d0nne11 commented 6 years ago

The default tests are running and passing when we trigger a job manually but the same jobs aren't being triggered by the PR webhooks. Might have something to do with the PR being older.