Re: [EXIM] virtual domain with some local addresses ?

Pàgina inicial
Delete this message
Reply to this message
Autor: Ian Jackson
Data:  
A: Philip Hazel
CC: exim-users
Assumpte: Re: [EXIM] virtual domain with some local addresses ?
Philip Hazel writes ("Re: [EXIM] virtual domain with some local addresses ?"):
...
> Ah. You want some domains to be handled effectively as synonyms. Hmm. I
> don't think that can be done directly.

...
> I think that something like that is needed, but you don't mean a rewrite
> rule, you mean a transport filter. Essentially you need to turn all the
> domains that you want to batch together into the same domain, e.g.
>
> fred@???      =>  fred.fluffy@???
> joe@???      =>  joe.thunder@???
> postmaster@???  =>  postmaster.sour@???

>
> It might be easier to post-process the BSMTP files on their way to
> wherever than to use a transport filter.


The solution I came up with is to collect the domains together, but to
use a % to separate the original local-part and domain. This results
in BSMTP files like

MAIL FROM: <ijackson@???>
RCPT TO: <fred%fluffy.clouds.net@???>
RCPT TO: <joe%thunder.clouds.net@???>
DATA
...

which can be handled at the far end with an appropriate %-hack
configuration.

For information, the bits of config involved are below.

Thanks,
Ian.

HANDLING_DOMAINS=lsearch;/etc/mail/handling-domains

local_domains=LOCAL_HOSTS:....:HANDLING_DOMAINS

handling_tra:
    driver=appendfile
    directory=$host
    user=${lookup{$domain:user}lsearch{/etc/mail/handling-sites}{$value}fail}
    create_directory=false
    no_from_hack
    prefix=""
    suffix=""
    use_crlf=false
    mode=0660
    bsmtp=all


[Most directors have something like ...]

system_aliases:
    driver=aliasfile
    except_domains=HANDLING_DOMAINS


[ These are the virtual host directors: ]

handling_alias_dir:
    driver=aliasfile
    domains=HANDLING_DOMAINS
    search_type=lsearch
    freeze_missing_include=false
    modemask=002
    optional
    skip_syntax_errors
    syntax_errors_to=${extract{errors}{$domain_data}}
    errors_to=${extract{errors}{$domain_data}}
    file=${extract{aliases}{$domain_data}}
    user=${extract{user}{$domain_data}}
    initgroups


handling_smart_dir:
    driver=smartuser
    domains=HANDLING_DOMAINS
    user=${extract{user}{$domain_data}}
    new_address=${local_part}%${domain}@${extract{site}{$domain_data}}.site-gate.chiark.greenend.org.uk



handling_route:
    driver=domainlist
    domains=lsearch;/etc/mail/handling-sites
    user=${extract{user}{$domain_data}}
    route_list="* ${extract{queue}{$domain_data}}";
#    initgroups
    transport=handling_tra


[ The initgroups option is documented as working here, but it is
rejected. ]

# /etc/mail/handling-domains
fluffy.clouds.net:    user=Mclouds errors=owner-clouds \
            site=clouds aliases=/u/Mclouds/aliases.fluffy
thunder.clouds.net:    user=Mclouds errors=owner-clouds \
            site=clouds aliases=/u/Mclouds/aliases.thunder
sour.tastes.org:    user=Mtastes errors=owner-tastes \
            site=tastes aliases=/u/Mtastes/aliases.sour


# /etc/mail/handling-sites
clouds.site-gate.chiark.greenend.org.uk: user=Mclouds queue=/u/Mclouds/queue
tastes.site-gate.chiark.greenend.org.uk: user=Mtastes queue=/u/Mtastes/queue

-- 
Ian Jackson                  personal email: <ijackson@???>
These opinions are my own.        http://www.chiark.greenend.org.uk/~ijackson/
PGP2 public key id 0x23f5addb, fingerprint 5906F687 BD03ACAD 0D8E602E FCF37657


--
*** Exim information can be found at http://www.exim.org/ ***