generate_boundary generates boundary not correctly parsed by some implementations #13

Closed
opened 2021-04-08 02:10:43 +12:00 by zyddnys · 1 comment
zyddnys commented 2021-04-08 02:10:43 +12:00 (Migrated from github.com)

Result of generate_boundary contains '=' and '/', which is not correctly handle by some multipart implementations.
I have a very simple fix, hopefully you can merge it soon.
github.com/zyddnys/mime-multipart@fc18017579

Result of generate_boundary contains '=' and '/', which is not correctly handle by some multipart implementations. I have a very simple fix, hopefully you can merge it soon. https://github.com/zyddnys/mime-multipart/commit/fc18017579f1f6b082c00d1a592e35a4b3218f06
mikedilger commented 2021-04-08 05:21:22 +12:00 (Migrated from github.com)

Thanks for pointing this out.

According to this https://www.oreilly.com/library/view/programming-internet-email/9780596802585/ch03s04.html
MIME boundaries should probably only use letters, numbers, and '+'. Standard base64 encoding (as it currently uses) will also generate '/' which is apparently forbidden. So the fix should be replacing '/' with anything (e.g. 'x') and not using the urlsafe variant. If you make that change as a pull request I'll merge it.

Thanks for pointing this out. According to this https://www.oreilly.com/library/view/programming-internet-email/9780596802585/ch03s04.html MIME boundaries should probably only use letters, numbers, and '+'. Standard base64 encoding (as it currently uses) will also generate '/' which is apparently forbidden. So the fix should be replacing '/' with anything (e.g. 'x') and not using the urlsafe variant. If you make that change as a pull request I'll merge it.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mikedilger/mime-multipart#13
No description provided.