mouss wrote:
> Mike Kenny wrote:
>>
>>
>>     I hope to use this to cut down on spam and phishing attempts,
>> because
>>     I could identify legitimate mail by virtue of having the correct
>>     sender address (or at least domain) and recipient. That is, mail
>> from
>>     [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> to the
>>     [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> is very likely
>> mail
>>     from my bank, but mail from [EMAIL PROTECTED]
>>     <mailto:[EMAIL PROTECTED]> to that same address
>>     is not.  Likewise, mail from [EMAIL PROTECTED]
>>     <mailto:[EMAIL PROTECTED]> to [EMAIL PROTECTED]
>>     <mailto:[EMAIL PROTECTED]>
>>     is invalid.
>>
>>
>> Won't greylisting fulfill most of the requirements here?
>
> No. greylisting will not block mail from real MTAs that retry, unless
> they have been block listed in the meantime.
>
Greylisting may not fulfill it exactly, but milter-greylist can.

Despite being designed for greylisting, it has a powerful ACL language
for white, black, or greylisting hosts. You can also not greylist at all
by not declaring any greylist statements and making the "default action"
acl a whitelist.

The following greylist.conf would do what you want:
-----------------------
acl whitelist from [EMAIL PROTECTED] rcpt [EMAIL PROTECTED]
acl blacklist rcpt [EMAIL PROTECTED]
acl whitelist default
-----------------------

Since the rules get applied in-order and the first match wins, the first
rule will allow mail from your bank, while the second will 5xx anything
else sent to that address.

There's even examples of combining from and rcpt into a single
statement, and if you want to could tack on domain or addr to restrict
the hostname or IP address of the sending server.

If you wanted to make it work for "anyone" at mybank.com you can switch
to a regex for the from part:

acl whitelist from /@mybank\.com/ rcpt [EMAIL PROTECTED]


Now, that assumes you use sendmail or postfix, (ie: you can use
sendmail-style milters with your MTA.)

You might also be able to get milter-regex to do something like this,
but I've not used it before..






Reply via email to