Reputation: 21801
I'm hoping for an event based way to know when I get an email. Right now I'm using gmail but the email host isn't critical. Do I really have to poll it?
Upvotes: 1
Views: 213
Reputation: 3499
You could forward the mail to a *nix host that uses .forward files, then pipe the mail to a script that handles raising the event in your program (by pinging a URL, etc.)
Here's an example in a CPanel/PHP environment: http://kb.siteground.com/article/How_to_pipe_an_email_to_a_PHP_script.html
Upvotes: 3
Reputation: 29655
I've had bad luck with IDLE on both GMAIL and on Dreamhost (which uses courier). Exchange does a great job with IDLE though: I see mailbox updates in less than a second.
Without good IDLE support, yes, you need to poll.
Upvotes: 1
Reputation: 127467
RFC 5465 proposes a NOTIFY extension to IMAP. It is unlikely that many servers implement it, though.
Upvotes: 2
Reputation: 132257
If you connect to gmail using IMAP, you should be able to use the IDLE command. Gmail's IMAP server does support IDLE.
Upvotes: 3