You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
quote_token leaves an empty parameter value unquoted, producing invalid "name=" headers #1696
Expected: name="" in the encoded header. Per RFC 2045 section 5.1 a parameter value is a token (one or more characters) or a quoted-string, so an empty value has to be quoted.
Mail::Utilities.quote_token("") returns an empty string because TOKEN_UNSAFE does not match an empty string; ParameterHash#encoded and #decoded use it for every parameter.
Impact: Mail.ru sends pasted images as Content-Type: image/png; name="". Helpdesk software that re-sends such parts (Zammad agent notifications) produces name=, and SMTP servers reject these messages, e.g. 554 Transaction failed: In parameter list <;0x000d0x000a name=>, expected parameter value, got "null".
Possible fix: quote empty values in ParameterHash#encoded. Doing it in quote_token would also change #decoded to name="", and downstream parsers read decoded values: Zammad, for one, would then name such attachments "".
Activity