[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-users] Pipe email to script using procmail Walk through pipeing to cgi script



Hi

Her eis a walk through of my pipeing to a mail.cgi script may work for php.

DISCLAIMER I AM NOT RESPONSIBLE IF YOUR MACHINE TURNS TO TOAST. D HAY

1. Do not get discouraged if it dont work first off

2. Under the Raq GUI, add a user (if you don't already have one) for a catch
all account. This can be an existing one, or a new user. Go to the siteadmin
for your site and click on "Modify Email" (the blue email button). Add your
user name under Email Aliases. You only have to enter the name, do not enter
@www.domain.com, or the email alias will not work.
Click on Save Changes.

3. Telnet into your account and go to /etc/mail/. This is the default
directory for the mail program for Raq's (at least Raq4's). and edit your
virtusertable. Be sure to back up your virtusertable before modifying it. I
used pico to do this, but you can use whatever you like to edit it with.

Go to the area where it says:

# accept-email-at-domain routes

and remove all the entries under it. I don't know if you have to do this,
but it worked for me.

Go to the area where it says:

# Put custom additions below (Do not change/remove this line.

and add:

@www.domain.com username+%1

You may or may not be able to put www. before your name based on the
settings you used setting up you initial email settings for your domain.

Once you have done this, save your new virtusertable.

5. Now you have to update your tables, so:

makemap hash /etc/mail/virtusertable < /etc/mail/virtusertable

The Raq GUI for the email will automatically set up the virtusertable for
you when you make changes. The problem is it will overwrite the new virtuser
table everytime you make changes through the admin of the Raq. I made a back
up copy of the new virtusertable so I can reset it if I need to make changes
through the GUI. This new alias will also override any old aliases.

6. Now you have to make the .procmailrc

This has to go in the /home/sites/site(NUMBER)/users/USERNAME/
NUMBER and USERNAME being specific to your account.

go to pico and create a .procmailrc. It should have in it:

:0
| "/home/sites/site(NUMBER)/web/cgi-bin/mail/mail.cgi" $1

or your specific path to your mail.cgi

Now the important part:::: This MUST be chmodded at 644. The Raq will not
recognize the .procmailrc if it is not at 644.

Save and chmod your .procmailrc and exit.

7. From this point, your alias mail should work fine.


NOTES:
Here is some of the problems I had:
1. Did not realize the GUI for Raqs overwrote the virtusertable when making
changes through the admin GUI.

2. Did not back up my original virtuser table (very big problem,
initially!!)

3. Chmod .procmailrc to 644. I tried just about everything but 644.


-----Original Message-----
From: cobalt-users-admin@xxxxxxxxxxxxxxx
[mailto:cobalt-users-admin@xxxxxxxxxxxxxxx]On Behalf Of Michael Fritsch
Sent: Wednesday, October 02, 2002 7:43 PM
To: cobalt-users@xxxxxxxxxxxxxxx
Subject: [cobalt-users] Pipe email to script using procmail


We are trying to pipe email to a script using procmail. We have setup a file
called .procmailrc inside the users home directory with the following in it:

:0c
* (^To:|^CC:|^Cc:) .user@xxxxxxxxxx
| /home/sites/site5/script.php4

It has been chmoded to 600 although when sending email to user@xxxxxxxxxx it
just ignores the .procmail file and goes to the users mail box.

I searched the archives but none of the solutions helped.

Mike

_____________________________________
cobalt-users mailing list
cobalt-users@xxxxxxxxxxxxxxx
To subscribe/unsubscribe, or to SEARCH THE ARCHIVES, go to:
http://list.cobalt.com/mailman/listinfo/cobalt-users