Portal Home > Knowledgebase > Articles Database > Mail delivery failed - Pipe to script
Mail delivery failed - Pipe to script
Posted by gordy, 11-16-2008, 01:54 PM |
Mail delivery failed - Pipe to script
I've created a pipe script to read the incoming email and then input appropriate information into a MySQL database.. now that all works perfectly.. however, the sender gets an auto response saying it failed, but the email does get received and processed fine.. here is a copy of the email:
Quote:
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of itsrecipients. This is a permanent error. The following address(es) failed:
pipe to |/home/******/*****.php
generated by *****@********.com
local delivery failed
------ This is a copy of the message, including all the headers. ------
Any ideas why I am getting this if it is working?
__________________
Sincerely,
Gordon MacDonaldhttp://www.gmdLive.co.cc/http://www.txtMe.co.cc/ <--> FREE SMS TXT Messaging!
|
Posted by r0kawa, 11-19-2008, 12:52 PM |
did you set #! before the script ?
e.g
Code:
#!/usr/local/bin/php
__________________ZenPipe Hosting : Malaysia VPS Hosting
|
Posted by gordy, 11-20-2008, 10:14 PM |
Yep.. I have that already.. had it all along.. still "failing"
__________________
Sincerely,
Gordon MacDonaldhttp://www.gmdLive.co.cc/http://www.txtMe.co.cc/ <--> FREE SMS TXT Messaging!
|
Posted by JayShah, 11-21-2008, 06:52 AM |
Can you run the script in SSH, without the PHP intepreter? If you don't have SSH, did you check that the +x (executable) permission is set? What's the current permission on the script?
Thanks,
Jay
|
Posted by gordy, 11-21-2008, 02:52 PM |
I don't have SSH access.. how do I check that +x permission is set and the permission of the script itself? I've tried 755 and 777
__________________
Sincerely,
Gordon MacDonaldhttp://www.gmdLive.co.cc/http://www.txtMe.co.cc/ <--> FREE SMS TXT Messaging!
|
Posted by JayShah, 11-21-2008, 02:54 PM |
0755 should be fine. I've just read your post, and I think I might know what it could be:
Make sure your script outputs *nothing*. Not even a space. A single character is treated as an error and given to the user. Check the rest of the mail delivery page message, it might be in there.
Jay
|
Posted by gone-afk, 11-21-2008, 03:36 PM |
Have you seen this? http://www.evolt.org/article/Incomin...914/index.html
Quote:
You also have to edit your exim.conf, found at /etc/exim.conf. Look for a part containing 'address_pipe'. If there is such a part, replace it with the text below. If there is no such text, paste this text somewhere in exim.conf. Save the file.
address_pipe:
driver = pipe
pipe_as_creator
If using a forward file, create a file named .forward in your home dir. Then add the following line and save the file. Email sent to you, will be forwarded to the script. If you'd also like the email sent to another address, you can add that address before the script and tailed by a comma. /our/script.php should be substituted with the full path to the script.
__________________
Gordon, Incero custom websites and software.
|
Posted by r0kawa, 11-21-2008, 11:13 PM |
I think I agree with JayShah. Make sure you didn't have any output inside your script
Code:
<--- don't have any space
<------- don't have any new line
and make sure don't have any output at all. If you don't have any shell access, run directly inside your webserver.
e.g http://example.com/pipe.php
if you don't have any output inside it.
__________________ZenPipe Hosting : Malaysia VPS Hosting
|
Posted by khu84, 11-22-2008, 06:33 AM |
Hi,
I have setup a number of "pipe to" scripts. The check list for you is to check
- Forwarder is placed in correct manner
- First line of script is #!/usr/bin/php -q
- Script don't output any thing
- Most important: no syntax error in script... if there is one the script will not accept any incoming mails.
Anyways I can help you with this in reviewing script and making it work. Also make sure you are on linux hosting and php is supported.
Best regards,
Khurram.
|
Posted by gordy, 11-22-2008, 02:54 PM |
Alright, I looked over my script, no output in any of it, no blank spaces or lines after the coding.. forwarder is correct, first line is correct, syntax looks fine.
The email gets parsed and inputted into MySQL fine but it just sends an error back.. I really don't know what to do now..
__________________
Sincerely,
Gordon MacDonaldhttp://www.gmdLive.co.cc/http://www.txtMe.co.cc/ <--> FREE SMS TXT Messaging!
|
Posted by JayShah, 11-22-2008, 02:55 PM |
Please try this. At the top of the script (right after the hashbang #!/usr/ ... line), put:
PHP Code:
ob_start();
At the end of the file, before the last ?> tag, add:
PHP Code:
ob_end_clean();
See if that helps. That will get any PHP output into a buffer, but clean it rather than flush it at the end.
Jay
__________________âÂÂJay Shah
âÂÂMyCoHost - User Mode Linux VPS - No OpenVZ = No Overselling âÂÂValue For Money Semi-Managed VPS's with cPanel/WHM, Fantastico, WHM Master Resellers
|
Posted by gordy, 11-23-2008, 11:36 AM |
Thanks everyone, I think I got it fixed with your help.. seems there was a space after the hashbang.. seems to be ok right now!
__________________
Sincerely,
Gordon MacDonaldhttp://www.gmdLive.co.cc/http://www.txtMe.co.cc/ <--> FREE SMS TXT Messaging!
|
Add to Favourites Print this Article
Also Read