Web Hosting Talk







View Full Version : Exim and PHP: The battle goes on


JustinH
09-21-2002, 01:42 AM
Okay... since at this point I've spent 11 hours trying to figure this crap out I'll ask you guys.

Here's the deal: I want Exim to pipe an email address to a php program. Should be as simple as 123 right? Umm.. no...

I just sent a test email from the server to helpdesk@somedomain.com and this is the error message that was returned:

From: Mail Delivery System
To: root@somedomain.com
Subject: Mail delivery failed: returning message to sender
---------------------------------------------------------------------------------------
This message was created automatically by mail delivery software (Exim).

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 |/home/something/public_html/helpdesk/email.php
generated by helpdesk@somedomain.com
Child process of virtual_address_pipe transport returned 69 (could mean service or program
unavailable) from command:
/home/something/public_html/helpdesk/email.php

I've checked permissions 800 million times (since generally returning 69 means a permissions problem with the command, in this case email.php).

So anyways 11 hours later still nothing. Here's my valias entry for the domain:

helpdesk@somedomain.com: |/home/something/public_html/helpdesk/email.php

Any suggestions?

priyadi
09-21-2002, 04:03 AM
If you haven't done so, try adding #!/usr/bin/php (or whatever location of your php interpreter) on top of your email.php, and chmod it +x.

If you don't have php interpreter on your system, you need to build one as CGI mode (not apache module).

JustinH
09-21-2002, 04:25 AM
So basically I'm screwed unless PHP is installed as a CGI binary (since it is currently installed as an Apache Mod)?

JustinH
09-21-2002, 04:28 AM
Oops... or as long as I run it as a CGI binary... that's cool, I didn't even think about the permissions problem on that end. Thanks for the tip ;)

Ahmad
09-21-2002, 05:16 AM
Yeah, you can have both CGI and Apache versions on the system.

JustinH
09-21-2002, 01:35 PM
Welp I did that, CGI and mod_php and now... a new error :(.

This message was created automatically by mail delivery software (Exim).

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 |/home/someplace/public_html/helpdesk/cgi-bin/email.php
generated by helpdesk@somewhere.com

The following text was generated during the delivery attempt:

------ pipe to |/home/someplace/public_html/helpdesk/cgi-bin/email.php
generated by helpdesk@somewhere.com ------

X-Powered-By: PHP/4.2.2
Content-type: text/html

Now I'm really confused... never gotten THIS one before.

cyansmoker
09-21-2002, 04:39 PM
Well I don't know Exim but the header that you see here may be what makes it so angry. Instead of /usr/bin/php, use /usr/bin/php -q

JustinH
09-21-2002, 04:45 PM
tried that also...

Found in exim_mainlog:
Not as a CGI binary
2002-09-21 00:12:04 17seQu-000223-00 ** |/home/compcity/public_html/helpdesk/email.php D=virtual_aliases_nostar T=virtual_address_pipe: Child process of virtual_address_pipe transport returned 69 (could mean service or program unavailable) from command: /home/compcity/public_html/helpdesk/email.php

Is a CGI binary, and no message returned!
2002-09-21 07:10:59 17skyJ-0005jo-00 ** |/home/compcity/public_html/helpdesk/cgi-bin/email.php D=virtual_aliases_nostar T=virtual_address_pipe: return message generated

Nothing found in exim_rejectlog... pretty frustrating.

JustinH
09-21-2002, 05:52 PM
Well I just don't know. Everyone I've talked to is pretty much saying they don't have a clue what the problem is. :p...

priyadi
09-22-2002, 02:51 AM
Try executing /home/compcity/public_html/helpdesk/email.php directly from shell, see if it works.

JustinH
09-22-2002, 02:08 PM
Like a charm...

priyadi
09-22-2002, 05:23 PM
Probably php returned wrong exit code. Try adding exit(0) on the bottom of your php script. Other than that I don't know, maybe the problem is inside the script.