I am creating a email-to-push service for an iOS app I am developing. I already have the push part of this service using a PHP server that sends APNS messages. Now I need a way to check an email address for new messages and send the contents of each new message via this PHP script.
I am using an Ubuntu server.
Any suggestions of either software or more PHP code that I can use to accomplish this?
Thanks!
If you use postfix as your MTA, you can easily arrange for a PHP script to be called for e-mail delivery. Inside this PHP script you can do whatever you need: Write the mail to a DB, arrange to push it to the device, whatever.
Add this to postfix master.cf
and this to your main.cf (if you want to deliver ALL local mail through php)
This will result in your script being run with the recipient as first argument.
Naturally this will work only, if the email addresses are set up to deliver (at least a copy) to your postfix server.