How to delete an email with CURLS MBS?

I have used the MBS example ‘CURLS Email Client’ to get a list of my emails with their attachments. If I want to delete an email from the server that I have downloaded, how do you do that? I cannot find an example to show me.

IMAP?

First make connections with custom request having “STORE " + EmailID + " +FLAGS (\DELETED)” commands and than later one with “EXPUNGE” command.

Either POP3 or IMAP.

The delete flag works for those Imap accounts that don’t have a trash mailbox. For Gmail etc. I copy the mails to the trash mailbox and then set the delete flag.

for pop3:

URL “pop3://pop.monkeybreadsoftware.de/1” and custom request “DELE”.