Forward mail to a PHP script using procmail on Ubuntu
$10-30 USD
ถูกยกเลิก
โพสต์ มากกว่า 7 ปีที่ผ่านมา
$10-30 USD
ชำระเงินเมื่อส่งงาน
Greetings:
I'm trying to send all email on a user account to a PHP script, but can't quite get it to work.
The box is a Ubuntu 14 from Digital Ocean. From new, I did the following:
apt-get update
apt-get upgrade
apt-get install postfix php5-cli mailutils
adduser smurf
Using the installation wizard, I set postfix up as an "Internet site". If I login as user "smurf" and run the "mail" command, I can see test emails that I have sent from Gmail, etc. to the fully-qualified email address (I pointed an MX to this server's IP address and opened port 25 on the firewall).
My PHP script touches a file and tries to write the contents of STDIN to file. If I pipe it data, it works as expected.
From here, I've tried about 20 different forms of .procmail, .procmailrc, .forward, etc.; none of which work quite right. I think the problem is that I just haven't found the right combination of file names, script, permissions, etc. Every site has a little piece buried amount a ton of other information and I just haven't sifted through it.
I'm looking for step-by-step instructions on what to do next. If you are familiar with procmail, this is probably very easy... I just don't want to spend more hours trying to find the answer by accident when I can pay you for the solution :)