Exim redirect mail to another server?

cburchell

Member
Dec 8, 2004
8
0
151
Is there a setting / configuration change that can be made in Exim to redirect incoming mail for one domain to another mail server?

MX records currently point to my cPanel server so that the cPanel server provides spam filtering, etc. However, I want to configure Exim so that once mail arrives for a particular domain, messages are forwarded to the client's in-house e-mail server.

I know I can change MX records to point directly to their own server, but I'd like to relay through mine to provide e-mail / spam filtering service.

Can this be done with an Exim or cPanel hack / tweak?
 

bking

Well-Known Member
Mar 1, 2004
206
1
168
Sydney
Maybe add the domain to /etc/secondarymx and remove the domain from /etc/localdomains ?

Hrmm.. actually I dont think that will work if you are listed as best pref MX...

You could always go into cPanel and then the mail options and enable Email Domain Forwarders to goto another domain on this other server...
 
Last edited:

cburchell

Member
Dec 8, 2004
8
0
151
I've thought of this approach (hiding the lower MX priority host behind a firewall and setting up rules to only allow relay forwarding from the host in question) but I'm looking for a solution that is configurable at the transport / Exim level on the host itself rather than through MX relaying.

Any ideas?
 

abubin

Well-Known Member
Dec 7, 2004
401
3
168
so, you are saying you only want to redirect the email from your server and not through MX records?

That means you definitely want email to come into this server and then from this server forward the email to another server? Am I getting it right?

Can I know what is the reason for it? Maybe the first server will have antispam to scan for spams and after scanning, forward the email to the correct server?
 

cburchell

Member
Dec 8, 2004
8
0
151
abubin / nickp666:

Thanks for your replies.

The artilce nickp666 provided is _exactly_ what I'm trying to achieve. I want to act as primary MX for a customers e-mail domain to provide virus and spam filtering and then push the mail directly to their non-MX-published Exchange host. thanks for the link - this is exactly what I was looking for.