Solved

p3scan iptables rules

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help instaling linux on vmware 36 81
iptables ubuntu BLOCK all 2 79
Measure data download 2 94
Xymon customize http timeout 2 65
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…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

910 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

20 Experts available now in Live!

Get 1:1 Help Now