Relay certain domain email through external emal

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,252
Location
GMT +7.00
Hello,

Yes, you should extend

Code:
domains =

conditions with your list of target domains
 

dannygoh

Verified User
Joined
Feb 9, 2004
Messages
390
Location
Malaysia
Hello,

Yes, you should extend

Code:
domains =

conditions with your list of target domains

Below is my smart_route code. How do I put in yahoo.com, live.com and gmail.com?

Code:
 smart_route:
   driver = manualroute
   domains = ! +local_domains
   ignore_target_hosts = 127.0.0.0/8
   condition = "${perl{check_limits}}"
   route_list = !+local_domains ip.address.xyz
   transport = remote_smtp
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,252
Location
GMT +7.00
[h=3]Section 8. Domain lists[/h]http://www.exim.org/exim-html-current/doc/html/spec_html/ch-domain_host_address_and_local_part_lists.html
 

toml

Verified User
Joined
Oct 3, 2003
Messages
1,246
Location
Scottsdale, AZ
Something like this should work. Create this as your first router (i.e. right after "begin routers"):
Code:
static_route:
  driver = manualroute
  transport = remote_smtp
  domains = lsearch;/etc/virtual/staticroutes
  route_data = $domain_data
then your /etc/virtual/staticroutes can be updated to look something like this:
Code:
yahoo.com : 1.2.3.4
hotmail.com : 1.2.3.4
where the 1.2.3.4 is the IP of the external email server you want to use to relay your email. Then you would need to remove or comment out your smart_route, so that it doesn't attempt to use that to send emails that don't match the static_route condition.
 

dannygoh

Verified User
Joined
Feb 9, 2004
Messages
390
Location
Malaysia
Hi,

Below code need to commend or uncomment?
Code:
#lookuphost:
#  driver = dnslookup
#  domains = ! +local_domains
#  ignore_target_hosts = 127.0.0.0/8
#  condition = "${perl{check_limits}}"
#  transport = remote_smtp
#  no_more

Something like this should work. Create this as your first router (i.e. right after "begin routers"):
Code:
static_route:
  driver = manualroute
  transport = remote_smtp
  domains = lsearch;/etc/virtual/staticroutes
  route_data = $domain_data
then your /etc/virtual/staticroutes can be updated to look something like this:
Code:
yahoo.com : 1.2.3.4
hotmail.com : 1.2.3.4
where the 1.2.3.4 is the IP of the external email server you want to use to relay your email. Then you would need to remove or comment out your smart_route, so that it doesn't attempt to use that to send emails that don't match the static_route condition.
 

toml

Verified User
Joined
Oct 3, 2003
Messages
1,246
Location
Scottsdale, AZ
In my setup, I have my static_route defined in /etc/exim.easy_spam_fighter/mailman_router.conf and the top of my routers section looks like this:
Code:
begin routers
  .include_if_exists /etc/exim.easy_spam_fighter/mailman_router.conf

#EDIT#48:

lookuphost:
  driver = dnslookup
  domains = ! +local_domains
  ignore_target_hosts = 127.0.0.0/8
  condition = "${perl{check_limits}}"
  transport = remote_smtp
  no_more

# RELATED: http://help.directadmin.com/item.php?id=153
# smart_route:
#   driver = manualroute
#   domains = ! +local_domains
#   ignore_target_hosts = 127.0.0.0/8
#   condition = "${perl{check_limits}}"
#   route_list = !+local_domains HOSTNAME-or-IP#
#   transport = remote_smtp

Since I use mailman (due to DMARC isssues with majordomo) and needed a router defined for that, it was easier to make my modifications to that file for both routers and just add the include line it any time my exim.conf is updated.
 

dannygoh

Verified User
Joined
Feb 9, 2004
Messages
390
Location
Malaysia
In my setup, I have my static_route defined in /etc/exim.easy_spam_fighter/mailman_router.conf and the top of my routers section looks like this:
Code:
begin routers
  .include_if_exists /etc/exim.easy_spam_fighter/mailman_router.conf

#EDIT#48:

lookuphost:
  driver = dnslookup
  domains = ! +local_domains
  ignore_target_hosts = 127.0.0.0/8
  condition = "${perl{check_limits}}"
  transport = remote_smtp
  no_more

# RELATED: http://help.directadmin.com/item.php?id=153
# smart_route:
#   driver = manualroute
#   domains = ! +local_domains
#   ignore_target_hosts = 127.0.0.0/8
#   condition = "${perl{check_limits}}"
#   route_list = !+local_domains HOSTNAME-or-IP#
#   transport = remote_smtp

Since I use mailman (due to DMARC isssues with majordomo) and needed a router defined for that, it was easier to make my modifications to that file for both routers and just add the include line it any time my exim.conf is updated.

Thanks @toml. It work perfectly!
 

nkyee

New member
Joined
Aug 6, 2009
Messages
4
set multiple relay IP

can i set multiple replay IP?? if my replay IP block by yahoo then switch to another IP send out email.
 
Top