Wednesday, March 24, 2010

RBL Configuration with Exim

Configure RBL with Exim
Firt create 3 files
rblblacklist
It is a manual blacklist, it rejects specific spammer hosts BEFORE they can send more email to your server.

rblbypass
It will email testing for specific destination (local) domains that don't want RBL filtering or prefer SpamAssassin tagging.

rblwhitelist
It will email testing for listed incoming hosts, (wildcards allowed), in case an important client's mailserver is listed on an RBL you use, also automatically excludes relayhosts.

touch /etc/rblblacklist rblbypass rblwhitelist

-------------------------------
EXIM CONFIGURATION EDITOR
-------------------------------
Now edif exim.conf file any your any favorite text editor like vi/nano/pico

# pico /etc/exim.conf

######################################################################

# MAIN CONFIGURATION SETTINGS #

######################################################################

# Specify your host's canonical name here. This should normally be the fully

# qualified "official" name of your host. If this option is not set, the

# uname() function is called to obtain the name. In many cases this does

# the right thing and you need not set anything explicitly.

# primary_hostname =

Add these Linux Here

domainlist rbl_blacklist = lsearch;/etc/exim/rblblacklist

domainlist rbl_bypass = lsearch;/etc/exim/rblbypass

hostlist rbl_whitelist = lsearch;/etc/exim/relayhosts : partial-lsearch;/etc/exim/rblwhitelist

######################################################################

# ACL CONFIGURATION #

# Specifies access control lists for incoming SMTP mail #

######################################################################

begin acl

# This access control list is used for every RCPT command in an incoming

# SMTP message. The tests are run in order until the address is either

# accepted or denied.

acl_check_rcpt:

# Accept if the source is local SMTP (i.e. not over TCP/IP). We do this by

# testing for an empty sending host field.

accept hosts = :

Add these Lines Here

#**#

#**# RBL List Begin

#**#

#

# Always accept mail to postmaster & abuse for any local domain

#

accept domains = +local_domains

local_parts = postmaster:abuse

#

# Check sending hosts against DNS black lists.

# Accept all locally generated messages

# Reject message if address listed in blacklist.

deny message = Message rejected because $sender_fullhost is blacklisted at $dnslist_domain see $dnslist_text :

!hosts = +relay_from_hosts

!authenticated = *

dnslists = dnsbl.njabl.org : bl.spamcop.net : sbl.spamhaus.org : list.dsbl.org : cbl.abuseat.org :

# RBL Bypass Local Domain List

!domains = +rbl_bypass

# RBL Whitelist incoming hosts

!hosts = +rbl_whitelist

#**#

#**# RBL List End

#**#

######################################################################

# ROUTERS CONFIGURATION #

# Specifies how addresses are handled #

######################################################################

# THE ORDER IN WHICH THE ROUTERS ARE DEFINED IS IMPORTANT! #

# An address is passed to each router in turn until it is accepted. #

######################################################################

begin routers

# This router routes to remote hosts over SMTP by explicit IP address,

# when an email address is given in "domain literal" form, for example,

# . The RFCs require this facility. However, it is

# little-known these days, and has been exploited by evil people seeking

# to abuse SMTP relays. Consequently it is commented out in the default

# configuration. If you uncomment this router, you also need to uncomment

# allow_domain_literals above, so that Exim can recognize the syntax of

# domain literal addresses.

# domain_literal:

# driver = ipliteral

# domains = ! +local_domains

# transport = remote_smtp


Add These Lines Here

# Deny and send notice to list of rejected domains.

reject_domains:

driver = redirect

# RBL Blacklist incoming hosts

domains = +rbl_blacklist

allow_fail

data = :fail: Connection rejected: SPAM source $domain is manually blacklisted


No comments:

Post a Comment