Re: [exim] Routing for aliases

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Niels Kobschätzki
Datum:  
To: Odhiambo Washington
CC: exim users
Betreff: Re: [exim] Routing for aliases
On 19 Jan 2021, at 9:46, Odhiambo Washington wrote:

> On Tue, 19 Jan 2021 at 11:40, Niels Kobschätzki
> <niels@???>
> wrote:
>
>> On 19 Jan 2021, at 9:36, Odhiambo Washington wrote:
>>
>>> On Tue, 19 Jan 2021 at 11:31, Niels Kobschätzki via Exim-users <
>>> exim-users@???> wrote:
>>>
>>>> Hi,
>>>>
>>>> I have the following case: I have users who have their mail-address
>>>> aliased to an external address. The moment a router resolves the
>>>> alias
>>>> it doesn’t go again for the new target address through all
>>>> routers
>>>> but
>>>> jumps directly the router to my dnslookup-router which is used for
>>>> external mails and sends it out. Any idea how I get the mail
>>>> through
>>>> the
>>>> whole router-loop again?
>>>>
>>>
>>> A matching route was found and the mail routed correctly.
>>> Maybe you want to re-order your routers - because routers are
>>> processed "in
>>> order"...
>>
>> But there are several routers before the dnslookup-router and the
>> debug-output does not indicate that they are checked before.
>>
>> Best,
>>
>> Niels
>>
>
>
> Is that so? Can we see the routers?


Sure

begin routers

filtering_secondary:
   driver = manualroute
   transport = remote_smtp
   domains = 
partial-lsearch,ret=key;/usr/local/etc/exim/conf/secondary_filter_domains
   headers_remove = Subject
   headers_add = ${if and { \
            {>={$h_X-VISP-Spam-Score-Int:}{50}} \
            {match_domain{$domain}{+tag_domains}} \
        }{Subject: ***SPAM*** $h_Subject:}{Subject: $rh_Subject:}}
   route_list = $domain 
${lookup{$domain}lsearch{/usr/local/etc/exim/conf/secondary_filter_domains}}


exchange_internal_delivery:
driver = manualroute
domains = exchange.local
transport = remote_smtp
route_list = * exchange.de.inter.net

mailshield_resubmit:
driver = manualroute
transport = remote_smtp
condition = ${if eq {$received_protocol}{mailshield}{1}{0}}
headers_add = ${lookup ldap{LDAP_AUTH
ldap:///LDAP_USER_DN?savFilter?sub?(mail=${quote_ldap:$local_part@$domain})}{X-VISP-ShouldScan:
$value}{X-VISP-ShouldScan: 0}}
route_list = * mailshield1.domain.tld:mailshield2.domain.tld
hosts_randomize = true

