procmail
[Top] [All Lists]

RE: SWITCHRC

2002-10-01 02:10:01
David W. Tamkin wrote:


Dallman Ross wrote,


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

That recipe should fail to match, since $TEST does have at least one
non-newline character.

You know, I'm not sure how many times over I need to keep learning the
lesson:  Don't Try to Code Procmail When You Need to Go To Sleep.  :)

Thanks, David.



| Well, the mail does get delivered to $DEFAULT as expected.

It seems to me that it lands in $DEFAULT because procmail 
reaches the end

Yes, of course.  Thank you for banging on my brain appropriately.



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

The value of $TEST won't show up in the log unless you log it:

LOG="The value of \$TEST is $TEST, honestly.
"

Yes.  That's about what I had done.  I didn't bother posting that
part, is all.


My Final Solution (sorry for the bad pun) in my SWITCHRC is now:


 # if $TEST and no $REDELIVER, vamoose now; else, fall off end to
$DEFAULT.

 :0
  *   TEST      ?? .
  * ! REDELIVER ?? ^^(y|on)
  { HOST = byebye }

That allows me to set $TEST (e.g., to "y") on the command line
and stop delivery, unless I set a second command-line var,
$REDELIVER, to "y" or "on".  (I use that sometimes to override
X-Loop:, & such, headers that my rc added already, when I'm
sure I know what I'm doing and want to reprocess that mail
anyway but without having to bother to edit the headers manually
to remove those things that will normally interrupt delivery
per my existing rc.

-- 
Dallman Ross

"If you find a path with no obstacles, it probably does not lead to
anywhere."
        Thoughts of Rev. Sunnan Kubose, from _Zen in the Markets_ 

_______________________________________________
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>
  • RE: SWITCHRC, Dallman Ross <=