procmail
[Top] [All Lists]

Re: Test Bench

2003-05-02 15:20:07
At 16:02 2003-05-02 -0400, Doug Essinger-Hileman did say:
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.

Clarity. I'm one of those freaks that codes in other languages, so some of my style is influenced by them. For example, in C, either of the following are valid:

        if (condition)
                single-line-action;

        if (condition)
        {
                singe-or-multiple-line-action;
        }

        There's also the K&R style bracing, where the first line has the
        opening brace at the end (valid for C, not for procmail):

        if (condition) {
                single-or-multiple-line-action;
        }

I adhere to use of the second form wherever possible (braces at same level, indented action). Consistent, and I'm less likely to boff something up if I add an extra line and forget that "oh, yea, I need to brace it now."

Also, for my own delivery recipes, I have a condition level, and then operations within bracing, like so:

:0
* conditions
{
        :0c:
        | formail (stuff) >> $DEFAULT

        :0:
        | gzip -9fc >> folder-specific-mailbox.gz
}

So, even for my "regular" filters, I'm using bracing. The above, if you're wondering, adds a header which my PC mail client uses for shuttling messages into mailboxes, and also stores a copy of the message into a _compressed_ mailbox (thus allowing me to store more mail for archive purposes, which is stored in a dated folder, so at the end of the month, I recompress them all for better compression ratios to boot).

Again, thank you for your answer. It has helped me greatly.

It's the purpose of having published the material at my disclaimer link, to help others. Thanks for the acknowledgement.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.


_______________________________________________
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: Test Bench, Doug Essinger-Hileman
    • Re: Test Bench, Professional Software Engineering <=