Solved

I have a question about Postfix and mail relaying.

Posted on 2011-02-12
7
314 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Granting full access permission allows users to access mailboxes present in their database. By giving full access permission one can open and read the content of any mailbox but cannot send emails from that mailbox.
Resolve DNS query failed errors for Exchange
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 video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager

738 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