Results 1 to 11 of 11
  1. #1

    Block one IP > mail

    Anyone know how to block one specific IP
    So that my box couldn't send Email to that IP
    By PHP mail(); or SMTP ?

    Is APF -d IP enough?

    Thx in advice.

  2. #2
    Join Date
    Jun 2008
    Location
    Los Angeles, CA
    Posts
    272
    use iptables to block all outgoing traffic to the specific IP
    █ Lebnene
    █ Consultant: Colocation, Cloud & Dedicated Servers

  3. #3
    i did even ping to IP doesnt work
    that will do trick?

  4. #4
    Join Date
    Aug 2009
    Posts
    38
    If you configured IPTables correctly for this, then yes, that is all you need.

  5. #5
    Join Date
    Jun 2008
    Location
    Los Angeles, CA
    Posts
    272
    You should be all set.
    █ Lebnene
    █ Consultant: Colocation, Cloud & Dedicated Servers

  6. #6
    Well to be honest I don't use iptables, i Use APF to block traffic.
    But i get APF uses iptables.

    I got in/out traffic blocked to IP that i wanted by adding

    APF -d IPadress

    rule

    i wonder if it is enough?

  7. #7
    Join Date
    Aug 2009
    Location
    Bangalore
    Posts
    59
    run the commands below in your server command prompt.

    /sbin/iptables -A OUTPUT -p tcp -i eth0 -s x.x.x.x --dport 25 -j DROP
    /etc/init.d/iptables save

    /etc/init.d/iptables restart

    replace the x.x.x.x with the IP address that you want to block.


    Thanks,
    Mike

  8. #8
    Thanks Mike but i did remove -i eth0 bcoz Iptables told me to.

  9. #9
    Join Date
    Aug 2009
    Location
    Bangalore
    Posts
    59
    Hey friend, It's fine

  10. #10
    Join Date
    Nov 2004
    Location
    Australia
    Posts
    1,737
    apf uses iptables, it's just an easier interface to iptables. So if you've blocked the site with "apf -d" and you can't ping it, the site will be cut off.

    If you really want to test it, try "telnet 1.2.3.4 25" where 1.2.3.4 is the IP you blocked; if it times out, then you know you've cut it off successfully. If you want to be even smarter, you could try turning iptables off.

  11. #11
    Quote Originally Posted by Cameleon View Post

    I got in/out traffic blocked to IP that i wanted by adding

    APF -d IPadress

    rule

    i wonder if it is enough?
    yes that will work fine.
    Windows VPS | Linux Hybrid Server | 99.9% Uptime
    http://www.odishahosting.com ( USA DC)
    http://www.odishahosting.in ( INDIA DC)

Similar Threads

  1. web host block php mail... alternatives?
    By ariopp in forum Web Hosting
    Replies: 12
    Last Post: 02-15-2009, 06:21 PM
  2. How to block a mail server
    By marekc in forum Hosting Security and Technology
    Replies: 2
    Last Post: 12-13-2008, 02:41 AM
  3. block outgoing mail
    By Saryooo in forum Hosting Security and Technology
    Replies: 2
    Last Post: 05-28-2007, 04:37 AM
  4. How can I block mail access on a domain?
    By sytker in forum Hosting Security and Technology
    Replies: 5
    Last Post: 06-23-2006, 02:05 PM
  5. block incoming mail based on ip?
    By r2tech in forum Dedicated Server
    Replies: 4
    Last Post: 05-28-2005, 01:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •