These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for email piping error on the new forum.
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?
--
Check out the forum guidelines!
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 <a href='http://docs.accord5.com/Email_Piping' target='_blank'>http://docs.accord5.com/Email_Piping</a>
I used this virtualmin forum to find out how to set up the email piping <a href='http://www.virtualmin.com/forums/virtualmin/%5Bsolved%5D-forward-mail-to... target='_blank'>http://www.virtualmin.com/forums/virtualmin/%5Bsolved%5D-forward-mail-to...
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
the .forward sounds like a good idea, how would I write one of those?
Just this:
|/path/to/pipe.php
--
Check out the forum guidelines!
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
I made the atiptopcomputer directory executable by using chmod +x and then sent the test email again, and recieved the following error"
[doce] Reporting-MTA: dns; srv1.rooksystems.com X-Postfix-Queue-ID: F3E8631E6BD X-Postfix-Sender: rfc822; anwoke8204@gmail.com Arrival-Date: Sat, 13 Jun 2009 17:38:55 -0600 (MDT)
Final-Recipient: rfc822; support-hardware-atiptopcomputer.com@srv1.rooksystems.com Original-Recipient: rfc822;support-hardware@atiptopcomputer.com Action: failed Status: 5.3.0 Diagnostic-Code: x-unix; /home/atiptopcomputer/scripts/.forward: 1: Syntax error: "|" unexpected [/code]
the above was attached to the error email the server sent to my mail client Any idea as to why it isn't working and why my mail server is still showing up as srv1.rooksystems.com when it should be atiptopcomputer.com?
it also had the following in the email?
support-hardware-atiptopcomputer.com@srv1.rooksystems.com (expanded from support-hardware@atiptopcomputer.com): Command died with status 2: "/home/atiptopcomputer/scripts/.forward". Command output: /home/atiptopcomputer/scripts/.forward: 1: Syntax error: "|" unexpected
Many thanks
Alright, so that's good news -- the script is running now.
The problem is that there's a syntax error in the script.
Which leads me to the next issue -- I've long since lost track of what you're trying to do and why you're trying to do it :-)
Can you explain the details of your setup here, and how exactly this .forward file is being called? -Eric
I am using a help desk program that if someone sends an email to a certain email address it will automatically create a ticket for it, or if me or someone responds to the ticket then it sends the customer an email and they can reply to teh email and thier comments will be attached to the ticket. I tried getting it to go with pop3 but it wouldn't work, so the company (Accord 5 Trellis Desk) said to use email piping and have a script pipe the email to the pipe.php, and then it will work the way it should. the pipe.php script file is in a directory that the mail server can't access, so Joe suggested I create this .forward file, as someone created the .forward file in the past and was able to get it working. it was suggested I put the file in /home/atiptopcomputer/scripts. let me know if this helps
Many thanks
Okay, cool.
How are you going about invoking it?
That is, where is your script being called from, and what syntax is being used to do that? -Eric
I am using a mail alias to invoke it, when an email comes in to hardware-support@atiptopcomputer.com, the alias is set to pipe to the script which then forwards to the pipe.php file for the software and then it also gets forwarded to a regular email so it can be checked later as well
Alright -- it's been ages since I've attempted to use a .forward file, but my understanding is that they're called directly by Postfix (or Sendmail).
That is, by sticking a .forward file in $HOME, assuming Postfix is configured to handle them, it should be executed automatically.
So you wouldn't need to call it via a pipe or anything.
There's some additional info here in the section "SYSTEM-WIDE AND USER-LEVEL ALIASING":
http://www.postfix.org/local.8.html
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.
--
Check out the forum guidelines!
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?
--
Check out the forum guidelines!
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.
--
Check out the forum guidelines!