This question has been replicated under suggestion from this one at StackOverflow, as long as it is a programming issue, but seems to depend on Linux tools. I will post the link to the solution (if found) on both places.
I don't know much about IMAP mail, since I have always used POP3. But deleting emails from the POP3 mail server was possible by using tools included on Windows eMail clients like The Bat!.
But now on my job I have a new IMAP account with a stupid problem: sometimes emails from outside my domain (the
@myenterprise.com part) do not arrive, and would like to script some method to detect it.
Just a simple shell script (Linux is highly preferred for me on scripting) that sends periodical emails from an external account and checks for the correct arrival of them would be enough, but if I schedule it to run once each hour... well, after a few days I will have lots of
Subject:Test emails on trash. So the solution would be to delete them from IMAP server after the checks.
How can I delete specific emails from my IMAP server from Linux shell in a scriptable manner?
Bash shell preferred, if solutions are specific.