Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: exim: users

RBL + Blacklisting + Whitelisting

 

 

exim users RSS feed   Index | Next | Previous | View Threaded


sysadm at giversen

Nov 15, 2006, 12:25 PM

Post #1 of 5 (438 views)
Permalink
RBL + Blacklisting + Whitelisting

--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/


wbh at conducive

Nov 15, 2006, 12:29 PM

Post #2 of 5 (431 views)
Permalink
Re: RBL + Blacklisting + Whitelisting [In reply to]

sysadm wrote:



=========

Looks to be quite effective! Stripped the body right out of the message.

How'd ya do that?

Bill


--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/


sysadm at giversen

Nov 15, 2006, 12:36 PM

Post #3 of 5 (413 views)
Permalink
RBL + Blacklisting + Whitelisting [In reply to]

Dear exim users
I'm a newbie with exim, so please ignore my ignorance.
I'm trying to construct a set-up where I do the RBL reject at the
incomming SMTP level. In the set up I will also try to do host based
black/white list reject/accept.

I have created the following, will that do, or have I missed something?

#for stopping spam at SMTP level start:
deny message = rejected because $sender_host_address is in a
local blacklist of hosts
hosts = ${if exists {/etc/exim/black-list-hosts} \
{/etc/exim/black-list-hosts}{}}

deny message = rejected because $sender_host_address is in a
black list at $dnslist_domain\n$dnslist_text
dnslists =
relays.ordb.org:sbl.spamhaus.org:xbl.spamhaus.org:sbl-xbl.spamhaus.org:bl.spamcop.net:\

dnsbl.njabl.org:blackholes.mail-abuse.org:dialups.mail-abuse.org:relays.mail-abuse.org:\

dnsbl.sorbs.net:http.dnsbl.sorbs.net:socks.dnsbl.sorbs.net:misc.dnsbl.sorbs.net:\

smtp.dnsbl.sorbs.net:web.dnsbl.sorbs.net:spam.dnsbl.sorbs.net:block.dnsbl.sorbs.net:\

zombie.dnsbl.sorbs.net:dul.dnsbl.sorbs.net:rhsbl.sorbs.net:cbl.abuseat.org:list.dsbl.org:\
opm.blitzed.org
!hosts = ${if exists {/etc/exim/white-list-hosts} \
{/etc/exim/white-list-hosts}{}}
#for stopping spam at SMTP level stop:

I have placed it in the top of the ACL just after the acl_check_rcpt: Is
that the best way to place it?

In the white-list-hosts and black-list-hosts files there is one host per
line. but is it possible to give an entire range of ip address by for
instance 193.243.4.0/24 or how do i do that ?


Regards Jørgen Giversen

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/


malcolm at vibrantlogic

Nov 15, 2006, 1:08 PM

Post #4 of 5 (417 views)
Permalink
Re: RBL + Blacklisting + Whitelisting [In reply to]

sysadm wrote:
> Dear exim users
> I'm a newbie with exim, so please ignore my ignorance.
> I'm trying to construct a set-up where I do the RBL reject at the
> incomming SMTP level. In the set up I will also try to do host based
> black/white list reject/accept.
>
> I have created the following, will that do, or have I missed something?
>
> #for stopping spam at SMTP level start:
> deny message = rejected because $sender_host_address is in a
> local blacklist of hosts
> hosts = ${if exists {/etc/exim/black-list-hosts} \
> {/etc/exim/black-list-hosts}{}}
>
> deny message = rejected because $sender_host_address is in a
> black list at $dnslist_domain\n$dnslist_text
> dnslists =
> relays.ordb.org:sbl.spamhaus.org:xbl.spamhaus.org:sbl-xbl.spamhaus.org:bl.spamcop.net:\
>
> dnsbl.njabl.org:blackholes.mail-abuse.org:dialups.mail-abuse.org:relays.mail-abuse.org:\
>
> dnsbl.sorbs.net:http.dnsbl.sorbs.net:socks.dnsbl.sorbs.net:misc.dnsbl.sorbs.net:\
>
> smtp.dnsbl.sorbs.net:web.dnsbl.sorbs.net:spam.dnsbl.sorbs.net:block.dnsbl.sorbs.net:\
>
> zombie.dnsbl.sorbs.net:dul.dnsbl.sorbs.net:rhsbl.sorbs.net:cbl.abuseat.org:list.dsbl.org:\
>
There are a few problems with the RBL list you're trying to use

1. You're querying the same data multiple times. sbl-xbl.spamhaus.org is
the same as sbl.spamhaus.org + xbl.spamhaus.org. Also, cbl.abuseat.org
is incorporated in the XBL. dnsbl.sorbs.net is an aggregate zone of most
of those that you've listed. See http://www.au.sorbs.net/using.shtml

2. mail-abuse.org is defunct

3. You can't query a righthandside blocklist (ie one that lists domain
names, not IP addresses), in this manner. rhsbl.sorbs.net is useless in
this context

--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/


wbh at conducive

Nov 15, 2006, 1:54 PM

Post #5 of 5 (413 views)
Permalink
Re: RBL + Blacklisting + Whitelisting [In reply to]

