Enough-Software / enough_mail

IMAP, POP3 and SMTP clients for Dart developers. Contains both low level as well as a high level API.
Mozilla Public License 2.0
104 stars 56 forks source link

How to delete an email permanently #178

Closed ShadmanAfzal closed 2 years ago

robert-virkus commented 2 years ago

MailClient has now the optional expunge boolean parameter: Future<DeleteResult> deleteMessages( MessageSequence sequence, {bool expunge = false})

surajprasad57 commented 2 years ago

How to permanently delete a message sequence using IMAP

robert-virkus commented 2 years ago

Mark the messages as deleted and then expunge.

await _imapClient.store(sequence, [MessageFlags.deleted], action: StoreAction.add, silent: true);
await _imapClient.expunge();