[Vmail-discuss] domain aliasing with local delivery

Paul Warren pdw@xxxxxxxxxxxxx
Sat, 27 Oct 2001 19:44:07 +0100

On Sat, Oct 27, 2001 at 04:58:12PM +0200, Jakob Hirsch wrote:
> ----- Original Message ----- From: "Paul Warren" <pdw@ex-parrot.com>
> > > But it's only a workaround, that only works if the real domain is
> > > listed in the domain-table before the alias domain.
> > The alias domain should not be listed in the domain-table at all - only
> > in the alias table.
> That means, if I have a domain dom1, that should be aliased to another
> domain dom2, dom1 will be in
> domain_alias table, but not in domain table? 

Correct.  This design is possibly not ideal, but is a result of the
aliasing being put in as an afterthought...

> Another point: I wasn't aware of the fact that dom2 has to be local.
> Maybe I'll try to implement a more generic form of aliasing that
> allows to use any domain as dom1 (with exim rewrite or something).

I'm not sure what you mean by local.  The idea is that the mail for a
particular domain e.g. fred.com is handled by the server in the
traditional vmail way.  If the user of fred.com also registers
fred.co.uk, it can be set up as an alias so that blah@fred.co.uk gets
handled exactly as if it were addressed to blah@fred.com, rather than
having its own vmail config.

> > The problem (AIUI) was that a query for e.g. mydomain.com was producing:
> >
> > path    mbox_name   domain.domain_name  alias.alias
> > foo     bar         mydomain.com        myalias.com
> > foo     bar         mydomain.com
> > foo     bar         mydomain.com        myotheralias.com
> Sure? This query here only gives lines 1 and 3.

My mistake, but the point still stands - you get multiple rows with the
same path and mbox_name, and the limit 1 will return just the first.

> My problem was: The query for the path in virtual_localdelivery gave
> two different results, one for dom1 and one for dom2, since both are
> in domain table with a path of "/var/spool/mail/<domain>".

If the path is different, then the domains are not 'aliased'.  The point
of aliasing is so that mail gets handled identically irrespective of
which of the aliased domains it is addressed to.  The model we have gone
for is defining alias names for a "real" domain in the domain table.  

> > also mentioned that the user query needs a limit 1:
> > but I suspect you've already got that...
> Not really, didn't even look for it, since I have the user hardcoded
> in exim.conf. I don't use quotas and that's the only thing it's needed
> for, if I understand correctly.

More or less, yes.  If you allow users shell access it is convenient to
have the mail in a spool owned by the relevant users.