ProtonMail / proton-bridge

Proton Mail Bridge application
GNU General Public License v3.0
1.18k stars 160 forks source link

Drafts made in Thunderbird are not being deleted server-side after being sent #433

Open tangodev opened 1 year ago

tangodev commented 1 year ago

Hello,

I've sent a bunch of messages today and after logging into the web interface for Mail I see that the messages are still there.

Expected Behavior

Drafts created in Thunderbird will get deleted both in Thunderbird and ProtonMail Web after being sent.

Current Behavior

Drafts created in Thunderbird get deleted from Thunderbird after being sent but remain in the Drafts folder in ProtonMail Web.

ALSO: when using identities the sender in Webmail is the default identity selected in Webmail and not the identity explicitly chosen in Thunderbird.

Possible Solution

May be related to this: https://github.com/ProtonMail/proton-bridge/issues/386

Steps to Reproduce

  1. Create a message in Thunderbird
  2. Make sure to save it instead of sending
  3. Close the mail editor window
  4. Wait for the draft to get synchronized to ProtonMail Web
  5. Open the draft in Thunderbird (enter key) and send it
  6. Confirm that the message was sent
  7. Compare: the drafts folder in Thunderbird with the drafts folder in ProtonMail Web

Version Information

OS: Kubuntu 23.04 Thunderbird: 1:115.3.1+build1-0ubuntu0.23.04.1 Bridge: v3.4.2 (br-165)

Context (Environment)

Impact: the issue makes Bridge much less reliable. Drafts are a basic feature and forcing the user to manually clean up after using it leads to a bad user experience. The server is assumed to be the single source of truth and clients follow that source. Now, other devices will keep those emails unless cleared by the user.

Detailed Description

When sending a message that was a draft, make sure the event of the drafts deletion gets replicated to the server.

LBeernaertProton commented 1 year ago

@tangodev Thank for your report, but unfortunately this is not a Bridge issue.

Thunderbird version older than 115 exhibited similar issues, where it would remove the message from the Thunderbird mailbox, but it would never send the EXPUNGE command immediately. These were usually deferred to a later moment or when you closed the application.

With Thunderbird 115, the moment when Thunderbird sends the EXPUNGE command to Bridge has increased even more, but eventually it gets sent and then we can remove the message from the Proton side. It has helped in the past to compact the mailbox to force Thunderbird to flush any pending EXPUNGE commands.

I personally use Thunderbird 115.3.2 and can not reproduce this issue. With Bridge 3.5.3 I am unable to reproduce your issue.

LBeernaertProton commented 1 year ago

Could you try with 3.5.3 and see if the situation is resolved?

tangodev commented 1 year ago

Hello,

short term

currently I'm running:

Bridge v3.5.3 (br-175) Thunderbird 1:115.3.1+build1-0ubuntu0.23.04.1 (latest my repo has at the moment)

There is no improvement. Manually compacting the Inbox in Thunderbird did delete the email from Webmail.

There is one subminor between your Thunderbird and mine, which is the only variable I see. I'll try to test on 115.3.2 and before that I'll try to enable compacting upon close.

longer term

I've read this article. It mentions one interesting thing: that Thunderbird may be moving to maildir-lite their own spin on the maildir structure.

Could this potentially solve the issue? No need for compacting implies an instant sync to the mail server.

tangodev commented 1 year ago

I've enabled

MAIL_ACCOUNT > Server Settings > Manage Storage > Clean up ("Expunge") Inbox on Exit

and this indeed does help, but only for messages moved straight from the Inbox elsewhere.

This setting does not affect messages moved from other online folders into Local Folders, so it's still not exactly what I'm looking for.

tangodev commented 1 year ago

Hello,

did you have a look at maildir @LBeernaertProton ?

If this bug is to be believed, maildir will eventually become the default storage format (currently it's definitely not production-ready).

How to enable maildir: https://support.mozilla.org/en-US/kb/maildir-thunderbird#thunderbird:linux:tb115

Any email account created from now on will use Maildir. Existing accounts will continue to use mbox.

Seeing how maildir abandons the idea of compacting, it may be the solution to this issue and a bunch of others:

https://github.com/ProtonMail/proton-bridge/issues/386 https://github.com/ProtonMail/proton-bridge/issues/434 https://github.com/ProtonMail/proton-bridge/issues/435

Could you setup a test mailbox with Thinderbird 115 set in maildir mode and try to reproduce the above issues?