mirror of
https://github.com/mjl-/mox.git
synced 2024-12-27 08:53:48 +03:00
a40f5a5eb3
according to the rfc's (2231, and 2047), non-ascii filenames in content-type and content-disposition headers should be encoded like this: Content-Type: text/plain; name*=utf-8''hi%E2%98%BA.txt Content-Disposition: attachment; filename*=utf-8''hi%E2%98%BA.txt and that is what the Go standard library mime.ParseMediaType and mime.FormatMediaType parse and generate. this is what thunderbird sends: Content-Type: text/plain; charset=UTF-8; name="=?UTF-8?B?aGnimLoudHh0?=" Content-Disposition: attachment; filename*=UTF-8''%68%69%E2%98%BA%2E%74%78%74 (thunderbird will also correctly split long filenames over multiple parameters, named "filename*0*", "filename*1*", etc.) this is what gmail sends: Content-Type: text/plain; charset="US-ASCII"; name="=?UTF-8?B?aGnimLoudHh0?=" Content-Disposition: attachment; filename="=?UTF-8?B?aGnimLoudHh0?=" i cannot find where the q/b-word encoded values in "name" and "filename" are allowed. until that time, we try parsing them unless in pedantic mode. we didn't generate correctly encoded filenames yet, this commit also fixes that. for issue #82 by mattfbacon, thanks for reporting! |
||
---|---|---|
.. | ||
api.go | ||
api.json | ||
api.ts | ||
api_test.go | ||
eventwriter.go | ||
lib.ts | ||
message.go | ||
message_test.go | ||
msg.html | ||
msg.js | ||
msg.ts | ||
text.html | ||
text.js | ||
text.ts | ||
view.go | ||
view_test.go | ||
webmail.go | ||
webmail.html | ||
webmail.js | ||
webmail.ts | ||
webmail_test.go |