Re: [exim] Router condition to send to different mail server…

Top Page
Delete this message
Reply to this message
Author: michael
Date:  
To: Gary Stothers, exim-users
CC: 
Subject: Re: [exim] Router condition to send to different mail servers
This is what I have as well:

# before acl
domainlist mailertable =
"lsearch;/etc/mail/mailertable${lookup{$domain}lsearch{/etc/mail/mailertable}{${extract{2}{:}{$value}}}}"

# begin acl
acl_check_rcpt:
  warn    local_parts   = ^[.] : ^.*[@%!/|]
             set acl_m9 = ${lookup mysql {LOG_INVALID_CHAR}}
  warn   local_parts   = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
             set acl_m9 = ${lookup mysql {LOG_INVALID_CHAR}}


  deny    message       = Restricted characters in address
          local_parts   = ^[.] : ^.*[@%!/|]
  deny    message       = Restricted characters in address
          local_parts   = ^[./|] : ^.*[@%!] : ^.*/\\.\\./



  require verify        = sender


  drop
    message     = Legitimate bounces are never sent to more than one 
recipient.
    senders     = : postmaster@*
    condition   = $recipients_count
    set acl_m9 = ${lookup mysql {LOG_INVALID_POSTMASTER}}
    delay       = 5m


  warn  !verify = recipient/callout=20s,defer_ok,use_sender
        set acl_m9 = ${lookup mysql {LOG_INVALID_RECIPIENT}}


  accept domains = +mailertable
         endpass
         message = Invalid Recipient
         verify = recipient/callout=20s,defer_ok,use_sender


  accept domains = !+mailertable
         message = Invalid Recipient
         verify = recipient/callout=20s,defer_ok,use_sender


  deny    message       = Relay not permitted



# begin routers
begin routers
mailertable_router:
driver = manualroute
domains =
"lsearch;/etc/mail/mailertable${lookup{$domain}lsearch{/etc/mail/mailertable}{${extract{2}{:}{$value}}}}"
transport = remote_smtp
route_data = ${lookup{$domain}lsearch{/etc/mail/mailertable}}
verify_sender

global_domain:
driver = manualroute
transport = remote_smtp
route_list = "* 172.1.1.1"
verify_sender





# my /etc/mail/mailertable looks like this:
testdomain.co.za : 172.1.1.1
test.co.za : 172.1.2.3
help.co.za : 19.21.112.1


# Hope this helps alot out people.


Thanks,
Michael





----- Original Message -----
From: "Gary Stothers" <gary_stothers@???>
To: <exim-users@???>
Sent: Wednesday, April 13, 2005 6:34 PM
Subject: Re: [exim] Router condition to send to different mail servers


Found it.

it was easy (as i knew it would be), but i'll note it here so others
learning (as i am) won't have to struggle.


begin routers

exchange_route:
driver = manualroute
local_parts = /etc/exim/exchange.list
route_data = 172.16.110.81
transport = remote_smtp

smart_route:
driver = manualroute
route_data = 172.16.102.10
transport = remote_smtp


local_parts is the hostname half of the email address, compared against the
list (in this case /etc/exim/exchange.list) and routed accordingly. no
match, proceeds to next router.

g.



>>> "Gary Stothers" <gary_stothers@???> April 12, 2005 2:56:26 PM >>>

Good Afternoon,

I am trying to write a router that will deliver mail to two different mail
servers based upon host address. i.e. when mail arrives for john@???
i redirect it to 172.16.102.10 but if it's to suzy@??? i redirect it to
172.16.110.81

here's what i have in my router file.

begin routers

exchange_route:
driver = manualroute
condition = /etc/exim/exchange.list
route_data = 172.16.110.81
transport = remote_smtp

smart_route:
driver = manualroute
route_data = 172.16.102.10
transport = remote_smtp


Thanks for any help.

Gary.
--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/
--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/