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