On 14 Nov 2013, at 1:32, Stan Hoeppner wrote:

On 11/13/2013 9:50 AM, Bill Cole wrote:
On 13 Nov 2013, at 6:39, Stan Hoeppner wrote:

Also, note that the carat (^) anchor isn't necessary. The header fields
you're testing for are in the left most position.  Thus no reason to
left anchor your expression.

There absolutely ARE reasons to anchor RE's in header_checks:

1. Performance. In recent years email has developed a sort of header
cancer: new, often proprietary, and often opaque headers that routinely have logical lengths of hundreds of characters. Not anchoring a header
check to the start of the header when you only want to check a few
specific headers wastes effort scanning for a match anywhere in a
header, potentially taking hundreds of times longer to confirm a non-match

In recent years CPUs have become so blindingly fast it makes no
difference. Any excess cycles burned by a non anchored regex were idle cycles anyway. There are good arguments for anchoring expressions, but
saving CPU cycles is simply no longer one of them, not for years now.

I used to make your argument here, but again, it no longer applies.

I think it might surprise you to learn how many mail servers run on systems constrained by CPU and RAM. This used to be a consequence of old hardware being repurposed to utility service and ambushed by the need to filter mail (a relative novelty) but today it is often the result of virtualization being used to maximize utilization of all those cheap and abundant resources. If your mail server is running on dedicated recent but not bleeding-edge hardware you may not care about CPU, but if it is running on a VPS capped at 300MHz or billed by real CPU usage, you do.

Reply via email to