[Vmail-discuss] suggestion for domain-aliases

klebermass@limtec.de klebermass@limtec.de
Thu, 12 Sep 2002 10:28:54 +0200


well  ok for this there would be so easy to solve but is still posible in
mysql ( thanks to the use of IF and string manipulation functions you can do
great things).
I think there are different ways to solve this.
One way would be to create an extra table  domains, with a field domain_id
and a field domain_name.
All domains that should be handled the same should hae the same domain_id.
Now you safe in your email_address table the domain_id and not the
domain_name.
in the sqlquery u make a join like
domain.domain_id=email_address.domain_id AND domain.domain_name='$domain'
(could be differ from system to system). Now  the  Emailadress should match
to all domains with the same domain_id .

The second way would be forwards from  domain1.com to domain2.com

You can solve this with eg an entry in your catchall table ( which has the
fields domain_name and target )
in the sql query you have to test if the target is a '*'  eg ( you can also
use another type, eg by saying target is only a domain)
and then puttying the new emailadress together by joining, the existing
local_part with the new domain.
Should be a little bit difficult to set up the query, but with IF clauses it
should be posible.

cya Martin