sysadm wrote:
> Dear exim users
> I'm a newbie with exim, so please ignore my ignorance.
> I'm trying to construct a set-up where I do the RBL reject at the
> incomming SMTP level. In the set up I will also try to do host based
> black/white list reject/accept.
>
> I have created the following, will that do, or have I missed something?
>

IIRC it is the physician's maxim: 'First, do no harm'.

There are two 'classes' of arrival you will want to exempt from
testing:

- any relay_hosts or other 'VIP' collaborators. Not liely to be RBL'ed, but best
to *insure* they have a 'pass'.

- Your own MUA clients connecting and authenticating. These will often come
from (x)dsl/cable/WiFi/dialup, and many such networks are blacklisted,
voluntarily or otherwise.

As to how to 'skip' these past the testing, have a look at:

- authenticated = *

- the effect of 'endpass' on an accept clause to skip over all subsequent
clauses in an acl_smtp_[phase]

- the use of an acl_c/m variable to carry an exemption flag which can be tested
with a conditional at each individual clause.


> #for stopping spam at SMTP level start:
> deny message = rejected because $sender_host_address is in a
> local blacklist of hosts
> hosts = ${if exists {/etc/exim/black-list-hosts} \
> {/etc/exim/black-list-hosts}{}}
>
> deny message = rejected because $sender_host_address is in a
> black list at $dnslist_domain\n$dnslist_text
> dnslists =
> relays.ordb.org:sbl.spamhaus.org:xbl.spamhaus.org:sbl-xbl.spamhaus.org:bl.spamcop.net:\
>
> dnsbl.njabl.org:blackholes.mail-abuse.org:dialups.mail-abuse.org:relays.mail-abuse.org:\
>
> dnsbl.sorbs.net:http.dnsbl.sorbs.net:socks.dnsbl.sorbs.net:misc.dnsbl.sorbs.net:\
>
> smtp.dnsbl.sorbs.net:web.dnsbl.sorbs.net:spam.dnsbl.sorbs.net:block.dnsbl.sorbs.net:\
>
> zombie.dnsbl.sorbs.net:dul.dnsbl.sorbs.net:rhsbl.sorbs.net:cbl.abuseat.org:list.dsbl.org:\
> opm.blitzed.org
> !hosts = ${if exists {/etc/exim/white-list-hosts} \
> {/etc/exim/white-list-hosts}{}}
> #for stopping spam at SMTP level stop:
>

You need only a fraction of those. Some are duplicates, some are hors de combat.
Many of the better ones carry highly similar listings or are even aggregates of
the others.

For a starting point, have a look at the ones SpamAssassin is using at any given
rev level. These are usually troublefree, as SA is a good sized project in its
own right, and changes what it uses as needed to make use of the more effective
ones.

> I have placed it in the top of the ACL just after the acl_check_rcpt: Is
> that the best way to place it?
>

It will work there.

*Wherever* you put it:

- the whitelist check should come first.

- any 'Local' blacklist next

- then the remote callout.

Even if you change the 'deny' to a 'warn' and carry a score forward for later
action, there is no point in making the RBL callout if you already know you wish
to *either* whitelist OR blacklist.

As to 'where':

The earliest you can do IP-based RBL checks is in acl_smtp_connect.

With use of a 'warn' instead of a 'deny', you may carry the results forward for
later use - all the way into the message queu for routers to act on if stored in
an acl_m9x) variable.

BUT: The earliest you can extract per-recipient preferences is in acl_smtp_rcpt.
i.e. - if you have/want to have some addresses that will accept traffic even if
it has hit RBL scores, others that will tolerate one hit, but not two, etc.

AND; The latest you can DO per-recipient rejection with Exim is also in
acl_smtp_rcpt. Once into the DATA phase most MTA can no longer do per-recipient
rejections.

So - yes, you have it in a place where it will work.

> In the white-list-hosts and black-list-hosts files there is one host per
> line. but is it possible to give an entire range of ip address by for
> instance 193.243.4.0/24 or how do i do that ?
>

CAVEAT:

An Exim 'hostlist' and the 'hosts' call that uses such a list OR those you
construct (see 'dsearch') have special rules.

More than just format is involved - 'hosts' can trigger an external DNS lookup
of element in a list (cached, but still...).

There is no point in having Exim do that when you already have the information
to make a pass/block decision on-box. Especially if it is in the LBL because it
*doesn't* return properly.

For some tests, a linear search called by a 'condition =' is more appropriate
than a 'hosts = '. See lsearch and wildlsearch.

Look also at Exim's specialized iplsearch tool for working with IP numbers and
ranges.

Different lookup, comparison, and match tools fit each content type most
effectively, so expect to have more than one whitelist, and more than one blacklist.

Most of all..

- turn your logging verbosity up before you start (log_selector = +all)

- add plenty of 'log_message' and 'logwrite' to acl's when first testing them

- tail or analyze the logs carefully

- use 'warn' first, monitor the effects,

- then switch to 'defer' and monitor some more,

- before cutting over to 'deny' - and monitor the effects of that, too.

HTH,

Bill



--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/

exim users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.