Ubuntu This forum is for the discussion of Ubuntu Linux. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
11-28-2008, 05:00 AM
|
#1
|
Member
Registered: Jun 2008
Posts: 197
Rep:
|
Configuring IPTABLES for POP - Thunderbird
Hello Everybody,
I guess this is a very common requirement. I am using Ubuntu 8.04 on AMD-64bit with 2 Network cards, one connected to a Broadband Internet modem and the other connects to the LAN.
I am running squid on this server and is working ok except its not letting POP access through thunderbird. Thunderbird works without proxy so there is no configuration problem.
Below is my IPTABLES configuration
SQUID_SERVER="10.10.10.10"
export SQUID_SERVER
INTERNET="eth0"
export INTERNET
LAN_IN="eth1"
export LAN_IN
SQUID_PORT="3128"
export SQUID_PORT
clear
echo " The following values are set "
echo "SQUID_SERVER :"$SQUID_SERVER
echo "INTERNET :"$INTERNET
echo "LAN_IN :"$LAN_IN
echo "SQUID_PORT :"$SQUID_PORT
echo "=============="
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j DNAT --to 10.10.10.10:3128
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
iptables -A INPUT -i $INTERNET -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables --table nat --append POSTROUTING --out-interface $INTERNET -j MASQUERADE
iptables --append FORWARD --in-interface $LAN_IN -j ACCEPT
iptables -A INPUT -i $LAN_IN -j ACCEPT
iptables -A OUTPUT -o $LAN_IN -j ACCEPT
iptables -t nat -A PREROUTING -i $LAN_IN -p tcp --dport 80 -j DNAT --to $SQUID_SERVER:$SQUID_PORT
iptables -t nat -A PREROUTING -i $INTERNET -p tcp --dport 80 -j REDIRECT --to-port $SQUID_PORT
iptables -A INPUT -j LOG
iptables -A INPUT -j DROP
iptables-save -c > /etc/iptables.rules
cp /etc/iptables.rules /etc/iptables.old
iptables-save -c > /etc/iptables.rules
Now even if i add iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 995/465 -j REDIRECT --to-port 3128
It doesnt work.
Any help is appreciated.
Avinash
|
|
|
11-28-2008, 06:23 AM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
squid is an http proxy, it can't handle pop traffic, and isn't meant to have anything to do with mail at all.
|
|
|
12-03-2008, 01:57 AM
|
#3
|
Member
Registered: Jun 2008
Posts: 197
Original Poster
Rep:
|
Ya, but how do i get thunderbird working through squid? If squid doesnt have any role to play how do i configure IPTABLES to get thunderbird working.
Avinash
|
|
|
12-03-2008, 01:59 AM
|
#4
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
did you not read what i said?? SQUID IS NOT A POP3 / SMTP PROXY.
|
|
|
12-03-2008, 02:56 AM
|
#5
|
Member
Registered: Jun 2008
Posts: 197
Original Poster
Rep:
|
Thank you for your answer sir!! I understand squid is not a POP3 or smtp proxy.
I will figure out the IPTABLES!
Quote:
Originally Posted by acid_kewpie
did you not read what i said?? SQUID IS NOT A POP3 / SMTP PROXY.
|
|
|
|
All times are GMT -5. The time now is 07:01 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|