My intention is to parse incoming emails with PHP. What would be the simplest way to set this up?
Would it suffice to rely on Postfix for this, or is there a better alternative?
The purpose of the parsing is to extract links from incoming emails and store them in the database.
My question is - how can I go about pulling the incoming emails and reading them with another application or script?
*Running Debian
Set up a pipe alias in
/etc/aliases
that will send the incoming emails to your script:The email itself will be readable from stdin.
Since this is being referenced from other questions as a duplicate.....
I'd recommend considering handling the redirection using an MDA rather than as an MDA. This gives a lot more flexibility. E.g. you can easily set up procmail to filter bounced messages, autorespond to incoming messages, forward a copy to a mailbox and send the email to a script. And it can be managed without root access.