Author Topic: IMAP delete does not sync to server  (Read 4732 times)

zoot

  • Newbie
  • *
  • Posts: 3
IMAP delete does not sync to server
« on: December 07, 2015, 11:58:10 am »
Hello

Whenever I delete messages via AquaMail, other IMAP clients still show the deleted messages. It appears that AquaMail is not setting the 'T' (Trash) flag on messages. I'm using Roundcube webmail and Thunderbird as other IMAP clients and each action the one does, reflects in the other, but when I delete in AquaMail, the messages are not flagged for deletion.

Samsung Galazy S3 (i9305)
Android 4.3
AquaMail Pro 1.5.9.14
Dovecot 2.0.21

Dale

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: IMAP delete does not sync to server
« Reply #1 on: December 07, 2015, 04:56:14 pm »
There is no 'T' (Trash) flag.

There is a \Deleted flag, which my IMAP code definitely does set.

How exactly are you deleting messages?

AquaMail has three ways (with different looking "delete" icons) -- "move to deleted" (the default), "delete immediately" and "hide in the app, keep on the server"; this is a per-account setting (long press the account -> options and folders -> account options).

Of these, "hide" does not touch the server at all.

If you're using "move to deleted", please check the "mapping" between Aqua's "[ Deleted ]" folder and server folder:

Long press the account -> options and folders -> folders

Find the server side Deleted (Trash, Bin, Deleted Items, etc) tap it and choose "Sync with [ Deleted ]".
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

zoot

  • Newbie
  • *
  • Posts: 3
Re: IMAP delete does not sync to server
« Reply #2 on: January 15, 2016, 03:31:37 pm »
Hi Kostya

Sorry it's taken me so long to respond.

I inadvertently mentioned the mailbox storage format's trash flag (Maildir messages have a 'T' added to the filename on disk). Flagging a message with the \Deleted flag would indeed add the 'T' to a Maildir message, which wasn't the case on the server (and why other email clients still showed the message).

Your last suggestion resolved the issue, thank you.

Correct me if I'm wrong, but my understanding of the typical delete operation in IMAP is:

Flag message with \Deleted (which translates to 'T' in message filename in a Maildir)
Move to assigned "Deleted" folder (Trash, in my case) (if the client is configured to do so)

I suspect your code is doing the reverse, and only flagging the message as \Deleted only if the move to the folder works.

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: IMAP delete does not sync to server
« Reply #3 on: January 15, 2016, 09:06:04 pm »
IMAP doesn't provide "MOVE" as part of the base spec -- it's an extension.

If it's there, then yes, the app will use it.

Otherwise, a message has to be copied and and deleted from the source folder.

My code does a copy first before deleting, because

1) copying also copies the message's flags, and you don't want \Deleted in the destination folder

2) messages marked with \Deleted can be easily "expunged" all at once, say by another mail app, too dangerous

3) and anyway, why not copy first then delete? it just feels right

Now you seem to be implying another, related, question -- why does it end up like this, not deleted (when the copy fails)?

Because "move to deleted" and "delete" are different things, looking from the user's perspective:

A message moved to Deleted continues to "live", and can still be found / opened / moved back.

And a message marked as \Deleted (and maybe even expunged by accident) is very different, at the very least it won't be visible in AquaMail and most other mail apps.
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/