Non-existent folder in PendingMoveOrCopy
Note: maybe related or duplicated with #4420 , but opening a new issue since I'm not sure.

Hello,
Thanks for working and offering k-9 mail, it's very useful piece of software.
I use the F-Droid version and recently upgraded from 5.600 to 5.700 (and then the next ones. Currently I'm using 5.703).

I use K-9 in telephone with Lineage 14 (Android 7.1.2), and I have several IMAP accounts configured.
For one of them, I'm experiencing an issue: when I mark as read a message, or I open to read it, it appears as "read" in K-9, but it seems that such status does not propagate to the server: when I refresh or obtain new mail, the messages that I've read in K-9 become "unread" again.

If I do the opposite (mark a read message as "not read"), when I refresh, the message becomes "read" again.

The same happens when I star/unstar a message.

I'm attaching a log of the action of reading several mails, and then, refreshing to receive new mail if available.

[k9-log-failure.txt](https://github.com/k9mail/k-9/files/4045387/k9-log-failure.txt)

The strange thing is that this happens only with this account (which receives dozens of mails daily). I have another account configured with much less traffic (1-2 mails each several days) and I cannot reproduce the problem in this second account. Both accounts are from the same provider (Gandi).

I have tried to uninstall K-9 and install again, and configure the account manually, but the problem persist. I have reviewed all the settings (general and account settings) to try to figure out if it was some setting by mistake, but I cannot find anything related to the issue.

Thanks!

diff --git a/app/core/src/main/java/com/fsck/k9/controller/MessagingController.java b/app/core/src/main/java/com/fsck/k9/controller/MessagingController.java
index b21b0c00d..d15b60eb5 100644
--- a/app/core/src/main/java/com/fsck/k9/controller/MessagingController.java
+++ b/app/core/src/main/java/com/fsck/k9/controller/MessagingController.java
@@ -2255,7 +2255,8 @@ public class MessagingController {
                 processPendingCommands(account);
             } else if (!syncedMessageUids.isEmpty()) {
                 if (account.getDeletePolicy() == DeletePolicy.ON_DELETE) {
-                    if (folder.equals(account.getTrashFolder()) || !backend.isDeleteMoveToTrash()) {
+                    if (!account.hasTrashFolder() || folder.equals(account.getTrashFolder()) ||
+                            !backend.isDeleteMoveToTrash()) {
                         queueDelete(account, folder, syncedMessageUids);
                     } else if (account.isMarkMessageAsReadOnDelete()) {
                         queueMoveOrCopy(account, folder, account.getTrashFolder(),
['app/core/src/main/java/com/fsck/k9/controller/MessagingController.java']