Re: [Exim] PGsql lookup - strange behaviour ?

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Robert Gomulka
Datum:  
To: Philip Hazel
CC: exim-users
Betreff: Re: [Exim] PGsql lookup - strange behaviour ?
Dnia Pon 16. Lipiec 2001 10:18, Philip Hazel napisał:
> On Sun, 15 Jul 2001, Robert Gomulka wrote:
> > Philip, you are great! That works of course. But I was (and some people
> > too), that this lookup gives list of domains (I know, I should look into
> > archives
> >
> > :).
> >
> > But if you tell that will be simplier in exim 4 I believe you.
>
> No, this one won't be any simpler. But I will try to improve the
> documentation.

Well, I still have questions.
A piece of config:
db_user:
    driver = aliasfile
    domains = "pgsql;select domains from domain where domain='$key'"
    search_type = pgsql
    query="select name from aliasmail where name='$local_part' and 
domain='$domain'"
    transport = db_deliver


db_deliver:
    driver = aliasfile
    domains = "pgsql;select domain from domains where domain='$key'"
    search_type = pgsql
    query="select name from aliasmail where alias='$local_part' and 
domain='$domain'"
    qualify_preserve_domain


THAT WORKS. But why do I have 2 so similar drivers? Without second entry,
exim looks once into database for name the same as alias. And founds nothing,
so gives up. Without first entry, it ALMOST work, because it finds once good
things (alias->username), but local_part is alias from alias@domain, so many
things defined in config don't work (eg. user = $local_part, and so on.
Exactly, when invoking in testing mode, to my surprise I see that exim looks
SECOND TIME into database, now looking for "alias=realname and domain=domain".

Isn't that clear? Well, I try to show it
mail to: test@???, database table: alias=test, user=usertest,
domain=domain.pl

First entry/Second entry/First look/Second look
yes/yes/db_deliver:alias=test,domain=domain.pl/db_user:name=usertest,domain=domain.pl
yes/no/db_user:name=test,domain=domain.pl/
#no second lookup - first fail, because there is no such field
no/yes/db_deliver:alias=test,domain=domain.pl/db_deliver:alias=usertest,domain=domain.pl
#second lookup fails - after resolving alias->username it tries
#to resolve it second time. why? and in the meantime exim "variables"
#such as local_part are set to alias, not username

I repeat: it only works, when 2 entries are present.
Sorry for so many postings, but I am just looking for helpful explanation how
to do some things simplier. An answer "But it works" doesn't satisfy me.

And if it is helpful, I will send exim -d 9 -v -bt address output.
Sincerely
Robert Gomulka