aboutsummaryrefslogtreecommitdiff
path: root/services/docker/mail-server/dovecot.conf
blob: 6cebe9b7c0d7c5426dcf658685e818951a9aa101 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
dovecot_config_version = 2.4.1
dovecot_storage_version = 2.4.0

base_dir = /run/dovecot
state_dir = /run/dovecot

protocols = imap submission lmtp lda sieve

mail_driver=maildir
mailbox_list_layout=index
mailbox_list_utf8=yes
mail_path=~/mail
mail_home=/data/vmail/%{user | domain}/%{user | username}
mail_utf8_extensions = yes

mail_uid = vmail
mail_gid = vmail

# Setup default mailboxes for inbox namespace
@mailbox_defaults = english

namespace inbox {
  separator = /

  mailbox Drafts {
    auto = subscribe
    special_use = \Drafts
  }
  mailbox Junk {
    auto = subscribe
    special_use = \Junk
  }
  mailbox Trash {
    auto = subscribe
    special_use = \Trash
  }

  mailbox Sent {
    auto = subscribe
    special_use = \Sent
  }

  mailbox Archive {
   auto = subscribe
   special_use = \Archive
  }
}

ssl = yes
ssl_server {
  cert_file = /etc/dovecot/ssl/tls.crt
  key_file = /etc/dovecot/ssl/tls.key
}

mail_attribute {
  dict file {
    path = %{home}/dovecot-attributes
  }
}

log_path = /dev/stdout

imap_hibernate_timeout = 5s

mail_plugins {
  fts = yes
  fts_flatcurve = yes
  mail_log = yes
  notify = yes
}

mail_log_events = delete undelete expunge save copy mailbox_create mailbox_delete mailbox_rename flag_change

fts_autoindex = yes
fts_autoindex_max_recent_msgs = 999
fts_search_add_missing = yes
language_filters = normalizer-icu snowball stopwords

language_tokenizers = generic email-address
language_tokenizer_generic_algorithm = simple

language en {
  default = yes
  filters = lowercase snowball english-possessive stopwords
}

fts flatcurve {
  substring_search = yes
}

auth_mechanisms = plain login
auth_username_format = %{user | username}

passdb passwd-file {
  passwd_file_path = /data/userdb
  default_password_scheme = SHA512-CRYPT
}

userdb passwd-file {
  passwd_file_path = /data/userdb
  fields {
    uid:default = vmail
    gid:default = vmail
    home:default = /data/vmail/%{user | domain}/%{user | username}
  }
}

protocol imap {
  mail_plugins {
    imap_sieve = yes
    imap_filter_sieve = yes
  }
}

protocol lmtp {
  mail_plugins {
    sieve = yes
  }
}

service imap-login {
  process_min_avail = 1
  client_limit = 100
}

service pop3-login {
  process_min_avail = 1
  client_limit = 100
}

service submission-login {
  process_min_avail = 1
  client_limit = 100

  inet_listener submissions {
    port = 465
    ssl = yes
  }
}

protocol lda {
  mail_plugins {
    sieve = yes
  }
}

service managesieve-login {
  process_min_avail = 1
  client_limit = 100
}

plugin {
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve

  # Directory for :global include scripts for the include extension.
  #sieve_global_dir =

  sieve_before = /data/sieve/global/before/
  sieve_after = /data/sieve/global/after/

  sieve_extensions = +notify +imapflags +special-use +vnd.dovecot.pipe +vnd.dovecot.filter
  sieve_plugins = sieve_imapsieve sieve_extprograms
}

event_exporter log {
   format = json
   time_format = rfc3339
}

# Add default backend metrics
@metric_defaults = backend

# Log auth failures
metric auth_failures {
  filter = event=auth_request_finished AND NOT success=yes
  exporter = log
}

metric imap_command {
  filter = event=imap_command_finished
  group_by cmd_name {
    method discrete {
    }
  }
  group_by tagged_reply_state {
    method discrete {
    }
  }
}

metric smtp_command {
  filter = event=smtp_server_command_finished and protocol=submission
  group_by cmd_name {
     method discrete {
    }
  }
  group_by status_code {
     method discrete {
    }
  }
  group_by duration {
     method exponential {
       base = 10
       min_magnitude = 1
       max_magnitude = 5
    }
  }
}

metric lmtp_command {
  filter = event=smtp_server_command_finished and protocol=lmtp
  group_by cmd_name {
     method discrete {
    }
  }
  group_by status_code {
     method discrete {
    }
  }
  group_by duration {
     method exponential {
       base = 10
       min_magnitude = 1
       max_magnitude = 5
    }
  }
}

# Add duration metrics for deliveries
metric mail_deliveries {
  filter = event=mail_delivery_finished
  group_by duration {
     method exponential {
       base = 10
       min_magnitude = 1
       max_magnitude = 5
     }
  }
}

!include_try vendor.d/*.conf
!include_try conf.d/*.conf