Here's what I'm trying to figure out.
I want to match unless every address in To: matches a pattern. That will
probably require a fork of formail -zx if there are more than one To: header,
and it will also require comment stripping or some bullet-proof comment ig-
noring.
The MTA will have rewritten the incoming addresses in @-form and qualified
them if they were unqualified on mail that originated locally. If I may
assume that nobody is out to break it by putting at-signs into comments,
would this do?
:0h
* ^To:(.+$)To:
tooz=| formail -zx To:
:0E # not important to strip leading whitespace
* ^To:\/.+
{ tooz = $MATCH }
:0
* 9876543210^0 ! ^To:
* 1^1 tooz ?? [^ ]@([^ ]\.)+[^ ]
* $ -1^1 tooz ?? $pattern
action