Providing Dovecot 2.x configuration steps on FreeBSD

(fixes also the FreeBSD-Part of ticket #1015)
- configuration files can be adopted for other os i think
This commit is contained in:
byteworkshosting
2013-03-12 11:57:50 +01:00
parent b5fb0da98f
commit 877add851b
3 changed files with 178 additions and 0 deletions

View File

@@ -203,8 +203,40 @@ return Array(
'restart' => Array(
'sh /usr/local/etc/rc.d/dovecot restart'
)
),
// Begin: Dovecot 2.x Config
'dovecot2' => array(
'label' => 'Dovecot 2.x',
'commands_1' => array(
'cd /usr/ports/mail/dovecot2',
'make config',
'set [x] kqueue(2) support (default)',
'set [x] MySQL database',
'set [x] SSL protocol (default)',
'make install clean; rehash',
),
'commands_2' => array(
'echo "dovecot_enable=\"YES\"" >> /etc/rc.conf',
PHP_EOL,
'pw adduser '. $vmail_username .' -g '. $vmail_groupname .' -u '. $settings['system']['vmail_gid'] .' -d /nonexistent -s /usr/sbin/nologin -c "User for virtual mailtransport used by Postfix and Dovecot"',
PHP_EOL,
'chmod 0640 /usr/local/etc/dovecot-sql.conf'
),
'files' => array(
'usr_local_etc_dovecot_dovecot.conf' => '/usr/local/etc/dovecot/dovecot.conf',
'usr_local_etc_dovecot_dovecot-sql.conf' => '/usr/local/etc/dovecot/dovecot-sql.conf'
),
'commands_3' => array(
'echo "dovecot unix - n n - - pipe'. PHP_EOL .'flags=DRhu user='. $vmail_username .':'. $vmail_groupname .' argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient} -a ${recipient}" >> /usr/local/etc/postfix/master.cf',
),
'restart' => array(
'/usr/local/etc/rc.d/dovecot restart'
)
)
// End: Dovecot 2.x Config
)
),
'ftp' => Array(
'label' => $lng['admin']['configfiles']['ftp'],

View File

@@ -0,0 +1,8 @@
driver = mysql
connect = host=<SQL_HOST> dbname=<SQL_DB> user=<SQL_UNPRIVILEGED_USER> password=<SQL_UNPRIVILEGED_PASSWORD>
default_pass_scheme = CRYPT
password_query = SELECT username AS user, password_enc AS password, CONCAT(homedir, maildir) AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, CONCAT('maildir:', homedir, maildir) AS userdb_mail, CONCAT('maildir:storage=', (quota*1024)) as userdb_quota FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3') OR '%Ls' = 'smtp' OR '%Ls' = 'sieve')
user_query = SELECT CONCAT(homedir, maildir) AS home, CONCAT('maildir:', homedir, maildir) AS mail, uid, gid, CONCAT('*:storage=', (quota*1024)) as quota_rule FROM mail_users WHERE (username = '%u' OR email = '%u')
# this query is used for doveadm:
iterate_query = SELECT username AS user FROM mail_users

View File

@@ -0,0 +1,138 @@
### Dovecot 2.x configuration file ###
mail_plugins =
protocols = imap lmtp sieve
listen = *, [::]
mail_uid = vmail
mail_gid = vmail
mail_access_groups = vmail
disable_plaintext_auth = yes
auth_mechanisms = plain login
auth_cache_negative_ttl = 1 mins
auth_cache_size = 1 k
ssl = yes
#ssl_cert = </example.crt
#ssl_key = </example.key
#ssl_ca = </example_ca.pem
ssl_require_crl = yes
ssl_protocols = TLSv1
ssl_cipher_list = HIGH
passdb {
args = /usr/local/etc/dovecot/dovecot-sql.conf
driver = sql
}
userdb {
args = /usr/local/etc/dovecot/dovecot-sql.conf
driver = sql
}
plugin {
# put your plugins here
}
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
}
}
service auth-worker {
user = dovecot
}
lmtp_save_to_detail_mailbox = yes
service lmtp {
unix_listener /var/spool/postfix/private/dovecot-lmtp {
group = postfix
mode = 0660
user = postfix
}
}
service imap-login {
chroot = login
client_limit = 256
executable = /usr/local/libexec/dovecot/imap-login
process_min_avail = 2
process_limit = 128
service_count = 1
inet_listener imap {
address = *, [::]
port = 143
}
inet_listener imaps {
address = *, [::]
port = 993
}
}
service imap {
executable = /usr/local/libexec/dovecot/imap
}
service managesieve-login {
inet_listener sieve {
port = 4190
}
inet_listener sieve_deprecated {
port = 2000
}
}
protocol sieve {
# not implemented yet
}
protocol imap {
mail_plugins = $mail_plugins
imap_client_workarounds = delay-newmail tb-extra-mailbox-sep
imap_max_line_length = 64 k
}
protocol lmtp {
mail_plugins = $mail_plugins
postmaster_address = postmaster@example.net
}