Re: [Exim] wildcard and mysql

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: qadeer
CC: exim-users
Subject: Re: [Exim] wildcard and mysql
On Sat, 1 Jul 2000, qadeer wrote:

> I have my alias lookups occuring from Mysql
>
> emailid:alias:domain
> p12345-001:qadeer:net4india.com
>
> when a mail is delivererd to qadeer@??? it is directed by my
> Virtual_alias director
>
> virtual_alias:
>         driver=aliasfile
>         qualify_preserve_domain
>         search_type=mysql
>         query="select emailid from EMAILADDS where domain='${domain}'
> and alias='${local_part}'"
>         # transport = virtual_local_delivery

>
> If successful, it then drops to the local_user director


No. If successful, the new addresses are processed independently,
starting with the first director or router, as appropriate. Only if a
generated address is in a local domain and is not an alias will it reach
the next director.

> localuser:
>           driver = localuser
>           transport = virtual_local_delivery

>
> and uses the aforementioned transport. This is all well and good (I
> commented out the transport in the virtual_alias director since when
> delivering the local_part would not take p12345-001, instead it would
> use qadeer, as the file to which to deliver).


Correct. You do not want a transport on an aliasfile director that is
doing aliasing.

> What I now wanted to do is wildcard deliver in that domain, i.e if
> qadeer matches, then deliver to p12345-001, if not then deliver to
> p12345-002
>
> For this I set up another director
> virtual_alias_wild:
>         driver=aliasfile
>         qualify_preserve_domain
>         search_type=mysql
>         query="select emailid from EMAILADDS where domain='${domain}'
> and alias='@'"

>
> The problem here is I can either set a domain to use teh first director,
> or the second not both.


(1) Use the "new_director" option on your aliasfile, so that if it
succeeds, it goes straight to localuser. This will restrict your aliases
to generating only local addresses, but that seems to be what you are
doing.

OR

(2) Put the "localuser" director *before* the aliasfile director.


> 1.virtual_alias:
> 2.localuser:
> 3.virtual_alias_wild:
>
> I have placed the directors in this order


Indeed, that is a third solution.

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.