Bug 448183

Summary: Messageviewer is confused by strange RFC2047-encoded header
Product: [Applications] kdepim Reporter: Erik Quaeghebeur <bugs.kde.org>
Component: messageviewerAssignee: kdepim bugs <kdepim-bugs>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version: 5.16.1   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Example mail with RFC2047-encoded header that confuses messageviewer

Description Erik Quaeghebeur 2022-01-09 22:08:44 UTC
Created attachment 145281 [details]
Example mail with RFC2047-encoded header that confuses messageviewer

SUMMARY
Headers can contain RFC2047-encoded (Q-encoded) fragments. I got a mail that containts such a header that confuses messageviewer into displaying it wrong. Namely, the Cc field is

---
Cc: =?UTF-8?Q?comp=2Dneuro=40neuroinformatics=2Ebe_=3Ccomp=2Dneuro=40neuroinformati?=
	=?UTF-8?Q?cs=2Ebe=3E=2C=2C_connectionists=40cs=2Ecmu=2Eedu_=3Cconnectionists=40cs=2Ecmu=2Eed?=
	=?UTF-8?Q?u=3E=2C=2C_ml=2Dnews=40googlegroups=2Ecom_=3Cml=2Dnews=40googlegroups=2Ecom=3E=2C=2C_s?=
	=?UTF-8?Q?ystems=2Dneuroscience=40googlegroups=2Ecom_=3Csystems=2Dneuroscience=40g?=
	=?UTF-8?Q?ooglegroups=2Ecom=3E=2C=2C_maths=2Dneuronet=40lists=2Enottingham=2Eac=2Euk?= <ml-news@googlegroups.com>,
	rl-list@googlegroups.com
---

Everything in front of <ml-news@googlegroups.com> is decoded as if it were the display name for that address, namely, as the string

---
"comp-neuro@neuroinformatics.be <comp-neuro@neuroinformatics.be>,, connectionists@cs.cmu.edu <connectionists@cs.cmu.edu>,, ml-news@googlegroups.com <ml-news@googlegroups.com>,, systems-neuroscience@googlegroups.com <systems-neuroscience@googlegroups.com>,, maths-neuronet@lists.nottingham.ac.uk <ml-news@googlegroups.com>"
---

whereas actually it should not have the quotes added. (There are issues with this list, the double commas, but that is not the problem here, I think.)

The attached mail contains this Cc header. I've added the string above without the quotes to the Bcc header and it seems that the double commas confuse the header parser into displaying each address twice, so that is a second issue.

SOFTWARE/OS VERSIONS
messagelib version: 21.08.3
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.88.0
Qt Version: 5.15.2-r11