Open Bug 1563665 Opened 5 months ago Updated Last month

Replied mails are not marked as "replied" if the folder has a comma (,) in its substance file name

Categories

(Thunderbird :: Folder and Message Lists, defect)

Unspecified
Windows
defect
Not set

Tracking

(Not tracked)

People

(Reporter: yuki, Assigned: gds)

Details

Attachments

(1 file)

When I create and send a reply for an existing message, the original message is generally marked as "replied". However, the mark doesn't appear if the original message is placed in folders having a character "," in its local file name.

Steps to reproduce

  1. Prepare an IMAP account.
  2. Create a folder with name "comma,comma" under the IMAP account.
  3. Put a message to the folder "comma,comma".
  4. Reply to the message in the folder.

Actual result

The message has no mark in the thread pane.

Expected result

The message has a "replied" mark in the thread pane.

Environment

  • Windows 10 1809
  • Thunderbird 60.7.2 (32bit) (Build ID: 20190620083217)
  • Daily 69.0a1 (32bit) (Build ID 20190704092729)

Additional info

This problem also appears when the folder's substance file has , in its name as an UTF-7 encoded string. For example &U,BTFw-. This is an the encoded version of 台北 (Taipei, a city in Taiwan)

We know where Taipei is but you should note that IMAP uses MUTF-7, M for modified ;-)

Does this happen on an local folder? If so, it would be some reply processing that has gone wrong, otherwise, it's an IMAP issue.

I bet we send an IMAP command with a comma-separated list of folders, so if one folder has a comma in it's name, that's interpreted as two folders :-(

Flags: needinfo?(gds)

I can create a folder called com,com and it seems to work ok. The .msf file is valid and is com,com.msf. But the reporter is correct, when you reply to a message in folder com,com, you get no reply marker for some reason. I was able to see the reply mark on only a gmail account when I replied to a copy of a message in folder com,com in folder com. Then when I went back to com,com I see the marker. This is probably because gmail treats copies of message as labels and not as new messages unlike other servers. But on non-gmail, I never see the reply marker even after a tb restart. I need to look closer at this.

Flags: needinfo?(gds)

In nsMsgCompose.cpp nsMsgCompose::ProcessReplyFlags(), it handles multiple uri's in a while loop and assumes they are delimited with commas. Therefore, the uri with "com,com" as the folder gets split at the comma resulting in an invalid uri that fails when GetMsgDBHdrFromURI() is called and returns at the NS_ENSURE_SUCCESS() at line 3148. This cause the store of the \Answered imap flag to never be set by the imap protocol code.

At this time, I don't know what the solution is. It seems like everywhere else a folder name with a comma works OK. Can there really be more than one reply at a time? If so, maybe the delimiter should be something other than a comma, but what?

Edit: Here's where the error occurs: https://searchfox.org/comm-central/rev/493d9f10ec1cf52cec804decffecc74d32326123/mailnews/compose/src/nsMsgCompose.cpp#3145

Attached patch comma-fix.diffSplinter Review

Here's a proposed fix for this I did a few months ago and had forgotten about. I don't remember the details but I think it works and handles URLs that start with mail-message:// or imap-message:// that occur in the string.
(Uses "stone age" string functions :)).
Anyhow, saving my work here for future testing and work.

Assignee: nobody → gds
You need to log in before you can comment on or make changes to this bug.