Solved

p3scan iptables rules

Posted on 2004-04-08
4
818 Views
Last Modified: 2010-05-18
hello,

May you know the http://p3scan.sourceforge.net/ project. It is a transperent pop3 proxy which use iptables to redirect tcp packets to port 8110 and run virus scanning. This port is p3scan own. The readme say: in the default case we can use the next iptables rule: "iptables -t nat -A PREROUTING -p tcp -i eth0 --dport pop3 -j REDIRECT --to 8110" and it's works fine when a packet coming from some clients from our local network. But I want to set up an another iptables rule, which say the next: if our linux gw (the p3scan runing on this server too) want to download our mails so that will be redirect to the port 8110 too.

thanks your help!
0
Comment
Question by:Kosztik
  • 2
4 Comments
 
LVL 5

Expert Comment

by:brabard
ID: 10785063
Well , the core of iptables rules that redirect some requests by ports/services is to catch the requests before leaving the gateway , so you can try -o eth1 in OUTPUT chain , assuming eth1 is the interface that connect you to the Internet .

Tommorow I will try it with my pop3vscan .
0
 
LVL 9

Assisted Solution

by:Alf666
Alf666 earned 25 total points
ID: 10787463
You can not do that. This would create a loop.

You need your linux box to be able to connect to POP3 servers on the internet. If you add a rule on the OUTPUT, then your p3scan will connect to itself. BAD !

The only thing you can do is to configure your clients on the gateway to connect directly to port 8110.
0
 
LVL 5

Accepted Solution

by:
brabard earned 100 total points
ID: 10789557
Alf666 is absolutely right , the use of this rule will maka e loop , but the answer is in the bottom of README file of my pop3vscan distribution . Assuming p3scan is running as a special user , the rules have to be :
iptables -t nat -A OUTPUT -p tcp --dport pop3 -m owner --uid-owner UID -j ACCEPT
iptables -t nat -A OUTPUT -p tcp --dport pop3 -j REDIRECT --to 8110

0
 

Author Comment

by:Kosztik
ID: 10789836
>  , but the answer is in the bottom of README file of my >pop3vscan distribution

oh really! Thank you !!!
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question