procmail
[Top] [All Lists]

Re: Using a global procmail directory and calling procmail via -m flag

2002-01-07 15:29:11
Jason McMullen wrote,

| We are attempting to setup a transparent system of individual procmailrc's
| for specific users.  We have setup a global directory to keep .forward and
| .procmailrc's.  We have the forward files setup to call procmail such as
| this:
|
| "|/usr/contrib/bin/procmail -m /var/forward/.username.proc"
|
| This works fine in a recipe that delivers the mail offsite, but if
| procmail tries to deliver locally we see a "can't create output error".
| Does anyone know exactly what it is having a problem creating/modifying?
| This has me stumped after a full day of research.

My only guess is this: because you are using the -m option, procmail is not
cd'ing to the recipient ID's home directory.  Some MTAs automatically cd to
the recipient's $HOME to run a pipe in .forward, but maybe yours doesn't and
remains cd'ed to whatever directory it is already in, where the users don't
have write privileges.  Then when you have recipes like this,

 :0:
 * condition
 basename

trying to run under the recipient's permissions, procmail can't create a
file in the current directory.

Maybe if you drop the -m,

 "|/usr/contrib/bin/procmail /var/forward/.username.proc"

or if for some reason you must use -m, if you have this in .forward:

 "|cd && /usr/contrib/bin/procmail -m /var/forward/.username.proc"

or

 "|/usr/contrib/bin/procmail -m MAILDIR=$HOME /var/forward/.username.proc"

(provided that your MTA understands the $HOME variable properly in a
.forward -- not all do -- or that you can hardcode the full path to each
user's home directory in his or her .forward);

or just

 "|/usr/contrib/bin/procmail # username"

and put

 MAILDIR=$HOME
 SWITCHRC=/var/forward/.$LOGNAME.proc

into /etc/procmailrc (assuming you're using a recent enough version of
procmail to understand the SWITCHRC special variable);

or finally, you could recompile procmail to use /var/forward/.$LOGNAME.proc
instead of $HOME/.procmailrc as the default rcfile, and then the .forward
files could be simply,

 "|/usr/contrib/bin/procmail # username"

without need to set MAILDIR and SWITCHRC in /etc/procmailrc.


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>