Re: [exim] Problems with mysql query

Top Page
Delete this message
Reply to this message
Author: Magnus Holmgren
Date:  
To: exim-users
Subject: Re: [exim] Problems with mysql query
On Monday 05 March 2007 13:32, Adrian Chapela wrote:
> I can't select a user from a mysql database.
>
> The query seem not execute and I don't understand anything.
>
> I have a user in local and it's OK. The exim was compiled with mysql
> support.
>
> The domains list can't be retrevied from the database and no error....
>
> The config:
>
> The domain list error:
> domainlist local_domains = localhost: mysql;SELECT userid FROM domains
> WHERE userid='$domain';
>
> The domain list OK:
> domainlist local_domains = localhost : example.es
>
> #Router
> virtual_users:
> driver = redirect
> allow_fail
> allow_defer
> data = ${lookup mysql{select maildir from users where
> id='$local_part@$domain'}{$value}fail}
> directory_transport = virtual_delivery


You don't reference the local_domains domainlist from anywhere; at least not
from here (perhaps in the ACLs?). No wonder it doesn't execute. You would
typically include a condition:

domains = +local_domains

if that is really necessary. The data being empty gives the same result in
practice.

> The errors:13:21:41 29972 local_part=proba_salva domain=example.es
> 13:21:41 29972 calling virtual_users router
> 13:21:41 29972 rda_interpret (string): ${lookup mysql{select maildir
> from users where id='$local_part@$domain'}{$value}fail}
> 13:21:41 29972 expanding: select maildir from users where
> id='$local_part@$domain'
> 13:21:41 29972    result: select maildir from users where
> id='proba_salva@???'
> 13:21:41 29972 search_open: mysql "NULL"
> 13:21:41 29972 search_find: file="NULL"
> 13:21:41 29972   key="select maildir from users where
> id='proba_salva@???" partial=-1 affix=NULL starflags=0
> 13:21:41 29972 LRU list:
> 13:21:41 29972   :/etc/aliases
> 13:21:41 29972   End
> 13:21:41 29972 internal_search_find: file="NULL"
> 13:21:41 29972   type=mysql key="select maildir from users where
> id='proba_salva@???"
> 13:21:41 29972 database lookup required for select maildir from users
> where id='proba_salva@???'
> 13:21:41 29972 MYSQL query: select maildir from users where
> id='proba_salva@???'
> 13:21:41 29972 MYSQL new connection: host=localhost port=0 socket=NULL
> database=maildb user=mail


I can't see any error. The debug output shows how Exim starts expanding the
${lookup ...} item and prepares to execute the query "select maildir from
users where id='proba_salva@???'". But then you cut off before getting
to the interesting part.

-- 
Magnus Holmgren        holmgren@???
                       (No Cc of list mail needed, thanks)


"Exim is better at being younger, whereas sendmail is better for
Scrabble (50 point bonus for clearing your rack)" -- Dave Evans