ProtonMail / proton-bridge

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

Bridge corrupts inbox when spam is moved by spam filter or mail is deleted from "All Mail" #62

Closed kortschak closed 3 years ago

kortschak commented 4 years ago

There are three behaviours here that are likely due to the same underlying issue, so this is reported as a single bug.

Expected Behavior

  1. Deleting mail from "Spam" or "All Mail" using the bridge should leave the inbox in a usable state,
  2. mail deleted from the inbox should not remain in "All Mail", and
  3. mail in "All Mail" should be findable in other folders.

Current Behavior

  1. If mail is filtered as spam it is moved to "Spam". The way that this is done leaves an inconsistency in the state of the inbox according to the bridge that causes an error when trying to delete any item from another folder in the inbox.

    On attempting to delete an item when an item has been filtered to spam an error, "Error syncing changes: mailbox 4 does not exist" is reported. This can only be cleared by using the web client to purge the "Spam" folder.

    In the broken state I get the following error:

    Failed to refresh folder "<user>@protonmail.com : Trash”.
    
    The reported error was “Error syncing changes: mailbox 4 does not exist”.

    then when navigating away from the trash folder,

    Error while Storing folder “Trash”.
    
    Error syncing changes: mailbox 4 does not exist

    From this point on, evolution will not sync to the server until the web client clears the "Spam" folder.

  2. Occasionally, mail remains in the "All Mail" folder. This is visible both in the local client and with the web client (result shown in 3. in image below). Attempting to delete emails that are in "All Mail" in this state results in errors being reported by the local client when navigating to the "Trash" folder.

    Error while Storing folder “All Mail”.
    
    Unable to move deleted messages: Error moving messages: Label does not exist
  3. In the case where emails have been deleted but remail in "All Mail" they are clearly not present in any other location.

    borked

Steps to Reproduce

  1. Install ProtonMail Bridge and set up for use with evolution mail client.

  2. Spam issue

    1. Receive spam.
    2. Attempt to delete email from another location (say "Inbox").
    3. See error.
  3. All Mail issue

    1. Delete mail from "All Mail".
    2. Navigate to to "Trash".
    3. See error.

Context (Environment)

This fundamentally breaks the utility of having a local desktop client since a web client must be available to clean up after the bridge's corruption.

~ $ lsb_release -d
Description:    Ubuntu 18.04.4 LTS
~ $ dpkg -l evolution protonmail-bridge 
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                 Version         Architecture    Description
+++-====================-===============-===============-=============================================
ii  evolution            3.28.5-0ubuntu0 amd64           groupware suite with mail client and organize
ii  protonmail-bridge    1.2.7-1         amd64           ProtonMail Bridge

Additional information

I have an analysis from one of the devs of evolutions quoted here:

[imapx:A] I/O: 'A00226 SELECT Spam' [imapx:A] I/O: ' OK [UIDNEXT 14] Predicted next UID' [imapx:A] I/O: ' OK [UIDVALIDITY 4] UIDs valid' [imapx:A] I/O: ' FLAGS ()' [imapx:A] I/O: ' OK [PERMANENTFLAGS (\Seen \SEEN \Flagged \FLAGGED \Deleted \DELETED \Draft \DRAFT $junk junk nonjunk)] Flags permitted.' [imapx:A] I/O: ' 3 EXISTS' [imapx:A] I/O: ' 0 RECENT' [imapx:A] I/O: ' OK [UNSEEN 1] ' [imapx:A] I/O: 'A00226 OK [READ-WRITE] SELECT completed' ... [imapx:A] I/O: 'A00237 UID MOVE 3647 Spam' [imapx:A] I/O: ' 3182 FETCH (FLAGS ($junk junk) UID 3647)' [imapx:A] I/O: ' 3183 EXISTS' [imapx:A] I/O: ' OK [UNSEEN 4] ' [imapx:A] I/O: 'A00237 NO Label does not exist'

the above shows that the 'Spam' folder can be selected, but one cannot move messages into it. Is it auto-populated by the server with the Junk flag? Maybe it is a server-side virtual folder.

[imapx:A] I/O: 'A00270 UID MOVE 13 Trash' [imapx:A] I/O: '* 3 EXPUNGE' [imapx:A] I/O: 'A00270 OK [COPYUID 4 13 453] COPY completed'

