Results 1 to 11 of 11
Thread: Block one IP > mail
-
09-02-2009, 12:39 PM #1WHT Addict
- Join Date
- Oct 2005
- Posts
- 129
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.
-
09-02-2009, 01:25 PM #2Web Hosting Guru
- 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
-
09-02-2009, 01:39 PM #3WHT Addict
- Join Date
- Oct 2005
- Posts
- 129
i did even ping to IP doesnt work
that will do trick?
-
09-02-2009, 01:50 PM #4Junior Guru Wannabe
- Join Date
- Aug 2009
- Posts
- 38
If you configured IPTables correctly for this, then yes, that is all you need.
-
09-02-2009, 02:03 PM #5Web Hosting Guru
- Join Date
- Jun 2008
- Location
- Los Angeles, CA
- Posts
- 272
You should be all set.
█ Lebnene
█ Consultant: Colocation, Cloud & Dedicated Servers
-
09-02-2009, 02:13 PM #6WHT Addict
- Join Date
- Oct 2005
- Posts
- 129
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?
-
09-02-2009, 04:04 PM #7Junior Guru Wannabe
- 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
-
09-02-2009, 07:17 PM #8WHT Addict
- Join Date
- Oct 2005
- Posts
- 129
Thanks Mike but i did remove -i eth0 bcoz Iptables told me to.
-
09-02-2009, 07:38 PM #9Junior Guru Wannabe
- Join Date
- Aug 2009
- Location
- Bangalore
- Posts
- 59
Hey friend, It's fine
-
09-02-2009, 08:37 PM #10Web Hosting Master
- 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.
-
09-04-2009, 02:18 PM #11Junior Guru Wannabe
- Join Date
- Jun 2009
- Posts
- 72
Windows VPS | Linux Hybrid Server | 99.9% Uptime
http://www.odishahosting.com ( USA DC)
http://www.odishahosting.in ( INDIA DC)
Similar Threads
-
web host block php mail... alternatives?
By ariopp in forum Web HostingReplies: 12Last Post: 02-15-2009, 06:21 PM -
How to block a mail server
By marekc in forum Hosting Security and TechnologyReplies: 2Last Post: 12-13-2008, 02:41 AM -
block outgoing mail
By Saryooo in forum Hosting Security and TechnologyReplies: 2Last Post: 05-28-2007, 04:37 AM -
How can I block mail access on a domain?
By sytker in forum Hosting Security and TechnologyReplies: 5Last Post: 06-23-2006, 02:05 PM -
block incoming mail based on ip?
By r2tech in forum Dedicated ServerReplies: 4Last Post: 05-28-2005, 01:35 AM