Bug 359656 - Trojita adds double quotes around RFC2231-encoded parameters
Summary: Trojita adds double quotes around RFC2231-encoded parameters
Status: RESOLVED FIXED
Alias: None
Product: trojita
Classification: Unmaintained
Component: Core (show other bugs)
Version: unspecified
Platform: Microsoft Windows All
: NOR major
Target Milestone: ---
Assignee: Trojita default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-21 23:50 UTC by msjasinski
Modified: 2016-02-23 11:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description msjasinski 2016-02-21 23:50:36 UTC
Happened to me twice, on Windows. It's a lottery - sometimes the filename is not corrupted.
 Don't know if it happens on Linux.

Reproducible: Sometimes
Comment 1 Thomas Lübking 2016-02-22 09:36:28 UTC
On attaching, sending, receiving or downloading?
(wrong in composer, wrong for your receiver, wrong when you get the mail or wrong when you download/save the file)?

Is there a pattern to the original filename (using UTF-8 chars)?

Does the suffix stay intact? (foo.jpg -> noname.txt or noname.jpg?)

Does it affect any process or is it limited to drag'n'drop handling?

---
"noname" does not appear as string in trojitá sources, so the actual filename is likely picked by windows.
Comment 2 msjasinski 2016-02-22 16:54:32 UTC
On sending.(In reply to Thomas Lübking from comment #1)
> On attaching, sending, receiving or downloading?
> (wrong in composer, wrong for your receiver, wrong when you get the mail or
> wrong when you download/save the file)?

On sending (=wrong for your receiver).
 
> Is there a pattern to the original filename (using UTF-8 chars)?

Meaning what? 
The 1st time I didn't remember the filename, the 2nd time the filename was two or more words long.
 
> Does the suffix stay intact? (foo.jpg -> noname.txt or noname.jpg?)

No, 'something something.doc' changed into 'noname.txt' (2nd time).

> Does it affect any process or is it limited to drag'n'drop handling?

NEW MESSAGE (click on an icon on top left-hand corner of the screen) ATTACH (click on the button on top right-hand corner of the dialog), choosing file, clicking OPEN, writing email, clicking SENT.

Then: go to Gmail > SENT > there it is.

Don't know about drag and drop.
Comment 3 msjasinski 2016-02-22 17:02:46 UTC
the 2nd time the filename was two or more words long.
 
Actually, the 2nd time I attached two files, the other one got across alright, but its filename was one word long, exact filename was 'Teksty2013-cen.rtf',

On closer observation, my previous description was not 100% true (sorry, I'm in a hurry today) - in Trojita under gmail > SENT > email > attachment's filename (the multi-word one) looks fine. In gmail, it is renamed to 'noname.txt', so I assumed my addressees received it under the false name 'noname.txt'. (didn't check with them but it seems most likely if the webmail got it renamed like this.
Comment 4 msjasinski 2016-02-22 17:05:08 UTC
I can't give you the exact long filename for the sake of privacy, but it was sthg like:

'Oasdf - wsasdf. gadsaf Kfdsa.doc'

so it included a dot and a dash.
Comment 5 Jan Kundrát 2016-02-22 17:24:41 UTC
Thanks. There's apparently a bug in Trojita where we add double quotes around the parameter values when doing UTF-8 serialization according to RFC2231. GMail appears to be correct here.
Comment 6 Jan Kundrát 2016-02-22 17:43:48 UTC
Patch which fixes it is at https://gerrit.vesnicky.cesnet.cz/r/617 .
Comment 7 Jan Kundrát 2016-02-22 18:57:14 UTC
Could you please confirm that the installer from [1] fixes this issue?

[1] http://ci-logs.kde.flaska.net/binaries/trojita/win32/check/Trojita-Setup-617-6115090abc054456a4f27e3655d06c26.exe
Comment 8 msjasinski 2016-02-22 19:46:58 UTC
This built crashes when I type a few letters in 'TO' (main recipient) field.
Comment 9 Jan Kundrát 2016-02-23 11:17:36 UTC
(In reply to msjasinski from comment #8)
> This built crashes when I type a few letters in 'TO' (main recipient) field.

...so this is what we get for blindly supporting a platform that we cannot test. Oh well :).

Now, at this point your best bet is probably figuring out how to get a useful crash dump/backtrace from the program. When you have these details, please file another bug. Sorry for that, Windows support is something which we do on a best-effort basis.
Comment 10 Jan Kundrát 2016-02-23 11:18:21 UTC
Git commit 2f138e67afc7462ce56919f5b06bb7f8dec3858b by Jan Kundrát.
Committed on 22/02/2016 at 17:36.
Pushed by gerrit into branch 'master'.

Composer: do not quote RFC2231 parameters

I assumed that this was allowed due to the general MIME header syntax
rules, but this serialization apparently doesn't match the ABNF grammar,
and there are several bugreports in competing MUAs and e-mail libraries
[1] [2] about quotes not being conformant.

Motto of the day: "Even PHP is better than Trojitá". I'm so ashamed :(.
Thanks to msjasinski@gmail.com for reporting this.

[1] https://roundup.kolab.org/issue1562
[2] https://pear.php.net/bugs/bug.php?id=16706
Change-Id: I2d26f4fd862e78d2fffb2ecc61c75c5f5e241c01

M  +4    -2    src/Imap/Encoders.cpp
M  +2    -2    tests/Misc/test_rfccodecs.cpp

http://commits.kde.org/trojita/2f138e67afc7462ce56919f5b06bb7f8dec3858b