On 26 Apr 2003 at 11:41, Professional Software Engineering wrote:
Sean,
I have probably been remiss in not responding earlier, though I do
plead that my delay was caused by the necessities of real life (I'm a
minister by profession and the father of two teen-age daughters, both
facets of life this week requiring some extra-ordinary time). I also
wanted to make sure I took the time to read the material, understand
it, and actual *do* it before I wrote back.
I am quite grateful for the response you sent, including the
information I gathered by following the link at the bottom of your
email. I learned a lot, and now have a sandbox in which to play with
recipes.
If Timo's is the one to use, then let me ask where I should put the
mail.msg to be fed to the test. In one's home directory? or in the
test directory?
In Timos example, mail.msg would be in whatever directory was current
at the time you invoked the proctest script (the proctest.rc file
itself can be elsewhere, and the proctest script can be anywhere in
your path, or manually invoked with a prefixed path).
Thanks, again.
or, if I'm simply taking a _single_ test message and throwing it at
the rc:
procmail -m sandbox.rc < mbx/test.msg
This is how I perceive I will be using the sandbox most of the time.
The bottom line is, it depends on how you set things up. Ultimatley,
your testbench/sandbox/etc should set up a similar environment to what
your ~/.procmailrc does (before delivery/filter recipes), so that any
filter you test in the testbench will act the same as if it were
running in your real .procmailrc. So, if you define a number of
standard variables, define them in the sandbox.rc too.
Speaking of standard variables, I have taken the advice in your
sandbox.rc and created a variables.rc file. I noticed that you put
the action line between curly braces. The procmailrc man page says
that a curly brace followed by at least one space, tab or newline
will begin a nesting block, and that recipes which begin a nesting
block are not delivering recipes (thus allowing the processing of
that message to continue). But it seems that in the recipes defining
variables, the action lines aren't delivering action lines anyway. So
I am wondering why you choose to write the recipe in that format.
Having the test framework separate from the individual filter makes
for a more consistent test - you're not boffing the basic setup of the
sandbox each time, and the actual filter is more just as it would be
when you go to migrate it into your regular procmail config, with
nothing to strip out of the individual file to make it work properly
in your .procmailrc.
Again, thank you for your answer. It has helped me greatly.
Doug
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail