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
I sporadically had trouble extracting attachments from some received mails, which when checked do work in GMail. After analysis, I traced it down to extraneous whitespace in the Content-Disposition header of the attachment part.
#<Mail::Field::IncompleteParseError: Mail::ContentDispositionElement can not parse |attachment; filename = "file.pdf"|: Only able to parse up to "attachment; filename">
removing the extraneous whitespace around the = character:
I've checked RFC 2183 and RFC 822, and it is not entirely clear to me whether this white-space is legal (RFC 822 section 3.1.4 does say "free insertion of linear-white-space (which permits folding by inclusion of CRLFs) is allowed between lexical tokens." but I do not know if that applies here).
Regardless of standards conformance, there is probably no downside to being slightly more lenient here and allow the spaces.
I sporadically had trouble extracting attachments from some received mails, which when checked do work in GMail. After analysis, I traced it down to extraneous whitespace in the Content-Disposition header of the attachment part.
Specifically, the following headers:
fail with the follow parse error:
removing the extraneous whitespace around the
=
character:works as expected.
Both cases work as expected in GMail.
I've checked RFC 2183 and RFC 822, and it is not entirely clear to me whether this white-space is legal (RFC 822 section 3.1.4 does say "free insertion of linear-white-space (which permits folding by inclusion of CRLFs) is allowed between lexical tokens." but I do not know if that applies here).
Regardless of standards conformance, there is probably no downside to being slightly more lenient here and allow the spaces.
Probably somewhat related: #200
The text was updated successfully, but these errors were encountered: