Solved

I have a question about Postfix and mail relaying.

Posted on 2011-02-12
7
310 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 250 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 250 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
Why spend so long doing email signature updates?

Do you spend loads of your time carrying out email signature updates? Not very interesting are they? Don’t let signature updates get you down. Let Exclaimer Cloud - Signatures for Office 365 make managing email signatures a breeze.

 

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

Do email signature updates give you a headache?

Do you feel like you are constantly making changes to email signatures? Are the images not formatting how you want them to? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today.

Join & Write a Comment

Easy CSR creation in Exchange 2007,2010 and 2013
Ransomware continues to be a growing problem for both personal and business users alike and Antivirus companies are still struggling to find a reliable way to protect you from this dangerous threat.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

746 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

11 Experts available now in Live!

Get 1:1 Help Now