procmail
[Top] [All Lists]

Re: [Q] disable user .procmailrc

1999-04-26 20:53:47
Yiu Kin Ho <khyiu(_at_)glink(_dot_)net(_dot_)hk> writes:
I use solaris2.6 and sendmail8.9.1.  I have just installed procmail and
run fine with sendmail.  However, how can I disable our user from creating
their procmailrc in their home directory.  In other words, how can I
config my procmail so that it will go through /etc/procmailrc but ignore
any /$HOME/.procmailrc

Procmail has no built in way to ignore the user's .procmailrc.
However, you can tell it to look somewhere besides $HOME/.procmailrc,
say, /var/procmailrcs/$LOGNAME

To do so, find the following lines in the config.h file:

#define PROCMAILRC      "$HOME/.procmailrc"     /* default rcfile for every
                                                   recipient;  if this file
        is not found, maildelivery will proceed as normal to the default
        system mailbox.  This must be an absolute path or bad things will
        happen. */

Change the first of those from:

#define PROCMAILRC      "$HOME/.procmailrc"     /* default rcfile for every

to:

#define PROCMAILRC      "/var/procmailrc/$LOGNAME" /* default rcfile for every


One final catch if you ever do put an rcfile in /var/procmailrc:
changing the PROCMAILRC definition changes the default value of the
MAILDIR variable, such that when such an rcfile is opened, the procmail
process's current directory will be /var/procmailrc.


Philip Guenther

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