mox/webmail
Mechiel Lukkien a40f5a5eb3
webmail: recognize q/b-word-encoded filenames in attachments in messages
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!
2023-10-14 14:14:13 +02:00
..
api.go webmail: recognize q/b-word-encoded filenames in attachments in messages 2023-10-14 14:14:13 +02:00
api.json add todo's about mime header parameter decoding 2023-09-21 15:18:25 +02:00
api.ts add todo's about mime header parameter decoding 2023-09-21 15:18:25 +02:00
api_test.go make mox compile on windows, without "mox serve" but with working "mox localserve" 2023-10-14 10:54:07 +02:00
eventwriter.go initialize metric mox_panic_total with 0, so the alerting rule also catches the first panic for a label 2023-09-15 16:47:17 +02:00
lib.ts webmail: better recognize URLs in text wrapped in () or <> if it follows interpunction 2023-09-21 11:09:27 +02:00
message.go webmail: recognize q/b-word-encoded filenames in attachments in messages 2023-10-14 14:14:13 +02:00
message_test.go when making a message preview, also recognize []-enclosed "horizontal ellipsis" unicode character as a snip 2023-09-11 14:41:50 +02:00
msg.html webmail: ensure wrap of long header lines, instead of horizontal scrollbar in message header section 2023-10-12 22:08:13 +02:00
msg.js webmail: ensure wrap of long header lines, instead of horizontal scrollbar in message header section 2023-10-12 22:08:13 +02:00
msg.ts webmail: ensure wrap of long header lines, instead of horizontal scrollbar in message header section 2023-10-12 22:08:13 +02:00
text.html add webmail 2023-08-07 21:57:03 +02:00
text.js webmail: better recognize URLs in text wrapped in () or <> if it follows interpunction 2023-09-21 11:09:27 +02:00
text.ts add webmail 2023-08-07 21:57:03 +02:00
view.go webmail: recognize q/b-word-encoded filenames in attachments in messages 2023-10-14 14:14:13 +02:00
view_test.go make mox compile on windows, without "mox serve" but with working "mox localserve" 2023-10-14 10:54:07 +02:00
webmail.go webmail: recognize q/b-word-encoded filenames in attachments in messages 2023-10-14 14:14:13 +02:00
webmail.html webmail: ensure wrap of long header lines, instead of horizontal scrollbar in message header section 2023-10-12 22:08:13 +02:00
webmail.js ensure there is a space between active requests mentioned in the status bar at the top 2023-10-14 11:13:26 +02:00
webmail.ts ensure there is a space between active requests mentioned in the status bar at the top 2023-10-14 11:13:26 +02:00
webmail_test.go make mox compile on windows, without "mox serve" but with working "mox localserve" 2023-10-14 10:54:07 +02:00