dovecot.conf 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. # --------------------------------------------------------------------------
  2. # Please create a file "extra.conf" for persistent overrides to dovecot.conf
  3. # --------------------------------------------------------------------------
  4. # LDAP example:
  5. #passdb {
  6. # args = /etc/dovecot/ldap/passdb.conf
  7. # driver = ldap
  8. #}
  9. auth_mechanisms = plain login
  10. #mail_debug = yes
  11. #auth_debug = yes
  12. #log_debug = category=fts-flatcurve # Activate Logging for Flatcurve FTS Searchings
  13. log_path = syslog
  14. disable_plaintext_auth = yes
  15. # Uncomment on NFS share
  16. #mmap_disable = yes
  17. #mail_fsync = always
  18. #mail_nfs_index = yes
  19. #mail_nfs_storage = yes
  20. login_log_format_elements = "user=<%u> method=%m rip=%r lip=%l mpid=%e %c %k"
  21. mail_home = /var/vmail/%d/%n
  22. mail_location = maildir:~/
  23. mail_plugins = </etc/dovecot/mail_plugins
  24. mail_attachment_fs = crypt:set_prefix=mail_crypt_global:posix:
  25. mail_attachment_dir = /var/attachments
  26. mail_attachment_min_size = 128k
  27. # Significantly speeds up very large mailboxes, but is only safe to enable if
  28. # you do not manually modify the files in the `cur` directories in
  29. # mailcowdockerized_vmail-vol-1.
  30. # https://docs.mailcow.email/manual-guides/Dovecot/u_e-dovecot-performance/
  31. maildir_very_dirty_syncs = yes
  32. # Dovecot 2.2
  33. #ssl_protocols = !SSLv3
  34. # Dovecot 2.3
  35. ssl_min_protocol = TLSv1.2
  36. ssl_prefer_server_ciphers = yes
  37. ssl_cipher_list = ALL:!ADH:!LOW:!SSLv2:!SSLv3:!EXP:!aNULL:!eNULL:!3DES:!MD5:!PSK:!DSS:!RC4:!SEED:!IDEA:+HIGH:+MEDIUM
  38. # Default in Dovecot 2.3
  39. ssl_options = no_compression no_ticket
  40. # New in Dovecot 2.3
  41. ssl_dh = </etc/ssl/mail/dhparams.pem
  42. # Dovecot 2.2
  43. #ssl_dh_parameters_length = 2048
  44. log_timestamp = "%Y-%m-%d %H:%M:%S "
  45. recipient_delimiter = +
  46. auth_master_user_separator = *
  47. mail_shared_explicit_inbox = yes
  48. mail_prefetch_count = 30
  49. passdb {
  50. driver = lua
  51. args = file=/etc/dovecot/auth/passwd-verify.lua blocking=yes cache_key=%s:%u:%w
  52. result_success = return-ok
  53. result_failure = continue
  54. result_internalfail = continue
  55. }
  56. # try a master passwd
  57. passdb {
  58. driver = passwd-file
  59. args = /etc/dovecot/dovecot-master.passwd
  60. master = yes
  61. skip = authenticated
  62. }
  63. # check for regular password - if empty (e.g. force-passwd-reset), previous pass=yes passdbs also fail
  64. # a return of the following passdb is mandatory
  65. passdb {
  66. driver = lua
  67. args = file=/etc/dovecot/auth/passwd-verify.lua blocking=yes
  68. }
  69. # Set doveadm_password=your-secret-password in data/conf/dovecot/extra.conf (create if missing)
  70. service doveadm {
  71. inet_listener {
  72. port = 12345
  73. }
  74. vsz_limit=2048 MB
  75. }
  76. !include /etc/dovecot/dovecot.folders.conf
  77. protocols = imap sieve lmtp pop3
  78. service dict {
  79. unix_listener dict {
  80. mode = 0660
  81. user = vmail
  82. group = vmail
  83. }
  84. }
  85. service log {
  86. user = dovenull
  87. }
  88. service config {
  89. unix_listener config {
  90. user = root
  91. group = vmail
  92. mode = 0660
  93. }
  94. }
  95. service auth {
  96. inet_listener auth-inet {
  97. port = 10001
  98. }
  99. unix_listener auth-master {
  100. mode = 0600
  101. user = vmail
  102. }
  103. unix_listener auth-userdb {
  104. mode = 0600
  105. user = vmail
  106. }
  107. vsz_limit = 2G
  108. }
  109. service managesieve-login {
  110. inet_listener sieve {
  111. port = 4190
  112. }
  113. inet_listener sieve_haproxy {
  114. port = 14190
  115. haproxy = yes
  116. }
  117. service_count = 1
  118. process_min_avail = 2
  119. vsz_limit = 1G
  120. }
  121. service imap-login {
  122. service_count = 1
  123. process_min_avail = 2
  124. process_limit = 10000
  125. vsz_limit = 1G
  126. user = dovenull
  127. inet_listener imap_haproxy {
  128. port = 10143
  129. haproxy = yes
  130. }
  131. inet_listener imaps_haproxy {
  132. port = 10993
  133. ssl = yes
  134. haproxy = yes
  135. }
  136. }
  137. service pop3-login {
  138. service_count = 1
  139. process_min_avail = 1
  140. vsz_limit = 1G
  141. inet_listener pop3_haproxy {
  142. port = 10110
  143. haproxy = yes
  144. }
  145. inet_listener pop3s_haproxy {
  146. port = 10995
  147. ssl = yes
  148. haproxy = yes
  149. }
  150. }
  151. service imap {
  152. executable = imap
  153. user = vmail
  154. vsz_limit = 1G
  155. }
  156. service managesieve {
  157. process_limit = 256
  158. }
  159. service lmtp {
  160. inet_listener lmtp-inet {
  161. port = 24
  162. }
  163. user = vmail
  164. }
  165. listen = *,[::]
  166. ssl_cert = </etc/ssl/mail/cert.pem
  167. ssl_key = </etc/ssl/mail/key.pem
  168. userdb {
  169. driver = passwd-file
  170. args = /etc/dovecot/dovecot-master.userdb
  171. }
  172. userdb {
  173. args = /etc/dovecot/sql/dovecot-dict-sql-userdb.conf
  174. driver = sql
  175. skip = found
  176. }
  177. protocol imap {
  178. mail_plugins = </etc/dovecot/mail_plugins_imap
  179. imap_metadata = yes
  180. }
  181. mail_attribute_dict = file:%h/dovecot-attributes
  182. protocol lmtp {
  183. mail_plugins = </etc/dovecot/mail_plugins_lmtp
  184. auth_socket_path = /var/run/dovecot/auth-master
  185. }
  186. protocol sieve {
  187. managesieve_logout_format = bytes=%i/%o
  188. }
  189. plugin {
  190. # Allow "any" or "authenticated" to be used in ACLs
  191. acl_anyone = </etc/dovecot/acl_anyone
  192. acl_shared_dict = file:/var/vmail/shared-mailboxes.db
  193. acl = vfile
  194. acl_user = %u
  195. quota = dict:Userquota::proxy::sqlquota
  196. quota_rule2 = Trash:storage=+100%%
  197. sieve = /var/vmail/sieve/%u.sieve
  198. sieve_plugins = sieve_imapsieve sieve_extprograms
  199. sieve_vacation_send_from_recipient = yes
  200. sieve_redirect_envelope_from = recipient
  201. # From elsewhere to Spam folder
  202. imapsieve_mailbox1_name = Junk
  203. imapsieve_mailbox1_causes = COPY
  204. imapsieve_mailbox1_before = file:/usr/lib/dovecot/sieve/report-spam.sieve
  205. # END
  206. # From Spam folder to elsewhere
  207. imapsieve_mailbox2_name = *
  208. imapsieve_mailbox2_from = Junk
  209. imapsieve_mailbox2_causes = COPY
  210. imapsieve_mailbox2_before = file:/usr/lib/dovecot/sieve/report-ham.sieve
  211. # END
  212. master_user = %u
  213. quota_warning = storage=95%% quota-warning 95 %u
  214. quota_warning2 = storage=80%% quota-warning 80 %u
  215. sieve_pipe_bin_dir = /usr/lib/dovecot/sieve
  216. sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.execute
  217. sieve_extensions = +notify +imapflags +vacation-seconds +editheader
  218. sieve_max_script_size = 1M
  219. sieve_max_redirects = 100
  220. sieve_max_actions = 101
  221. sieve_quota_max_scripts = 0
  222. sieve_quota_max_storage = 0
  223. listescape_char = "\\"
  224. sieve_vacation_min_period = 5s
  225. sieve_vacation_max_period = 0
  226. sieve_vacation_default_period = 60s
  227. sieve_before = /var/vmail/sieve/global_sieve_before.sieve
  228. sieve_before2 = dict:proxy::sieve_before;name=active;bindir=/var/vmail/sieve_before_bindir
  229. sieve_after = dict:proxy::sieve_after;name=active;bindir=/var/vmail/sieve_after_bindir
  230. sieve_after2 = /var/vmail/sieve/global_sieve_after.sieve
  231. sieve_duplicate_default_period = 1m
  232. sieve_duplicate_max_period = 7d
  233. # -- Global keys
  234. mail_crypt_global_private_key = </mail_crypt/ecprivkey.pem
  235. mail_crypt_global_public_key = </mail_crypt/ecpubkey.pem
  236. mail_crypt_save_version = 2
  237. # Enable compression while saving, lz4 Dovecot v2.3.17+
  238. zlib_save = lz4
  239. mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename
  240. mail_log_fields = uid box msgid size
  241. mail_log_cached_only = yes
  242. # Try set mail_replica
  243. !include_try /etc/dovecot/mail_replica.conf
  244. }
  245. service quota-warning {
  246. executable = script /usr/local/bin/quota_notify.py
  247. # use some unprivileged user for executing the quota warnings
  248. user = vmail
  249. unix_listener quota-warning {
  250. user = vmail
  251. }
  252. }
  253. dict {
  254. sqlquota = mysql:/etc/dovecot/sql/dovecot-dict-sql-quota.conf
  255. sieve_after = mysql:/etc/dovecot/sql/dovecot-dict-sql-sieve_after.conf
  256. sieve_before = mysql:/etc/dovecot/sql/dovecot-dict-sql-sieve_before.conf
  257. }
  258. remote 127.0.0.1 {
  259. disable_plaintext_auth = no
  260. }
  261. submission_host = postfix:588
  262. mail_max_userip_connections = 500
  263. service stats {
  264. unix_listener stats-writer {
  265. mode = 0660
  266. user = vmail
  267. }
  268. }
  269. imap_max_line_length = 2 M
  270. auth_cache_verify_password_with_worker = yes
  271. auth_cache_negative_ttl = 60s
  272. auth_cache_ttl = 300s
  273. auth_cache_size = 10M
  274. auth_verbose_passwords = sha1:6
  275. service replicator {
  276. process_min_avail = 1
  277. }
  278. service aggregator {
  279. fifo_listener replication-notify-fifo {
  280. user = vmail
  281. }
  282. unix_listener replication-notify {
  283. user = vmail
  284. }
  285. }
  286. service replicator {
  287. unix_listener replicator-doveadm {
  288. mode = 0666
  289. }
  290. }
  291. replication_max_conns = 10
  292. doveadm_port = 12345
  293. replication_dsync_parameters = -d -l 30 -U -n INBOX
  294. # <Includes>
  295. !include_try /etc/dovecot/sni.conf
  296. !include_try /etc/dovecot/sogo_trusted_ip.conf
  297. !include_try /etc/dovecot/extra.conf
  298. !include_try /etc/dovecot/shared_namespace.conf
  299. !include_try /etc/dovecot/conf.d/fts.conf
  300. # </Includes>
  301. default_client_limit = 10400
  302. default_vsz_limit = 1024 M