The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Countering mail spam at the iptables level?

Discussion in 'E-mail Discussions' started by quanin, Dec 2, 2011.

  1. quanin

    quanin Well-Known Member

    Joined:
    Aug 18, 2011
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    We recently took on a couple of accounts that seem to have brought with them a lot of unwanted spammer attention. That's resulted in a pretty significant increase in mail trafick to the server, most of it not very helpful. I'm wondering if there's a halfway decent means, either within CPanel or that will work with CPanel, to have a certain number of rejected messages trigger a temporary block at the firewall level. I've done some digging on this and haven't found anything myself, but that doesn't necessarily mean there's nothing to find. I currently use configserver firewall, and while it does a decent job with everything else, it doesn't appear to support what I'm looking to do. If anyone's got a suggestion or two, that'd be appreciated. Thanks a lot for the help.
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You could simply have any IPs that hit the machine over a set number for port 25 will be blocked either permanently or temporarily. There's a discussion for doing this via iptables for port number 22 (SSH) at this location:

    Block brute force attacks with iptables

    This basically blocks any IPs that are hitting the machine 8 or more times in 60 seconds or less. You could do something similar for possibly IPs hitting the machine in 30 seconds or less 5 or more times on port 25. You'd simply have to revise the rules mentioned in the guide.
     
  3. quanin

    quanin Well-Known Member

    Joined:
    Aug 18, 2011
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    I may be able to make use of something like this in CSF itself. I'll investigate. Thanks.
     
Loading...

Share This Page