piping issue: piping works, delivery error still is being returned to the sender

Absturz

Verified User
Joined
Jul 4, 2008
Messages
5
SOLUTION IN THE FIRST REPLY

I'm triggering a php script if an email is being received by [email protected]

The line in the aliases file is:
Code:
upload: "| /usr/local/php5/bin/php -q /home/snapixel/domains/snapixel.com/public_html/emailtrigger.php"
(note the exta space between "|" and "/" seems to be needed for the piping to work)

anyways.. the script is being executed but the sender still gets a delivery error sent back

Code:
This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

 pipe to | /usr/local/php5/bin/php -q /home/path/to/script.php
   generated by [email protected]

The following text was generated during the delivery attempt:

------ pipe to | /usr/local/php5/bin/php -q /home/path/to/script.php
      generated by [email protected] ------

The php-script does not generate any output. I also tried it with an empty file or sending exit(0); or returning NULL. Nothing seems to solve this issue.

I only found a couple other people having the same issues on machines running directadmin but didn't find a solution.

Needed system information:
Code:
Exim 4.67
DirectAdmin 1.32.1 
dovecot 1.0.14 
Linux 2.6.18-53.1.21.el5

Thank you for any help in advance
 
Last edited:
My Solution:

Please post another better solution if you have one!

in the exim.conf I commented out the line
Code:
return_output
under
Code:
virtual_address_pipe

It now looks as following:
Code:
virtual_address_pipe:
  driver = pipe
  group = nobody
  #return_output
  user = "${lookup{$domain}lsearch* {/etc/virtual/domainowners}{$value}}"
 
At all? It says that
Code:
"| /usr/local/php5/bin/php -q /home/snapixel/domains/snapixel.com/public_html/emailtrigger.php"

Wont' work, because it has a space after "|, so it should be:
Code:
"|/usr/local/php5/bin/php -q /home/snapixel/domains/snapixel.com/public_html/emailtrigger.php"

But you know better than me, if it doesn't help then it doesn't.
 
At all? It says that
Code:
"| /usr/local/php5/bin/php -q /home/snapixel/domains/snapixel.com/public_html/emailtrigger.php"

Wont' work, because it has a space after "|, so it should be:
Code:
"|/usr/local/php5/bin/php -q /home/snapixel/domains/snapixel.com/public_html/emailtrigger.php"

But you know better than me, if it doesn't help then it doesn't.

actually it only works with the space after the pipe-character - quiet strange...
 
actually it only works with the space after the pipe-character - quiet strange...

You said (in your first post) that it doesn't work, so it does now? If you don't get any output that doesn't mean that it doesn't work, your PHP script could be not working. P.S. it's better to use /usr/local/bin/php instead of /usr/local/php5/bin/php.
 
You said (in your first post) that it doesn't work, so it does now? If you don't get any output that doesn't mean that it doesn't work, your PHP script could be not working. P.S. it's better to use /usr/local/bin/php instead of /usr/local/php5/bin/php.

I came up with the solution and posted it as reply to my first post.
The php-script works fine - I also tested it over the command line first.

The only issue there was that there still was an error message sent back to the original sender - even though the script was triggered and terminated without errors. Using another php-binary didn't change anything either. Writing the output of the script to a file didnt change anything either. Also it was the same problem with a bash-script.
 
Back
Top