procmail
[Top] [All Lists]

Re: systemwide procmailrc and user

2006-07-16 03:44:18
On Sun, Jul 16, 2006 at 02:25:32AM +0200, Dallman Ross wrote:

On Sat, Jul 15, 2006 at 07:40:59PM +0200, Ruud H.G. van Tol wrote:

Don Russell schreef:

  :0
  * ? test -f ${HOME}/.procmailrc
  {
      DROPPRIVS=YES
      INCLUDERC=${HOME}/.procmailrc
  }

  # If we get this far, either no .procmailrc file, or it wasn't
  delivered by .procmailrc
  :0:
  ${DEFAULT}

I see some problems with that. $HOME might contain whitespace.

That doesn't matter.  It doesn't need quoting once it is already
assigned to a var.

On the other hand, I was wrong not to consider the need for quotes
around the test statement in the condition line.  There they'd be
needed, if there is whitespace in $HOME.

Has anyone ever actually seen a Unix filesystem with whitespace
in the path to $HOME?

The other thing I'm wondering is, why can't we just conduct the OP's
test this way at the bottom of the /etc/procmailrc?

    ----------------------------------------------
    SWITCHRC = $HOME/.procmailrc

    # we should only still be here if the above file was not present.
    # we will drop off the end, and the message should land in the
    # user's $DEFAULT, yes?
    ----------------------------------------------

I haven't tested the above.  I am under the impression that elevated
privileges would be dropped at the point of the SWITCHRC, if it succeeds.
But I am not entirely sure.  Ruud, or somebody?

Dallman

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail