Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

I have a question about Postfix and mail relaying.

Posted on 2011-02-12
7
Medium Priority
?
319 Views
Last Modified: 2012-05-11
I am having trouble with this scenario and I know I m not doing it correctly.

I want to have mail come into a mail server(s) that will process spamassassin and (hopefully clamav) and the forward on the mail to another server(s) which will do some custom things with it.  I am not so concerned as the spamassassin part of it since it works properly.  The biggest question I had was how to relay/forward the mail onto the secondary set of servers.

The path looks like this
Email ---->  [first set of servers (spam)] ----> [relayed to this set of servers]

Open in new window


So this is sort of a two part question.

How do you forward/relay ALL mail, after processing on the first set of servers onto the second set.  And is there a way to put multiple server ip's in (hopefully not using DNS as a round robin tool).

Some more knowledge, the first set of servers accepts mail from multiple domains.   The first set is accepting mail through a load balancer, so I'm not needing any ideas accepting mail on the first set, just the forwarding/relaying onto the next set.

You may be asking why not do this all on one server.   I am isolating the two as a buffer, and to break down the processing.  The second server has some custom software that takes a little bit more time to process.

Thanks in advance.  If more information is needed, I can give it.
 
0
Comment
Question by:zoobuh
7 Comments
 
LVL 9

Accepted Solution

by:
fcontrepois earned 1000 total points
ID: 34881618
you can use the same load balancer creating a new farm on a different port (2525 for example) and forward all mail coming out from spamassassin to the load balancer port 2525

you can use the transport table http://www.postfix.org/STANDARD_CONFIGURATION_README.html#firewall
or check those links http://www.postfix.org/BASIC_CONFIGURATION_README.html#relay_to and http://www.postfix.org/STANDARD_CONFIGURATION_README.html#firewall

you should also be able to use the master.cf file but I'm no expert about it
0
 
LVL 9

Assisted Solution

by:expert_tanmay
expert_tanmay earned 1000 total points
ID: 34885123
What you want to do is called smarthost. All you have to do is add one entry in /etc/postfix/main.cf:

relayhost = IP_address_of_relay_server

Then restart postfix

Cheers...
0
 
LVL 3

Expert Comment

by:oppofwar
ID: 34913524
To achieve the scenario MAiL Server (MX) -> Antispam Server -> Mail Server

Apart from relaying you have to enable Forwarding.

Follow the below guide to achieve it

http://www.postfix.org/STANDARD_CONFIGURATION_README.html#firewall
0
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.

 

Author Comment

by:zoobuh
ID: 34913813
For some reason it isn't working.  This is actually how I had it.  I think it is dying after it runs the spamc script.  
0
 
LVL 9

Expert Comment

by:expert_tanmay
ID: 34914051
On your first set of servers you need to simply add one entry in /etc/postfix/main.cf:

relayhost = [relayed to this set of servers]

0
 

Author Comment

by:zoobuh
ID: 34914141
I verified that your solutions do in fact work.  But, when I add the

smtp ...
  -o content_filter=sfilter:dummy

and

sfilter unix - n n - - pipe
  flags=DRq user=spamfilter argv=/scripts/spamfilter.sh -f ${sender} -- ${recipient}

That's when it goes off into never never land.
0
 

Author Comment

by:zoobuh
ID: 34914147
For whatever reason it's forwarding now.   Now I just need to figure out why.  

0

Featured Post

Cyber Threats to Small Businesses (Part 1)

This past May, Webroot surveyed more than 600 IT decision-makers at medium-sized companies to see how these small businesses perceived new threats facing their organizations.  Read what Webroot CISO, Gary Hayslip, has to say about the survey in part 1 of this 2-part blog series.

Question has a verified solution.

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

The main intent of this article is to make you aware of ‘Exchange fail to mount’ error, its effects, causes, and solution.
I have written articles previously comparing SARDU and YUMI.  I also included a couple of lines about Easy2boot (easy2boot.com).  I have now been using, and enjoying easy2boot as my sole multiboot utility for some years and realize that it deserves …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…
Suggested Courses

971 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