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