[Vmail-discuss] Separate domain_alias table?

Paul Makepeace Paul.Makepeace at realprogrammers.com
Thu, 10 Jul 2003 20:20:39 +0100


On Thu, Jul 10, 2003 at 08:08:45PM +0100, Chris Lightfoot wrote:
> On Thu, Jul 10, 2003 at 05:28:41PM +0100, Paul Makepeace wrote:
> > Cons: can't map one domain to many. Semantically this isn't possible
> > though, right?
> 
> Um. We allow that (one domain having many aliases). This
> is quite useful when somebody has example.{com,org,net} or
> whatever.

I meant in the other direction: one domain can't alias to multiple other
"real" domains.

> I suspect that the correct way to do this would be:
> 
>     create table domain (
>         id integer primary key,
>         name varchar(255)
>     );
> 
>     create table destination (
>         domainid integer references domain.id,
>         localpart varchar(255),
>         type enum ( forwarder, popbox ),
>         destination text,
>         primary key (domainid, localpart)
>     );

(Isn't this solving another problem?)

Paul, who is trying to decide whether to combine forwarder & popbox as
above or keep them separate. For me, they're just on the edge of being
sufficently different to keep them separate while yet remaining
tantalisingly similar... At the moment I've created an "accounts" table
which is simply localpart + domain_id and then have the other "forwards"
and "mailboxes" tables reference the accounts. Who knows..

-- 
Paul Makepeace ....................................... http://paulm.com/

"What is the difference between a shoe? Less moon pie."
   -- http://paulm.com/toys/surrealism/