procmail
[Top] [All Lists]

SWITCHRC

2002-09-27 17:25:26
I have an alias in my shell that runs

        formail -s procmail TEST=y < somefile

I have several recipes in my .procmailrc that deliver
to $DEFAULT.  I was running in there until now something
like this:

        :0:
        * some conditions
        * ! TEST ?? .
        $DEFAULT



I decided to stop writing "* ! TEST ?? ." about five times
and use a separate rcfile to make the delivery.  So I changed
the recipes to something like:

        :0
        * some conditions
        { SWITCHRC = $SPOOL }

I had, of course, defined the path to $SPOOL up above.

Within the rc called $SPOOL is this:

        :0:
        * ! TEST ?? .
        $DEFAULT


Well, the mail does get delivered to $DEFAULT as expected.
But the check for TEST no longer works.  When I run my
test alias, that mail also gets delivered now.  I can't
figure out why it isn't being stopped.

Verbose logs:

procmail: Assigning "SWITCHRC=/net/u/1/d/dman/.procmail/subs/deliver"
procmail: No match on ! "."
procmail: Locking "/net/u/1/d/dman/.mailspool/dman.lock"
procmail: Assigning "LASTFOLDER=/net/u/1/d/dman/.mailspool/dman"



If I put in the $SPOOL rc to spit out the value of "$TEST" to the
log, it complies, and looks normal.

I did read the part of `man procmailrc' that says:

                   As  with INCLUDERC, no checking is done on the
                   permissions or ownership  of  the  rcfile  and
                   command line assignments have no effect.


Is that what is going wrong?  I frankly don't entirely understand
what that caveat is saying.  I have used SWITCHRC for a couple
of months now in other guises, and haven't noticed this kind of
thing before.  And, as I say, within $SPOOL, a query spat to the
logs of the value of TEST does show up as I thought it should.

What am I missing?

-- 
Dallman Ross

P.S.  Will somebody *please* fix the procmail.org alias to this
list?  It has been broken now for at least three weeks.

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