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