This successfully moves a message to Trash folder on connect 'A'. Meanwhile had been made connection 'B' (and 'C').

[imapx:B] I/O: 'B00271 SELECT Trash' [imapx:B] I/O: ' 3182 FETCH (FLAGS (\Seen nonjunk) UID 3647)' [imapx:B] I/O: ' 3183 EXISTS' [imapx:B] I/O: ' OK [UNSEEN 3] ' [imapx:B] I/O: ' OK [UNSEEN 0] ' [imapx:B] I/O: ' OK [UIDNEXT 454] Predicted next UID' [imapx:B] I/O: ' OK [UIDVALIDITY 4] UIDs valid' [imapx:B] I/O: ' FLAGS ()' [imapx:B] I/O: ' OK [PERMANENTFLAGS (\Seen \SEEN \Flagged \FLAGGED \Deleted \DELETED \Draft \DRAFT $junk junk nonjunk)] Flags permitted.' [imapx:B] I/O: ' 1 EXISTS' [imapx:B] I/O: ' 0 RECENT' [imapx:B] I/O: 'B00271 OK [READ-WRITE] SELECT completed'

The connection 'B' has selected the Trash folder now.

[imapx:B] I/O: 'B00278 UID STORE 453 -FLAGS.SILENT (\DELETED)' [imapx:B] I/O: 'B00278 OK UID STORE completed' [imapx:B] I/O: 'B00280 UID STORE 453 -FLAGS.SILENT (JUNK)' [imapx:B] I/O: 'B00280 NO mailbox 4 does not exist'

IMAPx wants to unset \Deleted and Junk flags on the just moved message, because it's in the Trash folder, where the \Deleted flag doesn't make much sense. It succeeded with the \Deleted flag, but failed with the Junk flag.

It seems to me that the server treats the Spam and Trash folders very specifically, the same as the Junk flag. Why it errors out this way might be a question for them.

With respect of the real versus virtual Trash/Junk folders, unless the server forces subscription of these folders you can check "Show only subscribed folders" option in the account Properties->Receiving Options tab (which is unchecked by default), and it'll show you only subscribed folders. Which they are can be seen in Folder->Subscriptions for that account.

I didn't get whether using virtual trash/junk behaves properly for the Trash/Spam sever-side folders or not. If it does weird things, then rather stay with the real folders. I'd definitely try to contact them and ask them about these errors. Feel free to use my text from above, which may or may not help them from the technical point of view.

Maybe there are IMAP clients not showing these errors, but I'd be afraid that such clients just hide these errors from the user, pretending everything worked fine. Of course, I cannot tell for sure unless having similar communication log. There's always a chance that the IMAPx provide does something wrong.

exander77 commented 4 years ago

I have already reported this. I think this is related to All Mail containing Spam and Trash.

All Mail should never contain Trash. As when you delete email from All Mail, it goes to Trash and as Trash is part of All Mail it pops again. Which really fucks email clients.

It has different repercussions in different clients. But can even rekt the Bridge itself as mail client will get into some strange states.

ProtonMail is lying, it says the mail was deleted from All Mail, but actually wasn't as Trash is also a part of All Mail.

I have already reported it months ago.

It is also related to this: https://github.com/ProtonMail/proton-bridge/issues/25

kortschak commented 4 years ago

I think this is related to All Mail containing Spam and Trash.

I don't think this is the case. It is possible for this broken state to exist with an empty "Trash" (at least the "Spam"-related problem). The other issue where items exist in "All Mail" but nowhere else can happen when the "Trash" is empty.

exander77 commented 4 years ago

I think this is related to All Mail containing Spam and Trash.

I don't think this is the case. It is possible for this broken state to exist with an empty "Trash" (at least the "Spam"-related problem). The other issue where items exist in "All Mail" but nowhere else can happen when the "Trash" is empty.

I wonder if mail clients do not expect specific behaviour for Spam folders as well. I have not found a system where Spam is in All Mail (expect ProtonMail).

horejsek commented 4 years ago

Thanks for the report. We truly have an issue with moving messages to Spam folder. We noticed this problem two weeks ago and we are working on it (internal issue GODT-409).

