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