Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Howto get mail working
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
esc*
n00b
n00b


Joined: 19 Aug 2003
Posts: 55
Location: Finland

PostPosted: Sat May 01, 2004 12:29 pm    Post subject: Howto get mail working Reply with quote

Hello.
I have problem with pop3 mail account, gentoo is setup router/firewall box with iptables and squid proxy. I can use Internet (port80) on windows machines (homenetwork). But Outlook/pop3 mail doesnt work. I have put mailclient use same proxy port like web-browser but it cant connect port 110. Tryed open somehow that port, iptables -A INPUT -p tct -m tcp --port 110 -j ACCEPT but this is wrong method i know. So if anyone know what i need setup and where? Thanks.
Back to top
View user's profile Send private message
Little Nemo
l33t
l33t


Joined: 29 Mar 2004
Posts: 623
Location: Berlin, Germany

PostPosted: Sat May 01, 2004 1:33 pm    Post subject: Reply with quote

You need a forwarding rule for port 110 on the gateway.

Code:
/sbin/iptables -A FORWARD -i $DEV_INT -o $DEV_EXT -s $NET_INT -d $POPSERVER -p tcp --dport 110 --sport $UNPRIVPORTS -m state NEW,ESTABLISHED -j ACCEPT
/sbin/iptables -A FORWARD -i $DEV_EXT -o $DEV_INT -s $POPSERVER -d $NET_INT -p tcp --dport $UNPRIVPORTS --sport 110 -m state ESTABLISHED -j ACCEPT


$DEV_INT is the local interface, $DEV_EXT the external interface. $NET_INT is your network, $POPSERVER the pop server's IP address. $UNPRIVPORTS are defined as "1024:65535". You need the ipt_state module for "-m state" to work.

I assume you do not use public addresses on your internal network. So you need masquerading, too:

Code:
iptables -t nat -A POSTROUTING -o $DEV_EXT -j MASQUERADE


If you're lucky to have a fixed external address, use SNAT instead of MASQUERADE and append a --to destination.

Make sure your system can forward IP:

Code:
echo 1 > /proc/sys/net/ipv4/ip_forward


Don't use all of this blindly. You should read the documentation at http://www.netfilter.org/ and know what you're doing before applying it. You also need default rules that forbid everything you don't allow explicitly.

How did you setup outgoing mail, by the way? Did you configure an MTA on the gateway?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum