CA Process Automation has a number of email related operators that in some instances function differently depending on the type of email server being used.
The Delete Mail Operator works as expected when connected to a POP3 email server, but does not delete emails when connected to an IMAP server.
How to delete emails from an IMAP email server?
When connected to an IMAP server, the Delete Mail operator sets the flag on the specified email(s) as 'Deleted' but does not remove the email.
Process Automation must then send a command to clear all email flagged as 'Deleted' from a specified folder using the Purge Folder operator.
Here is an example of a process that checks a folder for a list of Emails, queries for and retrieves a specific email, flags it for deletion and then finally purges the folder:
The Purge Folder operator can be used within the same process if the email should be immediately cleared, or alternatively a very simple process could be built and scheduled to issue the Purge Folder commands to the IMAP mail server once a day.