The behavior changed after last release.
When a message is moved to the Trash, it is moved to the Trash locally and on the server. If a sync is issued on that folder, then the local Trash will reflect the changes of the server, including any recently moved messages.
The messages are being moved to the Trash, but when it is synchronized with the server, it is duplicating the messages locally. Then when the delete is issued from the server side and a subsequent sync happens on the Trash folder, the remote duplicates are removed, but the local duplicates remain. The server has no reference to the messages in the Trash, and as far as it knows, it is empty. However, K9 believes there are messages in the Trash folder. Repeated sync's do not remove them. Clearing messages locally will remove the duplicate messages.
K-9 Mail version:
5.600
Android version:
8.1.0
Account type (IMAP, POP3, WebDAV/Exchange):
IMAP
Can you please record a debug log while deleting a message. See https://github.com/k9mail/k-9/wiki/LoggingErrors
Deleting a message in K-9 Mail first moves the message to the local trash folder. But as soon as the server command to move the message completes, the local message should be updated to point to the remote message in the Trash folder. From your description it sounds like the last step doesn't happen in your setup.
This is happening to me as well. It is happening with two IMAP accounts just as described above. It only began doing this after the most recent update. If a log has not been provided already, I will try and generate one later this week when I am at my main laptop.
Also, when messages are deleted from local trash, they are not deleted from the server.
Steps to reproduce
Delete message via K9
Sync Trash folder
Empty Trash via K9
Sync Trash folder
Messages are still in the Trash folder when accessing via webmail
Clear Trash via Webmail
Messages are gone
Environment
K-9 Mail version:
5.600
Android version:
8.0.0
Account type:
IMAP
I am having issues retrieving the log from my personal system, and I do not wish to install the Android SDK onto my work computer. @CueHD if you could provide a log before I can figure out how to extract one, then please beat me to it. 😀
Delete msg commond:
UID COPY 1465203373 "Trash"
UID STORE 1465203373 +FLAGS.SILENT (\Deleted)
delete succuess,but when sync:
09-28 16:59:36.758 10282-10377/? V/k9: conn92385403>>> 5 SELECT "Trash"
09-28 16:59:36.767 10282-10377/? V/k9: conn92385403<<<#null# [0, EXISTS]
then the remoteMessageCount =0,so the ui list has no msg
I observe the same behaviour as @lordkage and in addition deleted messages show up in the webinterface of my e-mail provider marked as deleted (but still present). After manually executing "expunge" on K-9, messages are deleted completely from webinterface.
Expected behavior
After deleting a message in K-9, this message shows up in folder trash in K-9 and webinterface. Trash is emptied via at least two different paths:
Actual behavior
After deleting a message in K-9, this message shows up _twice_ in folder trash in K-9 and _once_ in webinterface. Trash is emptied via at least two different paths:
Summary
No duplicate messages should be in trash and deleting from trash should trigger expunge.
Steps to reproduce (reproducibility: always)
Send message to yourself
Delete message from inbox
Sync trash folder (K-9)
Observe duplicate messages in trash folder (K-9) and single message in webinterface
Empty trash folder in webinterface
Sync trash folder (K-9)
Observe one message in trash folder (K-9)
Delete message from trash folder (K-9)
Delete message from sent items
Sync trash folder (K-9)
Observe duplicate messages in trash folder (K-9)
Empty trash folder in K-9
Observe message marked as deleted in webinterface
Manually execute "expunge" on K-9
Messages deleted completely in webinterface
The log file after executing above steps is available here @cketti : k9-log.txt
Environment
K-9 Mail version:
5.600
fresh install
Settings -> Account Settings -> Fetching Mail -> Erase deleted messages on server -> Immediately
Android version:
8.0.0 (OnePlus 3 with OxygenOS 5.0.5)
Account type (IMAP, POP3, WebDAV/Exchange):
IMAP
For those affected by this issue, were you able to figure out a workaround?
Nope. I make sure to delete my messages using a different interface, then "clear local message" from the trash to remove any local copies.
I have found a work around. While deleting individual messages from the Trash folder in K9, the message is still in the trash folder on the server. However, both of the "Empty Trash" buttons do appear
to remove the messages from the server.
The two buttons are:
From within an account's folder list, select the options menu and click "Empty Trash"
or
From the K9 account list, long press on an account and click "Empty Trash".
This is a very annoying bug, which hits me very hard, since I have several mail accounts. I usually delete a single message only.
Here are what I have to do to delete a message:
Please fix this bug.
Possible related and/or duplicate: #4008, #3903, #3801, #3355, #2705
Another potential concern with this issue is what "Empty Trash" does. Preciously, I had been deleting items from the trash to remove them from both my device and the server. Now, I must use "Empty Trash" to do this. However when I empty trash from K9, it empties the enitire trash from the server, not only the messages located in K9.
While I realize that this is likely the desired outcome, it means that we currently have no easy way to remove messages deleted by K9 from the server without emptying the entire trash.
It may be helpful to know that Version 5.600 appeared to be working normally when used with a GoDaddy IMAP server. The duplicate trash issue developed when I move to a Network Solutions IMAP server. Deleted mail is added to the Trash folder on the server as expected. As the K9 trash folder updates, two of each deleted message appear. When the Trash folder is purged on the server via a desktop client, the duplicate messages remain on the Trash folder on the phone. I delete them by using "Clear Local Messages". Other then this issue with the Trash folder, the Network Solutions IMAP server works normally.
I also have the same problem that @lordkage posted on the opening post.
I don't know about using a "webinterface" as @wurstsemmel says. When I delete my message I do it on K9 and I always follow with an clearing of trash inside K9.
I believe that (when deleting an email) K9 moving the message to Trash folder locally could be removed and instead do an email move to Trash folder only on the server.
Then, when viewing the Trash folder on K9, it could do a fetch of Trash folder emails from the server.
Doing so, it would not create duplicate emails inside the Trash folder when deleting email. This is exactly what I want.
This solution, would remove my issue.
Thank you for the OpenSource solution of K9. This is the only issue that I have using it, so for me everything else that K9 delivers is good :wink:
This should no longer be an issue in K-9 Mail 5.7xx.
Is that a beta version or a release version?
It's a beta version.