In using DA for over a year, I've never been able to get email piping to work.

knoxhosting

Verified User
Joined
Jan 10, 2005
Messages
44
I use a DA server for my less-experienced users who might be overwhelmed by one of my cPanel ones. Overall, I've been happy, except for my seemingly idiotic inability to set up a working email pipe. Even when set up perfectly correct, they just don't work.

Searching "email piping" in these forums returns a small handful of "maybe this will work" and "try this" pseudo-fixes but no definitive answer as to why a DA server seems to not like email pipes, or why some systems seem to run them fine and others don't, even when using the same software and settings.

Does anyone have a "this always works" solution?
 
knoxhosting,
What is your specifici problem with email piping? It's working use and cerberus just fine....
 
The mail error log always returns error 127. In my most recent case, it's a perl script. The first line is pointing to perl and I've edited the script as instructed by the instructions -- it's osTicket FWIW -- when I run the script from the command line I do not get an error.

I've checked, double and triple checked the path to the script, and I've even added the path to perl in the piping line but that hasn't worked either.
 
That might explain it.
When I tried it out I couldn't get the 1.3.0 perl pipe to work, 1.2.7 worked however.
Give that one a try.
 
1.3.1 is the latest; both 1.2.7 and 1.3.0 contain serious security issues, so while that option may work, from my point of view it is not a good one.

I have several 1.3.1's running on cPanel servers and one plain vanilla Fedore Core 3 server, in fact I just set one up last night for this customer's account I'm using right now.

So I've dodged the DA piping bullet again, but am still going keep trying to get this one to work on a test domain I use. I'll do some more testing and post some more detailed logs after the holiday.
 
All versions of osTicket have problems, but that's besides the point. I didn't mean change versions all together. At least between 1.2.7 and 1.3.0 the perl pipe only added feature was an attempt to block spamming, however it did not work properly.
Simply removing that function (using 1.2.7 pipe) it worked.

I have not done a comparison with 1.3.1 to see if anything else has changed.
 
Just as a note of interest...

Majordomo is written in Perl.

Majordomo uses piping.

Majordomo works on DirectAdmin.

Jeff
 
Hi

I can't comment about perl, but I have just worked for a few hours to learn the ins and outs of piping in a DA/exim environment.

1/ To set up the pipe add a new forwarder in the form
"|/home/user/path/to/script"
The inverted commas are required. If they're not used the forwarder will be rejected as an invalid email address.

2/ Create a script to run.
eg for PHP: the script requires a 'shebang' line at the top. The shebang line must be the address of the CLI PHP executable. In my case it's at /usr/local/bin/php, therefore:

#!/usr/local/bin/php

Whatever line you use you can test with (eg)
/usr/local/bin/php -v
- the version info should tell you whether its CGI of CLI. The CGI version will send html headers: this will cause a bounce 'undelivered mail' to the sender of the email.

Within your PHP script make sure there are no blank lines before the '<?PHP' opening tag or after the '?>' closing tag. Blank lines will cause a bounce (similar to use of CGI instead of CLI).

The script must have permissions set to 755, owner:group chown'ed to the applicable user for the domain in question.

-----------------------------------

For a list of environment variables available within the script check this page:
http://exim.org/exim-html-4.40/doc/html/spec_29.html#IX2074

-----------------------------------

It's that simple. (If only I'd known 10 hours ago!!)

------------------------------------

I also use Pascal with the free pascal compiler, so if anyone wants an sample Pascal executable,to use in place of a PHP script, I'll happily provide!
 
Hi,

I was trying to make piping work to a php script. But not working.

1. I setup a php script that has shebang line #!/usr/local/bin/php
(the script is tested and it is working on other hosts)

2. I setup forwarder:
"|/home/USER/domains/path/to/phpscript.php" from [email protected]
([email protected] is a catch-all account for the site)

I make sure there is no pop3 account for catch-all, so email won't be caught by the pop3 before it piped to php script.

3. php script chmoded 755 to give it execute permissions.

Try to send [email protected]. It supposed to piped thru php script and an email sent to the user.

PROBLEM: I am not receiving any error emails or anything.

Any advice?

Thanks much, rrts
 
Nope...

Still nothing... no error messages either.

I created pop3 on this default catch-all, the test email reaching this pop3 account. So email coming to server. The piping part is not working. Not sure why...

Any more advice please?

Thanks much, rrts
 
I tried all these by sending an email to the aliase [email protected] (There is no pop3 account for this) . nothing working.

If I send an email to [email protected] > pipied to php script > sent the user an email back.

"|/usr/local/bin/php -q /home/User/domains/path/to/phpscript.php"

"|/usr/local/bin/php /home/User/domains/path/to/phpscript.php"

"|/home/User/domains/path/to/phpscript.php"


Thanks much, rrts
 
intramanga said:
you could try to swich off the catch all , I dont use this , and it works for me ...

Ed,

So you created an account for the email you are piping?
 
Anything in your exim logfiles? I would expect if you are getting any errors, they should show up in one of the mainlog/rejectlog/paniclog log files.
 
toml said:
Anything in your exim logfiles? I would expect if you are getting any errors, they should show up in one of the mainlog/rejectlog/paniclog log files.

I am not receiving any error messages. And where is this log file?

Thanks much, rrts
 
Any and all error messages due to piping will go to the exim log files. On a RedHat based system, they are located in /var/log/exim, not sure exactly where if you are using FreeBSD or Debian.
 
Its Linux box.

There is only tmp folder in 'var' directory.

Thanks much, rrts
 
Back
Top