procmail
[Top] [All Lists]

Re: Performance Considerations of a Global procmailrc

2002-02-13 22:18:41
Michael J Wise <mjwise(_at_)kapu(_dot_)net> writes:
Philip Guenther wrote:

Optimizing the recipe to not invoke so many outside processes will
probably give the greatest gain in speed.  First of all, you should delay
invocations until you know you'll need them.  Can you replace any of
the formail invocations with uses of the builtin extraction capability
using \/ and $MATCH?

No. These are not extractions, but additions, of the type:

      :0 fwh
      * ...
      | formail -A 'Comments: yada yada yada'

So store them up in a variable and then add them at the end with one
formail call:

        :0
        * ...
        {
                add_headers = "${add_header:+$add_headers
}Comments: yada yada yada"
        }

Then later:

        :0 fhw
        * ! $${add_headers:+!}
        | formail -A"$add_headers"


The "${add_header+$add_headers
}" bit expands to the value of the variable then a newline, but only
if the variable's value wasn't empty.  The "! $${add_headers:+!}" in
the condition is similar, expanding to "! !" is the variable's value
is not empty and "!" if it is, so that the condition matches only if
add_headers isn't empty.

As for nslookups from inside procmail, would the ability to do 'A'
lookups via gethostbyname() by sufficient or do you need to do general
DNS queries?


Philip Guenther
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail