Best-Selling Hosting

Top Rated Providers

Editors Pick

Stop Spam At The Server with Exim RBL Published: Sep 21, 2004
  • Rating

    4/5

Do you need more granular control over some of your clients? Instead of limiting them to a certian amount of bandwidth per month, how about per week, day or even hour? Apache module mod_throttle is the answer.

This Apache module is intended to reduce the load on your server & bandwidth generated by popular virtual hosts, directories, locations, or users according to supported polices (see below) that decide when to delay or refuse requests. Also mod_throttle can track and throttle incoming connections by IP address or by authenticated remote user.

Every request now passes through four levels of throttling, which are: by client's IP address (ThrottleClientIP), by authenticated remote user name (ThrottleRemoteUser), by local user ID (ThrottleUser), and by directory, location, virtual host, or server (ThrottlePolicy).

To install with cPanel, SSH into your server as root and perform the following:

cd /usr/src

wget http://www.snert.com/Software/mod_throttle/mod_throttle312.tgz

tar zxvf mod_throttle312.tgz

cd mod_throttle-3.1.2

pico Makefile

Then edit the line that reads:

APXS=apxs

And change it to read:

APXS=/usr/local/apache/bin/apxs

Save the file and then:

make

make install

service httpd restart

Usage

Best bet is to go to http://www.snert.com/Software/mod_throttle/ and read up on all the options, but I will give you an example of limiting a site, and how to monitor all your throttled sites status.

Edit your /etc/httpd/conf/httpd.conf and locate the virtualhost entry for the site you wish to throttle. Just BEFORE the </VirtualHost> entry, insert:

<IfModule mod_throttle.c>
ThrottlePolicy Volume 10G 30d
</IfModule>
<Location /throttle-me>
SetHandler throttle-me
</Location>

The ThrottlePolicy line is the key. The first number is the amount of data and acceptable letters are G, M and K. The second number is the period and acceptable letters are m, w, d, h, and s.

Then restart Apache (service httpd restart).

