procmail
[Top] [All Lists]

RE: procmail blues: half-shod solution...

2003-01-02 11:53:19
poff(_at_)sixbit(_dot_)org [mailto:poff(_at_)sixbit(_dot_)org] wrote:

accounts... How is your "sandbox" actually setup?

Mine -- which, as I said, I call a "test harness," but by which I
mean the same thing as do Sean Straw and others when they say "sandbox"
--
is probably too complicated to describe here without lots of work for 
me and lots of problems for people who blindly try to copy its function.

I think Sean has a pretty good blueprint at his web site -- sorry, I 
don't have the URL handy, but look for the next mail from him to the
list 
and look at the .sig.

I can briefly explain the algorithm behind mine, though, in any case,
and show one tiny part.  I have alternative var definitions in my
rc, depending on whether the private vars "TEST" and "HARNESS" have
been set and what their values are.  Here's something from near the
beginning of my rc:


 :0  # set $LOGFILE and $TRAP unless we're running a test harness
  * $ HARNESS ?? $FALSE
  {
      # 021211 () my logs saved by date (per $VARS/genvars); purged by
cron
      LOGFILE  = ${LOGFILE:-$PDIR/logs/$DATE}
      TRAP     = 'echo "$DATE:$LASTFOLDER" >> mytrap'
  }



Okay, so under normal procmail runs (i.e., with incoming mail, et al.),
HARNESS is unset, which triggers "$FALSE"; and my logfile and trap
are initiated.

However, if HARNESS is set (and various values for it will do various
things
in the test run), LOGFILE remains unset -- which causes the output to
be shunted directly to my screen; and TRAP doesn't get run on procmail's
exit.

I have a Bourne script that initiates procmail and sets the values for
HARNESS,
TEST, and some other things.  Wherever there is a delivery attempt in my
rc,
a SWITCHRC is initiated that looks for those first.  If we're in TEST
mode,
the folder for final delivery gets set to /dev/null; calls to $SENDMAIL
don't actually happen; etc.  Otherwise, delivery is as per the rc's
directive, and calls to $SENDMAIL or whatever are not blocked.

Also, My rc is in sections, and I can set HARNESS to the name of a
section
instead of only to "yes" or "on"; and that will cause that section to
run in VERBOSE mode to my screen, while the other sections do not log
in VERBOSE mode.  (If I want them all to be verbose, I can do that,
too.)

One day I'll do a web page describing it all in a fashion that the
casual
reader can follow more understandably.

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