procmail
[Top] [All Lists]

Re: How to subvert global procmailrc

2004-11-15 21:09:25
    INCLUDERC=/home/$LOGNAME/.procmailrc

You don't want to do that in /etc/procmailrc without dropping privileges 
first.

        Ok. Thank you.

    | /usr/local/cyrus/bin/procmail-cyrus-delivery.sh $LOGNAME

Now wait ... is procmail-cyrus-delivery.sh a filter as the current code 
you quoted indicates or is it a delivering program as you imply now? 
I'm assuming the latter.

The script is :

#!/bin/sh
LOGNAME=$1
PATH=/usr/bin:/usr/local/bin:/usr/sbin:/usr/local/cyrus/bin
/usr/local/bin/formail -I"From " | /usr/local/cyrus/bin/deliver -a $LOGNAME -m 
user.$LOGNAME

        I would be calling this in the INCLUDERC too, sort of why I want
the end of the included RC to stop after it finished, since I planned on 
maybe calling a procmail-cyrus-delivery-folder.sh where it sends it to a
specific folder if it meets a criteria (SpamAssassin).

    What I want is that if the user has his own procmailrc, then run it
and stop after its done. If not, then just go through the regular delivery.

Does "the regular delivery" mean handing the message over to 
procmail-cyrus-delivery.sh?

        Yes.

Let's see ... I think this should be enough:

  :0
  * ! ? test -f $HOME/.procmailrc
  | /usr/local/cyrus/bin/procmail-cyrus-delivery.sh $LOGNAME

and then if $HOME/.procmailrc does exist, procmail will have reached the 
end of /etc/procmailrc, so it will drop privileges and move to 
$HOME/.procmailrc on its own.

        Ok, but what if I'm not putting the .procmailrc in a $HOME 
directory? I won't be able to in reality, so I need some way to tell it 
to run an RC somewhere other than $HOME, and then stop.

If there's no /bin/test and procmail needs to invoke a shell to run 
test, add a semicolon to the end of the condition.

        I think it will need to invoke a shell.

                Thanks, Tuc

____________________________________________________________
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