[Dovecot] Dovecot failed with a correct sql user_query

Nicola Tiling nti at w4w.net
Mon Jul 7 00:20:21 EEST 2008


Dovecot (1.1.1) criticises a sql user_query that's working on the sql  
console and thats correct.

DOVECOT-LOG:
"dovecot: Jul 06 22:58:29 Error: auth(default): sql(nti): User query  
failed: ERROR:  syntax error at or near "mbox"
dovecot: Jul 06 22:58:29 Error: auth(default): LINE 1: ...gid, home,  
(CASE WHEN smtp like '/var/pop3/ THEN 'mbox:' || ..."

QUERY:
user_query = SELECT '%u' AS user, uid, gid, home, (CASE WHEN home like  
'/var/pop3/%' THEN 'mbox:' || home || '/mail/:INDEX=' || home || '/ 
indexes/' WHEN home like '/var/maildir/%' THEN 'maildir:' || home || '/ 
mail/:INDEX=' || home || '/indexes/' END) AS mail FROM users WHERE  
username = '%u'  AND users.enabled = '1' AND users.type='local'

PGSQL-PROMPT:
mail=# SELECT 'nti' AS user, uid, gid, home, (CASE WHEN home like '/ 
var/pop3/%' THEN 'mbox:' || home || '/mail/:INDEX=' || home || '/ 
indexes/' WHEN home like '/var/maildir/%' THEN 'maildir:' || home || '/ 
mail/:INDEX=' || home || '/indexes/' END) AS mail FROM users WHERE  
username = 'nti' AND users.enabled = '1' AND users.type='local';
  user | uid | gid |       home       |                               
mail
------+-----+-----+------------------ 
+----------------------------------------------------------------
  nti  |  99 |  99 | /var/maildir/nti | maildir:/var/maildir/nti/ 
mail/:INDEX=/var/maildir/nti/indexes/


More information about the dovecot mailing list