Re: [exim] trouble with a redirect router

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Noah Meyerhans
Date:  
À: exim-users
Sujet: Re: [exim] trouble with a redirect router
On Thu, Oct 07, 2004 at 03:16:04PM -0700, Fred Viles wrote:
> So you don't want to use condition= to cause the router to be skipped
> if the lookup fails. I think you want to do the lookup in an ${if in
> the data= line and then fail the expansion or return an empty string
> if the lookup fails.


In case anybody cares, the router ended up looking like this:
legacy_mail:
    driver = redirect
    domains = +legacy_domains
    local_parts = dbm;/etc/exim/$domain.db : *
    local_part_suffix = +*
    local_part_suffix_optional
    data = ${lookup {$local_part}dbm{/etc/exim/$domain.db} \
              {${quote:\
                 ${local_part:$local_part_data}$local_part_suffix}@\
                 ${domain:$local_part_data}} \
              {}}
    cannot_route_message = "Unkown user $local_part in domain $domain"
    more = false


Accepting "*" as a local_part works here, since this is the only router
that will be tried for a domain listed in +legacy_domains. We still
need to do the dbm lookup for local_parts, though, so we have
$local_part_data set when doing the lookups in the data= section.

This seems to be working fine, and logically it makes sense.

noah

-- 
Noah Meyerhans                         System Administrator
MIT Computer Science and Artificial Intelligence Laboratory