email piping error

Hi, I am trying to pipe an email alias to a file, but after setting it up and clicking save on the alies I get the following error:

Failed to lock file /etc/postfix/virtual after 5 minutes

the file I am trying to pipe is /home/atiptopcomputer/public_html/ticket/sources/pipe.php

any ideas as to why it can’t like the file?

What exactly are you entering into the form when creating the alias?

in the alias name I am entering support-hardware then it fills in @atiptopcomputer.com, then I click the drop down box and choose feed to program, and then I put in the location below.

it is also set ot forward to a local mail box as well, should I remove the mail box?

seems as if it might be postfix as a whole, I try to add a new email address and the system just hangs, but I can do anything else just fine. I have stopped postfix and restarted it and still the same issues

Try restarting Webmin.

I rebooted the entire server and all seems to be working now, however I still can’t seem to get the piping working

Define “can’t seem to get the piping working”? Is there an error? When/where are you having a problem?

the file is no longer failing to lock though, but when I send a test email to the email address that is supposed to be piping to the program, the program is not picking it up. I have checked the settings within the program and they look right

here is the doc on the program and setting up the email piping, the doc is for cpanel but I used the steps http://docs.accord5.com/Email_Piping

I used this virtualmin forum to find out how to set up the email piping http://www.virtualmin.com/forums/virtualmin/%5Bsolved%5D-forward-mail-to-script-pipe-to-stdout.html

I have it set to forward to teh program and to another email address on the server, but it is not being recieved by the email address

its giving me this error when it tries to forward the email to the program

temporary failure. Command output: local: fatal: execvp /home/atiptopcomputer/public_html/ticket/sources/pipe.php: Permission denied

I have tried changing permissions on the file, I have set them from 755 to 775, to 777 and still get permission denied, it says I have to make the file executable so 755 should do the trick to make the file executable. every test I have sent now comes back with the above output and it just stays queued in the mail queue till I flush the queue.

Remember that the mail server is running as “nobody”. It probably doesn’t have access to that directory.

You have a few options to make it accessible. You could make the whole path up to that file +x for everybody (751 for /home/atiptopcomputer/…).

You could put the file somewhere where user ‘nobody’ has access to it. /home/scripts or /etc/scripts or something along those lines. You could even make a directory for every user with 751 permissions explicitly for this purpose, if you wanted to keep 750 permissions on /home.

You could create a mailbox, rather than an alias, and use the .forward file to send the mail instead (just as in the first mention in that linked thread). I think that would make it run as the user, since it’d be the delivery agent (procmail) doing the work.

the .forward sounds like a good idea, how would I write one of those?

Just this:

|/path/to/pipe.php

ok, so I just create a new file named .forward or does it need to be named like email.forward

once the file is created I just put in:

|/path/to/pipe.php (with the |)

sorry, I have never had to make a file like that before, so a bit confused. and then once done I assume it would have either 751 or 755 permissions right?

It’d just be “.forward”. Also, try using “750” for the permissions (if that doesn’t work, try using 755, just in case it’s not being executed as your user).

The .forward file needs to be in the home directory of that email user.

If things don’t work, look in both the mail log, as well as the procmail log (both in /var/log), for any clues as to what’s going wrong.
-Eric

ok, I have it in /home/atiptopcomputer/scripts and I have tried 750 and 755 and it is still comming up as permission denied, here is what is in the error log for mail

May 30 00:05:20 srv1 postfix/smtpd[19083]: connect from mail-px0-f119.google.com[209.85.216.119]
May 30 00:05:20 srv1 postfix/smtpd[19083]: BD1C831E63A: client=mail-px0-f119.google.com[209.85.216.119]
May 30 00:05:20 srv1 postfix/cleanup[19086]: BD1C831E63A: message-id=<004d01c9e0ec$76ebfa50$64c3eef0$@com>
May 30 00:05:20 srv1 postfix/qmgr[5241]: BD1C831E63A: from=<**********@gmail.com>, size=4130, nrcpt=1 (queue active)
May 30 00:05:20 srv1 local[19088]: fatal: execvp /home/atiptopcomputer/scripts/.forward: Permission denied
May 30 00:05:20 srv1 postfix/local[19087]: BD1C831E63A: to=<support-hardware-atiptopcomputer.com@srv1.rooksystems.com>, orig_to=<support-hardware@atiptopcomputer.com>, relay=local, delay=0.32, delays=0.3/0.01/0/0.02, dsn=4.3.0, status=deferred (temporary failure. Command output: local: fatal: execvp /home/atiptopcomputer/scripts/.forward: Permission denied )
May 30 00:05:51 srv1 postfix/smtpd[19083]: disconnect from mail-px0-f119.google.com[209.85.216.119]

there is nothing in procmail about it

Well, I’m not entirely certain what the problem is, but what are the permissions on the directories leading up to your .forward file?

For example:

ls -ld /home/atiptopcomputer

ls -ld /home/atiptopcomputer/scripts

Hi, sorry this took so long, here are the results of the above:

drwxr-x— 13 atiptopcomputer atiptopcomputer 4096 2009-05-29 01:20 /home/atipto
pcomputer

drwxr-xr-x 2 atiptopcomputer atiptopcomputer 4096 2009-05-29 23:58 /home/atiptop
computer/scripts

any idea as to what else we can do to get it working?

Many thanks

If your script isn’t being run as the user “atiptopcomputer” (which it sounds like it may not be), then every directory up to and including the “scripts” directory needs to be, at a minimum, world executable.

The “scripts” directory is, but /home/atiptopcomputer is not. You can fix that dir by typing:

chmod +x /home/atiptopcomputer