Wallace Tan wrote:
> Dear all,
>
> I am trying to setup 1 redirect router to 3 different transports.
I could be wrong, but AFAIK, an arbitrarily large number of routers can
call the same transport, (we've done that with different helo-data for
example)
- but each router can only call ONE transport.
Grant - *which one* need not be 'hard-coded' the selection may be from a
condition or lookup within the router, though that seems like double work...
Otherwise, we use a 'set' of routers separated by 'unseen', each calling
its own transport.
> I have read the exim-4.63 documentation, spec.txt
> However, I do not fully understand the redirect router's "data" option.
>
Terminology. That isn't so much calling multiple transports as it is
altering *part of* the behaviour of a configurable transport. See also
'helo_data' fro soem examples.
> I can get the redirect router to use "remote_smtp" transport
> But how do I use the redirect router's "data" for "db_aliases_user" and "db_aliases_user_mailbox" transport?
>
>
> # Sample exim.conf file
> #
> # DB table: aliases
> # +----------------------------+---------------------+
> # | alias | deliver_to |
> # +----------------------------+---------------------+
> # | localuser@??? | localuser |
> # | localuser.sent@??? | localuser/Sent |
> # | localuser.sent@??? | otheruser@??? |
> # +----------------------------+---------------------+
>
> DB_LOCAL_DOMAINS = SELECT SUBSTRING_INDEX(alias, '@', -1) AS domain FROM aliases WHERE alias LIKE '%@${quote_mysql:$domain}' LIMIT 1
> DB_ALIASES = SELECT deliver_to FROM aliases WHERE alias='${quote_mysql:$local_part}@${quote_mysql:$domain}'
>
> domainlist local_domains = ${lookup mysql{DB_LOCAL_DOMAINS}}
>
> begin routers
>
> dnslookup:
> driver = dnslookup
> domains = !+local_domains
> transport = remote_smtp
> ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
> no_more
>
> db_aliases_forward:
> driver = redirect
> data = ${lookup mysql{DB_ALIASES}}
>
>
> begin transports
>
> # transport for "otheruser@???"
> remote_smtp:
> driver = smtp
>
> # transport for "localuser"
> db_aliases_user:
> driver = pipe
> command = /usr/local/sbin/dbmail-smtp -u localuser
> return_fail_output
>
> # transport for "localuser/Sent"
> db_aliases_user_mailbox:
> driver = pipe
> command = /usr/local/sbin/dbmail-smtp -u localuser -M Sent
> return_fail_output
>
We do complex archiving - multiple copies, shared folders, sets by
destination, sets by sender, et al, and all PostgreSQL driven.
But there is a 'chain' of successive routers separated by 'unseen' for
each type of handling. The routers and transports themselves are
dirt-simple, little or no logic involved, no data needs to be onpassed.
We just use a lot of them.
But all the 'logic' is in the SQL match/ fail.
HTH,
Bill