Exim Experts plz Help - manual routing to remote server

electron33

Well-Known Member
Feb 24, 2004
90
0
166
One of the domain on my server uses their own mail server. I have put the records in the dns zones and they receive emails from other servers.

However, when an email is sent from our server e.g. through an enquiry form. Exim won't deliver the mail to the remote server and gives:

R=virtual_aliases: No Such User Here

Mind you, no mail users have been set up on our server, since the domain is not using our server for mail anyway.

Is there any way I can tell to route all emails for that domain to the remote smtp.

Thanks very much for your help.

ps.

OK, I went to Exim advanced config editor and added:

special:
driver = manualroute
transport = remote_smtp
route_list = domain.com host.com


(as per exim's faq)
http://wiki.exim.org/FAQ/Routing_to_remote_hosts/Q0316

It seemed to work. But now, I don't know how to list more domains and hosts. Do I need to repeat the above for each domain, or can I separate them by comma, etc.
 
Last edited:

sallen812

Member
Oct 20, 2005
12
0
151
I have the same problem. I dont use the email in WHM/Cpanel. And the same thing is going on with all my domains hosted on the server. A nice work around would be good.
 

electron33

Well-Known Member
Feb 24, 2004
90
0
166
This seems to be working for me:

Add the following to your exim config via WHM:

OK, I went to Exim advanced config editor and added:

special:
driver = manualroute
transport = remote_smtp
route_list = domain1.com somesmtp.com; domain2.com somesmtp2.com
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
how to manual route for spesific email account?
Routing to a "Smart Host" for mail delivery could be setup on a per-domain level as mentioned earlier in this thread; however, I am not sure how feasible or possible it would be to attempt using a smart host for only a single e-mail account. I recommend using a setup that routes on a per-domain basis as this will reduce the complexity involved of an already custom solution. For additional details please reference the following forums post:
cPanel Forums - View Single Post - Configuring Exim to use a Smart Host
 

wp11b

Active Member
Feb 23, 2009
42
0
56
where i must add this section at exim ?

special:
driver = manualroute
transport = remote_smtp
route_list = domain.com smtp.domain.com
 

Mick71

Registered
Jan 3, 2005
2
0
151
Here is a way to setup smart hosts for specific email accounts.

Use the following commands to create a file with the email addresses and smart hosts.

touch /etc/static_route
chown root:mail /etc/static_route
chmod 660 /etc/static_route

Use vi or pico to edit the /etc/static_route file:

[email protected]: smarthost.domain.com
[email protected]: smarthost.domain.com

In the advanced exim editor add the following to the first box below the # ROUTERS CONFIGURATION # section.

static_route:
driver = manualroute
transport = remote_smtp
route_data = ${lookup{[email protected]$domain}lsearch{/etc/static_route}}

That's it. You can make changes to the /etc/static_route file without having to restart exim.
 

nshreders

Member
PartnerNOC
May 9, 2007
23
0
151
chicago, IL
I needed to relay all remote domains to a central mail server but bypass the local domains and use exim to route that locally.

smarthost:
driver = manualroute
domains = !+local_domains
transport = remote_smtp
route_data = "mail.foo.domain.com"

I had to put the FQDN into /etc/localhosts to get it to work and told exim to lookup how it would route a local domain, and then a remote domain:

# exim -bt [email protected]
[email protected]
<-- [email protected]
router = localuser, transport = local_delivery

# exim -bt [email protected]
[email protected]
router = smarthost, transport = remote_smtp
host mail.foo.domain.com [1.2.3.4]