importing a EML file into a IMAP Gmail folder, you'll have a wrong date in GMAIL webmail

UNCONFIRMED
Unassigned

Status

UNCONFIRMED
7 years ago
6 years ago

People

(Reporter: intendentedelleacque, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
If you import a EML file into a IMAP Gmail folder, you'll have a wrong date in GMAIL webmail.

To be exact, it is not used the "Date" header, but the date and time of the moment you import the message.

I'm not sure that it depends from a Thunderbird bug or from a GMAIL bug; when uploading messages, the IMAP client is supposed to specify the "internal date" of the message as one of the arguments to the APPEND command. If the client omits this parameter, the server is supposed to use the current time. RFC 3501 section 6.3.11 states in part:

"If a date-time is specified, the internal date SHOULD be set in the resulting message; otherwise, the internal date of the resulting message is set to the current date and time by default."

I've tried to log the IMAP connection, but I can't see the details of APPEND command in the log file.

Comment 1

7 years ago
(In reply to intendentedelleacque from comment #0)
If you can attach the email to the bug (after removing private info), that would be helpful.
(In reply to intendentedelleacque from comment #0)
> when uploading messages, the IMAP client is supposed to specify the
> "internal date" of the message as one of the arguments to the APPEND
> command. If the client omits this parameter, the server is supposed to use
> the current time. RFC 3501 section 6.3.11 states in part:

You are correct.
As seen in bug 693353, Tb requests timestamp of Date: header as "internal date" upon APPEND for new version of DETACH'ed/DELETE'd mail. This was done by bug 521867. Bug 693353 can be called "a kind of regression" with some special IMAP servers due to bug 521867.

It may not be true when APPEND for import of mail like "import of mail by Drag&Drop of .eml to thread pane of IMAP folder".
Neeeded IMAP log is "log line for append command issued by Tb" only.
Required data is Date: header of the uploaded mail only.
(Reporter)

Comment 3

7 years ago
I can see this behaviour with GMAIL both using "import of mail by Drag&Drop of .eml to thread pane" and using my extension ImportExportTools.

ImportExportTools uses nsIMsgCopyService.CopyFileMessage (and I guess that Drag&Drop uses it too).

But according to https://bug521867.bugzilla.mozilla.org/attachment.cgi?id=406525 , CopyFileMessage is setting the INTERNALDATE for APPEND correctly, isn't it? 
Does this mean that GMAIL server behaviour is wrong?

If you need some logs about it, tell me how I can have them in a useful form; with "export NSPR_LOG_MODULES=all:5" I can see that everything seems sent properly and the server response is  

14 OK [APPENDUID 2 274] (Success)

but the date shown in webmail is wrong.
Note that wrong date is just on GMAIL IMAP thread pane, but not when you open the message.
(In reply to intendentedelleacque from comment #3)
> I can see this behaviour with GMAIL both using "import of mail by Drag&Drop
> of .eml to thread pane" and using my extension ImportExportTools.
> ImportExportTools uses nsIMsgCopyService.CopyFileMessage (and I guess that
> Drag&Drop uses it too).
> But according to
> https://bug521867.bugzilla.mozilla.org/attachment.cgi?id=406525 ,
> CopyFileMessage is setting the INTERNALDATE for APPEND correctly, isn't it? 
> Does this mean that GMAIL server behaviour is wrong?

I don't know well about it, so I requested you to provide IMAP log data which shows us actual behavior of Tb in your environment.

> 14 OK [APPENDUID 2 274] (Success)

I never requested "append command response from server". I simply requested you to show us Tb's IMAP log for "append command issued by Tb upon upload" in which "internal date" is placed if Tb requested it upon append.
(Reporter)

Comment 5

7 years ago
Created attachment 617304 [details]
log with upload of an EML file into a GMAIL imap server
(In reply to intendentedelleacque from comment #5)
> Created attachment 617304 [details]
> log with upload of an EML file into a GMAIL imap server

I could see following log only by search for "append" in your log.
> -1305556112[99054f80]: 99064800:imap.gmail.com:S-INBOX:ProcessCurrentURL:imap://qqq%40gmail%2Ecom@imap.gmail.com:993/appendmsgfromfile%3E/INBOX:  = currentUrl
> -1305556112[99054f80]: 99064800:imap.gmail.com:S-INBOX:SendData: 14 append "INBOX" (\Seen) {1959}
> -1305556112[99054f80]: 99064800:imap.gmail.com:S-INBOX:CreateNewLineFromSocket: 14 OK [APPENDUID 2 274] (Success)

It looks Tb doesn't request "internal date" based Date: header upon append to upload mail data.
It explains phenomenon you observed.

What's wrong in current Tb's ehaviour?
What should Tb do when bug 693353 happens?

Updated

6 years ago
Component: General → Untriaged
You need to log in before you can comment on or make changes to this bug.