If you want to be able to see the status of all throttled sites on the server at once, go to the first virtualhost entry in your httpd.conf file (this should be the entry for your server's hostname) and add the following:

<Location /throttle-status>
SetHandler throttle-status
</Location>

Then restart Apache again, and you can go to http://host.name.com/throttle-status and see the status of all throttled sites.

Enjoy!

  • Rating

    4/5

Related Articles

Comments (29)

  • Gravatar - Mevrick
    Mevrick 03:20, October 3, 2004
    Do you have any list about the spam domain or ip ? because i don't know about the blacklist.<br />
    <br />
    Thanks
  • Gravatar - Steve
    Steve 23:10, October 3, 2004
    Mevrick, the domains included in the RBL ruleset have updated lists of spammers IPs that will be blocked from sending/receiving any email automatically.
  • Gravatar - Wilton Bennet
    Wilton Bennet 01:05, October 14, 2004
    I put the :\ in the end of each line RBL. Without that it happened error in Exim Configuration Editor.<br />
    <br />
    It is not possible line break in:<br />
    deny message = Message rejected because $sender_fullhost <br />
    is blacklisted at $dnslist_domain see $dnslist_text<br />
    <br />
    I put those alterations and it worked. Thank you.<br />
  • Gravatar - Gareth S
    Gareth S 01:17, October 28, 2004
    Just wanted to say thanks for a first rate guide on setting up and RBL / Spam Filter in Exim4.<br />
    <br />
    I'll admit the exim conf file scares the hell out of me but thanks to your guide I now have a lot of happy customers!! thanks a million!!
  • Gravatar - Ashish Chadha
    Ashish Chadha 13:53, October 31, 2004
    What Wilton Bennet told was absolutely corrent the author need this change to be updated. One more BUG in the tutorial.<br />
    <br />
    Replace the following lines :<br />
    <br />
    dnslists = dnsbl.njabl.org : <br />
    bl.spamcop.net : <br />
    sbl.spamhaus.org : <br />
    list.dsbl.org : <br />
    cbl.abuseat.org : <br />
    relays.ordb.org<br />
    <br />
    <br />
    #WITH<br />
    <br />
    dnslists = dnsbl.njabl.org : bl.spamcop.net : sbl.spamhaus.org : list.dsbl.org : cbl.abuseat.org :<br />
    <br />
    ----------------<br />
    <br />
    Remeber that no enter should be there. Below is the correct ACL Section :<br />
    <br />
    #**#<br />
    #**# RBL List Begin<br />
    #**#<br />
    #<br />
    # Always accept mail to postmaster & abuse for any local domain<br />
    #<br />
    accept domains = +local_domains<br />
    #**#<br />
    #**# Reject Email to Invalid Recipient<br />
    #**#<br />
    endpass<br />
    message = unknown user<br />
    verify = recipient<br />
    #**#<br />
    local_parts = postmaster:abuse<br />
    #<br />
    # Check sending hosts against DNS black lists.<br />
    # Accept all locally generated messages<br />
    # Reject message if address listed in blacklist.<br />
    deny message = Message rejected because $sender_fullhost is blacklisted at $dnslist_domain see $dnslist_text :<br />
    !hosts = +relay_hosts<br />
    !authenticated = *<br />
    dnslists = dnsbl.njabl.org : bl.spamcop.net : sbl.spamhaus.org : list.dsbl.org : cbl.abuseat.org : relays.ordb.org :<br />
    # RBL Bypass Local Domain List<br />
    !domains = +rbl_bypass<br />
    # RBL Whitelist incoming hosts<br />
    !hosts = +rbl_whitelist <br />
    #**#<br />
    #**# RBL List End<br />
    #**#
  • Gravatar - Icarus
    Icarus 19:18, November 2, 2004
    Are you the same that started this post?<br />
    <br />
    http://forums.ev1servers.net/showthread.php?s=&threadid=34689<br />
    <br />
    Othewise you should credit eMtnMan<br />
    <br />
  • Gravatar - Zach W
    Zach W 04:48, November 25, 2004
    <br />
    FreeBSD users manually modifying the exim configuration file note that Cpanel uses /usr/local/etc/exim/configure instead of /etc/exim.conf. Make a symbolic link if that's easier.<br />
    <br />
    Good tutorial!
  • Gravatar - Paul (eMtnMan)
    Paul (eMtnMan) 04:34, April 13, 2005
    No, I'm eMtnMan and this thread was posted with my permission. <br />
    <br />
    I just updated my original post with a great new anti-spam solution... see:<br />
    http://forums.ev1servers.net/showpost.php?p=342702<br />
    - and -<br />
    http://forums.ev1servers.net/showpost.php?p=343002<br />
    <br />
    Feel free to PM me at ev1... :)<br />
    <br />
    Paul (eMtnMan)
  • Gravatar - Stefin
    Stefin 17:20, May 9, 2005
    One of my clients ISP got black listed. Now he can't send emails through his domain hosted on our server from his outlook express.<br />
    <br />
    The client got dynamic IP, not a domain name.<br />
    <br />
    So i do i allow him to send emails using my server ?<br />
    <br />
    Lets say his IPS provide dialup IP in the range of 120.123.112.*<br />
    <br />
    Can i add IP (120.123.112.*) to <br />
    <br />
    /etc/rblwhitelist<br />
    <br />
    Regards,<br />
    <br />
    Yujin<br />
    <br />
  • Gravatar - Snowman
    Snowman 03:55, May 10, 2005
    Ive suddently found for no reason at all that a lot of incoming mail is being blocked and that exim is throwing 550 Administrative prohibition and 550 unknown user errors.<br />
    <br />
    Has anyone else seen these? <br />
    <br />
    The only change i have made to exim in the past few months is that i added the clamavconnector and set it up to scan in zips in a bid to stop the Sober worm.<br />
  • Gravatar - Enigmatic
    Enigmatic 22:16, July 1, 2005
    Is there a way to allow all host to relay outgoing messages.<br />
    Some of our people are getting blocked by RBLs so the script/line to skip scanning these hosts will be helpful.<br />
    <br />
    Thanks!
  • Gravatar - Steve
    Steve 15:52, July 26, 2005
    Add their IP to the whitelist...<br />
    <br />
    /etc/rblwhitelist
  • Gravatar - mike
    mike 22:24, January 24, 2006
    #**#<br />
    #**# Reject Email to Invalid Recipient<br />
    #**#<br />
    endpass<br />
    message = unknown user<br />
    verify = recipient<br />
    #**#<br />
    <br />
    This looks like it is included in WHM 10.8... Added quotes to the message, so you might try that if you are having problems with other versions.
  • Gravatar - Felipe
    Felipe 17:43, February 7, 2006
    Hi, I have the same problem as Stevie "A lot of my clients ISP got black listed. Now they can't send emails through his domain hosted on our server from his outlook express."<br />
    <br />
    There is any solution for this?<br />
    <br />
    I´m having to delete some rbls sites to solve the situation
  • Gravatar - Steve
    Steve 04:48, February 8, 2006
    It's the responsibility of the ISP to make sure their IPs remain clean. Get the client on the backs of their ISPs, this is needed to ensure spam remains at bay.
  • Gravatar - cristian
    cristian 04:14, May 24, 2006
    This is still valid before all maildir changes on recen cpanel/whm ?<br />
    <br />
    cristian
  • Gravatar - Raj
    Raj 07:49, June 3, 2006
    failed to open /etc/rblwhitelist for linear search: Permission denied (euid=47 egid=12) <br />
    <br />
    this error is showing in exim log any idea
  • Gravatar - AndyM
    AndyM 17:40, July 17, 2006
    I'd like to point out that if you are using SpamAssassin as part of cpanel, then mail is already checked against various RBLs and there's no need to add it separately to exim.<br />
    <br />
    However, this does require that the account owner enables SpamAssassin for their account, so if you want a server wide RBL check, then this will be of use to you.<br />
  • Gravatar - skylap
    skylap 11:05, November 22, 2006
    what this rbl setup needs is an auto whitelist of senders domains on your server so that your own clients don't get blacklisted when their ISP's become blacklisted because of other users, this RBL is great in theory but it causes more support tickets than worth it on some servers, we disabled on some busy servers and let clients use spam assassin instead independently.<br />
    <br />
    Basically enabling RBL on your servers will be a big headache with many clients not being able to send emails and many clients not being able to receive emails.
  • Gravatar - Rumahweb
    Rumahweb 20:18, January 30, 2007
    relays.ordb.org is closed. Please delete it from your exim.conf otherwise you'll get problem with callback feature
  • Gravatar - pankaj singh
    pankaj singh 23:14, February 6, 2007
    The exim is not working for particular domain and gives out following error with hylafax ::<br />
    <br />
    <br />
    arielp@lcjlawfirm.com R=dnslookup_relay_to_domains T=remote_smtp: SMTP error from remote mail server after RCPT TO:<arielp@lcjlawfirm.com>: host rcom-outblaze-com.mr.outblaze.com [205.158.62.207]: 550 <FaxMaster@poseidon.nofault.local>: No thank you rejected: Domain not found<br />
    2007-02-06 15:58:56 1HEXOy-0002qI-ML <= <> R=1HEXOw-0002p8-6g U=Debian-exim P=local S=2963<br />
    2007-02-06 15:58:56 1HEXOy-0002qI-ML ** faxmaster@poseidon.nofault.local <FaxMaster@poseidon.nofault.local>: Unrouteable address<br />
    2007-02-06 15:58:56 1HEXOy-0002qI-ML Frozen (delivery error message)<br />
    2007-02-06 15:58:56 1HEXOw-0002p8-6g Completed<br />
  • Gravatar - Wareagle
    Wareagle 15:43, February 9, 2007
    I just installed this on my server but the only one the is working is obm, the others are getting through, can someone tell me if they had the same problem and were to start looking to correct it. thanks
  • Gravatar - Roj Niyogi
    Roj Niyogi 09:04, February 21, 2007
    As mentioned by Rumahweb, remove relays.ordb.org since this breaks the ability for remote servers to verify using Callbacks. More information here:<br />
    <br />
    http://www.webhostingtalk.com/showthread.php?t=577577&highlight=sender+callout+verify<br />
    <br />
    Roj
  • Gravatar - jakejammin
    jakejammin 03:05, May 17, 2007
    Is there a way to rotate the exim_rejectlog as I can see this file getting big.<br />
    <br />
    Can I add that to the Logrotate?
  • Gravatar - jakejammin
    jakejammin 03:32, May 17, 2007
    Can you please not post that last question I asked, as I now found out that my Logrotate is set to rotate the exim_paniclog and exim_rejectlog.<br />
    <br />
    Sorry for the stupid question without atleast looking for the answer first.<br />
    <br />
    Jake Jammin
  • Gravatar - gaurav.gh
    gaurav.gh 22:51, May 25, 2007
    hi,<br />
    will thi work with cpanel 11 ?<br />
    are there any cheap package where you can get this enabled on the server without mail scanner.<br />
    <br />
    ofcourse great piece of work.<br />
    <br />
    look forward to get this done on 2 server atleast.
  • Gravatar - Trigger
    Trigger 05:53, July 5, 2007
    relays.ordb.org have now closed so should be removed. <br />
    Otherwise it will cause timeout issues on incoming mail to the server.
  • Gravatar - Diego
    Diego 19:40, August 24, 2007
    Im using cpanel 11 and I dont see any accept domains = +local_domains line at exim.conf so where should I locate <br />
    <br />
    #**#<br />
    #**# Reject Email to Invalid Recipient<br />
    #**#<br />
    endpass<br />
    message = unknown user<br />
    verify = recipient<br />
    #**#
  • Gravatar - sDaSeStono
    sDaSeStono 13:29, June 11, 2011
    how to unlock iphone
    iphone unlock

    <a href="http://ounlockiphone.com">unlock iphone</a> unlock iphone unlock iphone
    Hi, i had my laptop about 3 weeks ago and 1 week ago i went to log into my account and after i put my password in and clicked enter it said welcome with the loading icon and just stayed like that. It did this every time i tried to log on. I could start it in safe mode. I just wiped my computer clean and started again with the disk. The same thing happened yesterday. I do not have a virus after doing scans from Mcafee and two other virus scans and they all found nothing. I have restarted my whole computer again and i am desperate to know what happened and how i can stop it from happening Again. My OS is Windows 7. Thanks unlock iphone

    unlock iphone how to unlock iphone [url=http://ounlockiphone.com]how to unlock iphone [/url] iphone unlock

Add Your Thoughts

WebHostGear.com is a hosting directory, not a web host.

Copyright © 1998-2012 WebHostGear.com