INSTALL
changeset 15 1607f7b2dba9
parent 14 ebc9b864bc9a
child 16 3388b96fd3ed
equal deleted inserted replaced
14:ebc9b864bc9a 15:1607f7b2dba9
    37     CREATE USER dovecot ENCRYPTED password 'DB PASSWORD for Dovecot';
    37     CREATE USER dovecot ENCRYPTED password 'DB PASSWORD for Dovecot';
    38     CREATE ROLE mailsys WITH USER postfix, dovecot;
    38     CREATE ROLE mailsys WITH USER postfix, dovecot;
    39 
    39 
    40     # set permissions
    40     # set permissions
    41     GRANT SELECT ON dovecot_password, dovecot_user TO dovecot;
    41     GRANT SELECT ON dovecot_password, dovecot_user TO dovecot;
    42     GRANT SELECT ON postfix_alias, postfix_maildir, postfix_relocated,
    42     GRANT SELECT ON postfix_alias, postfix_gid, postfix_maildir,
    43     postfix_uid, postfix_gid, postfix_transport TO postfix;
    43     postfix_relocated, postfix_transport, postfix_uid TO postfix;
    44 
    44 
    45     # leave psql
    45     # leave psql
    46     \q
    46     \q
    47 
    47 
    48 Create directory for your mails
    48 Create directory for your mails
    56 Configuring Dovecot
    56 Configuring Dovecot
    57 
    57 
    58 * /etc/dovecot/dovecot.conf
    58 * /etc/dovecot/dovecot.conf
    59     # all your other settings
    59     # all your other settings
    60     mail_location = maildir:~/Maildir
    60     mail_location = maildir:~/Maildir
    61     mail_extra_groups = mail
    61     mail_privileged_group = mail
    62     first_valid_uid = 70000
    62     first_valid_uid = 70000
    63     first_valid_gid = 70000
    63     first_valid_gid = 70000
    64     protocol lda {
    64     protocol lda {
    65       postmaster_address = postmaster@domain.tld
    65       postmaster_address = postmaster@domain.tld
    66     }
    66     }
    90 * /etc/dovecot/dovecot-sql.conf
    90 * /etc/dovecot/dovecot-sql.conf
    91     driver = pgsql
    91     driver = pgsql
    92     connect = host=localhost dbname=mailsys user=dovecot password=$Dovecot_PASS
    92     connect = host=localhost dbname=mailsys user=dovecot password=$Dovecot_PASS
    93     default_pass_scheme = HMAC-MD5
    93     default_pass_scheme = HMAC-MD5
    94     password_query = SELECT "user", password FROM dovecot_password WHERE "user"= '%u'
    94     password_query = SELECT "user", password FROM dovecot_password WHERE "user"= '%u'
    95     user_query = SELECT home, uid, gid FROM dovecot_user WHERE userid = '%u'
    95     user_query = SELECT home, uid, gid, mail FROM dovecot_user WHERE userid='%u'
    96 
    96 
    97 Provide a root SETUID copy of Dovecot's deliver agent for Postfix
    97 Provide a root SETUID copy of Dovecot's deliver agent for Postfix
    98 
    98 
    99     mkdir -p /usr/local/lib/dovecot
    99     mkdir -p /usr/local/lib/dovecot
   100     chmod 700 /usr/local/lib/dovecot
   100     chmod 700 /usr/local/lib/dovecot