Skip to content

Instantly share code, notes, and snippets.

@jult

jult/dovecot.conf

Last active Mar 24, 2018
Embed
What would you like to do?
dovecot.conf for debian 9 with CLucene FTS
protocols = imap pop3
auth_mechanisms = plain login
auth_cache_size = 24 M
auth_cache_ttl = 18 hours
disable_plaintext_auth = no
listen = *,[::]
log_timestamp = "%Y-%m-%d %H:%M:%S "
log_path = /var/log/dovecot.log
login_greeting = encrypted ready.
postmaster_address = julius@encrypted.net
ssl_protocols = !SSLv3
ssl_cert = </etc/postfix/smtpd.cert
ssl_key = </etc/postfix/smtpd.key
# see https://wiki.dovecot.org/MailLocation/LocalDisk
mail_fsync = never
mail_temp_dir = /ramm/dovecot
mail_max_userip_connections = 500
mail_privileged_group = vmail
mail_plugins = " fts fts_lucene"
mailbox_idle_check_interval = 59 secs
mailbox_list_index = yes
maildir_very_dirty_syncs = yes
passdb {
args = /etc/dovecot/dovecot-sql.conf
driver = sql
}
plugin {
fts = lucene
fts_autoindex = yes
fts_autoindex_max_recent_msgs = 60
fts_index_timeout = 60
fts_lucene = whitespace_chars=@. normalize no_snowball
sieve = /var/vmail/%d/%n/.sieve
sieve_max_redirects = 25
}
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
}
unix_listener auth-userdb {
group = vmail
mode = 0600
user = vmail
}
user = root
}
service imap-login {
process_min_avail = 6
service_count = 64
vsz_limit = 256 M
client_limit = 1000
process_limit = 512
}
service lmtp {
unix_listener /var/spool/postfix/private/dovecot-lmtp {
group = postfix
mode = 0600
user = postfix
}
}
userdb {
driver = prefetch
}
userdb {
args = /etc/dovecot/dovecot-sql.conf
driver = sql
}
protocol pop3 {
pop3_uidl_format = %08Xu%08Xv
}
protocol lda {
mail_fsync = optimized
mail_plugins = sieve
postmaster_address = julius@encrypted.net
}
protocol lmtp {
mail_fsync = optimized
mail_plugins = sieve
postmaster_address = julius@encrypted.net
}
@jult

This comment has been minimized.

Copy link
Owner Author

@jult jult commented Mar 9, 2018

#!/bin/sh

chown vmail:vmail /var/vmail/ -R
cd /var/vmail
find . -type d -name Maildir -exec chmod 700 -R {} \;
find . -type f \( -name '.sieve' -o -name '.sieve.svbin' \) -exec chmod 644 {} \;
find . -type f \( -name 'dovecot-uidlist' -o -name 'dovecot-uidvalidity' -o -name 'dovecot.index*' -o -name 'maildirsize'  \) -exec chmod 600 {} \;
find . -type f \( -name 'dovecot-uidvalidity.*'  \) -exec chmod 444 {} \;
find . -type f \( -name 'subscriptions' \) -exec chmod 744 {} \;
chown root:www-data /home/prefs -R
chown root:www-data /home/attach -R
@jult

This comment has been minimized.

Copy link
Owner Author

@jult jult commented Mar 9, 2018

cron.monthly that cleans up people's Junk and Trash

#!/bin/sh
doveadm expunge -A mailbox Junk savedbefore 90d
doveadm expunge -A mailbox Trash savedbefore 660d
doveadm force-resync -A '*'
exit 0

kills Spam older than 90 days, and Trash older than ~2 years..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment