View Full Version : email piping
JayBaen
04-06-2004, 11:01 AM
Is there a way within interworks to set up an email alias that pipes to a .cgi?
example:
support@mydomain.com
is an alias which points to:
|/home/path/to/my/script/email.cgi
Can this be done?
If not, can outside interworx a .qmail-support file be created within a mydomain.com directory that will redirect?
JB
IWorx-Paul
04-06-2004, 12:05 PM
Hi,
Currently there isn't support for this in the InterWorx web interface, but there's nothing to stop you from creating a dot-qmail file to do what you want. For example:
/home/vpopmail/domains/mydomain.com/.qmail-support
Paul
JayBaen
04-06-2004, 12:22 PM
Thx for the quick response, do you think it will be in a future update?
I've had issues with the mail bouncing back to me when I use the dot-qmail file to redirect to a .cgi.
Does the following look correct to you as a substitue for Interworx being able to handle it?
Example:
(file)
.qmail-support
(inside)
|/home/user/my.domain.com/html/cgi-bin/path/to/email.cgi
Do I need the piping character? A different command? You'd just be doing me a favor to answer this, lots of searching is running me in circles.
JB
IWorx-Paul
04-06-2004, 12:26 PM
What does the bounced message say the problem was?
Also, try watching the mail log like this while sending the message to see what's happening:
# tail -f /var/log/send/current
Also may want to check the ownership and permissions of the dot-qmail file, and the cgi.
Paul
IWorx-Paul
04-06-2004, 12:45 PM
To answer your question, yes, that general setup looks correct, and you do need the piping character, etc.
Paul
JayBaen
04-06-2004, 12:51 PM
Haha, thx.
My stumbling block may very well be permissions, or rather, ownership. I'm not sure who should 'own' the .qmail file, I'm guessing permissions should be 600.
JB
IWorx-Paul
04-06-2004, 12:58 PM
If you're going to make the permissions 600, you'll want the owner of the dot-qmail file to be the vpopmail user. Also, the vpopmail user should be able to read and execute the cgi. It would probably be easiest to make the cgi world read and executable.
I should also mention that the CGI will have to "work" via the command line, since that's how it gets called.
Paul
JayBaen
04-06-2004, 01:14 PM
Does it make sense to think that the vpopmail user is simply "mail?"
IWorx-Paul
04-06-2004, 01:15 PM
I'm sorry, I should have been more clear.
The user name is actually "vpopmail"
Paul
JayBaen
04-06-2004, 01:19 PM
Thx for all your help so far, I may as well be IMing you .. :)
When I set this ownership:
chown vpopmail.vpopmail .qmail-support
I get this response:
chown: `vpopmail.vpopmail': invalid group
However, when I use mail.mail, I don't.
JB
IWorx-Paul
04-06-2004, 01:24 PM
There is a vpopmail user, but there isn't a vpopmail group.
So you'll just want to do:
chown vpopmail .qmail-support
The group should be whatever the group is for the other files in this directory, although it shouldn't have an effect on functionality.
Paul
JayBaen
04-06-2004, 01:53 PM
Thanks so much for your help. You've gone well beyond the call of duty.
It seems as if I have everything set correctly from a .qmail perspective (thx to you). I'm just waiting for mail to bounce back.
When I don't have this .qmail-support alias file, I get the bounced mail immediately. With the file, it takes quite a while (almost an hour), but then eventually the mail bounces back -- almost as if the alias is set up correctly, but the .cgi file just isn't working right.
I've posted on the forums of the company who's .cgi file it is (which DOES run from command line) to see if they have any thoughts. They aren't nearly as snappy as you on the responses, however .. ;)
I'll post the final results here as soon as I know, so that others needing this functionality will at least know whether or not we achieved the desired results from this thread.
JB
JayBaen
04-06-2004, 02:27 PM
FYI ...
That did the trick. I had a few perl modules to get installed first for the .cgi to function, after which the piping worked exactly as expected.
Thx much.
JB
IWorx-Paul
04-06-2004, 02:58 PM
Great, glad it's working.
Do you mind saying where you found the script, and who made it?
Paul
JayBaen
04-06-2004, 03:05 PM
Not at all,
It's part of the PerlBill (www.perlbill.com) suite, made by LogicNow (they also make PerlDesk ... which you're probably aware of :) )
They have an option of automatically logging incoming email to the helpdesk system, if you can pipe it correctly.
JB
How much has changed since this thread died? I cant seem to get EZMLM to work properly. I need to have list files and .qmail files world readable to get qmail to even get to EZMLM. Then, EZMLM sends back out errors because it can't write anything to disk. All the files are owned by vpopmail and I see a few qmail users... I'm probably missing something simple going 2 weeks without proper sleep will do that to you ;)
Nevermind I slept in today and got everything to work first shot. That's pretty sad I think.
vBulletin® v3.7.1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.