Re: [exim] Error generated from pipe|php in /etc/valiases

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Peter Bowyer
Datum:  
To: exim-users
Betreff: Re: [exim] Error generated from pipe|php in /etc/valiases
Dave Kennedy <davek@???> wrote:

>> That won't work. You have written a shell command. Exim does not run a
>> shell by default. You have to ask for one if you want one. A similar
>> problem is answered in FAQ 0084. See also section 29.2 of the
>> reference manual.
>
> I'm not sure what "won't work" means, since
> when an email message is received by user@???,
> the PHP script, Phone2wp.php, is executed and the email message is
> posted to the wordpress blog.
>
> The issue is with the permanent error that is emailed back to me:
> The following address(es) failed:
> pipe to |/usr/bin/php -q -f
> /home/user/public_html/wordpress/phone2wp.php >/dev/null 2>&1
> generated by <mailto:user@domain.com:> user@???:
>
> The delivery instruction was modeled on an existing instruction for
> mailman in the /etc/valiases file:
> mylist-subscribe@???:
> "|/usr/local/cpanel/3rdparty/mailman/mail/mailman subscribe
> mylist_domain.com"


The mailman example doesn't need a shell - it simply needs the 'mailman'
executable with 2 arguments.

Your php command does need a shell because you've used shell features to
redirect stderr and stdout to /dev/null. Which is the exact same reason that
you get an error - Exim assumes that if the command returns any output then
there's an error - your attempt to stop it doing that with the redirects
didn't work because there's no shell.

Wrap your whole command up in 'sh -c' and see if it goes away (substituting
a shell which works on your system for 'sh', and checking the man page for
it to see what the correct syntax is).

Peter