Dovecot setup thoughts?

2014-07-31
2014-07-31
  • Hi!
    I now have a nicely working Postfix/PFA with SSL setup where the folders are being created and mail delivered as they should. Next step now is to add Dovecot to the mix, but looking at the DOVECOT.txt file it confuses me more than it helps :P
    My setup for postfix is:
    virtual_mailbox_base = /var/vmail
    virtual_minimum_uid = 5000
    virtual_uid_maps = static:5000
    virtual_gid_maps = static:5000
    (users/group vmail)
    I use the default sql files for PFA/MySQL for PFA.
    I use the default pfa options
    $CONF['domain_path'] = 'YES';
    $CONF['domain_in_mailbox'] = 'NO';
    For a nice directory layout.

    It seems to me the Dovecot instructions are assuming some different settings than the Postfix file does?
    mail_location = maildir:/var/mail/vmail/%u/
    Looks wrong to me, maybe
    mail_location = maildir:/var/vmail/%d/n%/
    ?
    Also the SQL stuff doesn't look right, but not sure how to adapt

    password_query = SELECT username AS user,password FROM mailbox WHERE username = '%u' AND active='1'

    Then

    user_query = SELECT maildir, 1001 AS uid, 1001 AS gid FROM mailbox WHERE username = '%u' AND active='1'

    Exchange 1001 for my 5000 UID/GID I guess, something else?
    But right after that there's a second user query marked as mysql (but no second for password query?), it's

    user_query = SELECT CONCAT('/var/vmail/mail/', maildir) AS home, 1001 AS uid, 1001 AS gid, CONCAT('*:bytes=', quota) AS quota_rule FROM mailbox WHERE username = '%u' AND active='1'

    Change /var/vmail/mail/ to /var/vmail/ I guess, and 1001's to 5000's again ?
    But which of the quesries to use? (the 2 shorter mentions mailbox but I'm using maildir?)

    Very grateful for all help and advice. (Sure there are many guides to find, but few have the same setup as you or same choices and even fewer explain WHY some choises and settings are made).