1/*
2Package config holds the configuration file definitions.
3
4Mox uses two config files:
5
61. mox.conf, also called the static configuration file.
72. domains.conf, also called the dynamic configuration file.
8
9The static configuration file is never reloaded during the lifetime of a
10running mox instance. After changes to mox.conf, mox must be restarted for the
11changes to take effect.
12
13The dynamic configuration file is reloaded automatically when it changes.
14If the file contains an error after the change, the reload is aborted and the
15previous version remains active.
16
17Below are "empty" config files, generated from the config file definitions in
18the source code, along with comments explaining the fields. Fields named "x" are
19placeholders for user-chosen map keys.
20
21# sconf
22
23The config files are in "sconf" format. Properties of sconf files:
24
25 - Indentation with tabs only.
26 - "#" as first non-whitespace character makes the line a comment. Lines with a
27 value cannot also have a comment.
28 - Values don't have syntax indicating their type. For example, strings are
29 not quoted/escaped and can never span multiple lines.
30 - Fields that are optional can be left out completely. But the value of an
31 optional field may itself have required fields.
32
33See https://pkg.go.dev/github.com/mjl-/sconf for details.
34
35# mox.conf
36
37 # NOTE: This config file is in 'sconf' format. Indent with tabs. Comments must be
38 # on their own line, they don't end a line. Do not escape or quote strings.
39 # Details: https://pkg.go.dev/github.com/mjl-/sconf.
40
41
42 # Directory where all data is stored, e.g. queue, accounts and messages, ACME TLS
43 # certs/keys. If this is a relative path, it is relative to the directory of
44 # mox.conf.
45 DataDir:
46
47 # Default log level, one of: error, info, debug, trace, traceauth, tracedata.
48 # Trace logs SMTP and IMAP protocol transcripts, with traceauth also messages with
49 # passwords, and tracedata on top of that also the full data exchanges (full
50 # messages), which can be a large amount of data.
51 LogLevel:
52
53 # Overrides of log level per package (e.g. queue, smtpclient, smtpserver,
54 # imapserver, spf, dkim, dmarc, dmarcdb, autotls, junk, mtasts, tlsrpt).
55 # (optional)
56 PackageLogLevels:
57 x:
58
59 # User to switch to after binding to all sockets as root. Default: mox. If the
60 # value is not a known user, it is parsed as integer and used as uid and gid.
61 # (optional)
62 User:
63
64 # If true, do not automatically fix file permissions when starting up. By default,
65 # mox will ensure reasonable owner/permissions on the working, data and config
66 # directories (and files), and mox binary (if present). (optional)
67 NoFixPermissions: false
68
69 # Full hostname of system, e.g. mail.<domain>
70 Hostname:
71
72 # If enabled, a single DNS TXT lookup of _updates.xmox.nl is done every 24h to
73 # check for a new release. Each time a new release is found, a changelog is
74 # fetched from https://updates.xmox.nl/changelog and delivered to the postmaster
75 # mailbox. (optional)
76 CheckUpdates: false
77
78 # In pedantic mode protocol violations (that happen in the wild) for SMTP/IMAP/etc
79 # result in errors instead of accepting such behaviour. (optional)
80 Pedantic: false
81
82 # Global TLS configuration, e.g. for additional Certificate Authorities. Used for
83 # outgoing SMTP connections, HTTPS requests. (optional)
84 TLS:
85
86 # (optional)
87 CA:
88
89 # (optional)
90 AdditionalToSystem: false
91
92 # (optional)
93 CertFiles:
94 -
95
96 # Automatic TLS configuration with ACME, e.g. through Let's Encrypt. The key is a
97 # name referenced in TLS configs, e.g. letsencrypt. (optional)
98 ACME:
99 x:
100
101 # For letsencrypt, use https://acme-v02.api.letsencrypt.org/directory.
102 DirectoryURL:
103
104 # How long before expiration to renew the certificate. Default is 30 days.
105 # (optional)
106 RenewBefore: 0s
107
108 # Email address to register at ACME provider. The provider can email you when
109 # certificates are about to expire. If you configure an address for which email is
110 # delivered by this server, keep in mind that TLS misconfigurations could result
111 # in such notification emails not arriving.
112 ContactEmail:
113
114 # TLS port for ACME validation, 443 by default. You should only override this if
115 # you cannot listen on port 443 directly. ACME will make requests to port 443, so
116 # you'll have to add an external mechanism to get the tls connection here, e.g. by
117 # configuring firewall-level port forwarding. Validation over the https port uses
118 # tls-alpn-01 with application-layer protocol negotiation, which essentially means
119 # the original tls connection must make it here unmodified, an https reverse proxy
120 # will not work. (optional)
121 Port: 0
122
123 # If set, used for suggested CAA DNS records, for restricting TLS certificate
124 # issuance to a Certificate Authority. If empty and DirectyURL is for Let's
125 # Encrypt, this value is set automatically to letsencrypt.org. (optional)
126 IssuerDomainName:
127
128 # ACME providers can require that a request for a new ACME account reference an
129 # existing non-ACME account known to the provider. External account binding
130 # references that account by a key id, and authorizes new ACME account requests by
131 # signing it with a key known both by the ACME client and ACME provider.
132 # (optional)
133 ExternalAccountBinding:
134
135 # Key identifier, from ACME provider.
136 KeyID:
137
138 # File containing the base64url-encoded key used to sign account requests with
139 # external account binding. The ACME provider will verify the account request is
140 # correctly signed by the key. File is evaluated relative to the directory of
141 # mox.conf.
142 KeyFile:
143
144 # File containing hash of admin password, for authentication in the web admin
145 # pages (if enabled). (optional)
146 AdminPasswordFile:
147
148 # Listeners are groups of IP addresses and services enabled on those IP addresses,
149 # such as SMTP/IMAP or internal endpoints for administration or Prometheus
150 # metrics. All listeners with SMTP/IMAP services enabled will serve all configured
151 # domains. If the listener is named 'public', it will get a few helpful additional
152 # configuration checks, for acme automatic tls certificates and monitoring of ips
153 # in dnsbls if those are configured.
154 Listeners:
155 x:
156
157 # Use 0.0.0.0 to listen on all IPv4 and/or :: to listen on all IPv6 addresses, but
158 # it is better to explicitly specify the IPs you want to use for email, as mox
159 # will make sure outgoing connections will only be made from one of those IPs. If
160 # both outgoing IPv4 and IPv6 connectivity is possible, and only one family has
161 # explicitly configured addresses, both address families are still used for
162 # outgoing connections. Use the "direct" transport to limit address families for
163 # outgoing connections.
164 IPs:
165 -
166
167 # If set, the mail server is configured behind a NAT and field IPs are internal
168 # instead of the public IPs, while NATIPs lists the public IPs. Used during
169 # IP-related DNS self-checks, such as for iprev, mx, spf, autoconfig,
170 # autodiscover, and for autotls. (optional)
171 NATIPs:
172 -
173
174 # Deprecated, use NATIPs instead. If set, IPs are not the public IPs, but are
175 # NATed. Skips IP-related DNS self-checks. (optional)
176 IPsNATed: false
177
178 # If empty, the config global Hostname is used. The internal services webadmin,
179 # webaccount, webmail and webapi only match requests to IPs, this hostname,
180 # "localhost". All except webadmin also match for any client settings domain.
181 # (optional)
182 Hostname:
183
184 # For SMTP/IMAP STARTTLS, direct TLS and HTTPS connections. (optional)
185 TLS:
186
187 # Name of provider from top-level configuration to use for ACME, e.g. letsencrypt.
188 # (optional)
189 ACME:
190
191 # Keys and certificates to use for this listener. The files are opened by the
192 # privileged root process and passed to the unprivileged mox process, so no
193 # special permissions are required on the files. If the private key will not be
194 # replaced when refreshing certificates, also consider adding the private key to
195 # HostPrivateKeyFiles and configuring DANE TLSA DNS records. (optional)
196 KeyCerts:
197 -
198
199 # Certificate including intermediate CA certificates, in PEM format.
200 CertFile:
201
202 # Private key for certificate, in PEM format. PKCS8 is recommended, but PKCS1 and
203 # EC private keys are recognized as well.
204 KeyFile:
205
206 # Minimum TLS version. Default: TLSv1.2. (optional)
207 MinVersion:
208
209 # Private keys used for ACME certificates. Specified explicitly so DANE TLSA DNS
210 # records can be generated, even before the certificates are requested. DANE is a
211 # mechanism to authenticate remote TLS certificates based on a public key or
212 # certificate specified in DNS, protected with DNSSEC. DANE is opportunistic and
213 # attempted when delivering SMTP with STARTTLS. The private key files must be in
214 # PEM format. PKCS8 is recommended, but PKCS1 and EC private keys are recognized
215 # as well. Only RSA 2048 bit and ECDSA P-256 keys are currently used. The first of
216 # each is used when requesting new certificates through ACME. (optional)
217 HostPrivateKeyFiles:
218 -
219
220 # Maximum size in bytes for incoming and outgoing messages. Default is 100MB.
221 # (optional)
222 SMTPMaxMessageSize: 0
223
224 # (optional)
225 SMTP:
226 Enabled: false
227
228 # Default 25. (optional)
229 Port: 0
230
231 # Do not offer STARTTLS to secure the connection. Not recommended. (optional)
232 NoSTARTTLS: false
233
234 # Do not accept incoming messages if STARTTLS is not active. Consider using in
235 # combination with an MTA-STS policy and/or DANE. A remote SMTP server may not
236 # support TLS and may not be able to deliver messages. Incoming messages for TLS
237 # reporting addresses ignore this setting and do not require TLS. (optional)
238 RequireSTARTTLS: false
239
240 # Do not announce the REQUIRETLS SMTP extension. Messages delivered using the
241 # REQUIRETLS extension should only be distributed onwards to servers also
242 # implementing the REQUIRETLS extension. In some situations, such as hosting
243 # mailing lists, this may not be feasible due to lack of support for the extension
244 # by mailing list subscribers. (optional)
245 NoRequireTLS: false
246
247 # Addresses of DNS block lists for incoming messages. Block lists are only
248 # consulted for connections/messages without enough reputation to make an
249 # accept/reject decision. This prevents sending IPs of all communications to the
250 # block list provider. If any of the listed DNSBLs contains a requested IP
251 # address, the message is rejected as spam. The DNSBLs are checked for healthiness
252 # before use, at most once per 4 hours. IPs we can send from are periodically
253 # checked for being in the configured DNSBLs. See MonitorDNSBLs in domains.conf to
254 # only monitor IPs we send from, without using those DNSBLs for incoming messages.
255 # Example DNSBLs: sbl.spamhaus.org, bl.spamcop.net. See
256 # https://www.spamhaus.org/sbl/ and https://www.spamcop.net/ for more information
257 # and terms of use. (optional)
258 DNSBLs:
259 -
260
261 # Delay before accepting a message from a first-time sender for the destination
262 # account. Default: 15s. (optional)
263 FirstTimeSenderDelay: 0s
264
265 # Override default setting for enabling TLS session tickets. Disabling session
266 # tickets may work around TLS interoperability issues. (optional)
267 TLSSessionTicketsDisabled: false
268
269 # SMTP for submitting email, e.g. by email applications. Starts out in plain text,
270 # can be upgraded to TLS with the STARTTLS command. Prefer using Submissions which
271 # is always a TLS connection. (optional)
272 Submission:
273 Enabled: false
274
275 # Default 587. (optional)
276 Port: 0
277
278 # Do not require STARTTLS. Since users must login, this means password may be sent
279 # without encryption. Not recommended. (optional)
280 NoRequireSTARTTLS: false
281
282 # SMTP over TLS for submitting email, by email applications. Requires a TLS
283 # config. (optional)
284 Submissions:
285 Enabled: false
286
287 # Default 465. (optional)
288 Port: 0
289
290 # Additionally enable submission on HTTPS port 443 via TLS ALPN. TLS Application
291 # Layer Protocol Negotiation allows clients to request a specific protocol from
292 # the server as part of the TLS connection setup. When this setting is enabled and
293 # a client requests the 'smtp' protocol after TLS, it will be able to talk SMTP to
294 # Mox on port 443. This is meant to be useful as a censorship circumvention
295 # technique for Delta Chat. (optional)
296 EnabledOnHTTPS: false
297
298 # IMAP for reading email, by email applications. Starts out in plain text, can be
299 # upgraded to TLS with the STARTTLS command. Prefer using IMAPS instead which is
300 # always a TLS connection. (optional)
301 IMAP:
302 Enabled: false
303
304 # Default 143. (optional)
305 Port: 0
306
307 # Enable this only when the connection is otherwise encrypted (e.g. through a
308 # VPN). (optional)
309 NoRequireSTARTTLS: false
310
311 # IMAP over TLS for reading email, by email applications. Requires a TLS config.
312 # (optional)
313 IMAPS:
314 Enabled: false
315
316 # Default 993. (optional)
317 Port: 0
318
319 # Additionally enable IMAP on HTTPS port 443 via TLS ALPN. TLS Application Layer
320 # Protocol Negotiation allows clients to request a specific protocol from the
321 # server as part of the TLS connection setup. When this setting is enabled and a
322 # client requests the 'imap' protocol after TLS, it will be able to talk IMAP to
323 # Mox on port 443. This is meant to be useful as a censorship circumvention
324 # technique for Delta Chat. (optional)
325 EnabledOnHTTPS: false
326
327 # Account web interface, for email users wanting to change their accounts, e.g.
328 # set new password, set new delivery rulesets. Default path is /. (optional)
329 AccountHTTP:
330 Enabled: false
331
332 # Default 80 for HTTP and 443 for HTTPS. See Hostname at Listener for hostname
333 # matching behaviour. (optional)
334 Port: 0
335
336 # Path to serve requests on. Should end with a slash, related to cookie paths.
337 # (optional)
338 Path:
339
340 # If set, X-Forwarded-* headers are used for the remote IP address for rate
341 # limiting and for the "secure" status of cookies. (optional)
342 Forwarded: false
343
344 # Account web interface listener like AccountHTTP, but for HTTPS. Requires a TLS
345 # config. (optional)
346 AccountHTTPS:
347 Enabled: false
348
349 # Default 80 for HTTP and 443 for HTTPS. See Hostname at Listener for hostname
350 # matching behaviour. (optional)
351 Port: 0
352
353 # Path to serve requests on. Should end with a slash, related to cookie paths.
354 # (optional)
355 Path:
356
357 # If set, X-Forwarded-* headers are used for the remote IP address for rate
358 # limiting and for the "secure" status of cookies. (optional)
359 Forwarded: false
360
361 # Admin web interface, for managing domains, accounts, etc. Default path is
362 # /admin/. Preferably only enable on non-public IPs. Hint: use 'ssh -L
363 # 8080:localhost:80 you@yourmachine' and open http://localhost:8080/admin/, or set
364 # up a tunnel (e.g. WireGuard) and add its IP to the mox 'internal' listener.
365 # (optional)
366 AdminHTTP:
367 Enabled: false
368
369 # Default 80 for HTTP and 443 for HTTPS. See Hostname at Listener for hostname
370 # matching behaviour. (optional)
371 Port: 0
372
373 # Path to serve requests on. Should end with a slash, related to cookie paths.
374 # (optional)
375 Path:
376
377 # If set, X-Forwarded-* headers are used for the remote IP address for rate
378 # limiting and for the "secure" status of cookies. (optional)
379 Forwarded: false
380
381 # Admin web interface listener like AdminHTTP, but for HTTPS. Requires a TLS
382 # config. (optional)
383 AdminHTTPS:
384 Enabled: false
385
386 # Default 80 for HTTP and 443 for HTTPS. See Hostname at Listener for hostname
387 # matching behaviour. (optional)
388 Port: 0
389
390 # Path to serve requests on. Should end with a slash, related to cookie paths.
391 # (optional)
392 Path:
393
394 # If set, X-Forwarded-* headers are used for the remote IP address for rate
395 # limiting and for the "secure" status of cookies. (optional)
396 Forwarded: false
397
398 # Webmail client, for reading email. Default path is /webmail/. (optional)
399 WebmailHTTP:
400 Enabled: false
401
402 # Default 80 for HTTP and 443 for HTTPS. See Hostname at Listener for hostname
403 # matching behaviour. (optional)
404 Port: 0
405
406 # Path to serve requests on. Should end with a slash, related to cookie paths.
407 # (optional)
408 Path:
409
410 # If set, X-Forwarded-* headers are used for the remote IP address for rate
411 # limiting and for the "secure" status of cookies. (optional)
412 Forwarded: false
413
414 # Webmail client, like WebmailHTTP, but for HTTPS. Requires a TLS config.
415 # (optional)
416 WebmailHTTPS:
417 Enabled: false
418
419 # Default 80 for HTTP and 443 for HTTPS. See Hostname at Listener for hostname
420 # matching behaviour. (optional)
421 Port: 0
422
423 # Path to serve requests on. Should end with a slash, related to cookie paths.
424 # (optional)
425 Path:
426
427 # If set, X-Forwarded-* headers are used for the remote IP address for rate
428 # limiting and for the "secure" status of cookies. (optional)
429 Forwarded: false
430
431 # Like WebAPIHTTP, but with plain HTTP, without TLS. (optional)
432 WebAPIHTTP:
433 Enabled: false
434
435 # Default 80 for HTTP and 443 for HTTPS. See Hostname at Listener for hostname
436 # matching behaviour. (optional)
437 Port: 0
438
439 # Path to serve requests on. Should end with a slash, related to cookie paths.
440 # (optional)
441 Path:
442
443 # If set, X-Forwarded-* headers are used for the remote IP address for rate
444 # limiting and for the "secure" status of cookies. (optional)
445 Forwarded: false
446
447 # WebAPI, a simple HTTP/JSON-based API for email, with HTTPS (requires a TLS
448 # config). Default path is /webapi/. (optional)
449 WebAPIHTTPS:
450 Enabled: false
451
452 # Default 80 for HTTP and 443 for HTTPS. See Hostname at Listener for hostname
453 # matching behaviour. (optional)
454 Port: 0
455
456 # Path to serve requests on. Should end with a slash, related to cookie paths.
457 # (optional)
458 Path:
459
460 # If set, X-Forwarded-* headers are used for the remote IP address for rate
461 # limiting and for the "secure" status of cookies. (optional)
462 Forwarded: false
463
464 # Serve prometheus metrics, for monitoring. You should not enable this on a public
465 # IP. (optional)
466 MetricsHTTP:
467 Enabled: false
468
469 # Default 8010. (optional)
470 Port: 0
471
472 # Serve /debug/pprof/ for profiling a running mox instance. Do not enable this on
473 # a public IP! (optional)
474 PprofHTTP:
475 Enabled: false
476
477 # Default 8011. (optional)
478 Port: 0
479
480 # Serve autoconfiguration/autodiscovery to simplify configuring email
481 # applications, will use port 443. Requires a TLS config. (optional)
482 AutoconfigHTTPS:
483 Enabled: false
484
485 # TLS port, 443 by default. You should only override this if you cannot listen on
486 # port 443 directly. Autoconfig requests will be made to port 443, so you'll have
487 # to add an external mechanism to get the connection here, e.g. by configuring
488 # port forwarding. (optional)
489 Port: 0
490
491 # If set, plain HTTP instead of HTTPS is spoken on the configured port. Can be
492 # useful when the autoconfig domain is reverse proxied. (optional)
493 NonTLS: false
494
495 # Serve MTA-STS policies describing SMTP TLS requirements. Requires a TLS config.
496 # (optional)
497 MTASTSHTTPS:
498 Enabled: false
499
500 # TLS port, 443 by default. You should only override this if you cannot listen on
501 # port 443 directly. MTA-STS requests will be made to port 443, so you'll have to
502 # add an external mechanism to get the connection here, e.g. by configuring port
503 # forwarding. (optional)
504 Port: 0
505
506 # If set, plain HTTP instead of HTTPS is spoken on the configured port. Can be
507 # useful when the mta-sts domain is reverse proxied. (optional)
508 NonTLS: false
509
510 # All configured WebHandlers will serve on an enabled listener. (optional)
511 WebserverHTTP:
512 Enabled: false
513
514 # Port for plain HTTP (non-TLS) webserver. (optional)
515 Port: 0
516
517 # All configured WebHandlers will serve on an enabled listener. Either ACME must
518 # be configured, or for each WebHandler domain a TLS certificate must be
519 # configured. (optional)
520 WebserverHTTPS:
521 Enabled: false
522
523 # Port for HTTPS webserver. (optional)
524 Port: 0
525
526 # Destination for emails delivered to postmaster addresses: a plain 'postmaster'
527 # without domain, 'postmaster@<hostname>' (also for each listener with SMTP
528 # enabled), and as fallback for each domain without explicitly configured
529 # postmaster destination.
530 Postmaster:
531 Account:
532
533 # E.g. Postmaster or Inbox.
534 Mailbox:
535
536 # Destination for per-host TLS reports (TLSRPT). TLS reports can be per recipient
537 # domain (for MTA-STS), or per MX host (for DANE). The per-domain TLS reporting
538 # configuration is in domains.conf. This is the TLS reporting configuration for
539 # this host. If absent, no host-based TLSRPT address is configured, and no host
540 # TLSRPT DNS record is suggested. (optional)
541 HostTLSRPT:
542
543 # Account to deliver TLS reports to. Typically same account as for postmaster.
544 Account:
545
546 # Mailbox to deliver TLS reports to. Recommended value: TLSRPT.
547 Mailbox:
548
549 # Localpart at hostname to accept TLS reports at. Recommended value: tls-reports.
550 Localpart:
551
552 # Mailboxes to create for new accounts. Inbox is always created. Mailboxes can be
553 # given a 'special-use' role, which are understood by most mail clients. If
554 # absent/empty, the following additional mailboxes are created: Sent, Archive,
555 # Trash, Drafts and Junk. (optional)
556 InitialMailboxes:
557
558 # Special-use roles to mailbox to create. (optional)
559 SpecialUse:
560
561 # (optional)
562 Sent:
563
564 # (optional)
565 Archive:
566
567 # (optional)
568 Trash:
569
570 # (optional)
571 Draft:
572
573 # (optional)
574 Junk:
575
576 # Regular, non-special-use mailboxes to create. (optional)
577 Regular:
578 -
579
580 # Deprecated in favor of InitialMailboxes. Mailboxes to create when adding an
581 # account. Inbox is always created. If no mailboxes are specified, the following
582 # are automatically created: Sent, Archive, Trash, Drafts and Junk. (optional)
583 DefaultMailboxes:
584 -
585
586 # Transport are mechanisms for delivering messages. Transports can be referenced
587 # from Routes in accounts, domains and the global configuration. There is always
588 # an implicit/fallback delivery transport doing direct delivery with SMTP from the
589 # outgoing message queue. Transports are typically only configured when using
590 # smarthosts, i.e. when delivering through another SMTP server. Zero or one
591 # transport methods must be set in a transport, never multiple. When using an
592 # external party to send email for a domain, keep in mind you may have to add
593 # their IP address to your domain's SPF record, and possibly additional DKIM
594 # records. (optional)
595 Transports:
596 x:
597
598 # Submission SMTP over a TLS connection to submit email to a remote queue.
599 # (optional)
600 Submissions:
601
602 # Host name to connect to and for verifying its TLS certificate.
603 Host:
604
605 # If unset or 0, the default port for submission(s)/smtp is used: 25 for SMTP, 465
606 # for submissions (with TLS), 587 for submission (possibly with STARTTLS).
607 # (optional)
608 Port: 0
609
610 # If set an unverifiable remote TLS certificate during STARTTLS is accepted.
611 # (optional)
612 STARTTLSInsecureSkipVerify: false
613
614 # If set for submission or smtp transport, do not attempt STARTTLS on the
615 # connection. Authentication credentials and messages will be transferred in clear
616 # text. (optional)
617 NoSTARTTLS: false
618
619 # If set, authentication credentials for the remote server. (optional)
620 Auth:
621 Username:
622 Password:
623
624 # Allowed authentication mechanisms. Defaults to SCRAM-SHA-256-PLUS,
625 # SCRAM-SHA-256, SCRAM-SHA-1-PLUS, SCRAM-SHA-1, CRAM-MD5. Not included by default:
626 # PLAIN. Specify the strongest mechanism known to be implemented by the server to
627 # prevent mechanism downgrade attacks. (optional)
628 Mechanisms:
629 -
630
631 # Submission SMTP over a plain TCP connection (possibly with STARTTLS) to submit
632 # email to a remote queue. (optional)
633 Submission:
634
635 # Host name to connect to and for verifying its TLS certificate.
636 Host:
637
638 # If unset or 0, the default port for submission(s)/smtp is used: 25 for SMTP, 465
639 # for submissions (with TLS), 587 for submission (possibly with STARTTLS).
640 # (optional)
641 Port: 0
642
643 # If set an unverifiable remote TLS certificate during STARTTLS is accepted.
644 # (optional)
645 STARTTLSInsecureSkipVerify: false
646
647 # If set for submission or smtp transport, do not attempt STARTTLS on the
648 # connection. Authentication credentials and messages will be transferred in clear
649 # text. (optional)
650 NoSTARTTLS: false
651
652 # If set, authentication credentials for the remote server. (optional)
653 Auth:
654 Username:
655 Password:
656
657 # Allowed authentication mechanisms. Defaults to SCRAM-SHA-256-PLUS,
658 # SCRAM-SHA-256, SCRAM-SHA-1-PLUS, SCRAM-SHA-1, CRAM-MD5. Not included by default:
659 # PLAIN. Specify the strongest mechanism known to be implemented by the server to
660 # prevent mechanism downgrade attacks. (optional)
661 Mechanisms:
662 -
663
664 # SMTP over a plain connection (possibly with STARTTLS), typically for
665 # old-fashioned unauthenticated relaying to a remote queue. (optional)
666 SMTP:
667
668 # Host name to connect to and for verifying its TLS certificate.
669 Host:
670
671 # If unset or 0, the default port for submission(s)/smtp is used: 25 for SMTP, 465
672 # for submissions (with TLS), 587 for submission (possibly with STARTTLS).
673 # (optional)
674 Port: 0
675
676 # If set an unverifiable remote TLS certificate during STARTTLS is accepted.
677 # (optional)
678 STARTTLSInsecureSkipVerify: false
679
680 # If set for submission or smtp transport, do not attempt STARTTLS on the
681 # connection. Authentication credentials and messages will be transferred in clear
682 # text. (optional)
683 NoSTARTTLS: false
684
685 # If set, authentication credentials for the remote server. (optional)
686 Auth:
687 Username:
688 Password:
689
690 # Allowed authentication mechanisms. Defaults to SCRAM-SHA-256-PLUS,
691 # SCRAM-SHA-256, SCRAM-SHA-1-PLUS, SCRAM-SHA-1, CRAM-MD5. Not included by default:
692 # PLAIN. Specify the strongest mechanism known to be implemented by the server to
693 # prevent mechanism downgrade attacks. (optional)
694 Mechanisms:
695 -
696
697 # Like regular direct delivery, but makes outgoing connections through a SOCKS
698 # proxy. (optional)
699 Socks:
700
701 # Address of SOCKS proxy, of the form host:port or ip:port.
702 Address:
703
704 # IP addresses connections from the SOCKS server will originate from. This IP
705 # addresses should be configured in the SPF record (keep in mind DNS record time
706 # to live (TTL) when adding a SOCKS proxy). Reverse DNS should be set up for these
707 # address, resolving to RemoteHostname. These are typically the IPv4 and IPv6
708 # address for the host in the Address field.
709 RemoteIPs:
710 -
711
712 # Hostname belonging to RemoteIPs. This name is used during in SMTP EHLO. This is
713 # typically the hostname of the host in the Address field.
714 RemoteHostname:
715
716 # Like regular direct delivery, but allows to tweak outgoing connections.
717 # (optional)
718 Direct:
719
720 # If set, outgoing SMTP connections will *NOT* use IPv4 addresses to connect to
721 # remote SMTP servers. (optional)
722 DisableIPv4: false
723
724 # If set, outgoing SMTP connections will *NOT* use IPv6 addresses to connect to
725 # remote SMTP servers. (optional)
726 DisableIPv6: false
727
728 # Do not send DMARC reports (aggregate only). By default, aggregate reports on
729 # DMARC evaluations are sent to domains if their DMARC policy requests them.
730 # Reports are sent at whole hours, with a minimum of 1 hour and maximum of 24
731 # hours, rounded up so a whole number of intervals cover 24 hours, aligned at
732 # whole days in UTC. Reports are sent from the postmaster@<mailhostname> address.
733 # (optional)
734 NoOutgoingDMARCReports: false
735
736 # Do not send TLS reports. By default, reports about failed SMTP STARTTLS
737 # connections and related MTA-STS/DANE policies are sent to domains if their
738 # TLSRPT DNS record requests them. Reports covering a 24 hour UTC interval are
739 # sent daily. Reports are sent from the postmaster address of the configured
740 # domain the mailhostname is in. If there is no such domain, or it does not have
741 # DKIM configured, no reports are sent. (optional)
742 NoOutgoingTLSReports: false
743
744 # Also send TLS reports if there were no SMTP STARTTLS connection failures. By
745 # default, reports are only sent when at least one failure occurred. If a report
746 # is sent, it does always include the successful connection counts as well.
747 # (optional)
748 OutgoingTLSReportsForAllSuccess: false
749
750 # Default maximum total message size in bytes for each individual account, only
751 # applicable if greater than zero. Can be overridden per account. Attempting to
752 # add new messages to an account beyond its maximum total size will result in an
753 # error. Useful to prevent a single account from filling storage. The quota only
754 # applies to the email message files, not to any file system overhead and also not
755 # the message index database file (account for approximately 15% overhead).
756 # (optional)
757 QuotaMessageSize: 0
758
759# domains.conf
760
761 # NOTE: This config file is in 'sconf' format. Indent with tabs. Comments must be
762 # on their own line, they don't end a line. Do not escape or quote strings.
763 # Details: https://pkg.go.dev/github.com/mjl-/sconf.
764
765
766 # Domains for which email is accepted. For internationalized domains, use their
767 # IDNA names in UTF-8.
768 Domains:
769 x:
770
771 # Disabled domains can be useful during/before migrations. Domains that are
772 # disabled can still be configured like normal, including adding addresses using
773 # the domain to accounts. However, disabled domains: 1. Do not try to fetch ACME
774 # certificates. TLS connections to host names involving the email domain will
775 # fail. A TLS certificate for the hostname (that wil be used as MX) itself will be
776 # requested. 2. Incoming deliveries over SMTP are rejected with a temporary error
777 # '450 4.2.1 recipient domain temporarily disabled'. 3. Submissions over SMTP
778 # using an (envelope) SMTP MAIL FROM address or message 'From' address of a
779 # disabled domain will be rejected with a temporary error '451 4.3.0 sender domain
780 # temporarily disabled'. Note that accounts with addresses at disabled domains can
781 # still log in and read email (unless the account itself is disabled). (optional)
782 Disabled: false
783
784 # Free-form description of domain. (optional)
785 Description:
786
787 # Hostname for client settings instead of the mail server hostname. E.g.
788 # mail.<domain>. For future migration to another mail operator without requiring
789 # all clients to update their settings, it is convenient to have client settings
790 # that reference a subdomain of the hosted domain instead of the hostname of the
791 # server where the mail is currently hosted. If empty, the hostname of the mail
792 # server is used for client configurations. Unicode name. (optional)
793 ClientSettingsDomain:
794
795 # If not empty, only the string before the separator is used to for email delivery
796 # decisions. For example, if set to "+", you+anything@example.com will be
797 # delivered to you@example.com. (optional)
798 LocalpartCatchallSeparator:
799
800 # Similar to LocalpartCatchallSeparator, but in case multiple are needed. For
801 # example both "+" and "-". Only of one LocalpartCatchallSeparator or
802 # LocalpartCatchallSeparators can be set. If set, the first separator is used to
803 # make unique addresses for outgoing SMTP connections with FromIDLoginAddresses.
804 # (optional)
805 LocalpartCatchallSeparators:
806 -
807
808 # If set, upper/lower case is relevant for email delivery. (optional)
809 LocalpartCaseSensitive: false
810
811 # With DKIM signing, a domain is taking responsibility for (content of) emails it
812 # sends, letting receiving mail servers build up a (hopefully positive) reputation
813 # of the domain, which can help with mail delivery. (optional)
814 DKIM:
815
816 # Emails can be DKIM signed. Config parameters are per selector. A DNS record must
817 # be created for each selector. Add the name to Sign to use the selector for
818 # signing messages.
819 Selectors:
820 x:
821
822 # sha256 (default) or (older, not recommended) sha1. (optional)
823 Hash:
824
825 # (optional)
826 Canonicalization:
827
828 # If set, some modifications to the headers (mostly whitespace) are allowed.
829 HeaderRelaxed: false
830
831 # If set, some whitespace modifications to the message body are allowed.
832 BodyRelaxed: false
833
834 # Headers to sign with DKIM. If empty, a reasonable default set of headers is
835 # selected. (optional)
836 Headers:
837 -
838
839 # If set, don't prevent duplicate headers from being added. Not recommended.
840 # (optional)
841 DontSealHeaders: false
842
843 # Period a signature is valid after signing, as duration, e.g. 72h. The period
844 # should be enough for delivery at the final destination, potentially with several
845 # hops/relays. In the order of days at least. (optional)
846 Expiration:
847
848 # Either an RSA or ed25519 private key file in PKCS8 PEM form.
849 PrivateKeyFile:
850
851 # List of selectors that emails will be signed with. (optional)
852 Sign:
853 -
854
855 # With DMARC, a domain publishes, in DNS, a policy on how other mail servers
856 # should handle incoming messages with the From-header matching this domain and/or
857 # subdomain (depending on the configured alignment). Receiving mail servers use
858 # this to build up a reputation of this domain, which can help with mail delivery.
859 # A domain can also publish an email address to which reports about DMARC
860 # verification results can be sent by verifying mail servers, useful for
861 # monitoring. Incoming DMARC reports are automatically parsed, validated, added to
862 # metrics and stored in the reporting database for later display in the admin web
863 # pages. (optional)
864 DMARC:
865
866 # Address-part before the @ that accepts DMARC reports. Must be
867 # non-internationalized. Recommended value: dmarc-reports.
868 Localpart:
869
870 # Alternative domain for reporting address, for incoming reports. Typically empty,
871 # causing the domain wherein this config exists to be used. Can be used to receive
872 # reports for domains that aren't fully hosted on this server. Configure such a
873 # domain as a hosted domain without making all the DNS changes, and configure this
874 # field with a domain that is fully hosted on this server, so the localpart and
875 # the domain of this field form a reporting address. Then only update the DMARC
876 # DNS record for the not fully hosted domain, ensuring the reporting address is
877 # specified in its "rua" field as shown in the suggested DNS settings. Unicode
878 # name. (optional)
879 Domain:
880
881 # Account to deliver to.
882 Account:
883
884 # Mailbox to deliver to, e.g. DMARC.
885 Mailbox:
886
887 # MTA-STS is a mechanism that allows publishing a policy with requirements for
888 # WebPKI-verified SMTP STARTTLS connections for email delivered to a domain.
889 # Existence of a policy is announced in a DNS TXT record (often
890 # unprotected/unverified, MTA-STS's weak spot). If a policy exists, it is fetched
891 # with a WebPKI-verified HTTPS request. The policy can indicate that
892 # WebPKI-verified SMTP STARTTLS is required, and which MX hosts (optionally with a
893 # wildcard pattern) are allowd. MX hosts to deliver to are still taken from DNS
894 # (again, not necessarily protected/verified), but messages will only be delivered
895 # to domains matching the MX hosts from the published policy. Mail servers look up
896 # the MTA-STS policy when first delivering to a domain, then keep a cached copy,
897 # periodically checking the DNS record if a new policy is available, and fetching
898 # and caching it if so. To update a policy, first serve a new policy with an
899 # updated policy ID, then update the DNS record (not the other way around). To
900 # remove an enforced policy, publish an updated policy with mode "none" for a long
901 # enough period so all cached policies have been refreshed (taking DNS TTL and
902 # policy max age into account), then remove the policy from DNS, wait for TTL to
903 # expire, and stop serving the policy. (optional)
904 MTASTS:
905
906 # Policies are versioned. The version must be specified in the DNS record. If you
907 # change a policy, first change it here to update the served policy, then update
908 # the DNS record with the updated policy ID.
909 PolicyID:
910
911 # If set to "enforce", a remote SMTP server will not deliver email to us if it
912 # cannot make a WebPKI-verified SMTP STARTTLS connection. In mode "testing",
913 # deliveries can be done without verified TLS, but errors will be reported through
914 # TLS reporting. In mode "none", verified TLS is not required, used for phasing
915 # out an MTA-STS policy.
916 Mode:
917
918 # How long a remote mail server is allowed to cache a policy. Typically 1 or
919 # several weeks.
920 MaxAge: 0s
921
922 # List of server names allowed for SMTP. If empty, the configured hostname is set.
923 # Host names can contain a wildcard (*) as a leading label (matching a single
924 # label, e.g. *.example matches host.example, not sub.host.example). (optional)
925 MX:
926 -
927
928 # With TLSRPT a domain specifies in DNS where reports about encountered SMTP TLS
929 # behaviour should be sent. Useful for monitoring. Incoming TLS reports are
930 # automatically parsed, validated, added to metrics and stored in the reporting
931 # database for later display in the admin web pages. (optional)
932 TLSRPT:
933
934 # Address-part before the @ that accepts TLSRPT reports. Recommended value:
935 # tls-reports.
936 Localpart:
937
938 # Alternative domain for reporting address, for incoming reports. Typically empty,
939 # causing the domain wherein this config exists to be used. Can be used to receive
940 # reports for domains that aren't fully hosted on this server. Configure such a
941 # domain as a hosted domain without making all the DNS changes, and configure this
942 # field with a domain that is fully hosted on this server, so the localpart and
943 # the domain of this field form a reporting address. Then only update the TLSRPT
944 # DNS record for the not fully hosted domain, ensuring the reporting address is
945 # specified in its "rua" field as shown in the suggested DNS settings. Unicode
946 # name. (optional)
947 Domain:
948
949 # Account to deliver to.
950 Account:
951
952 # Mailbox to deliver to, e.g. TLSRPT.
953 Mailbox:
954
955 # Routes for delivering outgoing messages through the queue. Each delivery attempt
956 # evaluates account routes, these domain routes and finally global routes. The
957 # transport of the first matching route is used in the delivery attempt. If no
958 # routes match, which is the default with no configured routes, messages are
959 # delivered directly from the queue. (optional)
960 Routes:
961 -
962
963 # Matches if the envelope from domain matches one of the configured domains, or if
964 # the list is empty. If a domain starts with a dot, prefixes of the domain also
965 # match. (optional)
966 FromDomain:
967 -
968
969 # Like FromDomain, but matching against the envelope to domain. (optional)
970 ToDomain:
971 -
972
973 # Matches if at least this many deliveries have already been attempted. This can
974 # be used to attempt sending through a smarthost when direct delivery has failed
975 # for several times. (optional)
976 MinimumAttempts: 0
977 Transport:
978
979 # Aliases that cause messages to be delivered to one or more locally configured
980 # addresses. Keys are localparts (encoded, as they appear in email addresses).
981 # (optional)
982 Aliases:
983 x:
984
985 # Expanded addresses to deliver to. These must currently be of addresses of local
986 # accounts. To prevent duplicate messages, a member address that is also an
987 # explicit recipient in the SMTP transaction will only have the message delivered
988 # once. If the address in the message From header is a member, that member also
989 # won't receive the message.
990 Addresses:
991 -
992
993 # If true, anyone can send messages to the list. Otherwise only members, based on
994 # message From address, which is assumed to be DMARC-like-verified. (optional)
995 PostPublic: false
996
997 # If true, members can see addresses of members. (optional)
998 ListMembers: false
999
1000 # If true, members are allowed to send messages with this alias address in the
1001 # message From header. (optional)
1002 AllowMsgFrom: false
1003
1004 # Accounts represent mox users, each with a password and email address(es) to
1005 # which email can be delivered (possibly at different domains). Each account has
1006 # its own on-disk directory holding its messages and index database. An account
1007 # name is not an email address.
1008 Accounts:
1009 x:
1010
1011 # Webhooks for events about outgoing deliveries. (optional)
1012 OutgoingWebhook:
1013
1014 # URL to POST webhooks.
1015 URL:
1016
1017 # If not empty, value of Authorization header to add to HTTP requests. (optional)
1018 Authorization:
1019
1020 # Events to send outgoing delivery notifications for. If absent, all events are
1021 # sent. Valid values: delivered, suppressed, delayed, failed, relayed, expanded,
1022 # canceled, unrecognized. (optional)
1023 Events:
1024 -
1025
1026 # Webhooks for events about incoming deliveries over SMTP. (optional)
1027 IncomingWebhook:
1028
1029 # URL to POST webhooks to for incoming deliveries over SMTP.
1030 URL:
1031
1032 # If not empty, value of Authorization header to add to HTTP requests. (optional)
1033 Authorization:
1034
1035 # Login addresses that cause outgoing email to be sent with SMTP MAIL FROM
1036 # addresses with a unique id after the localpart catchall separator (which must be
1037 # enabled when addresses are specified here). Any delivery status notifications
1038 # (DSN, e.g. for bounces), can be related to the original message and recipient
1039 # with unique id's. You can login to an account with any valid email address,
1040 # including variants with the localpart catchall separator. You can use this
1041 # mechanism to both send outgoing messages with and without unique fromid for a
1042 # given email address. With the webapi and webmail, a unique id will be generated.
1043 # For submission, the id from the SMTP MAIL FROM command is used if present, and a
1044 # unique id is generated otherwise. (optional)
1045 FromIDLoginAddresses:
1046 -
1047
1048 # Period to keep messages retired from the queue (delivered or failed) around.
1049 # Keeping retired messages is useful for maintaining the suppression list for
1050 # transactional email, for matching incoming DSNs to sent messages, and for
1051 # debugging. The time at which to clean up (remove) is calculated at retire time.
1052 # E.g. 168h (1 week). (optional)
1053 KeepRetiredMessagePeriod: 0s
1054
1055 # Period to keep webhooks retired from the queue (delivered or failed) around.
1056 # Useful for debugging. The time at which to clean up (remove) is calculated at
1057 # retire time. E.g. 168h (1 week). (optional)
1058 KeepRetiredWebhookPeriod: 0s
1059
1060 # If non-empty, login attempts on all protocols (e.g. SMTP/IMAP, web interfaces)
1061 # is rejected with this error message. Useful during migrations. Incoming
1062 # deliveries for addresses of this account are still accepted as normal.
1063 # (optional)
1064 LoginDisabled:
1065
1066 # Default domain for account. Deprecated behaviour: If a destination is not a full
1067 # address but only a localpart, this domain is added to form a full address.
1068 Domain:
1069
1070 # Free form description, e.g. full name or alternative contact info. (optional)
1071 Description:
1072
1073 # Full name, to use in message From header when composing messages in webmail. Can
1074 # be overridden per destination. (optional)
1075 FullName:
1076
1077 # Destinations, keys are email addresses (with IDNA domains). All destinations are
1078 # allowed for logging in with IMAP/SMTP/webmail. If no destinations are
1079 # configured, the account can not login. If the address is of the form '@domain',
1080 # i.e. with localpart missing, it serves as a catchall for the domain, matching
1081 # all messages that are not explicitly configured. Deprecated behaviour: If the
1082 # address is not a full address but a localpart, it is combined with Domain to
1083 # form a full address. (optional)
1084 Destinations:
1085 x:
1086
1087 # Mailbox to deliver to if none of Rulesets match. Default: Inbox. (optional)
1088 Mailbox:
1089
1090 # Delivery rules based on message and SMTP transaction. You may want to match each
1091 # mailing list by SMTP MailFrom address, VerifiedDomain and/or List-ID header
1092 # (typically <listname.example.org> if the list address is listname@example.org),
1093 # delivering them to their own mailbox. (optional)
1094 Rulesets:
1095 -
1096
1097 # Matches if this regular expression matches (a substring of) the SMTP MAIL FROM
1098 # address (not the message From-header). E.g. '^user@example\.org$'. (optional)
1099 SMTPMailFromRegexp:
1100
1101 # Matches if this regular expression matches (a substring of) the single address
1102 # in the message From header. (optional)
1103 MsgFromRegexp:
1104
1105 # Matches if this domain matches an SPF- and/or DKIM-verified (sub)domain.
1106 # (optional)
1107 VerifiedDomain:
1108
1109 # Matches if these header field/value regular expressions all match (substrings
1110 # of) the message headers. Header fields and valuees are converted to lower case
1111 # before matching. Whitespace is trimmed from the value before matching. A header
1112 # field can occur multiple times in a message, only one instance has to match. For
1113 # mailing lists, you could match on ^list-id$ with the value typically the mailing
1114 # list address in angled brackets with @ replaced with a dot, e.g.
1115 # <name\.lists\.example\.org>. (optional)
1116 HeadersRegexp:
1117 x:
1118
1119 # Influences spam filtering only, this option does not change whether a message
1120 # matches this ruleset. Can only be used together with SMTPMailFromRegexp and
1121 # VerifiedDomain. SMTPMailFromRegexp must be set to the address used to deliver
1122 # the forwarded message, e.g. '^user(|\+.*)@forward\.example$'. Changes to junk
1123 # analysis: 1. Messages are not rejected for failing a DMARC policy, because a
1124 # legitimate forwarded message without valid/intact/aligned DKIM signature would
1125 # be rejected because any verified SPF domain will be 'unaligned', of the
1126 # forwarding mail server. 2. The sending mail server IP address, and sending EHLO
1127 # and MAIL FROM domains and matching DKIM domain aren't used in future
1128 # reputation-based spam classifications (but other verified DKIM domains are)
1129 # because the forwarding server is not a useful spam signal for future messages.
1130 # (optional)
1131 IsForward: false
1132
1133 # Influences spam filtering only, this option does not change whether a message
1134 # matches this ruleset. If this domain matches an SPF- and/or DKIM-verified
1135 # (sub)domain, the message is accepted without further spam checks, such as a junk
1136 # filter or DMARC reject evaluation. DMARC rejects should not apply for mailing
1137 # lists that are not configured to rewrite the From-header of messages that don't
1138 # have a passing DKIM signature of the From-domain. Otherwise, by rejecting
1139 # messages, you may be automatically unsubscribed from the mailing list. The
1140 # assumption is that mailing lists do their own spam filtering/moderation.
1141 # (optional)
1142 ListAllowDomain:
1143
1144 # Influences spam filtering only, this option does not change whether a message
1145 # matches this ruleset. If a message is classified as spam, it isn't rejected
1146 # during the SMTP transaction (the normal behaviour), but accepted during the SMTP
1147 # transaction and delivered to the specified mailbox. The specified mailbox is not
1148 # automatically cleaned up like the account global Rejects mailbox, unless set to
1149 # that Rejects mailbox. (optional)
1150 AcceptRejectsToMailbox:
1151
1152 # Mailbox to deliver to if this ruleset matches.
1153 Mailbox:
1154
1155 # Free-form comments. (optional)
1156 Comment:
1157
1158 # If non-empty, incoming delivery attempts to this destination will be rejected
1159 # during SMTP RCPT TO with this error response line. Useful when a catchall
1160 # address is configured for the domain and messages to some addresses should be
1161 # rejected. The response line must start with an error code. Currently the
1162 # following error resonse codes are allowed: 421 (temporary local error), 550
1163 # (user not found). If the line consists of only an error code, an appropriate
1164 # error message is added. Rejecting messages with a 4xx code invites later retries
1165 # by the remote, while 5xx codes should prevent further delivery attempts.
1166 # (optional)
1167 SMTPError:
1168
1169 # If non-empty, an additional DMARC-like message authentication check is done for
1170 # incoming messages, validating the domain in the From-header of the message.
1171 # Messages without either an aligned SPF or aligned DKIM pass are rejected during
1172 # the SMTP DATA command with a permanent error code followed by the message in
1173 # this field. The domain in the message 'From' header is matched in relaxed or
1174 # strict mode according to the domain's DMARC policy if present, or relaxed mode
1175 # (organizational instead of exact domain match) otherwise. Useful for
1176 # autoresponders that don't want to accept messages they don't want to send an
1177 # automated reply to. (optional)
1178 MessageAuthRequiredSMTPError:
1179
1180 # Full name to use in message From header when composing messages coming from this
1181 # address with webmail. (optional)
1182 FullName:
1183
1184 # If configured, messages classified as weakly spam are rejected with instructions
1185 # to retry delivery, but this time with a signed token added to the subject.
1186 # During the next delivery attempt, the signed token will bypass the spam filter.
1187 # Messages with a clear spam signal, such as a known bad reputation, are
1188 # rejected/delayed without a signed token. (optional)
1189 SubjectPass:
1190
1191 # How long unique values are accepted after generating, e.g. 12h.
1192 Period: 0s
1193
1194 # Default maximum total message size in bytes for the account, overriding any
1195 # globally configured default maximum size if non-zero. A negative value can be
1196 # used to have no limit in case there is a limit by default. Attempting to add new
1197 # messages to an account beyond its maximum total size will result in an error.
1198 # Useful to prevent a single account from filling storage. (optional)
1199 QuotaMessageSize: 0
1200
1201 # Mail that looks like spam will be rejected, but a copy can be stored temporarily
1202 # in a mailbox, e.g. Rejects. If mail isn't coming in when you expect, you can
1203 # look there. The mail still isn't accepted, so the remote mail server may retry
1204 # (hopefully, if legitimate), or give up (hopefully, if indeed a spammer).
1205 # Messages are automatically removed from this mailbox, so do not set it to a
1206 # mailbox that has messages you want to keep. (optional)
1207 RejectsMailbox:
1208
1209 # Don't automatically delete mail in the RejectsMailbox listed above. This can be
1210 # useful, e.g. for future spam training. It can also cause storage to fill up.
1211 # (optional)
1212 KeepRejects: false
1213
1214 # Automatically set $Junk and $NotJunk flags based on mailbox messages are
1215 # delivered/moved/copied to. Email clients typically have too limited
1216 # functionality to conveniently set these flags, especially $NonJunk, but they can
1217 # all move messages to a different mailbox, so this helps them. (optional)
1218 AutomaticJunkFlags:
1219
1220 # If enabled, junk/nonjunk flags will be set automatically if they match some of
1221 # the regular expressions. When two of the three mailbox regular expressions are
1222 # set, the remaining one will match all unmatched messages. Messages are matched
1223 # in the order 'junk', 'neutral', 'not junk', and the search stops on the first
1224 # match. Mailboxes are lowercased before matching.
1225 Enabled: false
1226
1227 # Example: ^(junk|spam). (optional)
1228 JunkMailboxRegexp:
1229
1230 # Example: ^(inbox|neutral|postmaster|dmarc|tlsrpt|rejects), and you may wish to
1231 # add trash depending on how you use it, or leave this empty. (optional)
1232 NeutralMailboxRegexp:
1233
1234 # Example: .* or an empty string. (optional)
1235 NotJunkMailboxRegexp:
1236
1237 # Content-based filtering, using the junk-status of individual messages to rank
1238 # words in such messages as spam or ham. It is recommended you always set the
1239 # applicable (non)-junk status on messages, and that you do not empty your Trash
1240 # because those messages contain valuable ham/spam training information.
1241 # (optional)
1242 JunkFilter:
1243
1244 # Approximate spaminess score between 0 and 1 above which emails are rejected as
1245 # spam. Each delivery attempt adds a little noise to make it slightly harder for
1246 # spammers to identify words that strongly indicate non-spaminess and use it to
1247 # bypass the filter. E.g. 0.95.
1248 Threshold: 0.000000
1249 Params:
1250
1251 # Track ham/spam ranking for single words. (optional)
1252 Onegrams: false
1253
1254 # Track ham/spam ranking for each two consecutive words. (optional)
1255 Twograms: false
1256
1257 # Track ham/spam ranking for each three consecutive words. (optional)
1258 Threegrams: false
1259
1260 # Maximum power a word (combination) can have. If spaminess is 0.99, and max power
1261 # is 0.1, spaminess of the word will be set to 0.9. Similar for ham words.
1262 MaxPower: 0.000000
1263
1264 # Number of most spammy/hammy words to use for calculating probability. E.g. 10.
1265 TopWords: 0
1266
1267 # Ignore words that are this much away from 0.5 haminess/spaminess. E.g. 0.1,
1268 # causing word (combinations) of 0.4 to 0.6 to be ignored. (optional)
1269 IgnoreWords: 0.000000
1270
1271 # Occurrences in word database until a word is considered rare and its influence
1272 # in calculating probability reduced. E.g. 1 or 2. (optional)
1273 RareWords: 0
1274
1275 # Maximum number of outgoing messages for this account in a 24 hour window. This
1276 # limits the damage to recipients and the reputation of this mail server in case
1277 # of account compromise. Default 1000. (optional)
1278 MaxOutgoingMessagesPerDay: 0
1279
1280 # Maximum number of first-time recipients in outgoing messages for this account in
1281 # a 24 hour window. This limits the damage to recipients and the reputation of
1282 # this mail server in case of account compromise. Default 200. (optional)
1283 MaxFirstTimeRecipientsPerDay: 0
1284
1285 # Do not apply a delay to SMTP connections before accepting an incoming message
1286 # from a first-time sender. Can be useful for accounts that sends automated
1287 # responses and want instant replies. (optional)
1288 NoFirstTimeSenderDelay: false
1289
1290 # If set, this account cannot set a password of their own choice, but can only set
1291 # a new randomly generated password, preventing password reuse across services and
1292 # use of weak passwords. Custom account passwords can be set by the admin.
1293 # (optional)
1294 NoCustomPassword: false
1295
1296 # Routes for delivering outgoing messages through the queue. Each delivery attempt
1297 # evaluates these account routes, domain routes and finally global routes. The
1298 # transport of the first matching route is used in the delivery attempt. If no
1299 # routes match, which is the default with no configured routes, messages are
1300 # delivered directly from the queue. (optional)
1301 Routes:
1302 -
1303
1304 # Matches if the envelope from domain matches one of the configured domains, or if
1305 # the list is empty. If a domain starts with a dot, prefixes of the domain also
1306 # match. (optional)
1307 FromDomain:
1308 -
1309
1310 # Like FromDomain, but matching against the envelope to domain. (optional)
1311 ToDomain:
1312 -
1313
1314 # Matches if at least this many deliveries have already been attempted. This can
1315 # be used to attempt sending through a smarthost when direct delivery has failed
1316 # for several times. (optional)
1317 MinimumAttempts: 0
1318 Transport:
1319
1320 # Redirect all requests from domain (key) to domain (value). Always redirects to
1321 # HTTPS. For plain HTTP redirects, use a WebHandler with a WebRedirect. (optional)
1322 WebDomainRedirects:
1323 x:
1324
1325 # Handle webserver requests by serving static files, redirecting, reverse-proxying
1326 # HTTP(s) or passing the request to an internal service. The first matching
1327 # WebHandler will handle the request. Built-in system handlers, e.g. for ACME
1328 # validation, autoconfig and mta-sts always run first. Built-in handlers for
1329 # admin, account, webmail and webapi are evaluated after all handlers, including
1330 # webhandlers (allowing for overrides of internal services for some domains). If
1331 # no handler matches, the response status code is file not found (404). If
1332 # webserver features are missing, forward the requests to an application that
1333 # provides the needed functionality itself. (optional)
1334 WebHandlers:
1335 -
1336
1337 # Name to use in logging and metrics. (optional)
1338 LogName:
1339
1340 # Both Domain and PathRegexp must match for this WebHandler to match a request.
1341 # Exactly one of WebStatic, WebRedirect, WebForward, WebInternal must be set.
1342 Domain:
1343
1344 # Regular expression matched against request path, must always start with ^ to
1345 # ensure matching from the start of the path. The matching prefix can optionally
1346 # be stripped by WebForward. The regular expression does not have to end with $.
1347 PathRegexp:
1348
1349 # If set, plain HTTP requests are not automatically permanently redirected (308)
1350 # to HTTPS. If you don't have a HTTPS webserver configured, set this to true.
1351 # (optional)
1352 DontRedirectPlainHTTP: false
1353
1354 # Transparently compress responses (currently with gzip) if the client supports
1355 # it, the status is 200 OK, no Content-Encoding is set on the response yet and the
1356 # Content-Type of the response hints that the data is compressible (text/...,
1357 # specific application/... and .../...+json and .../...+xml). For static files
1358 # only, a cache with compressed files is kept. (optional)
1359 Compress: false
1360
1361 # Serve static files. (optional)
1362 WebStatic:
1363
1364 # Path to strip from the request URL before evaluating to a local path. If the
1365 # requested URL path does not start with this prefix and ContinueNotFound it is
1366 # considered non-matching and next WebHandlers are tried. If ContinueNotFound is
1367 # not set, a file not found (404) is returned in that case. (optional)
1368 StripPrefix:
1369
1370 # Directory to serve files from for this handler. Keep in mind that relative paths
1371 # are relative to the working directory of mox.
1372 Root:
1373
1374 # If set, and a directory is requested, and no index.html is present that can be
1375 # served, a file listing is returned. Results in 403 if ListFiles is not set. If a
1376 # directory is requested and the URL does not end with a slash, the response is a
1377 # redirect to the path with trailing slash. (optional)
1378 ListFiles: false
1379
1380 # If a requested URL does not exist, don't return a file not found (404) response,
1381 # but consider this handler non-matching and continue attempts to serve with later
1382 # WebHandlers, which may be a reverse proxy generating dynamic content, possibly
1383 # even writing a static file for a next request to serve statically. If
1384 # ContinueNotFound is set, HTTP requests other than GET and HEAD do not match.
1385 # This mechanism can be used to implement the equivalent of 'try_files' in other
1386 # webservers. (optional)
1387 ContinueNotFound: false
1388
1389 # Headers to add to the response. Useful for cache-control, content-type, etc. By
1390 # default, Content-Type headers are automatically added for recognized file types,
1391 # unless added explicitly through this setting. For directory listings, a
1392 # content-type header is skipped. (optional)
1393 ResponseHeaders:
1394 x:
1395
1396 # Redirect requests to configured URL. (optional)
1397 WebRedirect:
1398
1399 # Base URL to redirect to. The path must be empty and will be replaced, either by
1400 # the request URL path, or by OrigPathRegexp/ReplacePath. Scheme, host, port and
1401 # fragment stay intact, and query strings are combined. If empty, the response
1402 # redirects to a different path through OrigPathRegexp and ReplacePath, which must
1403 # then be set. Use a URL without scheme to redirect without changing the protocol,
1404 # e.g. //newdomain/. If a redirect would send a request to a URL with the same
1405 # scheme, host and path, the WebRedirect does not match so a next WebHandler can
1406 # be tried. This can be used to redirect all plain http traffic to https.
1407 # (optional)
1408 BaseURL:
1409
1410 # Regular expression for matching path. If set and path does not match, a 404 is
1411 # returned. The HTTP path used for matching always starts with a slash. (optional)
1412 OrigPathRegexp:
1413
1414 # Replacement path for destination URL based on OrigPathRegexp. Implemented with
1415 # Go's Regexp.ReplaceAllString: $1 is replaced with the text of the first
1416 # submatch, etc. If both OrigPathRegexp and ReplacePath are empty, BaseURL must be
1417 # set and all paths are redirected unaltered. (optional)
1418 ReplacePath:
1419
1420 # Status code to use in redirect, e.g. 307. By default, a permanent redirect (308)
1421 # is returned. (optional)
1422 StatusCode: 0
1423
1424 # Forward requests to another webserver, i.e. reverse proxy. (optional)
1425 WebForward:
1426
1427 # Strip the matching WebHandler path from the WebHandler before forwarding the
1428 # request. (optional)
1429 StripPath: false
1430
1431 # URL to forward HTTP requests to, e.g. http://127.0.0.1:8123/base. If StripPath
1432 # is false the full request path is added to the URL. Host headers are sent
1433 # unmodified. New X-Forwarded-{For,Host,Proto} headers are set. Any query string
1434 # in the URL is ignored. Requests are made using Go's net/http.DefaultTransport
1435 # that takes environment variables HTTP_PROXY and HTTPS_PROXY into account.
1436 # Websocket connections are forwarded and data is copied between client and
1437 # backend without looking at the framing. The websocket 'version' and
1438 # 'key'/'accept' headers are verified during the handshake, but other websocket
1439 # headers, including 'origin', 'protocol' and 'extensions' headers, are not
1440 # inspected and the backend is responsible for verifying/interpreting them.
1441 URL:
1442
1443 # Headers to add to the response. Useful for adding security- and cache-related
1444 # headers. (optional)
1445 ResponseHeaders:
1446 x:
1447
1448 # Pass request to internal service, like webmail, webapi, etc. (optional)
1449 WebInternal:
1450
1451 # Path to use as root of internal service, e.g. /webmail/.
1452 BasePath:
1453
1454 # Name of the service, values: admin, account, webmail, webapi.
1455 Service:
1456
1457 # Routes for delivering outgoing messages through the queue. Each delivery attempt
1458 # evaluates account routes, domain routes and finally these global routes. The
1459 # transport of the first matching route is used in the delivery attempt. If no
1460 # routes match, which is the default with no configured routes, messages are
1461 # delivered directly from the queue. (optional)
1462 Routes:
1463 -
1464
1465 # Matches if the envelope from domain matches one of the configured domains, or if
1466 # the list is empty. If a domain starts with a dot, prefixes of the domain also
1467 # match. (optional)
1468 FromDomain:
1469 -
1470
1471 # Like FromDomain, but matching against the envelope to domain. (optional)
1472 ToDomain:
1473 -
1474
1475 # Matches if at least this many deliveries have already been attempted. This can
1476 # be used to attempt sending through a smarthost when direct delivery has failed
1477 # for several times. (optional)
1478 MinimumAttempts: 0
1479 Transport:
1480
1481 # DNS blocklists to periodically check with if IPs we send from are present,
1482 # without using them for checking incoming deliveries.. Also see DNSBLs in SMTP
1483 # listeners in mox.conf, which specifies DNSBLs to use both for incoming
1484 # deliveries and for checking our IPs against. Example DNSBLs: sbl.spamhaus.org,
1485 # bl.spamcop.net. (optional)
1486 MonitorDNSBLs:
1487 -
1488
1489# Examples
1490
1491Mox includes configuration files to illustrate common setups. You can see these
1492examples with "mox config example", and print a specific example with "mox
1493config example <name>". Below are all examples included in mox.
1494
1495# Example webhandlers
1496
1497 # Snippet of domains.conf to configure WebDomainRedirects and WebHandlers.
1498
1499 # Redirect all requests for mox.example to https://www.mox.example.
1500 WebDomainRedirects:
1501 mox.example: www.mox.example
1502
1503 # Each request is matched against these handlers until one matches and serves it.
1504 WebHandlers:
1505 -
1506 # Redirect all plain http requests to https, leaving path, query strings, etc
1507 # intact. When the request is already to https, the destination URL would have the
1508 # same scheme, host and path, causing this redirect handler to not match the
1509 # request (and not cause a redirect loop) and the webserver to serve the request
1510 # with a later handler.
1511 LogName: redirhttps
1512 Domain: www.mox.example
1513 PathRegexp: ^/
1514 # Could leave DontRedirectPlainHTTP at false if it wasn't for this being an
1515 # example for doing this redirect.
1516 DontRedirectPlainHTTP: true
1517 WebRedirect:
1518 BaseURL: https://www.mox.example
1519 -
1520 # The name of the handler, used in logging and metrics.
1521 LogName: staticmjl
1522 # With ACME configured, each configured domain will automatically get a TLS
1523 # certificate on first request.
1524 Domain: www.mox.example
1525 PathRegexp: ^/who/mjl/
1526 WebStatic:
1527 StripPrefix: /who/mjl
1528 # Requested path /who/mjl/inferno/ resolves to local web/mjl/inferno.
1529 # If a directory contains an index.html, it is served when a directory is requested.
1530 Root: web/mjl
1531 # With ListFiles true, if a directory does not contain an index.html, the contents are listed.
1532 ListFiles: true
1533 ResponseHeaders:
1534 X-Mox: hi
1535 -
1536 LogName: redir
1537 Domain: www.mox.example
1538 PathRegexp: ^/redir/a/b/c
1539 # Don't redirect from plain HTTP to HTTPS.
1540 DontRedirectPlainHTTP: true
1541 WebRedirect:
1542 # Just change the domain and add query string set fragment. No change to scheme.
1543 # Path will start with /redir/a/b/c (and whathever came after) because no
1544 # OrigPathRegexp+ReplacePath is set.
1545 BaseURL: //moxest.example?q=1#frag
1546 # Default redirection is 308 - Permanent Redirect.
1547 StatusCode: 307
1548 -
1549 LogName: oldnew
1550 Domain: www.mox.example
1551 PathRegexp: ^/old/
1552 WebRedirect:
1553 # Replace path, leaving rest of URL intact.
1554 OrigPathRegexp: ^/old/(.*)
1555 ReplacePath: /new/$1
1556 -
1557 LogName: app
1558 Domain: www.mox.example
1559 PathRegexp: ^/app/
1560 WebForward:
1561 # Strip the path matched by PathRegexp before forwarding the request. So original
1562 # request /app/api become just /api.
1563 StripPath: true
1564 # URL of backend, where requests are forwarded to. The path in the URL is kept,
1565 # so for incoming request URL /app/api, the outgoing request URL has path /app-v2/api.
1566 # Requests are made with Go's net/http DefaultTransporter, including using
1567 # HTTP_PROXY and HTTPS_PROXY environment variables.
1568 URL: http://127.0.0.1:8900/app-v2/
1569 # Add headers to response.
1570 ResponseHeaders:
1571 X-Frame-Options: deny
1572 X-Content-Type-Options: nosniff
1573
1574# Example transport
1575
1576 # Snippet for mox.conf, defining a transport called Example that connects on the
1577 # SMTP submission with TLS port 465 ("submissions"), authenticating with
1578 # SCRAM-SHA-256-PLUS (other providers may not support SCRAM-SHA-256-PLUS, but they
1579 # typically do support the older CRAM-MD5).:
1580
1581 # Transport are mechanisms for delivering messages. Transports can be referenced
1582 # from Routes in accounts, domains and the global configuration. There is always
1583 # an implicit/fallback delivery transport doing direct delivery with SMTP from the
1584 # outgoing message queue. Transports are typically only configured when using
1585 # smarthosts, i.e. when delivering through another SMTP server. Zero or one
1586 # transport methods must be set in a transport, never multiple. When using an
1587 # external party to send email for a domain, keep in mind you may have to add
1588 # their IP address to your domain's SPF record, and possibly additional DKIM
1589 # records. (optional)
1590 Transports:
1591 Example:
1592 # Submission SMTP over a TLS connection to submit email to a remote queue.
1593 # (optional)
1594 Submissions:
1595 # Host name to connect to and for verifying its TLS certificate.
1596 Host: smtp.example.com
1597
1598 # If set, authentication credentials for the remote server. (optional)
1599 Auth:
1600 Username: user@example.com
1601 Password: test1234
1602 Mechanisms:
1603 # Allowed authentication mechanisms. Defaults to SCRAM-SHA-256-PLUS,
1604 # SCRAM-SHA-256, SCRAM-SHA-1-PLUS, SCRAM-SHA-1, CRAM-MD5. Not included by default:
1605 # PLAIN. Specify the strongest mechanism known to be implemented by the server to
1606 # prevent mechanism downgrade attacks. (optional)
1607
1608 - SCRAM-SHA-256-PLUS
1609
1610
1611 # Snippet for domains.conf, specifying a route that sends through the transport:
1612
1613 # Routes for delivering outgoing messages through the queue. Each delivery attempt
1614 # evaluates account routes, domain routes and finally these global routes. The
1615 # transport of the first matching route is used in the delivery attempt. If no
1616 # routes match, which is the default with no configured routes, messages are
1617 # delivered directly from the queue. (optional)
1618 Routes:
1619 -
1620 Transport: Example
1621*/
1622package config
1623
1624// NOTE: DO NOT EDIT, this file is generated by ../gendoc.sh.
1625