[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re[2]: Exim & virtual users



Вот   спасибо!  Проблема  решена  несколько
иначе, но логика та же:

Q0308: I have a domain for which some local
       parts must be delivered locally, but
       the remainder are to be treated like
       any other remote addresses.
A0308: The way to do this is not to include
       the domain in local_domains, so that
       addresses  initially  get  passed to
       the routers. The first router should
       be definied like this:

         special_local:
           driver = domainlist
           local_parts = whatever...
           domains = whatever...
           route_list = * localhost byname
           self = local
           
That  will  pick  off  those addresses with
matching  local parts and domains, and hand
them   to  the  directors,  because  of the
self  =  local setting. Any other addresses
will  fall through to the other routers and
be handled as normal remote addresses.

config.samples     действительно    надо
просматривать :-)

25 марта 2004 г. Вы писали:
> On Wed, 24 Mar 2004 13:45:55 +0000
>  SH059  (SH059) wrote:

>  SH059> Есть локальная сеть, в ней почтовый шлюз, который должен локальную
>  SH059> почту раскладывать по ящикам, а не локальную передавать на
>  SH059> smarthost например domain.com. Кроме того на domain.com есть
>  SH059> несколько акаунтов (например box1@domain.com и box2@domain.com) с
>  SH059> которых почта забирается fetchmail'ом.  Есть желание, чтобы если
>  SH059> кто-то из локальной сети отправлял почту на box1@domain.com или
>  SH059> box2@domain.com Exim сразу клал бы ее в соответствующий локальный
>  SH059> ящик, а вся остальная почта (в том числе и для domain.com)
>  SH059> перенаправлялась бы на smarthost.

> Всё понятно ;)

> Есть такая вещь, как config.samples - рекомендую просматривать. Вот рецепт
> #C031 (hint: self = local):

> Date: Tue, 23 Nov 1999 02:49:32 +0200
> From: Vadim Vygonets <vadik@cs.huji.ac.il>

> Something Hans Matzen and I did.

> # These are config file snippets for handling certain remote
> # addresses as local, and making only real external addresses
> # visible to users.


> # Copyright (c) 1999
> #       Hans Matzen <hans@tm.informatik.uni-frankfurt.de>,
> #       Vadim Vygonets <vadik@vygo.net>.  All rights reserved.

> #################################################################
> # These are config file snippets for handling certain remote
> # addresses as local, and making only real external addresses
> # visible to users.
> #
> # First, adjust values of the following definitions, which will
> # be used in configuration snippets below:

> EXIM_DIR        = /var/exim
> LOCAL_DOM       = home.dom
> LOCAL_NET       = 192.168.0.0/16
> SMART_HOST      = cc.huji.ac.il


> # The scheme is to use global addresses everywhere, which is done
> # by rewriting envelope sender and all headers, using a dbm file
> # EXIM_DIR/in2ex, which maps internal local parts to external
> # e-mail addresses using entries like:
> #       user:   someone@remote.dom
> #
> # To do this, it good to hide hostnames in all envelope and
> # header addresses first, using this rewriting rule:

> *@*.LOCAL_DOM   $1@LOCAL_DOM                                            Eh

> # Then, rewrite envelope sender and all headers to external
> # addresses with this rule:

> *@LOCAL_DOM     ${lookup{${lc:$1}}dbm{EXIM_DIR/in2ex}{$value}fail}      Fh


> # This means that envelope recipients must be somehow rewritten
> # back to local addresses, which is done in one of the two
> # proposed ways (you choose).
> #
> # One way to do it is by rewriting, using a dbm file
> # EXIM_DIR/ex2in, which maps external e-mail addresses to
> # internal local parts using entries like:
> #       someone@remote.dom:     user
> #
> # This is done with the rewriting rule:
> #
> # *@*   ${lookup{${lc:$0}}dbm{EXIM_DIR/ex2in}{$value@LOCAL_DOM}fail}    T


> # The preferred way to do it is by treating certain e-mail
> # addresses on remote domains as local, using route_list and self
> # options to the domainlist routers, looking up e-mail addresses
> # in dbm file EXIM_DIR/ex2in and throwing values away.  This is
> # an example of such router.  It should probably the only router
> # in the configuration.

> smart_route:
>    driver = domainlist
>    transport = remote_smtp
>    route_list = "*      ${lookup{$local_part@$domain}dbm\
>                           {EXIM_DIR/ex2in}{@}{SMART_HOST}}      bydns_a"
>    self = local


> # Then, IF local parts of some of your users are different in
> # their internal and external addresses, it's nice to have the
> # internal_adjust smartuser director to rewrite the address.  It
> # should probably be the first director.

> internal_adjust:
>   driver = smartuser
>   new_address = "${lookup{${lc:$local_part@$domain}}dbm{EXIM_DIR/ex2in}\
>                    {$value@LOCAL_DOM}fail}"

> ;)

> -- 
> Serge Olkhowik <solo@isd.dp.ua>
> ISD Configuration Management Team <cm@isd.dp.ua>




-- 
Denis Sokolov     mailto:sh059@hottabych.ru






Reply to: