Re: [Exim] Virtual domains and aliases

Top Page
Delete this message
Reply to this message
Author: Vadim Vygonets
Date:  
To: exim-users
Subject: Re: [Exim] Virtual domains and aliases
Quoth Gary Hill on Thu, Apr 27, 2000:
> We are a mid size ISP based here in East Anglia


Send me some ales.

> Have users that use fred@??? and something@??? delivered
> to /var/spool/mail/fred (we use MX Records of course.


I actually thought about implementing such scheme, but for
multiple number of domains (all virtual domains), in my "hairy"
config (C022). Maybe I'll do it one day.

You can transform anything matching ^.*@(.*).keme.co.uk$ to
$1@??? (i.e., one@??? to two@???) with
the following director (untested):

domain_to_localpart:
driver = smartuser
condition = "${if match{$domain}{^[^.]+\\\\.keme\\\\.co\\\\.uk\\$}{yes}{no}}"
new_address = ${extract{1}{.}{$domain}}@???

I used "condition" instead of "domains" because regexps are not
allowed in domain-list. Or are they? Philip?

Then, deliver mail to fred@??? using the regular localuser
director.

Beware, though: if mail comes to anything@???,
the address will first be rewritten to nonexistent@???,
and only then nonexistent@??? will be refused.

> Standard aliases file.


Trivial.

> RelayTo file containing a list of domains that we handle.


You should probably make them local domains. Such as:

local_domains = keme.co.uk : *.keme.co.uk : /path/to/RelayTo

> A virtualmail file that contains stuff like:-
>
> fred@???    fred (local user)
> steve@???    stve123@???
> john@???    john (local user)
> domain.com        rita (local user, catchall)
> #---------------------
> fredd@???    fredd (local user)
> steve@???    stve123@???
> john@???        john22 (local user)
> anotherdomain.com        rita2 (local user, catchall)

>
> etc..........


Uh oh. Why did you choose such difficult syntax? It would be
much better to turn it into a lsearch*@ aliasfile, such as:

fred@???:    fred@???
steve@???:    stve123@???
*@domain.com:        rita@???
john@???:    john22@???
*@anotherdomain.com:    rita2@???


And an aliasfile director to accompany it, such as:

virtual_aliases:
  driver = aliasfile
  domains = /path/to/RelayTo
  file = /path/to/that/alias/file/above
  search_type = dbm*@        # <-- Or lsearch*@
  qualify_preserve_domain    # <-- Or not, I don't know
  check_ancestor
  file_transport = address_file
  pipe_transport = address_pipe
  no_more            # <-- If this is the last director
                #     handling virtual domains


> Help -


Turn all your files to dbm. This will speed up the lookups.

Put directors handling virtual domains first, using "domains" on
each of them. Put no_more on last of them. virtual_aliases is
the only director to handle virtual domains, right?

After them, put domain_to_localpart. After it, put the usual
directors.

> pointers -


doc/spex.txt
http://www.exim.org/

In short, RTFM. This time, I'm helping you not because you
showed any effort to solve the problem, but because your question
is interesting. This doesn't usually happen to me.

> configs please.


Take mine!

Vadik.

--
Do not meddle in the affairs of sysadmins, they are quick to
anger and have no need for subtlety.