LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 11-28-2008, 05:00 AM   #1
avinash.rao
Member
 
Registered: Jun 2008
Posts: 197

Rep: Reputation: 30
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
 
Old 11-28-2008, 06:23 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
squid is an http proxy, it can't handle pop traffic, and isn't meant to have anything to do with mail at all.
 
Old 12-03-2008, 01:57 AM   #3
avinash.rao
Member
 
Registered: Jun 2008
Posts: 197

Original Poster
Rep: Reputation: 30
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
 
Old 12-03-2008, 01:59 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
did you not read what i said?? SQUID IS NOT A POP3 / SMTP PROXY.
 
Old 12-03-2008, 02:56 AM   #5
avinash.rao
Member
 
Registered: Jun 2008
Posts: 197

Original Poster
Rep: Reputation: 30
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 View Post
did you not read what i said?? SQUID IS NOT A POP3 / SMTP PROXY.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sharing folder between thunderbird and evolution to save pop mails linuxlover.chaitanya Linux - Software 3 05-15-2008 08:25 AM
SMTP/Pop authentication Reset in Thunderbird arctic Linux - Software 3 12-09-2007 07:17 AM
Thunderbird, Get IMAP and POP to download all messages to local folder sparckis Linux - Newbie 4 01-29-2007 02:09 AM
Can I switch an existing Thunderbird account from POP to IMAP? pnellesen Linux - Software 4 08-24-2005 11:15 AM
Clicking on links in Thunderbird doesn't pop up a browser window Valhalla Linux - Software 6 04-19-2005 08:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 04:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration