Stop Deletion of Emails after processing

Scenario

You would like the mailbox to retain copies of emails after JEMH has completed processing, rather than delete.

Answer

JEMH (in fact JIRA) has to respond with a 'delete' to the mailserver to remove it from the queue, otherwise repeated processing would occur.

Some mailservers such as Gmail have enhanced handling of these commands and rather than delete, simply remove the label 'inbox' from the message, so it 'goes away' without deleting.  Other mail systems may not have this ability.

Options

A rule could be added to your mailserver to forward a copy of the message into another 'archive' mailbox, thereby retaining a record, and allowing your mailserver to delete the local copy.