[commits] [Wiki] changed: SQLAuthHowTo
Wiki Guest
wikiguest at horde.org
Sun Apr 22 23:42:00 UTC 2012
guest [46.208.216.239] Sun, 22 Apr 2012 23:42:00 +0000
Modified page: http://wiki.horde.org/SQLAuthHowTo
New Revision: 22
Change log: Add notes on using Dovecot SQL auth with Horder users table
@@ -76,4 +76,36 @@
NB: We do not (in this wiki page) use the uid/gid fields. If you
need these fields, you will need to modify the queries to include
them, as appropriate. In the same vain, you could add additional
fields as well, if needed or desired.
If you need to use multiple virtual domains, you might see the web
page
http://wiki.vpslink.com/HOWTO:_ISP-style_Email_Server_with_Debian-Etch_and_Postfix_2.3 which could provide much inspiration for the sql database
setup.
+
+---------------------------------------------------
+''Comment from another user: You can also do it the other way - let
Dovecot authenticate against the Horde users table, like I do: ''
+
+1. Add a dovecot user to the SQL server (I use PostgreSQL).
+2. Amend permissions for the the 'horde_users' table to give the
'dovecot' user read (SELECT) permission.
+3. Use the following (amend as needed - the example assumes you are
using PostgreSQL) in /etc/dovecot/dovecot-sql.conf:
+
+#/etc/dovecot/dovecot-sql.conf
+driver = pgsql
+connect = host=localhost dbname=horde user=dovecot password=
+default_pass_scheme = MD5-CRYPT
+password_query = SELECT user_uid AS username, user_pass AS password \
+ FROM horde_users WHERE user_uid = '%u'
+iterate_query = SELECT user_uid AS username FROM users
+
+
+4. I use a static user database in Dovecot, so I didn't need the "user_query"
+5. Add the following to /etc/dovecot/dovecot.conf:
+
+userdb {
+ args = uid=vmail gid=vmail home=/srv/dovecot/%u
+ driver = static
+}
+
+passdb {
+ driver = sql
+ args = /etc/dovecot/dovecot-sql.conf
+}
+
+
+Amend the above to suit your setup. Don't forget to set MD5-CRYPT as
password encryption in Horde as well. One advantage of doing things
this way is that passwords can be changed through Horde - and they
will apply to Dovecot as well.
More information about the commits
mailing list