Solved

p3scan iptables rules

Posted on 2004-04-08
4
812 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now