[Exim] wildcard and mysql

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: qadeer
Dátum:  
Címzett: exim-users
Tárgy: [Exim] wildcard and mysql
Hi

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

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).

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.

Eg delivery to qadeer@??? --->p12345-001
Now this is then passed through the director again, and if no match then
it used to (before addtion of second director) goto local_user and
deliver, but now what it does is that when there is no match, it drops
to the second director (which from what I read it is supposed to do),
and from here it looks up the wildcard pop box, and delivers all the
mail there, irrespective of whether the "actual" popbox exists or not.

Logically this is what exim is supposed to do, so anyone have any ideas
of how i prevent that.

I think I managed to kludge something together but just need
confirmation that it is the best way of doing it.

1.virtual_alias:
2.localuser:
3.virtual_alias_wild:

I have placed the directors in this order

So if match in virtual alias, drops to local user and delivery happens

If no match i.e for a wildcard, then he will not also be a local user,
hence 2 is missed, he then goes to 3, find the local user where all wild
card entries are deliverd, goes back to 1, then delivers in 2.

Is this correct. I have test what would happen if I deliver offsite.

Thanks

Qadeer


--

Try the Moo Shu Pork. It is especially good today.