virtual_spambox:
driver = manualroute
transport = spam_virtual_delivery
domains = lsearch,ret=key;VIRTUAL_DOMAINS_FILE
condition = ${if eq {$received_protocol}{spamdeliver}{1}{0}}
address_data = ${lookup ldap{LDAP_AUTH
ldap:///LDAP_USER_DN?mail?sub?(mail=${quote_ldap:$local_part_data@$domain_data})}{$value}fail}
route_list = *
no_more
.ifdef SRS

srs_reply_router:
driver = redirect
senders = *@+local_domains
srs = reverseandforward
data = ${srs_recipient}
allow_fail
allow_defer

.endif

.ifdef MAILOUT

massmail_mailout:
    driver = manualroute
    transport = remote_smtp
    senders = nwildlsearch;/usr/local/etc/exim/conf/ratelimit_whitelist
    domains = !+local_domains
    route_list = * mmout1.domain.tld:mmout2.domain.tld


.endif

dynamic_reroute:
    driver = manualroute
    transport = remote_smtp
    domains = dsearch,ret=key;//usr/local/etc/exim/redirects
    route_list = * 
${readfile{/usr/local/etc/exim/redirects/$domain_data}{}}


.ifdef SRS
dnslookup_srs:
driver = redirect
domains = ! +local_domains : ! +no_srs_domains
senders = ! : ! *@+local_domains
srs = forward
srs_alias = srs.snafu.de
data = ${quote_local_part:$local_part}@$domain
allow_fail
allow_defer
redirect_router = dnslookup

.endif

dnslookup:
driver = dnslookup
domains = ! +local_domains
transport = remote_smtp
.ifdef SRS
dnssec_request_domains = *
.endif
mx_fail_domains = googlemail.de
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 : 192.168.0.0/16 :
10.0.0.0/8 : 172.16.0.0/12 : other_ips_from_my_ip_range
no_more


.ifdef SRS

virtual_aliases_nowild_srs:
driver = redirect
domains = lsearch,ret=key;VIRTUAL_DOMAINS_FILE
senders = ! : ! *@+local_domains
srs = forward
srs_condition = ${if match_domain{${domain:${lookup ldap{LDAP_AUTH
ldap:///LDAP_ALIAS_DN?mailDestinationAddress?sub?(mail=${quote_ldap:$local_part_data@$domain_data})}{$value}fail}}}{+no_srs_domains}{0}{1}}
data = ${lookup ldap{LDAP_AUTH
ldap:///LDAP_ALIAS_DN?mailDestinationAddress?sub?(mail=${quote_ldap:$local_part_data@$domain_data})}{$value}fail}
allow_fail
allow_defer
file_transport = address_file
pipe_transport = address_pipe
modemask = 002
redirect_router = dnslookup

virtual_aliases_nowild:
driver = redirect
domains = lsearch,ret=key;VIRTUAL_DOMAINS_FILE
data = ${lookup ldap{LDAP_AUTH
ldap:///LDAP_ALIAS_DN?mailDestinationAddress?sub?(mail=${quote_ldap:$local_part@$domain_data})}{$value}fail}
allow_fail
allow_defer
file_transport = address_file
pipe_transport = address_pipe
modemask = 002
redirect_router = dnslookup

.else

virtual_aliases_nowild:
driver = redirect
domains = lsearch,ret=key;VIRTUAL_DOMAINS_FILE
data = ${lookup ldap{LDAP_AUTH
ldap:///LDAP_ALIAS_DN?mailDestinationAddress?sub?(mail=${quote_ldap:$local_part_data@$domain_data})}{$value}fail}
allow_fail
allow_defer
file_transport = address_file
pipe_transport = address_pipe
modemask = 002

.endif

virtual_aliases_file:
driver = redirect
domains = lsearch,ret=key;VIRTUAL_DOMAINS_FILE
condition = ${if exists
{/usr/local/etc/exim/conf/aliases/$domain_data}{1}{0}}
data =
${lookup{$local_part}lsearch{/usr/local/etc/exim/conf/aliases/$domain_data}}
allow_fail
allow_defer
file_transport = address_file
pipe_transport = address_pipe
modemask = 002

LDAP_MAILBOX = ${lookup ldap{LDAP_AUTH
ldap:///LDAP_USER_DN?mailbox?sub?(mail=${quote_ldap:$local_part@$domain})}{$value}{/}}

virtual_userfilter:
driver = redirect
domains = lsearch;VIRTUAL_DOMAINS_FILE
no_check_local_user
no_verify
no_expn
router_home_directory = LDAP_MAILBOX
transport_home_directory = LDAP_MAILBOX
require_files = exim:${home}/.exim_filter
file = ${home}/.exim_filter
check_ancestor
allow_filter
file_transport = address_file
pipe_transport = address_pipe
reply_transport = address_reply
directory_transport = address_directory
modemask = 002
user = pop
group = exim


virtual_localuser:
driver = accept
transport = local_virtual_delivery
domains = lsearch,ret=key;VIRTUAL_DOMAINS_FILE
require_files = pop:+${home}
address_data = ${lookup ldap{LDAP_AUTH
ldap:///LDAP_USER_DN?mail?sub?(mail=${quote_ldap:$local_part@$domain})}{$value}fail}
transport_home_directory = LDAP_MAILBOX
router_home_directory = LDAP_MAILBOX

virtual_localuser_folder:
driver = accept
transport = local_virtualfolder_delivery
domains = lsearch,ret=key;VIRTUAL_DOMAINS_FILE
caseful_local_part = true
local_part_suffix = /*
require_files = pop:+${home}
address_data = ${lookup ldap{LDAP_AUTH
ldap:///LDAP_USER_DN?mail?sub?(mail=${quote_ldap:$local_part@$domain_data})}{$value}fail}
transport_home_directory =
LDAP_MAILBOX/.${tr{${substr_1:$local_part_suffix}}{.}{:}}
router_home_directory =
LDAP_MAILBOX/.${tr{${substr_1:$local_part_suffix}}{.}{:}}

.ifdef SRS

virtual_aliases_wildcard_srs:
driver = redirect
domains = lsearch,ret=aliasfile;VIRTUAL_DOMAINS_FILE
senders = ! : ! *@+local_domains
srs = forward
srs_condition = ${if match_domain{${domain:${lookup ldap{LDAP_AUTH
ldap:///LDAP_ALIAS_DN?mailDestinationAddress?sub?(mail=${quote_ldap:$local_part@$domain})}{$value}fail}}}{+no_srs_domains}{0}{1}}
condition = ${extract{aliasfile} {$domain_data}}
data = ${lookup ldap{LDAP_AUTH
ldap:///LDAP_ALIAS_DN?mailDestinationAddress?sub?(mail=${quote_ldap:all.all@$domain})}{$value}fail}
allow_fail
allow_defer
file_transport = address_file
pipe_transport = address_pipe
modemask = 002
redirect_router = dnslookup

virtual_aliases_wildcard:
driver = redirect
domains = lsearch,ret=aliasfile;VIRTUAL_DOMAINS_FILE
condition = ${extract{aliasfile} {$domain_data}}
data = ${lookup ldap{LDAP_AUTH
ldap:///LDAP_ALIAS_DN?mailDestinationAddress?sub?(mail=${quote_ldap:all.all@$domain})}{$value}fail}
allow_fail
allow_defer
file_transport = address_file
pipe_transport = address_pipe
modemask = 002
redirect_router = dnslookup

.else

virtual_aliases_wildcard:
driver = redirect
domains = lsearch,ret=aliasfile;VIRTUAL_DOMAINS_FILE
condition = ${extract{aliasfile} {$domain_data}}
data = ${lookup ldap{LDAP_AUTH
ldap:///LDAP_ALIAS_DN?mailDestinationAddress?sub?(mail=${quote_ldap:all.all@$domain})}{$value}fail}
allow_fail
allow_defer
file_transport = address_file
pipe_transport = address_pipe
modemask = 002

.endif


system_aliases_file:
driver = redirect
domains =
partial-lsearch,ret=key;/usr/local/etc/exim/conf/local_domains
condition = ${if exists
{/usr/local/etc/exim/conf/aliases/$domain_data}{1}{0}}
allow_fail
allow_defer
data =
${lookup{$local_part}lsearch,ret=key{/usr/local/etc/exim/conf/aliases/$domain_data}}
user = pop
group = exim
file_transport = address_file
pipe_transport = address_pipe

system_aliases:
driver = redirect
domains =
partial-lsearch,ret=key;/usr/local/etc/exim/conf/local_domains
allow_fail
allow_defer
data =
${lookup{$local_part}lsearch,ret=key{/usr/local/etc/exim/conf/local_aliases}}
user = pop
group = exim
file_transport = address_file
pipe_transport = address_pipe

userforward:
driver = redirect
check_local_user
domains =
partial-lsearch,ret=key;/usr/local/etc/exim/conf/local_domains
file = $home/.forward
no_verify
no_expn
check_ancestor
file_transport = address_file
pipe_transport = address_pipe
reply_transport = address_reply

localuser:
driver = accept
check_local_user
domains =
partial-lsearch,ret=key;/usr/local/etc/exim/conf/local_domains
transport = ${if eq {${extract{maildir} {${domain}}}} {yes}
{local_delivery_maildir} {local_delivery}}
cannot_route_message = Unknown user


Niels