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