Vexim with dovecot

From Veximwiki

Jump to: navigation, search

integration with dovecot

dovecot is a light, small and secure imap and pop3 client. Integration into vexim is quite easy. On Debian systems just install dovecot. After that edit dovecot-sql.conf. In there you must point dovecot to the database of vexim:

driver = mysql
connect = host=localhost user=CHANGE password=CHANGE dbname=CHANGE
default_pass_scheme = PLAIN
password_query = SELECT clear as password FROM users WHERE username = '%u' AND type = 'local' AND enabled = '1'
user_query = SELECT smtp AS maildir, uid, gid FROM users WHERE username = '%u' AND type = 'local' AND enabled = '1'

Just change username, password and dbname to your setup.

If you want to have accounts automatically disabled for POP/IMAP Login whenever you disable a domain, you could use the following user_query instead:

user_query = SELECT smtp as maildir, u.uid as uid, u.gid as gid, u.domain_id, d.domain_id FROM users u, domains d WHERE u.username = '%u' AND u.type = 'local' AND u.enabled = '1' AND u.domain_id = d.domain_id AND d.enabled = '1' AND d.domain = '%d'

In your dovecot.conf you must configure your auth mechanism to use the configuration:

 auth default {
   mechanisms = plain
   passdb sql {
     args = /etc/dovecot/dovecot-sql.conf
   } 
   userdb sql {
     args = /etc/dovecot/dovecot-sql.conf
   }
   user = CHANGE
   count = 1
 }
Personal tools