Solved

I have a question about Postfix and mail relaying.

Posted on 2011-02-12
7
311 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
Do email signature updates give you a headache?

Are you 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.

 

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

Want to promote your upcoming event?

Attending an event? Speaking at a conference? Or exhibiting at a trade show? Easily inform your contacts by using a promotional banner in your email signature. This will ensure your organization’s most important contacts are in the know.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Backup & Restore 3 46
su - oracle could not open session 6 47
is my large folder zipped corrupted 4 49
linux redhat 7.2 10 36
New-MailboxSearch Powershell Command and step by step approach to Search and Extract Emails form Exchange 2013 Journaling server.
Fine Tune your automatic Updates for Ubuntu / Debian
In this video we show how to create a Contact in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Contact ta…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

914 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

16 Experts available now in Live!

Get 1:1 Help Now