Re: [exim] Drop mail with some tld domain

Top Page
Delete this message
Reply to this message
Author: John Robinson
Date:  
To: Balzi Andrea
CC: Exim, Users
Subject: Re: [exim] Drop mail with some tld domain
On 13/09/2006 09:47, Balzi Andrea wrote:
> I have problems of RAM amount on my server and have had to disable the
> spamassassin.
> Now I would want to block to all the mail that they arrive from
> determines domains that end with TLD like .hu .ar .br .au .tw etc.
> I have insert the follow line on acl_check_rcpt:
>
> drop    message       = mail drop because $sender_address_domain is in
> our blacklist / mail scartata perche\' $sender_address_domain e\'
> presente nella nostra blacklist
>           !senders      = lsearch;/etc/exim4/whitelist_mails.cfg
>           sender_domains = lsearch;/etc/exim4/blacklist_domains.cfg

>
> This rule works only when the domain is like example.com
>
> In the file blacklist_domains.cfg I've insert the follow lines:
>
> ar
> br
> hu
> example.com
> ...
> example.it
>
> I've not found any example on the web or some function on the
> exim-specific documentation that can help me to make it.


Have a look at partial matching:
http://www.exim.org/exim-html-4.62/doc/html/spec_html/ch09.html#SECTpartiallookup

Without having tested it, what you probably want is something like
sender_domains = partial1-lsearch;/etc/exim4/blacklist_domains.cfg

and in blacklist_domains.cfg
*.ar
*.br
*.hu
example.com

Cheers,

John.