"D. DeCoudras" <[EMAIL PROTECTED]> writes:
> With regard to incoming mail filter sources, I have noted on this page:
>
> http://tmda.net/filter-sources.html
>
> the following text:
>
> > The to-* sources examine the envelope recipient address but not the
> > To header field, which is often bogus in spam email.
>
>
> Can someone either negate or affirm my deduction that the above TMDA
> rule, whereby the To header field is ignored and instead the envelope
> is examined to determined the real "to", also applies to incoming-only
> TMDA filters that explicitly use the "headers" source when the "To"
> header is included in the regular expression?
No. In fact, the opposite is true. The 'headers' (and
'headers-file') rules do a regular expression search against the full
email header -- all fields. The envelope recipient may or may not be
included in the header, but TMDA doesn't add or remove it and doesn't
try to make sense of your regular expression
> For example, I have a simple incoming filter that looks this line:
>
>
> headers "To:[EMAIL PROTECTED]" deliver=~/LeBox
>
> What I have noticed is that if the address [EMAIL PROTECTED] is
> Bcc'ed, but the To: header is some other address, the above line in my
> incoming filter disposes the message to ~/LeBox.
A couple of things. First, the '{1}' in your RE means exactly 1 of
the last "entity" that matched. The last entity above is the letter
'm', not the string '[EMAIL PROTECTED]'. If you want only 1 match of
the entire address, enclose it in parenthesis, like this:
"...([EMAIL PROTECTED]){1}..."
Second, you aren't anchoring the 'To:' at the beginning of a line, so
perhaps your MTA is inserting a 'Delivered-To:' field into the headers
that contains the envelope recipient. This would mean that, although
'[EMAIL PROTECTED]' was Bcc'ed and his/her address is not in the 'To:'
field, your RE would still match. Since all header fields must start
at the beginning of a line, use the following RE to prevent the
'Delivered-To:' (or anything else that ends in 'To:') from matching:
headers "^To:.*([EMAIL PROTECTED]){1}" deliver=~/LeBox
> The only way this can happen, the way I see it, is that TMDA is
> "smart" to realize that the To: field should never be parsed (even
> if its specified inside a regular expression), and instead the
> envelope is analyzed for the recipient's address. This is a really
> great feature of TMDA's, but, I am allowing for the possibility that
> maybe I've done something wrong.
It's not that smart :)
> It might seem like a moot point, but it might be a good idea to
> update this in the TMDA incoming filter documentation. Thanks for
> confirming or negating my deduction.
Good idea. I'll make that clear.
Tim
_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users