Koozali.org: home of the SME Server

Qmail | pipe messages to a program

Chris G

Qmail | pipe messages to a program
« on: February 19, 2003, 12:11:45 PM »
I have been trying to | pipe messages to a program. In this case it is email.cgi for PerlDesk 1.7 (awesome helpdesk software). Has abyone else successfully done this? I continue to get permission_denied errors. I have seen other messages in the forum - but none seem to figure it out.



@400000003e5349e1198c8124 delivery 233: deferral: /bin/sh:_/home/e-smith/files/ibays/networkhelp/cgi-bin/email.cgi:_Permission_denied/
@400000003e5349e1198cac1c status: local 0/10 remote 0/20


Chris G.

John Alamo

Re: Qmail | pipe messages to a program
« Reply #1 on: February 19, 2003, 09:28:44 PM »
Make sure your permissions on email.cgi are set correctly ... try this and see if it works:

chmod 755 /home/e-smith/files/ibays/networkhelp/cgi-bin/email.cgi

Chris G

Re: Qmail | pipe messages to a program
« Reply #2 on: February 20, 2003, 12:15:33 AM »
The CGI's are set to 755 - I was wondering about owners of the CGI.  I have set it as www, nobody, root, admin, and qmailr - no luck.

Chris

John Alamo

Re: Qmail | pipe messages to a program
« Reply #3 on: February 20, 2003, 12:41:08 AM »
I don't have a copy of PerlDesk 1.7, so I'm not sure if this would work, but did you try changing the group ownership to shared?

chgrp shared /home/e-smith/files/ibays/networkhelp/cgi-bin/email.cgi

Also, where are you piping the message? is it from a user .qmail file?  Have you tried using the email.cgi outside of qmail? (ie take a message in the Maildir and do something like:

cat message | /home/e-smith/files/ibays/networkhelp/cgi-bin/email.cgi

Does this work?

ROn

Re: Qmail | pipe messages to a program
« Reply #4 on: February 20, 2003, 12:48:31 AM »
How exactly do you pipe mesages to an external program??
I want to do that also ... instead of moving it in an box, i want to
strip any attachements, and put them in my webdir ..

Ron

John Alamo

Re: Qmail | pipe messages to a program
« Reply #5 on: February 20, 2003, 01:02:04 AM »
You could create a .qmail file in the /var/qmail/alias folder ..

the name goes something like this:

.qmail-name

where name is the email account name

inside this file, simply create a pipe to go to the program of your choice..

| program options

this avoids having to setup a user account ..

ROn

Re: Qmail | pipe messages to a program
« Reply #6 on: February 20, 2003, 01:14:40 AM »
Ahh great.. gonna try that out .. i'm sorry, it wasn't an answer to your question!!

But does that work with the fetchmail multi-drop ?? I don't have a working domainname, so i use pop3 boxes ...

Chris G

Re: Qmail | pipe messages to a program
« Reply #7 on: February 20, 2003, 12:14:31 PM »
Sorry for the delay.  I just try to cat a message to email.cgi.  It executes it.  I do get some perl errors but I believe I can get rid of those.  SO - after setting email.cgi to the shared group is still responds in the same manner.  
I will continue banging on this box and post any interesting things I stumble across.

Chris

Chris G

Re: Qmail | pipe messages to a program
« Reply #8 on: February 20, 2003, 12:20:57 PM »
Also...If I copy the file to /etc or /root it seems to execute fine.  Now if I could only get rid of these perl problems.

Chris

John Alamo

Re: Qmail | pipe messages to a program
« Reply #9 on: February 20, 2003, 05:34:46 PM »
Perhaps just copy the email.cgi script to /usr/bin and call it from there? It sounds to me that whatever user account qmail is using to access the program, it does not have adaquate permissions in the ibay and thats why its failing (though not sure why if you changed the permissions...)