Erik Max Francis <[EMAIL PROTECTED]> writes:
> I couldn't see anything about this in the documentation, but maybe I'm
> missing something obvious. Is there a way to negate rules?
Not in the general sense you're referring to. It's something I'll
explore, though. It's an interesting idea.
> The specific application I can think of is where you want in effect an
> assert, to declare that something should be the case, and if it isn't,
> take a certain action (say, hold or drop). I, for instance, get email
> to a wide variety of addresses, but have no interest in seeing something
> that isn't addressed properly, something very common with bulk emails (I
> mean what appears in the To: header, rather than what is specified in
> teh SMTP RCPT TO:<...> envelope, since obviously that must have been
> valid for me to see it). Further, it can ameliorate dictionary attacks
> in certain cases (turning the incoming email to a hold or drop instead
> of a bounce).
>
> The negation option would seem to make sense with almost all
> source/matches, for instance:
>
> # If the mail isn't addressed to a valid recipient, drop it.
> to-list -not ~/.tmda/lists/valid-recipients drop
>
> Does such functionality exist? If not, wouldn't it make sense?
Since the 'to*' rules match against the SMTP envelope receiver, the
specific example you give above wouldn't work anyhow. However, you
can accomplish the effect you want today.
First, set the default action, ACTION_INCOMING, to 'drop'. Then add a
rule similar to the following to the very end of your incoming filter.
Use your email addresses in your regular expression. This one matches
two of my base addresses ('tim' and 'thl') and any extensions
following those bases.
headers '^To:.*(?:\n[ \t]+.*)?(?:tim|thl)(?:-.*?)[EMAIL PROTECTED]' confirm
The idea is to catch all addresses on your whitelist earlier and
deliver them appropriately. Any addresses that manage to make it all
the way through will be compared to your valid addresses and a confirm
will be sent (or you can hold them, or deliver them, whatever you
prefer). Finally, if the regular expression doesn't match, the
default action (drop) will take place. You don't have to drop, of
course. You could also bounce or hold, again as you prefer.
Tim
_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users