N
N
Nicholas2011-06-21 08:30:24
Exim
Nicholas, 2011-06-21 08:30:24

Iptables, exim, mail from only one IP?

How can I use iptables or configure Exim to make my mail server receive mail from only one/several specific hosts?
Those. I want mail to reach the mail server only from IP: 22.33.44.55 and 66.77.88.99 and from no other.
OS:

####@###:/# uname -a<br/>
Linux ######## 2.4.16 #25 Чтв Авг 1 13:29:04 SAMST 2002 i686 unknown<br/>

Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Komarov, 2011-06-21
@FreeTibet

exim.conf
hostlist relay from hosts = 22.33.44.55:66.77.88.99

I
Ivan Komarov, 2011-06-21
@FreeTibet

and in iptables something like this:
/sbin/iptables -A INPUT -p tcp -m tcp -s 0.0.0.0/0 -i interface --dport 25 -j DROP
/sbin/iptables -A OUTPUT -p tcp -m tcp -d 0.0.0.0/0 -o interface --sport 25 -j DROP
/sbin/iptables -A INPUT -p tcp -m tcp -s 22.33.44.55/32 -i interface --dport 25 -j ACCEPT
/sbin/iptables -A OUTPUT -p tcp -m tcp -d 22.33.44.55/32 -o interface --sport 25 -j ACCEPT
/sbin/iptables -A INPUT -p tcp -m tcp -s 66.77.88.99/32 -i interface --dport 25 -j ACCEPT
/sbin/iptables -A OUTPUT -p tcp -m tcp -d 66.77.88.99/32 -o interface --sport 25 -j ACCEPT

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question