Solved

I have a question about Postfix and mail relaying.

Posted on 2011-02-12
7
315 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Resolve DNS query failed errors for Exchange
As cyber crime continues to grow in both numbers and sophistication, a troubling trend of optimization has emerged over the last year.
In this video we show how to create an Address List 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 Organization >> Ad…
In this video we show how to create an email address policy 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 Mail Flow…
Suggested Courses

622 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