summaryrefslogtreecommitdiff
path: root/etc/dovecot
diff options
context:
space:
mode:
authorJon duSaint2022-11-27 11:25:11 -0800
committerJon duSaint2022-11-27 11:25:11 -0800
commit254e41ba237796ce1ad6bf670aebf1b92eed98be (patch)
tree1be7770ddf0e78a7e262535f7e5dd47bb9b73575 /etc/dovecot
parenta49cb4da526c86385e942323e069a8e978d0cf4c (diff)

etc: all the interesting config files for the server

HEADmain
Diffstat (limited to 'etc/dovecot')
-rw-r--r--etc/dovecot/dovecot-sql.conf.ext5
-rw-r--r--etc/dovecot/dovecot.conf138
2 files changed, 143 insertions, 0 deletions
diff --git a/etc/dovecot/dovecot-sql.conf.ext b/etc/dovecot/dovecot-sql.conf.ext
new file mode 100644
index 0000000..3d8dbd6
--- /dev/null
+++ b/etc/dovecot/dovecot-sql.conf.ext
@@ -0,0 +1,5 @@
+driver = mysql
+connect = host=localhost dbname=mail user=postfix password=<PASSWORD GOES HERE>
+default_pass_scheme = PLAIN
+password_query = SELECT email as user, password FROM users WHERE email = '%u'
+user_query = SELECT id as uid, id as gid, home, concat('*:storage=', quota, 'M') AS quota_rule FROM users WHERE email = '%u'
diff --git a/etc/dovecot/dovecot.conf b/etc/dovecot/dovecot.conf
new file mode 100644
index 0000000..b8c2421
--- /dev/null
+++ b/etc/dovecot/dovecot.conf
@@ -0,0 +1,138 @@
+## Dovecot configuration file
+
+dict {
+}
+
+auth_mechanisms = plain login digest-md5 cram-md5 apop
+log_path = syslog
+syslog_facility = mail
+mail_location = maildir:/var/mailserv/mail/%d/%n
+base_dir = /var/dovecot/
+first_valid_uid = 1000
+mmap_disable = yes
+
+passdb {
+ args = /etc/dovecot/dovecot-sql.conf.ext
+ driver = sql
+}
+
+plugin {
+ antispam_mail_notspam = --ham
+ antispam_mail_sendmail = /usr/local/bin/sa-learn
+ antispam_mail_sendmail_args = --username=%u
+ antispam_mail_spam = --spam
+ antispam_mail_tmpdir = /tmp
+ antispam_signature = X-Spam-Flag
+ antispam_signature_missing = move
+ antispam_spam = SPAM;Spam;spam;Junk;junk
+ antispam_trash = trash;Trash;Deleted Items; Deleted Messages
+ quota = maildir
+ quota_rule = *:storage=5G
+ quota_rule2 = Trash:storage=+100M
+ quota_warning = storage=95%% /usr/local/bin/quota-warning.sh 95
+ quota_warning2 = storage=80%% /usr/local/bin/quota-warning.sh 80
+ sieve = ~/.dovecot.sieve
+ sieve_dir = ~/sieve
+}
+
+protocols = imap sieve pop3 lmtp
+
+service auth {
+ unix_listener /var/run/dovecot-auth-master {
+ group = _dovecot
+ mode = 0666
+ user = _dovecot
+ }
+
+ unix_listener /var/spool/postfix/private/auth {
+ group = _postfix
+ mode = 0660
+ user = _postfix
+ }
+}
+
+service imap-login {
+ service_count = 1
+}
+service pop3-login {
+ service_count = 1
+}
+
+ssl_cert=</etc/ssl/rockgeeks.net.fullchain.pem
+ssl_key =</etc/ssl/private/rockgeeks.net.key
+
+userdb {
+ driver = sql
+ args = /etc/dovecot/dovecot-sql.conf.ext
+}
+
+protocol imap {
+ imap_client_workarounds = delay-newmail
+ mail_plugins = quota imap_quota
+}
+
+protocol pop3 {
+ mail_plugins = quota
+ pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
+ pop3_uidl_format = %08Xv%08Xu
+}
+
+protocol lda {
+ auth_socket_path = /var/run/dovecot-auth-master
+ mail_plugins = $mail_plugins sieve
+ sendmail_path = /usr/sbin/sendmail
+}
+
+protocol lmtp {
+ mail_plugins = $mail_plugins sieve
+ postmaster_address = jon@rockgeeks.net
+}
+
+default_login_user = _dovenull
+default_internal_user = _dovecot
+
+service managesieve-login {
+ inet_listener sieve {
+ port = 4190
+ }
+
+ inet_listener sieve_deprecated {
+ port = 2000
+ }
+}
+
+service lmtp {
+ unix_listener /var/spool/postfix/private/dovecot-lmtp {
+ group = _postfix
+ mode = 0600
+ user = _postfix
+ }
+}
+
+service managesieve {
+}
+
+protocol sieve {
+}
+
+imap_capability = +SPECIAL-USE
+
+namespace inbox {
+ inbox=yes
+ mailbox Drafts {
+ auto = subscribe
+ special_use = \Drafts
+ }
+ mailbox Sent {
+ auto = subscribe
+ special_use = \Sent
+ }
+ mailbox Spam {
+ auto = subscribe
+ special_use = \Junk
+ }
+ mailbox Trash {
+ auto = subscribe
+ special_use = \Trash
+ }
+}