Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postfix piping email to php, permissions error

I'm attempting to pipe an email to PHP with my Postfix mail server, using the technique mentioned here and have encountered the following error...

Mar 16 22:52:52 s15438530 postfix/pipe[9259]: AD1632E84C63: to=<php@[myserver].com>, relay=plesk_virtual, delay=0.61, delays=0.59/0/0/0.02, dsn=4.3.0, status=deferred (temporary failure. Command output: /bin/sh: /var/www/vhosts/[myserver].com/httpdocs/clients/emailpipe/email2php.php: Permission denied 4.2.1 Message can not be delivered at this time )

I'd really appreciate if anyone could shed some light on this issue for me. I've tried 777'ing the emailpipe directory, to no avail. Where am I going wrong?

Many thanks.

like image 596
stevenmc Avatar asked Dec 07 '22 15:12

stevenmc


1 Answers

From the postfix docs...

For security reasons, deliveries to command and file destinations are performed with the rights of the alias database owner. A default userid, default_privs, is used for deliveries to commands/files in root-owned aliases.

So you have two options, either set the default_privs in main.cf to match the ownership of the email2php file.

Alternatively, there should be a way to create an alias database that is owned by the user instead of postfix/nobody. I haven't tried this before though so can't advise.

like image 91
outeredge Avatar answered Dec 31 '22 10:12

outeredge