Unable to get virtual users set up with database auth

Gedalya gedalya at gedalya.net
Thu Oct 16 17:46:19 UTC 2014


When you reply, try to make sure you reply to the list 
(dovecot at dovecot.org), in Thunderbird you should have a Reply List 
button, or just use reply to all.

btw I meant: the output of the 'dovecot -n' command, sorry :D

OK so, first of all, lda doesn't do any passdb lookup at all, only 
userdb. It doesn't have any password to check.

Just as a comment, your password query could just as well be:

password_query = SELECT uPass as password FROM users WHERE uName = '%n' 
AND uDomain = '%d'

auth_username_format = %Lu -- which I believe is set by default, would 
lowercase the username for you on the way in from the client, so if all 
your usernames are meant to be purely lowercase, there is no need to 
return these fields from the database. Set it explicitly just to be 
sure. You're using a somewhat old version, I'm not sure how it was back 
then. Either way, this shouldn't be affecting lda.

Now, this seems to be wrong.

mail_location = mbox:/var/spool/mail/%u:INBOX=/var/spool/mail/%u

You probably want it more like:
mbox:~/mail:INBOX=/var/spool/mail/%u

The first value, ~/mail, will be a /mail directory under the 'home' 
directory set in your static userdb, and that's where mailboxes 
(folders) other than INBOX will be stored. It must be a directory, not a 
file!

I'm a little confused about some of the other details in your log. Let's 
try to correct your mail_location first and see where that takes us.

Also, under namespace, you might as well comment out the 'location = ' 
and  'prefix = ' lines, though I'm not sure it matters.



On 10/16/2014 12:51 PM, Cliff Hayes wrote:
> Here it is:
>
> [root at avalon dovecot]# dovecot -n output
> # 2.0.9: /etc/dovecot/dovecot.conf
> # OS: Linux 2.6.32-431.29.2.el6.x86_64 x86_64 Scientific Linux release 
> 6.5 (Carbon) ext4
> auth_debug = yes
> auth_debug_passwords = yes
> auth_verbose = yes
> auth_verbose_passwords = plain
> first_valid_uid = 496
> mail_access_groups = mail
> mail_debug = yes
> mail_location = mbox:/var/spool/mail/%u:INBOX=/var/spool/mail/%u
> mbox_write_locks = fcntl
> namespace {
>   hidden = no
>   inbox = yes
>   list = yes
>   location =
>   prefix =
>   separator = .
>   subscriptions = yes
>   type = private
> }
> passdb {
>   args = /etc/dovecot/dovecot-sql.conf.ext
>   driver = sql
> }
> protocols = imap
> ssl_ca = </etc/pki/dovecot/certs/intermediate.crt
> ssl_cert = </etc/pki/dovecot/certs/avalon20140929.crt
> ssl_key = </etc/pki/dovecot/private/avalon20140929.key
> userdb {
>   args = uid=497 gid=12 home=/var/email/%u
>   driver = static
> }
> verbose_ssl = yes
> protocol imap {
>   imap_id_log = *
> }
>
> [root at avalon dovecot]# cat dovecot-sql.conf.ext
>
> driver = mysql
>
> default_pass_scheme = PLAIN
>
> connect = host=localhost dbname=email user=blah password=blah
>
> password_query = SELECT uName as user, uNameDomain as username, 
> uDomain as domain, uPass as password FROM users WHERE uName = '%n' AND 
> uDomain = '%d'
>
>
>
>
> On 10/16/2014 11:24 AM, Gedalya wrote:
>> On 10/16/2014 12:19 PM, Cliff Hayes wrote:
>>> well i don't want to use system users. but how do I assign a UID and
>>> GID to virtual users to eliminate the permissions errors?
>>>
>> For dovecot, it is like this:
>> http://wiki2.dovecot.org/AuthDatabase/SQL#User_database_lookups
>>
>> I don't know if this would be OK with your sendmail side.
>>
>> You should really post your complete dovecot config (dovecot -n output +
>> any ".ext" files) so that we can get a better picture.
>>



More information about the dovecot mailing list