But you cannot remove anything form All Mail, neither you can add to it. All Mail is not mailbox, it's virtual one, and it contains all messages. This is not bug, this is how All Mail behaves in all ProtonMail clients.

Also, ideally, message should not be only in All Mail mailbox (PM clients do not allow that in general). But it's not forbidden on the server and it can happen, usually with Bridge in situation when message is in Folder A only and user moves it from there to All Mail; resulting message exists in All Mail only. It's not clear what is the best behaviour and we have an issue in backlog, about reevaluating UX of all possible moves by the client.

exander77 commented 4 years ago

But you cannot remove anything form All Mail, neither you can add to it. All Mail is not mailbox, it's virtual one, and it contains all messages. This is not bug, this is how All Mail behaves in all ProtonMail clients.

It is from the perspective of the mail clients. This is why it should not contain Trash and Spam.

The standard workflow is to go to All Mail and clear your mailbox, but in case of ProtonMail, both mail clients and then Bridge will collapse under this nonstandard behavior. When I removed 10 thousand emails from All Mail and they started popping again. I completely ruined my ThunderBird profile and had to even remove Bridge cache.

Please remove Trash and Spam from All Mail.

kortschak commented 4 years ago

We truly have an issue with moving messages to Spam folder. We noticed this problem two weeks ago and we are working on it (internal issue GODT-409).

I filed support issues related to this in March (using RFC 1149 internally?).

But you cannot remove anything form All Mail, neither you can add to it. All Mail is not mailbox, it's virtual one, and it contains all messages. This is not bug, this is how All Mail behaves in all ProtonMail clients.

OK. So if you have this constraint on the box, can you

  1. communicate to the client that this is the case (or at the very least ignore mutations to it sent via the bridge), and
  2. ensure that updates to real mail boxes are reflected in "All Mail"; I wouldn't need to touch "All Mail" if it held sane invariants.

Given that I can delete messages from the box, I'd say that there is actually a bug. That they are there in the first place while not anywhere else, also a bug.

Also, ideally, message should not be only in All Mail mailbox (PM clients do not allow that in general).

