[Dovecot] dovecot 2.0.8 LDA with MYSQL issues
Hi, after deciding to use Dovecot 2.0.8 as a postfix LDA using mysql DB I'm running into some issues. I started to follow, http://wiki.dovecot.org/HowTo/DovecotLDAPostfixAdminMySQL but noticed that the auth settings on the config changed, after looking through the dovecot wiki I think I have that issue fixed. However I still can't get the SQL part to work right, below is what I have on the conf.d/sql.conf and the error I get.
service dovecot status
doveconf: Fatal: Error in configuration file /usr/local/etc/dovecot/conf.d/sql.conf line 1: Unknown setting: password_query
Where do I put the sql connect string, in the URL above that along with the driver type went on the sql.conf file but that is no longer the case. If anyone has a better reference/suggestions for what im trying to do I would appreciated it.
Thanks, Paul
[root@testip5 conf.d]# cat sql.conf
password_query = SELECT userid as user, password FROM users WHERE userid = '%u'
user_query = SELECT uid, gid, '/var/vmail/%d/%n' as home FROM users WHERE userid = '%u'
[root@testip5 conf.d]# dovecot -n
# 2.0.8: /usr/local/etc/dovecot/dovecot.conf
# OS: Linux 2.6.18-194.el5PAE i686 CentOS release 5.5 (Final) ext3
auth_mechanisms = plain login cram-md5
first_valid_uid = 101
last_valid_uid = 101
login_greeting = MegaNet Mail Server Ready.
mail_gid = vmail
mail_location = maildir:/var/vmail/%d/%u
mail_uid = vmail
passdb {
args = /usr/local/etc/dovecot/conf.d/sql.conf
driver = sql
}
plugin {
acl = vfile:/usr/local/etc/dovecot/acls
quota = maildir:storage=10240:messages=1000
trash = /usr/local/etc/dovecot/conf.d/trash.conf
}
protocols = imap pop3
userdb {
driver = prefetch
}
userdb {
args = /usr/local/etc/dovecot/conf.d/sql.conf
driver = sql
}
doveconf: Error: ssl enabled, but ssl_cert not set
doveconf: Fatal: Error in configuration file /usr/local/etc/dovecot/dovecot.conf: ssl enabled, but ssl_cert not set
I had the config files in the conf.d/ directory as *.conf instead of *conf.ext. When I renamed the files to include .ext that seemed to fix the problem. Coming from Dovecot 1.x I never used extended config files in the conf.d directory, apparently they have to be named .ext.
Thanks, Paul
-----Original Message----- From: dovecot-bounces+razor=meganet.net@dovecot.org [mailto:dovecot-bounces+razor=meganet.net@dovecot.org] On Behalf Of PA Sent: Thursday, December 16, 2010 1:33 PM To: dovecot@dovecot.org Subject: [Dovecot] dovecot 2.0.8 LDA with MYSQL issues
Hi, after deciding to use Dovecot 2.0.8 as a postfix LDA using mysql DB I'm running into some issues. I started to follow, http://wiki.dovecot.org/HowTo/DovecotLDAPostfixAdminMySQL but noticed that the auth settings on the config changed, after looking through the dovecot wiki I think I have that issue fixed. However I still can't get the SQL part to work right, below is what I have on the conf.d/sql.conf and the error I get.
service dovecot status
doveconf: Fatal: Error in configuration file /usr/local/etc/dovecot/conf.d/sql.conf line 1: Unknown setting: password_query
Where do I put the sql connect string, in the URL above that along with the driver type went on the sql.conf file but that is no longer the case. If anyone has a better reference/suggestions for what im trying to do I would appreciated it.
Thanks, Paul
[root@testip5 conf.d]# cat sql.conf
password_query = SELECT userid as user, password FROM users WHERE userid = '%u'
user_query = SELECT uid, gid, '/var/vmail/%d/%n' as home FROM users WHERE userid = '%u'
[root@testip5 conf.d]# dovecot -n
# 2.0.8: /usr/local/etc/dovecot/dovecot.conf
# OS: Linux 2.6.18-194.el5PAE i686 CentOS release 5.5 (Final) ext3
auth_mechanisms = plain login cram-md5
first_valid_uid = 101
last_valid_uid = 101
login_greeting = MegaNet Mail Server Ready.
mail_gid = vmail
mail_location = maildir:/var/vmail/%d/%u
mail_uid = vmail
passdb {
args = /usr/local/etc/dovecot/conf.d/sql.conf
driver = sql
}
plugin {
acl = vfile:/usr/local/etc/dovecot/acls
quota = maildir:storage=10240:messages=1000
trash = /usr/local/etc/dovecot/conf.d/trash.conf
}
protocols = imap pop3
userdb {
driver = prefetch
}
userdb {
args = /usr/local/etc/dovecot/conf.d/sql.conf
driver = sql
}
doveconf: Error: ssl enabled, but ssl_cert not set
doveconf: Fatal: Error in configuration file /usr/local/etc/dovecot/dovecot.conf: ssl enabled, but ssl_cert not set
Apparently that's not it, the include is configured as !include conf.d/*.conf - when I changed the conf.d/ files to .conf.ext it simple didn't read the file and it gave me no error. Back to square one.
-----Original Message----- From: PA [mailto:razor@meganet.net] Sent: Thursday, December 16, 2010 4:29 PM To: 'dovecot@dovecot.org' Subject: RE: [Dovecot] dovecot 2.0.8 LDA with MYSQL issues solved
I had the config files in the conf.d/ directory as *.conf instead of *conf.ext. When I renamed the files to include .ext that seemed to fix the problem. Coming from Dovecot 1.x I never used extended config files in the conf.d directory, apparently they have to be named .ext.
Thanks, Paul
-----Original Message----- From: dovecot-bounces+razor=meganet.net@dovecot.org [mailto:dovecot-bounces+razor=meganet.net@dovecot.org] On Behalf Of PA Sent: Thursday, December 16, 2010 1:33 PM To: dovecot@dovecot.org Subject: [Dovecot] dovecot 2.0.8 LDA with MYSQL issues
Hi, after deciding to use Dovecot 2.0.8 as a postfix LDA using mysql DB I'm running into some issues. I started to follow, http://wiki.dovecot.org/HowTo/DovecotLDAPostfixAdminMySQL but noticed that the auth settings on the config changed, after looking through the dovecot wiki I think I have that issue fixed. However I still can't get the SQL part to work right, below is what I have on the conf.d/sql.conf and the error I get.
service dovecot status
doveconf: Fatal: Error in configuration file /usr/local/etc/dovecot/conf.d/sql.conf line 1: Unknown setting: password_query
Where do I put the sql connect string, in the URL above that along with the driver type went on the sql.conf file but that is no longer the case. If anyone has a better reference/suggestions for what im trying to do I would appreciated it.
Thanks, Paul
[root@testip5 conf.d]# cat sql.conf
password_query = SELECT userid as user, password FROM users WHERE userid = '%u'
user_query = SELECT uid, gid, '/var/vmail/%d/%n' as home FROM users WHERE userid = '%u'
[root@testip5 conf.d]# dovecot -n
# 2.0.8: /usr/local/etc/dovecot/dovecot.conf
# OS: Linux 2.6.18-194.el5PAE i686 CentOS release 5.5 (Final) ext3
auth_mechanisms = plain login cram-md5
first_valid_uid = 101
last_valid_uid = 101
login_greeting = MegaNet Mail Server Ready.
mail_gid = vmail
mail_location = maildir:/var/vmail/%d/%u
mail_uid = vmail
passdb {
args = /usr/local/etc/dovecot/conf.d/sql.conf
driver = sql
}
plugin {
acl = vfile:/usr/local/etc/dovecot/acls
quota = maildir:storage=10240:messages=1000
trash = /usr/local/etc/dovecot/conf.d/trash.conf
}
protocols = imap pop3
userdb {
driver = prefetch
}
userdb {
args = /usr/local/etc/dovecot/conf.d/sql.conf
driver = sql
}
doveconf: Error: ssl enabled, but ssl_cert not set
doveconf: Fatal: Error in configuration file /usr/local/etc/dovecot/dovecot.conf: ssl enabled, but ssl_cert not set
On Thu, 2010-12-16 at 16:32 -0500, PA wrote:
Apparently that's not it, the include is configured as !include conf.d/*.conf - when I changed the conf.d/ files to .conf.ext it simple didn't read the file and it gave me no error. Back to square one.
The sql config isn't supposed to be !included, it gets used by:
passdb { driver = sql args = /path/to/sql.conf }
And looks like you already had it like that. So what's the problem?
Timo, thanks for the reply, the problem is that with dovecot 1.x the wiki recommends the connect string and password_query/user_query be in the sql.conf include file. According to wiki2 I should also be able to put these settings on the sql.conf include file but I get an error no matter what I put on there.
[root@testip5 conf.d]# cat sql.conf password_query = SELECT user, password FROM users WHERE user = '%u' user_query = SELECT 101 AS uid, 504 AS gid, home FROM users WHERE userid = '%n'
[root@testip5 conf.d]# dovecot -n # 2.0.8: /usr/local/etc/dovecot/dovecot.conf doveconf: Fatal: Error in configuration file /usr/local/etc/dovecot/conf.d/sql.conf line 1: Unknown setting: password_query
any idea what im doing wrong?
Thanks for the reply!
paul
-----Original Message----- From: dovecot-bounces+razor=meganet.net@dovecot.org [mailto:dovecot-bounces+razor=meganet.net@dovecot.org] On Behalf Of Timo Sirainen Sent: Friday, December 17, 2010 8:52 AM To: PA Cc: dovecot@dovecot.org Subject: Re: [Dovecot] dovecot 2.0.8 LDA with MYSQL issues not solved
On Thu, 2010-12-16 at 16:32 -0500, PA wrote:
Apparently that's not it, the include is configured as !include conf.d/*.conf - when I changed the conf.d/ files to .conf.ext it simple didn't read the file and it gave me no error. Back to square one.
The sql config isn't supposed to be !included, it gets used by:
passdb { driver = sql args = /path/to/sql.conf }
And looks like you already had it like that. So what's the problem?
On Fri, 2010-12-17 at 09:52 -0500, PA wrote:
Timo, thanks for the reply, the problem is that with dovecot 1.x the wiki recommends the connect string and password_query/user_query be in the sql.conf include file. According to wiki2 I should also be able to put these settings on the sql.conf include file but I get an error no matter what I put on there.
Do it like in the example-config. The file wasn't called sql.conf, it was called dovecot-sql.conf.ext. It's not supposed to be !included. That's why you get:
doveconf: Fatal: Error in configuration file /usr/local/etc/dovecot/conf.d/sql.conf line 1: Unknown setting: password_query
So .ext is just an extension to the config file. For some reason I kept putting it in the conf.d/ dir and calling a .conf file. At least this is now working for me, thanks Timo.
paul
-----Original Message----- From: dovecot-bounces+razor=meganet.net@dovecot.org [mailto:dovecot-bounces+razor=meganet.net@dovecot.org] On Behalf Of Timo Sirainen Sent: Friday, December 17, 2010 9:55 AM To: PA Cc: 'Dovecot Mailing List' Subject: Re: [Dovecot] dovecot 2.0.8 LDA with MYSQL issues not solved
On Fri, 2010-12-17 at 09:52 -0500, PA wrote:
Timo, thanks for the reply, the problem is that with dovecot 1.x the wiki recommends the connect string and password_query/user_query be in the sql.conf include file. According to wiki2 I should also be able to put these settings on the sql.conf include file but I get an error no matter what I put on there.
Do it like in the example-config. The file wasn't called sql.conf, it was called dovecot-sql.conf.ext. It's not supposed to be !included. That's why you get:
doveconf: Fatal: Error in configuration file /usr/local/etc/dovecot/conf.d/sql.conf line 1: Unknown setting: password_query
participants (2)
-
PA
-
Timo Sirainen