LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-22-2009, 10:48 AM   #1
tungvs
Member
 
Registered: May 2008
Distribution: Centos; Ubuntu; Fedora
Posts: 98

Rep: Reputation: 15
How can I setup a transparent mail proxy ?


Hi all !

This is the topo:

Code:
Local mail servers  ====>   Router/Firewall  =====>    Internet
                                 |
                                 |
                                 V
                       Transparent Mail proxy
This is the problem:

I want to setup a transparent mail proxy, which will filter all spam/virus mails from local mail servers to the Internet. The requirement is if a local mail server A send a mail, the SMTP traffic will get to the Internet through my mail proxy (in fact, SMTP traffic will be redirected to the proxy, it's not a relay). If it's a spam/virus mail, it'll be discarded. Else, the SMTP traffic will be forward to the Internet. But the Internet mail servers must see the SMTP traffic as if it is from local mail server A, not from my proxy.

I have searched through several popular softwares like Postfix, ASSP, ProxSMTP. But they don't match the requirement. (Or I just cannot figure how to do)

Any suggestions, please ?

Thanks .
 
Old 12-22-2009, 12:37 PM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
I do not think transparent means what you think it means (sorry princess bride.)

A transparent proxy is visible but requires no setup by the end user typically.
 
Old 12-22-2009, 12:40 PM   #3
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
why would mail need to come from a local mail server? The from address wouldn't change at all, surely that's all that matters? once email leaves your networks you have no idea where the email goes, it could go through 50 other SMTP relays without your knowledge. Just configure a postfix server (or similar) as a mail relay for the internal machines and off you go.

Last edited by acid_kewpie; 12-22-2009 at 12:41 PM.
 
Old 12-22-2009, 02:09 PM   #4
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
Acid is correct and pretty much any of the standard mailers (postfix, sendmail, exim) with the appropriate packages installed (ala spammassassin, clamav, amavis, etc.) and configured can do the job you're looking for.
 
Old 12-22-2009, 05:35 PM   #5
Smartpatrol
Member
 
Registered: Sep 2009
Posts: 196

Rep: Reputation: 38
...

Last edited by Smartpatrol; 03-11-2010 at 09:54 PM.
 
Old 12-22-2009, 07:32 PM   #6
tungvs
Member
 
Registered: May 2008
Distribution: Centos; Ubuntu; Fedora
Posts: 98

Original Poster
Rep: Reputation: 15
We have so many local mail servers behind the firewall (could be several hundreds), so the mail traffic would be enormous. If I setup the proxy as a relay, all outgoing mail traffic will be seen as originating from one IP: my proxy. With such a big amount of mail traffic coming from a single IP, I'm afraid my proxy IP will be listed as a spam source itself although I could have deployed spam filter at the proxy (all outgoing mails are not spam).

PS: I have configured a postfix server as a relay, but I couldn't figure out how to make it transparent without using iptables NAT and MASQUERADE. In my opinion, if using NAT, the performance of the server would be decrease dramatically. It's not suitable for such big mail traffic.
 
Old 12-23-2009, 02:15 AM   #7
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
No, you've got some logic wrong there. The IP of the mail source must change at a basic level as you want to have the email servber not 100% in line with the traffic, so if you don't change the IP address it will be impossible to establishg a TCP connection between your relay and the destination. Are these addresses behind firewalls private or public addresses? Are you not going out to a internet facing firewall which is then natting all traffic to a public IP anyway?

Transparent can mean a LOT of things. You seem to genuinely think you need something that you can't find though, so can you describe *EXACTLY* what you want to acheive in terms of SMTP headers, including samples of headers that have been subjected to a conventional relay and have then become unsuitable, highlighting why. Which level of OSI (etc.) do you think the transparency will occur? A transparent web proxy operates at http level, not tcp/ip level, whilst other transparent services, like load balancers do with at the tcp/ip level meaning that possibly other than MAC addresses there really is no evidence at all of the proxy being there. Maybe it's just a case of suppressing additional headers? I really can't see what you'd need to achieve, other than an ease of convenience in terms of not using an explicit relay, which I'm sure you can easily do with dnat as in your diagram to push anything on port 25 sideways to a relay. I've not done this before TBH, but can't see a reason it wouldn't work fine.

Last edited by acid_kewpie; 12-23-2009 at 02:18 AM.
 
Old 12-23-2009, 07:42 PM   #8
tungvs
Member
 
Registered: May 2008
Distribution: Centos; Ubuntu; Fedora
Posts: 98

Original Poster
Rep: Reputation: 15
I'm sorry if the phrase "Local mail servers" confuses you. I mean they're our customers' mail servers, and they all have public IP.

When a MTA connect to another MTA, the receiving one will see the IP of sending one. I've viewed the log file and see the line like
Code:
<receiving_MTA> postfix/smtpd[9335]: connect from <sending_MTA>[x.x.x.x]
. I suppose most spam filter will look at this info to blacklist spam source.

So I'd like the receiving MTAs in the Internet to see our customers' mail servers IP instead of our proxy IP. Because if receiving MTAs see that much of SMTP traffic coming from a single IP, I think they will enlist the proxy IP as spam source.

Do spam filters work that way ?
 
Old 12-24-2009, 01:35 AM   #9
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
There's nothing wrong with a mail server sending a lot of mail. Are you going to be sending more mail than GMail's servers? I doubt it. You want to run this mail server in the first place to filter out spam, right? So you shouldhave a good level of confidence that whatever you're sending out is not spam anyway, so as long as you do that part correctly, you should have no worries in the volume as the quality should be there to match.

Same time though, this might be interesting... http://smtp-proxy.klolik.org/ as this does appear to deal with some of the more subtle parts of SMTP, e.g. auth. As with the above discussion though, it is only transparent at SMTP level, not IP.

Last edited by acid_kewpie; 12-24-2009 at 01:46 AM.
 
Old 12-24-2009, 02:47 AM   #10
tungvs
Member
 
Registered: May 2008
Distribution: Centos; Ubuntu; Fedora
Posts: 98

Original Poster
Rep: Reputation: 15
Thanks mate, I see it more clear. I will plan a test soon and confirm some results back later.

Besides, I found a better documented software (at least in configuration file):
Code:
http://bent.latency.net/smtpprox/
 
  


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
help using iptables to setup a simple transparent proxy chibi Linux - Networking 2 10-04-2009 05:53 PM
transparent proxy server setup for isp bhumika Linux - Server 1 09-05-2009 04:32 AM
setup transparent proxy kirukan Linux - Server 10 02-15-2009 06:51 PM
FC4 - How to setup Transparent Proxy with Dansguardian RTX Networks Linux - Networking 1 09-12-2006 12:49 AM
LXer: Linux Setup a transparent proxy with Squid in three easy steps LXer Syndicated Linux News 0 05-27-2006 02:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:21 AM.

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