views:

29

answers:

2

I'm looking for a simple service/software that will convert emails into HTTP POST requests so I don't have to code in separate code paths for email handling. Does such a thing exist?

A: 

You could run Postfix or another mail server, configure it to accept the appropriate email, and then pipe the mail to a command which POSTs the data (using CURL or another framework).

Speaking SMTP correctly as a server isn't trivial. Access control is even harder. I'd say to use a real SMTP server.

Borealid
I could, I was just wondering if someone's already coded it up so I wouldn't have to. As for access control, what are the various ways it could break?
Shalmanese
@Shalmanese: you could end up vulnerable to a buffer overrun, you could end up relaying mail to unintended recipients, you could lack support for SASL authentication... The point is just that an SMTP server is already a very powerful piece of software. It would take a long time to rewrite all the functionality there.
Borealid
A: 

Google app engine converts incoming email into a POST to your app:

http://code.google.com/appengine/docs/python/mail/receivingmail.html

You could either handle the emails directly on app engine, or write a handler which calls back to your other site:

http://code.google.com/appengine/docs/python/urlfetch/overview.html

Saxon Druce