I am developing an application where users add their Gmail accounts, and I do some classification work on their emails.
I want to be notified when a new email comes to any of the registered accounts.
A solution is to keep polling the accounts via IMAP and saving the last email date I have fetched to check whether there is a new mail or not, but this has a lot of overhead.
Any idea how to monitor Gmail and be notified when a new email is received and integrate this with a Rails app? Is there an extension which can do that and send a post request to my Rails application for example?
I'm pretty sure IMAP is the only answer here.
You may want to see whether IDLE works--I've read conflicting answers. If it does, it's way more responsive than polling.
Otherwise, poll away.
Wikipedia article on IDLE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With