thunderbird / thunderbird-android

Thunderbird for Android – Open Source Email App for Android (fka K-9 Mail)
https://thunderbird.net/mobile
Apache License 2.0
10.94k stars 2.51k forks source link

Parsing error in compose view #2959

Open rancidfrog opened 6 years ago

rancidfrog commented 6 years ago

K9-mail allows account name to contain " character: Yet, when using long-press to copy email address directly from k9-mail, the process wraps name with " characters. However, in mail headers they do not exist, (look at email format in show headers and it appears as name < email address >, no " anywhere).

This creates parsing errors when pasting copied address into compose field.

K9-mail should either handle parsing " in compose forms, or forbid use in account name to avoid errors.

philipwhiuk commented 6 years ago

While it's not really common to have "s in an account name we should escape them rather than prevent them.

MJ10 commented 6 years ago

@philipwhiuk I would like to work on this issue, any suggestions on how to proceed?

philipwhiuk commented 6 years ago

Checkout a copy of the code in Android Studio, investigate how we build the header section of compose screen and try and reproduce the action. Then look at how stuff gets pasted in and escape "s.

cketti commented 6 years ago

Some notes:

Still, we should accept everything as display name and do the appropriate escaping when composing a message. I don't think this is an easy issue for beginners to tackle. Email addresses are hard.

MJ10 commented 6 years ago

Thanks @philipwhiuk @cketti
I'm unable to reproduce this bug, I'll try to do that, and fix it if possible.

rancidfrog commented 6 years ago

@cketti But, k9 app uses account name when copying email address on longpress. I longpressed on my address from a mail in sent folder then pasted it in compose view. It pasted account name as name. So to reproduce issue all you have to do is temporarily change your account name to include apostraphe " . Then use k9mail longpress on your address to copy email and when you paste it will come up as " acount with " name " < email address > I came across issue when I was testing duplicate mails in sent folders. So, I sent an email to myself.

Edit: App also seems to use Account name for sent items. I.E. Copying own address from mail in sent folder by longpress results in "Account name" < email address >