[Dovecot] sql : uid, gid, home ignored ?

Hurricane hurricane.san at gmail.com
Sun Jan 30 12:18:54 EET 2011


> >
> >    Hello,
> >
> >    I'm trying to setup a dovecot imap server.
> >
> >    version is 2.0.9
> >    I've setup a mysql database using:
> >
> >    user_query = \
> >        SELECT home, uid, gid, home as userdb_home, uid as userdb_uid,  
> > gid as userdb_gid, \
> >        FROM user WHERE username = '%n' AND domain = '%d' AND active =  
> > 'Y'
>
>
>
> Your SQL statement is incorrect, try:
>
> user_query =  SELECT userdb_home as home, userdb_uid as uid, userdb_gid  
> as gid, \
>     FROM user WHERE username = '%n' AND domain = '%d' AND active = 'Y'
>
>
>
> nick
>

(I sent the first mail with an address not registred with the mailing list)

Thank you Nick, but it didn't changed a thing. (I guess dovecots ignores  
columns with unknown names)

When I connect I still get:

==> mail.err <==
Jan 30 11:06:12 mail.mysite.com dovecot: imap(theuser): Error: user  
theuser: Couldn't drop privileges: User is missing UID (see mail_uid  
setting)
Jan 30 11:06:12 mail.mysite.com dovecot: imap(theuser): Error: Internal  
error occurred. Refer to server log for more information.

==> mail.info <==
Jan 30 11:06:12 mail.mysite.com dovecot: imap-login: Login:  
user=<theuser>, method=PLAIN, rip=1.2.3.4, lip=5.6.7.8, mpid=9298, TLS
Jan 30 11:06:12 mail.mysite.com dovecot: imap(theuser): Error: user  
theuser: Couldn't drop privileges: User is missing UID (see mail_uid  
setting)
Jan 30 11:06:12 mail.mysite.com dovecot: imap(theuser): Error: Internal  
error occurred. Refer to server log for more information.

==> mail.log <==
Jan 30 11:06:12 mail.mysite.com dovecot: imap-login: Login:  
user=<theuser>, method=PLAIN, rip=1.2.3.4, lip=5.6.7.8, mpid=9298, TLS
Jan 30 11:06:12 mail.mysite.com dovecot: imap(theuser): Error: user  
theuser: Couldn't drop privileges: User is missing UID (see mail_uid  
setting)
Jan 30 11:06:12 mail.mysite.com dovecot: imap(theuser): Error: Internal  
error occurred. Refer to server log for more information.

==> mail.warn <==
Jan 30 11:06:12 mail.mysite.com dovecot: imap(theuser): Error: user  
theuser: Couldn't drop privileges: User is missing UID (see mail_uid  
setting)
Jan 30 11:06:12 mail.mysite.com dovecot: imap(theuser): Error: Internal  
error occurred. Refer to server log for more information.

==> dovecot-debug.log <==
2011-01-30 11:06:12auth: Debug: client in: AUTH 1       PLAIN    
service=imap    secured lip=5.6.7.8        rip=1.2.3.4       
lport=143       rport=
9863
2011-01-30 11:06:12auth: Debug: client out: CONT        1
2011-01-30 11:06:12auth: Debug: client in: CONT 1        
AGh1cnJpY2FuZQBka3NtdDExJA==
2011-01-30 11:06:12auth: Debug: sql(theuser at mysite.com,1.2.3.4): query:  
SELECT username AS user, password, home AS userdb_home, uid AS userdb_uid,  
id AS userdb_gid, home, uid, gid FROM user WHERE username = 'theuser' AND  
domain = 'mysite.com' AND active = 'Y'
2011-01-30 11:06:12auth: Debug: auth(theuser at mysite.com,1.2.3.4): username  
changed theuser at mysite.com -> theuser
2011-01-30 11:06:12auth: Debug: auth(theuser at mysite.com,1.2.3.4): username  
changed theuser at mysite.com -> theuser
2011-01-30 11:06:12auth: Debug: client out: OK  1       user=theuser   
home=/home/theuser    uid=2000        gid=1000
2011-01-30 11:06:12auth: Debug: master in: REQUEST      1628045313       
9246    1       926873f8d25265e8b06ad56f5ac8ba9d
2011-01-30 11:06:12auth: Debug: master out: USER        1628045313       
theuser

The debug shows the right home, uid, gid for the user but it seems it does  
not cares about that afterwards.

The error only disappears when I set the global mail_uid and mail_gid but  
that's not what I need.  I need to be able to use a specific uid/gid/home  
for each account.

Weird.

Regards,

Eric


More information about the dovecot mailing list