Extended-Thunder / send-later

Schedule messages to be sent at a specific time.
Mozilla Public License 2.0
123 stars 17 forks source link

X-Send-Later-At header is lost with Proton Mail Bridge #586

Open jikamens opened 1 year ago

jikamens commented 1 year ago

A user reports to me via email:

I am running TB 102.14.0 on Linux Mint. Send Later is version 9.3.0 dated 09 August 2023.

My email accounts are on 3 different servers - [elided for privacy], [elided for privacy] and ProtonMail. I suppose they all have their own oddities as they implement IMAP. I generally keep all my mail, including Drafts, on the servers for accessibility. This particular issue seems to be somehow unique to the Proton account.

As a quick test, I created a draft just now to be sent tomorrow and saved it (using the "Send at ..." button) on the Proton server account. It showed on the server correctly [correct Send Later header].

Next, I went to the draft email and edited it. When saving, the correct "Send at" date/time was displayed. The draft was saved to the server again. However, when looking at the drafts after the edit the send date and time were no longer present:

It's going to be a challenge for me to troubleshoot this since I don't have a paid Proton Mail account and Proton Mail Bridge only works with paid accounts, but I'm going to see what I can do.

jikamens commented 1 year ago

I got the logs from the user experiencing this issue and confirmed that this is a Proton Mail bug. Thunderbird is correctly including the X-Send-Later- headers in drafts when they are uploaded to Proton Mail, but when Thunderbird subsequently asks Proton Mail for the headers of scheduled drafts, it is excluding the X-Send-Later- headers from the headers it sends back.

I've notified Proton about this issue, though I can't imagine it's going to be fixed quickly.

In the meantime the only workaround I can recommend is to store the drafts locally as described in the user guide.

jikamens commented 1 year ago

Possible workaround for this issue, which would also work for people who run into this problem with the IMAP server built into Microsoft Exchange: offer the user the option, configurable on a per-account basis, to store Send Later metadata in local storage instead of in message headers.

I asked on the addons list about how to do that, specifically what unique key I could use, and got back this response: from @jobisoft:

one way to store data per message is to build a tuple of headerMessageId and folder path (because headerMessageIds are not unique). It is not ideal, because the folder path could be changed on a remote client by moving the file from one folder to another one. If you just use the headerMessageId as identifier, you may end up with multiple messages being connected to the same saved data.