Re: [Exim] Basic Domain e-mail address blocking

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Darren Casey
Dátum:  
Címzett: Russell King
CC: exim-users
Tárgy: Re: [Exim] Basic Domain e-mail address blocking
> Coming from mainly a sendmail background.. I'm having a little trouble
with the below scenario.
>
> Running Exim 4.20.. All I want to simply do is have a file such as

/etc/spam with a list of e-mails
> (joe@???) or domains (spammer.com) that will be rejected with a

550.. "Domain not permitted"
> etc..


I use :-

deny recipients = @@lsearch;/etc/reject-by-domain
message = $local_part@$domain is an invalid e-mail address

And
MYSQL_BLOCK_SENDER = select user from block where condition=
'${quote_mysql:$domain}' and user = '${quote_mysql:$local_part}' limit 1

        deny message = Sender blocked
        condition    = ${lookup mysql {MYSQL_BLOCK_SENDER}{true}{false}}


We have catchall accounts and sometimes want to block some so the first is
useful

The file is in text format so lsearch is used, the @@usage is as follows
If a pattern starts with ``@@'' followed by a single-key lookup item (for
example, @@lsearch;/some/file), the address that is being checked is split
into a local part and a domain. The domain is looked up in the file. If it
is not found, there is no match. If it is found, the data that is looked up
from the file is treated as a colon-separated list of local part patterns,
each of which is matched against the subject local part in turn.

My file for instance is :-

carpediem-it.co.uk : priceless
php3hosting.com : altphp : noreply
php3hosting.co.uk : altphp : noreply
php4hosting.co.uk : altphp : noreply
php4hosting.com : altphp : noreply : carol

You could probably use the same format just by putting :-

deny senders = @@lsearch;/etc/reject-by-domain
message = $local_part@$domain does not want your email

Just put the domain then the localpart or a * for wildcards i.e.

spammer.com : *

anotherspammer.com : spam : dave : russell

Hope that goes some way to helping



Regards

Darren