Infernales

Dovecot 2.4

Nov 13th, 2025 (edited)
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.53 KB | Software | 0 0
  1. ## Dovecot configuration file
  2. # Dovecot configuration version. This must be the first setting in the
  3. # configuration file. It specifies the configuration syntax, the used setting
  4. # names and the expected default values.
  5. dovecot_config_version = 2.4.2
  6.  
  7. # Dovecot storage file format version. It specifies the oldest Dovecot version
  8. # that must be able to read files written by this Dovecot instance. The
  9. # intention is that when upgrading Dovecot cluster, this setting is first kept
  10. # as the old Dovecot version. Once the cluster is fully upgraded to a new
  11. # version and there is no intention to rollback to the old version anymore,
  12. # this version number can be increased.
  13. dovecot_storage_version = 2.4.2
  14.  
  15. # The configuration below is a minimal configuration file using system user authentication.
  16. # See https://doc.dovecot.org/latest/core/config/quick.html
  17.  
  18. !include_try conf.d/*.conf
  19.  
  20. protocols {
  21. imap = yes
  22. pop3 = yes
  23. sieve = yes
  24. lmtp = yes
  25. }
  26.  
  27. mail_plugins {
  28. acl = yes
  29. }
  30.  
  31. mailbox_list_layout = fs
  32. mail_home = /var/mail/%{user|domain}/%{user|username}@%{user|domain}
  33. mail_driver = maildir
  34. mail_path = ~
  35.  
  36. mail_uid = mail
  37. mail_gid = mail
  38.  
  39. first_valid_uid = 8
  40. last_valid_uid = 8
  41.  
  42. auth_verbose = yes
  43. auth_debug_passwords = yes
  44. log_debug = category=auth
  45. log_debug = category=ssl
  46. log_debug = category=mail
  47.  
  48. ssl = yes
  49. ssl_min_protocol = LATEST
  50. ssl_server_cert_file = /etc/letsencrypt/live/example.com/fullchain.pem
  51. ssl_server_key_file = /etc/letsencrypt/live/example.com/privkey.pem
  52. ssl_cipher_list = ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
  53.  
  54. auth_allow_cleartext = no
  55. auth_default_domain = example.com
  56. auth_mechanisms = PLAIN LOGIN
  57. auth_master_user_separator = *
  58.  
  59. acl_driver = vfile
  60. acl_sharing_map {
  61. dict file {
  62. path = /var/lib/dovecot/db/shared-mailboxes.db
  63. }
  64. }
  65.  
  66. sieve_script default {
  67. type = default
  68. name = default
  69. driver = file
  70. path = /etc/dovecot/sieve/default.sieve
  71. }
  72.  
  73. sql_driver = mysql
  74.  
  75. mysql localhost {
  76. user = user
  77. password = password
  78. dbname = postfix
  79. }
  80.  
  81. passdb_default_password_scheme = SHA256-CRYPT
  82.  
  83. passdb sql {
  84. query = SELECT username as user, '%{user|domain}' as domain, password, '/var/mail/%{user|domain}/%{user|username}@%{user|domain}' as userdb_home, 'maildir:/var/mail/%{user|domain}/%{user|username}@%{user|domain}' as userdb_mail, 8 as userdb_uid, 12 as userdb_gid FROM mailbox WHERE username = '%{user}' AND domain = '%{user|domain}' AND active = '1'
  85. }
  86.  
  87. userdb sql {
  88. query = SELECT '/var/mail/%{user|domain}/%{user|username}@%{user|domain}' as home, 'maildir:/var/mail/%{user|domain}/%{user|username}@%{user|domain}' as mail, 8 AS uid, 12 AS gid, concat('dirsize:storage=', quota) AS quota FROM mailbox WHERE username = '%{user}' AND domain = '%{user|domain}' AND active = '1'
  89. }
  90.  
  91. protocol lda {
  92. mail_plugins {
  93. sieve = yes
  94. }
  95. auth_socket_path = /var/run/dovecot/auth-master
  96. deliver_log_format = mail from %f: msgid=%m %$
  97. lda_mailbox_autocreate = yes
  98. lda_mailbox_autosubscribe = yes
  99. }
  100.  
  101. protocol lmtp {
  102. mail_plugins {
  103. quota = yes
  104. sieve = yes
  105. }
  106. postmaster_address = support
  107. lmtp_save_to_detail_mailbox = yes
  108. recipient_delimiter = +
  109. }
  110.  
  111. protocol imap {
  112. mail_plugins {
  113. imap_acl = yes
  114. }
  115. imap_client_workarounds = tb-extra-mailbox-sep
  116. mail_max_userip_connections = 10
  117. }
  118.  
  119. protocol pop3 {
  120. pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
  121. pop3_uidl_format = %{uid | hex(8)}%{uidvalidity | hex(8)}
  122. mail_max_userip_connections = 10
  123. }
  124.  
  125. service auth {
  126. unix_listener /var/spool/postfix/private/dovecot-auth {
  127. group = postfix
  128. mode = 0660
  129. user = postfix
  130. }
  131. unix_listener auth-master {
  132. user = mail
  133. group = mail
  134. mode = 0666
  135. }
  136. unix_listener auth-userdb {
  137. user = mail
  138. group = mail
  139. mode = 0660
  140. }
  141. }
  142.  
  143. service lmtp {
  144. unix_listener /var/spool/postfix/private/dovecot-lmtp {
  145. user = postfix
  146. group = postfix
  147. mode = 0600
  148. }
  149. }
  150.  
  151. namespace inbox {
  152. type = private
  153. separator = /
  154. prefix =
  155. inbox = yes
  156.  
  157. mailbox Sent {
  158. auto = subscribe
  159. special_use = \Sent
  160. }
  161. mailbox "Sent Messages" {
  162. auto = no
  163. special_use = \Sent
  164. }
  165. mailbox "Sent Items" {
  166. auto = no
  167. special_use = \Sent
  168. }
  169. mailbox Drafts {
  170. auto = subscribe
  171. special_use = \Drafts
  172. }
  173. mailbox Trash {
  174. auto = subscribe
  175. special_use = \Trash
  176. }
  177. mailbox "Deleted Messages" {
  178. auto = no
  179. special_use = \Trash
  180. }
  181. mailbox Junk {
  182. auto = subscribe
  183. special_use = \Junk
  184. }
  185. mailbox Spam {
  186. auto = no
  187. special_use = \Junk
  188. }
  189. mailbox "Junk E-mail" {
  190. auto = no
  191. special_use = \Junk
  192. }
  193. mailbox Archive {
  194. auto = no
  195. special_use = \Archive
  196. }
  197. mailbox Archives {
  198. auto = no
  199. special_use = \Archive
  200. }
  201. }
  202.  
  203. namespace shared {
  204. type = shared
  205. separator = /
  206. prefix = Shared/$user/
  207. list = children
  208. subscriptions = yes
  209. mail_driver = maildir
  210. mailbox_list_layout = fs
  211. mail_path = %{owner_home}
  212. mail_index_path = ~/Shared/%{owner_user}
  213. }
Advertisement
Add Comment
Please, Sign In to add comment