tags:

views:

164

answers:

2

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!

A: 

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.

divideandconquer.se
Unfortunately I plan to have anyone be able to send email to a certain email address so I can't really control the SMTP side
Benny Wong
+2  A: 

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.

ConcernedOfTunbridgeWells
Awesome! Exactly what I was looking for. Thanks !
Benny Wong