dovecot.conf 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  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_path = syslog
  13. disable_plaintext_auth = yes
  14. # Uncomment on NFS share
  15. #mmap_disable = yes
  16. #mail_fsync = always
  17. #mail_nfs_index = yes
  18. #mail_nfs_storage = yes
  19. login_log_format_elements = "user=<%u> method=%m rip=%r lip=%l mpid=%e %c %k"
  20. mail_home = /var/vmail/%d/%n
  21. mail_location = maildir:~/
  22. mail_plugins = </etc/dovecot/mail_plugins
  23. mail_attachment_fs = crypt:set_prefix=mail_crypt_global:posix:
  24. mail_attachment_dir = /var/attachments
  25. mail_attachment_min_size = 128k
  26. # Dovecot 2.2
  27. #ssl_protocols = !SSLv3
  28. # Dovecot 2.3
  29. ssl_min_protocol = TLSv1.2
  30. ssl_prefer_server_ciphers = yes
  31. ssl_cipher_list = ALL:!ADH:!LOW:!SSLv2:!SSLv3:!EXP:!aNULL:!eNULL:!3DES:!MD5:!PSK:!DSS:!RC4:!SEED:!IDEA:+HIGH:+MEDIUM
  32. # Default in Dovecot 2.3
  33. ssl_options = no_compression no_ticket
  34. # New in Dovecot 2.3
  35. ssl_dh=</etc/ssl/mail/dhparams.pem
  36. # Dovecot 2.2
  37. #ssl_dh_parameters_length = 2048
  38. log_timestamp = "%Y-%m-%d %H:%M:%S "
  39. recipient_delimiter = +
  40. auth_master_user_separator = *
  41. mail_shared_explicit_inbox = yes
  42. mail_prefetch_count = 30
  43. # try a master passwd
  44. passdb {
  45. driver = passwd-file
  46. args = /etc/dovecot/dovecot-master.passwd
  47. master = yes
  48. pass = yes
  49. result_failure = continue
  50. result_internalfail = continue
  51. }
  52. # try an app passwd
  53. passdb {
  54. driver = lua
  55. args = file=/etc/dovecot/lua/app-passdb.lua blocking=yes
  56. pass = yes
  57. result_failure = continue
  58. result_internalfail = continue
  59. }
  60. # check for regular password - if empty (e.g. force-passwd-reset), previous pass=yes passdbs also fail
  61. # a return of the following passdb is mandatory
  62. passdb {
  63. args = /etc/dovecot/sql/dovecot-dict-sql-passdb.conf
  64. driver = sql
  65. result_success = return-ok
  66. result_failure = continue
  67. result_internalfail = continue
  68. }
  69. passdb {
  70. driver = passwd-file
  71. args = /etc/dovecot/dovecot-master.passwd
  72. skip = authenticated
  73. }
  74. # Set doveadm_password=your-secret-password in data/conf/dovecot/extra.conf (create if missing)
  75. service doveadm {
  76. inet_listener {
  77. port = 12345
  78. }
  79. vsz_limit=2048 MB
  80. }
  81. namespace inbox {
  82. inbox = yes
  83. location =
  84. separator = /
  85. mailbox "Trash" {
  86. auto = subscribe
  87. special_use = \Trash
  88. }
  89. mailbox "Deleted Messages" {
  90. special_use = \Trash
  91. }
  92. mailbox "Deleted Items" {
  93. special_use = \Trash
  94. }
  95. mailbox "Rubbish" {
  96. special_use = \Trash
  97. }
  98. mailbox "Gelöschte Objekte" {
  99. special_use = \Trash
  100. }
  101. mailbox "Gelöschte Elemente" {
  102. special_use = \Trash
  103. }
  104. mailbox "Papierkorb" {
  105. special_use = \Trash
  106. }
  107. mailbox "Itens Excluidos" {
  108. special_use = \Trash
  109. }
  110. mailbox "Itens Excluídos" {
  111. special_use = \Trash
  112. }
  113. mailbox "Lixeira" {
  114. special_use = \Trash
  115. }
  116. mailbox "Prullenbak" {
  117. special_use = \Trash
  118. }
  119. mailbox "Odstránené položky" {
  120. special_use = \Trash
  121. }
  122. mailbox "Koš" {
  123. special_use = \Trash
  124. }
  125. mailbox "Verwijderde items" {
  126. special_use = \Trash
  127. }
  128. mailbox "Archive" {
  129. auto = subscribe
  130. special_use = \Archive
  131. }
  132. mailbox "Archiv" {
  133. special_use = \Archive
  134. }
  135. mailbox "Archives" {
  136. special_use = \Archive
  137. }
  138. mailbox "Arquivo" {
  139. special_use = \Archive
  140. }
  141. mailbox "Arquivos" {
  142. special_use = \Archive
  143. }
  144. mailbox "Archief" {
  145. special_use = \Archive
  146. }
  147. mailbox "Archív" {
  148. special_use = \Archive
  149. }
  150. mailbox "Archivovať" {
  151. special_use = \Archive
  152. }
  153. mailbox "Sent" {
  154. auto = subscribe
  155. special_use = \Sent
  156. }
  157. mailbox "Sent Messages" {
  158. special_use = \Sent
  159. }
  160. mailbox "Sent Items" {
  161. special_use = \Sent
  162. }
  163. mailbox "Gesendet" {
  164. special_use = \Sent
  165. }
  166. mailbox "Gesendete Objekte" {
  167. special_use = \Sent
  168. }
  169. mailbox "Gesendete Elemente" {
  170. special_use = \Sent
  171. }
  172. mailbox "Itens Enviados" {
  173. special_use = \Sent
  174. }
  175. mailbox "Enviados" {
  176. special_use = \Sent
  177. }
  178. mailbox "Verzonden items" {
  179. special_use = \Sent
  180. }
  181. mailbox "Verzonden" {
  182. special_use = \Sent
  183. }
  184. mailbox "Odoslaná pošta" {
  185. special_use = \Sent
  186. }
  187. mailbox "Odoslané" {
  188. special_use = \Sent
  189. }
  190. mailbox "Drafts" {
  191. auto = subscribe
  192. special_use = \Drafts
  193. }
  194. mailbox "Entwürfe" {
  195. special_use = \Drafts
  196. }
  197. mailbox "Rascunhos" {
  198. special_use = \Drafts
  199. }
  200. mailbox "Concepten" {
  201. special_use = \Drafts
  202. }
  203. mailbox "Koncepty" {
  204. special_use = \Drafts
  205. }
  206. mailbox "Junk" {
  207. auto = subscribe
  208. special_use = \Junk
  209. }
  210. mailbox "Junk-E-Mail" {
  211. special_use = \Junk
  212. }
  213. mailbox "Junk E-Mail" {
  214. special_use = \Junk
  215. }
  216. mailbox "Spam" {
  217. special_use = \Junk
  218. }
  219. mailbox "Lixo Eletrônico" {
  220. special_use = \Junk
  221. }
  222. mailbox "Nevyžiadaná pošta" {
  223. special_use = \Junk
  224. }
  225. mailbox "Infikované položky" {
  226. special_use = \Junk
  227. }
  228. mailbox "Ongewenste e-mail" {
  229. special_use = \Junk
  230. }
  231. mailbox "Koncepty" {
  232. special_use = \Drafts
  233. }
  234. mailbox "Nevyžádaná pošta" {
  235. special_use = \Junk
  236. }
  237. mailbox "Odstraněná pošta" {
  238. special_use = \Trash
  239. }
  240. mailbox "Odeslaná pošta" {
  241. special_use = \Sent
  242. }
  243. mailbox "Skräp" {
  244. special_use = \Trash
  245. }
  246. mailbox "Borttagna Meddelanden" {
  247. special_use = \Trash
  248. }
  249. mailbox "Arkiv" {
  250. special_use = \Archive
  251. }
  252. mailbox "Arkeverat" {
  253. special_use = \Archive
  254. }
  255. mailbox "Skickat" {
  256. special_use = \Sent
  257. }
  258. mailbox "Skickade Meddelanden" {
  259. special_use = \Sent
  260. }
  261. mailbox "Utkast" {
  262. special_use = \Drafts
  263. }
  264. prefix =
  265. }
  266. protocols = imap sieve lmtp pop3
  267. service dict {
  268. unix_listener dict {
  269. mode = 0660
  270. user = vmail
  271. group = vmail
  272. }
  273. }
  274. service log {
  275. user = dovenull
  276. }
  277. service config {
  278. unix_listener config {
  279. user = root
  280. group = vmail
  281. mode = 0660
  282. }
  283. }
  284. service auth {
  285. inet_listener auth-inet {
  286. port = 10001
  287. }
  288. unix_listener auth-master {
  289. mode = 0600
  290. user = vmail
  291. }
  292. unix_listener auth-userdb {
  293. mode = 0600
  294. user = vmail
  295. }
  296. }
  297. service managesieve-login {
  298. inet_listener sieve {
  299. port = 4190
  300. }
  301. service_count = 1
  302. process_min_avail = 2
  303. vsz_limit = 1G
  304. }
  305. service imap-login {
  306. service_count = 1
  307. process_limit = 10000
  308. vsz_limit = 1G
  309. user = dovenull
  310. }
  311. service pop3-login {
  312. service_count = 1
  313. vsz_limit = 1G
  314. }
  315. service imap {
  316. executable = imap imap-postlogin
  317. user = vmail
  318. vsz_limit = 1G
  319. }
  320. service managesieve {
  321. process_limit = 256
  322. }
  323. service lmtp {
  324. inet_listener lmtp-inet {
  325. port = 24
  326. }
  327. user = vmail
  328. }
  329. listen = *,[::]
  330. ssl_cert = </etc/ssl/mail/cert.pem
  331. ssl_key = </etc/ssl/mail/key.pem
  332. !include_try /etc/dovecot/sni.conf
  333. userdb {
  334. driver = passwd-file
  335. args = /etc/dovecot/dovecot-master.userdb
  336. }
  337. userdb {
  338. args = /etc/dovecot/sql/dovecot-dict-sql-userdb.conf
  339. driver = sql
  340. skip = found
  341. }
  342. protocol imap {
  343. mail_plugins = </etc/dovecot/mail_plugins_imap
  344. imap_metadata = yes
  345. }
  346. mail_attribute_dict = file:%h/dovecot-attributes
  347. protocol lmtp {
  348. mail_plugins = </etc/dovecot/mail_plugins_lmtp
  349. auth_socket_path = /var/run/dovecot/auth-master
  350. }
  351. protocol sieve {
  352. managesieve_logout_format = bytes=%i/%o
  353. }
  354. plugin {
  355. # Allow "any" or "authenticated" to be used in ACLs
  356. acl_anyone = </etc/dovecot/acl_anyone
  357. acl_shared_dict = file:/var/vmail/shared-mailboxes.db
  358. acl = vfile
  359. last_login_dict=</etc/dovecot/last_login
  360. last_login_key = last-login/%s/%u
  361. fts = solr
  362. fts_autoindex = yes
  363. fts_solr = url=http://solr:8983/solr/dovecot-fts/
  364. quota = dict:Userquota::proxy::sqlquota
  365. quota_rule2 = Trash:storage=+100%%
  366. sieve = /var/vmail/sieve/%u.sieve
  367. sieve_plugins = sieve_imapsieve sieve_extprograms
  368. sieve_vacation_send_from_recipient = yes
  369. sieve_redirect_envelope_from = recipient
  370. # From elsewhere to Spam folder
  371. imapsieve_mailbox1_name = Junk
  372. imapsieve_mailbox1_causes = COPY
  373. imapsieve_mailbox1_before = file:/usr/lib/dovecot/sieve/report-spam.sieve
  374. # END
  375. # From Spam folder to elsewhere
  376. imapsieve_mailbox2_name = *
  377. imapsieve_mailbox2_from = Junk
  378. imapsieve_mailbox2_causes = COPY
  379. imapsieve_mailbox2_before = file:/usr/lib/dovecot/sieve/report-ham.sieve
  380. # END
  381. quota_warning = storage=95%% quota-warning 95 %u
  382. quota_warning2 = storage=80%% quota-warning 80 %u
  383. sieve_pipe_bin_dir = /usr/lib/dovecot/sieve
  384. sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.execute
  385. sieve_extensions = +notify +imapflags +vacation-seconds +editheader
  386. sieve_max_script_size = 1M
  387. sieve_max_redirects = 30
  388. sieve_quota_max_scripts = 0
  389. sieve_quota_max_storage = 0
  390. listescape_char = "\\"
  391. sieve_vacation_min_period = 5s
  392. sieve_vacation_max_period = 0
  393. sieve_vacation_default_period = 60s
  394. sieve_before = /var/vmail/sieve/global_sieve_before.sieve
  395. sieve_before2 = dict:proxy::sieve_before;name=active;bindir=/var/vmail/sieve_before_bindir
  396. sieve_after = dict:proxy::sieve_after;name=active;bindir=/var/vmail/sieve_after_bindir
  397. sieve_after2 = /var/vmail/sieve/global_sieve_after.sieve
  398. # -- Global keys
  399. mail_crypt_global_private_key = </mail_crypt/ecprivkey.pem
  400. mail_crypt_global_public_key = </mail_crypt/ecpubkey.pem
  401. mail_crypt_save_version = 2
  402. # Enable compression while saving, lz4 Dovecot v2.2.11+
  403. zlib_save = lz4
  404. mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename
  405. mail_log_fields = uid box msgid size
  406. mail_log_cached_only = yes
  407. }
  408. service quota-warning {
  409. executable = script /usr/local/bin/quota_notify.py
  410. # use some unprivileged user for executing the quota warnings
  411. user = vmail
  412. unix_listener quota-warning {
  413. user = vmail
  414. }
  415. }
  416. dict {
  417. sqlquota = mysql:/etc/dovecot/sql/dovecot-dict-sql-quota.conf
  418. sieve_after = mysql:/etc/dovecot/sql/dovecot-dict-sql-sieve_after.conf
  419. sieve_before = mysql:/etc/dovecot/sql/dovecot-dict-sql-sieve_before.conf
  420. }
  421. remote 127.0.0.1 {
  422. disable_plaintext_auth = no
  423. }
  424. submission_host = postfix:588
  425. mail_max_userip_connections = 500
  426. service imap-postlogin {
  427. executable = script-login /usr/local/bin/postlogin.sh
  428. unix_listener imap-postlogin {
  429. }
  430. }
  431. service stats {
  432. unix_listener stats-writer {
  433. mode = 0660
  434. user = vmail
  435. }
  436. }
  437. imap_max_line_length = 2 M
  438. #auth_cache_verify_password_with_worker = yes
  439. #auth_cache_negative_ttl = 0
  440. #auth_cache_ttl = 30 s
  441. #auth_cache_size = 2 M
  442. service replicator {
  443. process_min_avail = 1
  444. }
  445. service aggregator {
  446. fifo_listener replication-notify-fifo {
  447. user = vmail
  448. }
  449. unix_listener replication-notify {
  450. user = vmail
  451. }
  452. }
  453. service replicator {
  454. unix_listener replicator-doveadm {
  455. mode = 0666
  456. }
  457. }
  458. replication_max_conns = 10
  459. doveadm_port = 12345
  460. replication_dsync_parameters = -d -l 30 -U -n INBOX
  461. !include_try /etc/dovecot/extra.conf
  462. !include_try /etc/dovecot/sogo-sso.conf
  463. !include_try /etc/dovecot/shared_namespace.conf
  464. default_client_limit = 10400
  465. default_vsz_limit = 1024 M