Question

I'm trying to write something that puts the contents of the message on a queue, to have work done on it later. I've been messing around with IMAP IDLE with varying degrees of success.

I was wondering if anyone knows of a method to have a mail server receive an email, and then perform an action like posting the contents of the email to a URL endpoint.

Any ideas? Thanks!

Was it helpful?

Solution

Try fetchmail and procmail. You periodically poll the mail server (every minute if necessary) and use fetchmail to download from the IMAP server. Set up a procmail rule to run your notifier application on emails that match your selection criteria.

Any of the scripting languages (perl, python, tcl/tk etc.) have good, mature and easy to use email handler libraries (in fact you can get this sort of thing for most lanaguages), so it should be quite straightforward to write the handler in one of those.

OTHER TIPS

Configure the SMTP (mail transport) server to deliver the mail to an application that performs the desired action. Don't do it on the IMAP (mailbox client) level if you can avoid it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top