I've spent hours searching for an answer to this question, but have not come close to a solution, i hope someone can help.
I need to poll a mailserver for new emails every few seconds (or use imap idle/push), if the subject line matches a certain string, send the body text to a receipt printer, then move the email to another folder. It needs no more functionality than that.
I would prefer to use synapse, but Indy or Lnet would suffice.
Every example I've come across (and there are very very few of those) doesn't show how to check for new messages, (that I think I can work around), but the one big sticking point is decoding the mime content and printing the text/body of the email.
Can anyone help with some simple example code ?