We've built a web service that needs to check constantly for email messages. Basically, an user sends us an email, and the server should make actions based on that email. We could use a crontab PHP script that checks for new messages every minute, with POP. But that's kind of offensive to the popserver and not very efficient (1min is too long).
But, I've read about PUSH email using IMAP around mobile devices. In my case is not a mobile device but a webserver.
Can I push an email to my webserver and have it execute a PHP script? We're using GMail as POP/SMTP/IMAP server.
EDIT 1 from the answers, we figured out:
there must be a 24/7 running process (daemon) on my webserver checking for emails
this daemon may communicate with Gmail using: i) POP with NOOP coomand or ii) IMAP with IDLE command
What's the best? POP or IMAP? Google seems to invite more the use of IMAP.
I don't want to overuse gmail (what's their 'fair use' for checking email? every 10secs?