I am accessing Gmail All Mail folder via imap, using RFC 3501. I need to delete a message (Move to Trash or Permanently delete) from the folder. The following commands do not seem to work:
UID STORE 123 +FLAGS (\Deleted)
EXPUNGE
I can modify labels using X-GM-LABELS, but there is no option to add a "Trash" label.
The RFC 3501, does not have a "MOVE" command, so I need to copy the message to "Trash" folder and then remove it from the parent folder. What's the way out??
Thanks.
Found partial answer.
To set Trash as a label, we need to use "\\Trash" as the label. Here are the commands to move the message to trash (delete inbox label and add trash label).
UID STORE 123 -X-GM-LABELS (\\Inbox)
UID STORE 123 +X-GM-LABELS (\\Trash)
Now, I am stuck on how to delete the message permanently.
These commands delete the message permanently:
Just tried it out and it works.