procmail
[Top] [All Lists]

Re: systemwide procmailrc and user

2006-07-15 10:43:25
Don Russell schreef:

/etc/procmailrc
  < do great things here >

  :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.
$DEFAULT's value might be changed by the users rc. Delivery to $DEFAULT
might fail, in which case maybe the user's .procmailrc might be run
again (once the normal flow starts working). I suggest using a
".my.procmailrc" in the mean time.


# /etc/procmailrc
# < do great things here >

  _MAIN_DEFAULT = "$$;$DEFAULT"
  :0
  * ? test -f "$HOME/.my.procmailrc"
  {
      DROPPRIVS = YES
      INCLUDERC = "$HOME/.my.procmailrc"
  }

  :0
  *$  _MAIN_DEFAULT ?? ^^$$;\/.*
  *$! DEFAULT ?? ^^$\MATCH^^
  { DEFAULT = $MATCH }

  # If we get this far, either no .my.procmailrc file exists,
  # or it wasn't delivered by the user's .my.procmailrc
  :0:
  $DEFAULT
  :0:
  $ORGMAIL

  SWITCHRC /dev/null
# EOF

-- 
Groet, Ruud


____________________________________________________________
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