procmail
[Top] [All Lists]

Re: DROPPRIVS=YES clarification

2004-01-30 12:15:56
On 29 Jan 2004, at 11:02, Bart Schaefer wrote:
On Wed, 28 Jan 2004, Bart Schaefer wrote:

Looks right to me. A better approach than explicit delivery to $DEFAULT
may be to simply abort the file by unsetting HOST.

I've just been reminded this is a thinko.  I meant SWITCHRC, not HOST.

I didn't think SWITCHRC would be a good idea since this is supposedly executing when there is no .procmailrc in the users home folder.

Either way, the script is not depositing mail in the Mail/SPAM folder:

:0
* ! ? test -f $HOME/.procmailrc
{
  :0 fw
  | /usr/local/bin/spamc -u $LOGNAME

  DROPPRIVS=YES

  :0:
  * ^X-Spam-Status:(.*\<)?Yes
  Mail/SPAM

  :0:
  $DEFAULT
}

procmail: Match on ! "test -f /home/MngdUser/.procmailrc"
procmail: Executing "/usr/local/bin/spamc,-u,MngdUser"
procmail: Assigning "DROPPRIVS=YES"
procmail: Assuming identity of the recipient, VERBOSE=off
procmail: Lock failure on "Mail/SPAM.lock"
procmail: Error while writing to "Mail/SPAM"
From b.TailWaggingOffer.0-2d32f90-580d.southgaylord.com.- MngdUser(_at_)f0(_dot_)tekmailer(_dot_)com Thu Jan 29 15:47:12 2004
 Subject: (Spam? 18.47) Make Money on Ebay
Folder: /var/mail/MngdUser 5565

So, why is DROPPRIVS preventing the lockfile from being written? doesn't DROPPRIV drop to the recipient's privs?

DROPPRIVS If set to `yes' procmail will drop all privileges it might have had (suid or sgid). This is only useful if you want to guarantee that the bottom half of the /usr/local/etc/procmailrc file is executed on behalf of the
                   recipient.

the following works:

  :0: /tmp/$USER.spamlock
  * ^X-Spam-Status:(.*\<)?Yes
  $HOME/Mail/SPAM

but only if the SPAM mailbox already exists. This is actually the behavior I *want* so I'm not going to change anything, but I _AM_ confused as to why the procmailrc won't create the mailbox, or write a lock file in the recipients Mail folder.

--
I'm sitting here with 4 Megs of RAM trying to figure out how to use it all... :-) (Me, in 1990)



_______________________________________________
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>