poco icon indicating copy to clipboard operation
poco copied to clipboard

MailMessage::read() chokes on "Content-disposition"

Open lewandowski-a-j-gmail-com opened this issue 3 years ago • 3 comments

I noticed that Net::MailMessage::read(std::istream&) is unable to parse a multipart message that contains "Content-disposition:" section (as oposed to "Content-Disposition:" which is parsed correctly).

I'm not an expert on email-related RFCs, but

  1. one of the email web-clients that I use did send a message with the problematic capitalization
  2. this message was parsed correctly by two different webmail clients that I use (including Google's one)
  3. MailMessage::read() does not seem have problems when I change "Content-Type:" to "Content-type:"

A small example illustraitng the problem is in the attachment. To see the unexpected [incorrect?] behavior, simply change "Content-Disposition:" to "Content-disposition:" in the raw_message string literal at the beggining of main(). The resulting new raw message string (obtained through Net::MailMessage::write()) does not have the section with "Content-disposition:" at all.

poco-email-parser_cpp.txt

should be case insensitive, RFC 2822 supersedes RFC 822

aleks-f avatar Jun 29 '22 09:06 aleks-f

ok, I can reproduce the problem using your code, so disregard previous (deleted) comment. scheduling this for 1.13

aleks-f avatar Jun 29 '22 10:06 aleks-f

Thanks for really fast reply. Best wishes,Adrian

W dniu środa, 29 czerwca 2022 Aleksandar Fabijanic @.***> napisał(a):

ok, I can reproduce the problem using your code, so disregard previous comment. scheduling this for 1.13

— Reply to this email directly, view it on GitHub https://github.com/pocoproject/poco/issues/3650#issuecomment-1169810809, or unsubscribe https://github.com/notifications/unsubscribe-auth/AODV3HIRLMKXNETV4PDUIUDVRQQHTANCNFSM52E7ZKMQ . You are receiving this because you authored the thread.Message ID: @.***>

This issue is stale because it has been open for 365 days with no activity.

github-actions[bot] avatar Jun 30 '23 02:06 github-actions[bot]

This issue was closed because it has been inactive for 60 days since being marked as stale.

github-actions[bot] avatar Aug 30 '23 02:08 github-actions[bot]