I'd go further and unless you're working under an eventual consistency model (which I don't think you are, since these messages that exist only in "All Mail" can persist for days) this is a situation of a requirement for correctness.

But it's not forbidden on the server and it can happen, usually with Bridge in situation when message is in Folder A only and user moves it from there to All Mail;

This happens to me on a probably daily basis when I delete mails from my inbox, they persist in "All Mail". This doesn't seem like an unusual use case to me.

resulting message exists in All Mail only. It's not clear what is the best behaviour and we have an issue in backlog, about reevaluating UX of all possible moves by the client.

I'd say that deletion would reasonably be expected to result in deletion of a mail from all places.

horejsek commented 4 years ago

Given that I can delete messages from the box, I'd say that there is actually a bug.

Not really, you cannot. Message is not deleted. Bridge ignores the request. Question is, though, whether Bridge should respond OK or BAD. We do OK now and we want to reevaluate it. It's not that easy to say what is better to do. Clients expect standard IMAP server and we are not standard IMAP server at all. We are constantly finding balanc between IMAP RFC, what clients really expect and how other PM clients work.

This happens to me on a probably daily basis when I delete mails from my inbox, they persist in "All Mail".

I'd say that deletion would reasonably be expected to result in deletion of a mail from all places.

Message deleted from any mailbox (but Trash or Spam) is moved to Trash, and All Mail includes also messages from Trash. Only message deleted from Trash or Spam (in case the message is not in any other mailbox) is permanently deleted (and thus removed from All Mail).

kortschak commented 4 years ago

Message deleted from any mailbox (but Trash or Spam) is moved to Trash, and All Mail includes also messages from Trash. Only message deleted from Trash or Spam (in case the message is not in any other mailbox) is permanently deleted (and thus removed from All Mail).

This is not the behaviour I see. When I delete messages (move to trash and then empty trash) there regularly persist messages that should not exist on the server; they were in the set of messages that were moved to trash and then the trash was purged. If you choose an alternative definition of delete (only move to trash), then sure, your argument holds, but I didn't write "When I move message to the trash I still see them in the All Mail folder", I wrote "when I delete mail from my inbox" (connoting the entire process).

exander77 commented 4 years ago

Not really, you cannot. Message is not deleted. Bridge ignores the request. Question is, though, whether Bridge should respond OK or BAD. We do OK now and we want to reevaluate it. It's not that easy to say what is better to do. Clients expect standard IMAP server and we are not standard IMAP server at all. We are constantly finding balanc between IMAP RFC, what clients really expect and how other PM clients work.

Nonsense. If the Bridge says OK, the message was deleted from the perspective of the mail client. If Bridge doesn't delete it, then it is a bug. You wonder why is Bridge so bad? It is because it lies. And this fucks with the mail client big time. I debugged communication with Bridge and it says OK. Do you imagine how this fucks mail client when it says 10k messages were deleted, but they were not? Are the responses from Bridge a joke?

**1. Deleting messages from All Mail should move them to Trash.

  1. Deleting messages from Trash should delete them permanently.
  2. Deleting messages from Spam should delete them permanently.
  3. All Mail should not contain Trash or Spam.**

Is it understood?

horejsek commented 4 years ago

I wrote "when I delete mail from my inbox" (connoting the entire process).

OK, that was not clear. Yeah, if you say that you delete message from Trash and it's still only in All Mail, there is something odd. That shouldn't happen. We will look into it.

exander77 commented 4 years ago

OK, that was not clear. Yeah, if you say that you delete message from Trash and it's still only in All Mail, there is something odd. That shouldn't happen. We will look into it.

This just shows, why you don't include Trash in All Mail. You are making simple things extremely complicated. And breaking the expected behaviour of both users and mail clients.

kortschak commented 4 years ago

@horejsek To demonstrate this behaviour this is the current number of messages in my non-zero folders (Trash is emptied).

But, All Mail has 5196. So there are 39 messages that are in All Mail that are not anywhere else. By marking the three folders' messages as all unread, I can see which messages in All Mail are orphaned. The earliest of these dates back to mid February.

horejsek commented 4 years ago

And you are sure that it happened by deleting messages from the Trash? Having messages in All Mail only does not mean it's a bug. We want to avoid it soon, but so far it's a valid situation (it can happen, for example, by moving message from folder to All Mail). The problem is if the message was in the Trash only, you deleted that message from there, and message was not deleted but stayed in All Mail.

kortschak commented 4 years ago

I don't move messages to All Mail.

The problem is if the message was in the Trash only, you deleted that message from there, and message was not deleted but stayed in All Mail.

I honestly don't understand this scenario.

exander77 commented 4 years ago

Having messages in All Mail and nowhere else does seem ok to me. But it should not happen by removing messages from Trash.

This, for example, happens when you move your messages between IMAP accounts. When you select messages from for example one INBOX and move them into another INBOX (in a different IMAP account), emails should be removed from the original INBOX, but should stay in All Main on the original IMAP account.

Moving emails should never delete them from the IMAP account.

kortschak commented 4 years ago

Moving emails should never delete them from the IMAP account.

I don't think this is true; a move can and often is implemented as a copy and then delete.

exander77 commented 4 years ago

I expanded the list to accommodate this: **1. Deleting messages from All Mail should move them to Trash.

  1. Deleting messages from Trash should delete them permanently.
  2. Deleting messages from Spam should delete them permanently.
  3. All Mail should not contain Trash or Spam.
  4. The only time a message is deleted is when it is deleted from Trash or Spam. Moving a message should never delete it.**
exander77 commented 4 years ago

Moving emails should never delete them from the IMAP account.

I don't think this is true; a move can and often is implemented as a copy and then delete.

Have you ever encountered such behavior on IMAP? I have tested this both with Gmail and Office 365. Moving never deletes messages. You have to take into account that the other IMAP server is third party system and you should always treat the third party as hostile.

kortschak commented 4 years ago

It's in the spec. MOVE is an extension that is in the normal situation implemented via a copy and delete.

exander77 commented 4 years ago

The RFC talks about the situation on a single server. And even in that case, the message should not be deleted (end result).

bartbutler commented 4 years ago

I recall Outlook does this, at least older versions (move via APPEND and DELETE). And in some cases the order was reversed (DELETE then APPEND), which is absurd as it can result in data loss.

kortschak commented 4 years ago

Indeed.

exander77 commented 4 years ago

It is dangerous to do shenanigans with emails. I am not sure if it is always the case, but from what I have seen, it is a good practice to not delete emails unless they were deleted.

My emails were actually saved by Gmail when I moved 500 emails to ProtonMail and it shredded them because Google preserved them in All Mail. Treat every third party hostile is a great practice.

kortschak commented 4 years ago

@exander77 this argument extended to its logical conclusion says that mv across fs boundaries should not delete the originals. If you are concerned about this kind of data loss, do a copy, verify the copy was correctly performed and then delete the originals. Moving things has well established semantics that are grounded in real world behaviours; moving an object in the real world does not leave a copy in the original location.

exander77 commented 4 years ago

@kortschak It does not actually if you are talking about the filesystems of the single system. This is not third party as you control both directly.

If we are talking about movement between the local filesystem and third party, for example, ssh, guess if scp has a move option? No, it does not, and there is no smv. Want some others... ftp, sftp comes to mind... no move. Btw scp can copy between two remote servers as well.

There are special cases like rsync which is a specialized tool that can do anything. Or if you mount a remote filesystem making it effectively local.

Also, I would advise against moving data on locally mounted Samba. I have lost data when the filesystem on the Samba server was full and Samba reported success and mv removed original files from the local filesystem.

kortschak commented 4 years ago

It does not actually if you are talking about the filesystems of the single system. This is not third party as you control both directly.

I'm not sure what you mean here, but it is the case that mv has different implementations depending on whether the src and dst are on the same filesystem. If they are on the same filesystem the operation is merely a change of path within the directory entry (rename(2)) changing parent ownership if necessary. If the dst is on a different filesystem device of the same system, the operation is a copy followed by a delete (see for example the freebsd man page for mv.

The business around scp is not relevant since that is a copy and not a move.

I don't touch samba if I can avoid it.

exander77 commented 4 years ago

I'm not sure what you mean here, but it is the case that mv has different implementations depending on whether the src and dst are on the same filesystem.

I meant that this is not a third party if all filesystems you move between are in the single system.

Two IMAP servers are two completely separate remote systems. SCP is the closest example I can think of as this can actually copy between two remote systems.

kortschak commented 4 years ago

That's not relevant; the discussion is about moving things, not copying things. That two separate file systems are on a single system is also irrelevant. The issue is whether a move requires a copy. In the case that it does then obviously a copy is required, but, the behaviour of a move should in that case match the behaviour of a move when it is not the case to prevent surprising behaviour for the user. This is the fundamental semantics of move; which, as I said before reflect the notion of moving things in the real world. If you want to ensure that a move is safe where there is an underlying copy required, do a copy, check and then delete. This is independent of whether the copy is from one device on a system to another on the same system or from one system to another on the other side of the world.

bartbutler commented 4 years ago

Yep, exactly, and most email clients do this safely. Unfortunately, some don't.

exander77 commented 4 years ago

@kortschak I am not disputing what move does. I agree with you. But this is superseded by treating third parties hostile. This is not about the move, this is about third parties.

exander77 commented 4 years ago

@bartbutler https://github.com/ProtonMail/proton-bridge/issues/2

Enough said.

exander77 commented 4 years ago

@bartbutler I am really not sure if you understand, that ProtonMail shredded 500 of my emails when moved using ProtonBridge, because it reported them successfully transferred.

Mail clients can't do anything except to try to download each mail again to be sure. I would be really interested to see a mail client which does that. Could you point me to such a mail client? Does even ProtonMail import tool that?

The Bridge is a hostile third party.

kortschak commented 4 years ago

As a further data point. I just had a replay of the "All Mail" issue in the OP. This happened because there was spam in the "Spam" folder when I deleted a message in the "Inbos", so when I deleted the message that found its way into being an orphan in "All Mail", the client believed the delete succeeded and removed from the client's view of the "Inbox" but for reasons that are presumably the basis for this issue, the message was not deleted, remaining in "All Mail". This supports my previous suspicion that these two issues are tightly coupled though present because of a confluence of bad behaviours:

  1. spam is not correctly handled in moves by the bridge
  2. success is not properly reported to clients allowing them to get into inconsistent states (this agrees with what the evolution dev wrote, quoted in the OP)
exander77 commented 4 years ago

@kortschak This sounds extremely similar to my problem when I deleted a lot of emails from All Mail and Bridge reported it succeeded, mail client removed them locally and they started popping back again.

All of these boils down to Bridge not reporting correct information about operation success or failure. This also relates to my 500 email loss. When Bridge incorrectly reported mails were successfully appended but were actually shredded.

kortschak commented 4 years ago

All of these boils down to Bridge not reporting correct information about operation success or failure.

Agreed.

bartbutler commented 4 years ago

I agree, the bridge should handle these scenarios such that if an operation fails it either explicitly errors out or, if there's a good reason to report success, it also simulates whatever server-side mailbox changes are necessary to reach the correct final state in the clients.

exander77 commented 4 years ago

I agree, the bridge should handle these scenarios such that if an operation fails it either explicitly errors out or, if there's a good reason to report success, it also simulates whatever server-side mailbox changes are necessary to reach the correct final state in the clients.

I see a problem here that this is hard to solve when All Mail contains Trash and Spam.

What to do when somebody deletes mail from All Mail? If you delete it and report success, it is actually not true as it stays in the All Mail and is added to Trash. When you add mail to Trash and report it failed, then users will be confused that operation actually succeded and mail is in Trash.

You can bypass Trash and delete it completely which seems unsafe. Or you can disallow all operations on All Mail which is extremely inconvenient.

This is why you don't include Trash and Spam in All Mail.

It gets even more complicated when I move mails from All Mail to some other mailbox. Does it fail or succeed? What about moving it from All Mail to Trash?

exander77 commented 4 years ago

Btw, these wrong reportings also affects Web UI as I have already reported. If I move an email to Sent, it shows success, I even see the mail disappearing, but it is not actually moved... still not fixed. This affects many folder combinations.

This could lead to huge email loss. When somebody moves emails, see them gone, refreshes, they are back, then deletes them, because he thinks he copied them... people lost emails because of this. I would guess many.

kortschak commented 4 years ago

Yes, I've seen this behaviour in the web client as well. An example of this is purging the "Spam" folder (which I need to do via the web client because of #62). More often than not, while the items are immediately removed from the message list pane, the count of messages in the folder list does not update for up to minutes and sometimes navigating away from the folder and back sees them present again. This seems like a symptom of presentation of inter-server consistency in the PM back end.

In the desktop client I see emails come and go or change state from read to unread and back too. This seems like a cache consistency issue though possibly also due to the reason above.

exander77 commented 4 years ago

@kortschak In the case, I am mentioning they will never actually move.

It seems that you cannot move to: Inbox -> Sent Sent -> Inbox Sent -> Draft Draft -> Sent Inbox -> Draft Draft -> Inbox Sent -> Starred (does not stare) Inbox -> Starred (does not stare)

You can move to: Sent -> Spam

When you move to: Spam -> Sent it ends up in Inbox... unless it was originally in Sent, then it is vice versa.

Everything is reported as a success... I am not sure what to make of it. It seems like everything succeeds in Web UI. And mails are either incoming or outgoing. Incoming can never be in outgoing and vice versa. But Spam and Trash are for both? And also drafts are separate.

Btw, all of my imported mail is "incoming".

I am sincerely disturbed by ProtonMail a lot. Hence I am reinforced into thinking everything is hostile... well because it is.

horejsek commented 4 years ago

Some summary:

We know about issue with Spam folder and we have fix ready to go to QA.

We know that UX of what users could expect is not ideal. The problem is, everyone is used to something else, and each client is doing something else. There is no perfect solution, only good enough which will always have downsides. We have already in QA change forbidding moves to or from All Mail and we are already looking into if responding BAD instead OK for deletion from All Mail results in better experience.

We cannot change what clients do during move. There is MOVE extension working only for operation in one account, but Outlook, for example, is not using MOVE and does COPY+DELETE instead. And all clients does the same thing when moving from one provider to other. Problem is, sometimes clients do not wait till COPY succeeds and do DELETE too soon. No one should use move operation in client because it's dangerous no matter what provider is used. You should always do copy to be sure.

Having Spam or Trash in All Mail is not bridge specific, and is not causing the issues mentioned here.

exander77 commented 4 years ago

@horejsek

So, instead of fixing the issues, you are going to block all operations on All Mail? What happens when I am migrating my emails to ProtonMail and there are emails which are only present in All Mail? Will you shred them? Usually, migration of emails is done in a way that you migrate All Mail folder first. How will that work with Proton Bridge?

I am again horrified.

Having Spam or Trash in All Mail is not bridge specific, and is not causing the issues mentioned here.

It does cause issues and is a problem.

I had reported issues 4 months ago which prevents me from migrating emails to ProtonMail. I pay Gmail for the whole time with the hope I will be able to migrate my emails properly. And now I see, you want to break the functionality which is ok, because you can't fix the real issue?

This sounds a lot like your duplicate email turn email shredding fix: https://github.com/ProtonMail/proton-bridge/issues/2

exander77 commented 4 years ago

Also, how would you delete emails which are only present in All Mail? You will be stuck with them for eternity? How would you easily erase all emails in your mailbox when you can't delete them from All Mail? Go folder by folder?

kortschak commented 4 years ago

We have already in QA change forbidding moves to or from All Mail

I'm concerned about this. It seems to leave people in a situation where mail that has due to incorrect communication ended up orphaned in "All Mail". Do you have a proposal for how to deal with these cases under this model?

kortschak commented 4 years ago

No one should use move operation in client because it's dangerous no matter what provider is used. You should always do copy to be sure.

This is not a properly engineered solution. Having an existing feature that people are in the common practice of using but need to know not to because it might erase their data is fundamentally unsafe. Ren and Stimpy did a documentary on it.

exander77 commented 4 years ago

@kortschak I think you could possibly copy it to INBOX and then delete it. As copying would not create a duplicate.

But otherwise, it is just bollocks. This is bollocks staking. Taking an existing load of bollocks and putting another load on top of that is not how you properly solve problems.

exander77 commented 4 years ago

@kortschak I think you could possibly copy it to INBOX and then delete it. As copying would not create a duplicate.

Anyone else thinking, this is insane?

horejsek commented 4 years ago

@kortschak You cannot add or remove message (which is already in PM; migration from other provider is different situation) to or from All Mail already now. All Mail cannot be changed, it's view over all messages of every mailbox.

Why Bridge allows clients to think operation passed and does nothing anyway? Because, for example, move operation would fail, thus confusing client. That's why we thought being silent is better option. We got several reports about it, so we are testing the other way around. It will clearly report to clients that the operation is not allowed but move will be not allowed.

But you can still copy the message to any other mailbox you want. This is, of course, allowed now and will be also in future versions. The change is just about what Bridge responses to clients.

kortschak commented 4 years ago

@kortschak You cannot add or remove message to or from All Mail already now. All Mail cannot be changed, it's view over all messages of every mailbox.

This is fundamentally not true. I just went to my "All Mail" and deleted an orphaned message (one of those that I noted above) using my desktop client via the bridge. The desktop client behaved as though it succeeded (which I take with a grain of salt because of problems with the bridge like this issue), but further this deletion was also reflected in the view of "All Mail" through the web client. So, it's not just that the desktop client thinks this is reality erroneously, it is reality.

Why Bridge allows clients to think operation passed and does nothing anyway? Because, for example, move operation would fail, thus confusing client. That's why we thought being silent is better option. We got several reports about it, so we are testing the other way around. It will clearly report to clients that the operation is not allowed but move will be not allowed.

This is appalling. Software engineering is not about the happy path. Silently accepting failures is terrible behaviour.

exander77 commented 4 years ago

@horejsek Bullshit. It works with copying messages to All Mail as well. I have done my migration like that and just retested, that I can import mail in All Mail. It shows an email without any folder icon in Web UI and is present in just All Mail.

Screenshot_2020-07-29_11-18-01

Wtf is going on in ProtonMail? Who are you? Can We get some Head of Development here? This is such gross incompetence.

This is truly unbelievable what I read here.

If you remove or limit the ability to modify All Mail in any way, I am leaving this service and requesting my money back. Enough is enough.