Reputation: 79268
After hearing about git commit hooks, I was thinking maybe there are such things as email hooks...
Is it possible for me to build a program that says "hey, you just received an email, now run this ruby script"? Something like a GMail Web Hook. Is there anything out there like that? I mean I could build a cron thing that checked my email all the time, but maybe there's a more formal way.
Looking for an online email system to do this with, not say my Mac Mail.
Upvotes: 5
Views: 1573
Reputation: 7325
This looks promising, but its still in beta phase: https://zapier.com/zapbook/gmail/webhook/
Upvotes: 0
Reputation: 11596
You can forward all incoming emails to a script. Normally a .forward
file in your home directory that looks similar to this would be enough:
|/path/to/your/script
The script has to be executable.
Here's an article about it. It's for PHP but it's the same for ruby. In the script you just need to read the STDIN to get the message.
Upvotes: 1
Reputation: 284826
You can try smtp2web. It basically consists of a SMTP daemon that maps incoming email to HTTP urls. Then, you can run the server-side code of your choice on those URLs. This is just one way to approach the problem. It's designed particularly for use with Google App Engine.
You can either run your own instance, or just sign up for mapping (e.g. [email protected] -> http://viatropos.com) and forward your gmail account to that. Then, you would run a HTTP server at viatropos.com.
EDIT: I also found Astrotrain, which is similar but written in Ruby.
Upvotes: 3
Reputation: 185862
The answer to this depends entirely on how you read your email. There are no user-accessible hooks in gmail, AFAIK, but you can pull gmail via POP3 and suck it through some mail processing system such as procmail.
Upvotes: 1