> The problem I'm having is that my To header rules aren't matching because
> there is no To header,
> and I'm otherwise unsure what to match on. The only occurrence of the
> recipient in the entire email
> is in that Received header.
>
> It does match on "ALL", but I think I need to be more specific than that, to
> avoid matching on "From:"
> or Return-Path or EnvelopeFrom./
If you want to match on text in Received headers only, then just write a rule
to check that header type:
header __TO_FRED_JOHNSON To ~= /\bfred\.johnson@foo\.com\b/
header __RCVD_FRED_JOHNSON Received ~= /\bfred\.johnson@foo\.com\b/
meta TO_FRED_JOHNSON __TO_FRED_JOHNSON || __RCVD_FRED_JOHNSON
meta NOT_TO_ME !TO_FRED_JOHNSON
You could do that with ALL, but this way is probably more efficient, and will
be a lot less confusing regex.
Loren