purebred-mua / purebred-email

A fast email parsing library implemented in Haskell
https://hackage.haskell.org/package/purebred-email
GNU Affero General Public License v3.0
23 stars 4 forks source link

Tab character in subject header shows as whitespace #13

Closed romanofski closed 6 years ago

romanofski commented 6 years ago

I've noticed this in an e-mail today where the subject was something like:

  cli can'    t be used for

because the e-mail underneath looked like this:

Subject: [Bug 1562010] New: rpmdeplint cli can'                                                                                                                                                                                               
_¸t be used for checking repoclosure of a single repo

Obviously I would want it to read:

[Bug 1562010] rpmdeplint cli can't be used for checking repoclosure of a single repo

without the whitespace. Have not spent time figuring out where exactly the problem is or what it supposed to happen, but rather thought filing the bug to have a record of this.

frasertweedale commented 6 years ago

All the whitespace including and surrounding the newline should be folded into a single space.

So it should be interpreted as cli can' t be used for, i.e. one space char after the aspotrophe.

frasertweedale commented 6 years ago

@romanofski can you provide minimum reproducer for purebred-email itself. AFAICT it's doing the right thing.

romanofski commented 6 years ago

I can try. Hm.. although when you say a single space then it seems to be doing the right thing... it just looks odd.

Checking in another mailer - mutt - it parses the mail the same. So... maybe there is no bug, it's just whatever produced the mail (guess Bugzilla) just stuffed up the word?

frasertweedale commented 6 years ago

Yeah, no bug :) Closing.

romanofski commented 6 years ago

Today I realised that the problem was actually never purebred-email. Working on the serialisation made me realise that our subject headers are still not correctly "unfolded" field bodies. Looking into this closer, I realised that we're actually showing the subject out of the index from notmuch. So it's notmuch which seems to not correctly unfolding field bodies. Once you view the mail, a folded field body (e.g the subject) is correctly shown.