= mta-sts-daemon.yml(5)
:doctype: manpage
:manmanual: mta-sts-daemon.yml
:mansource: postfix-mta-sts-resolver

== Name

mta-sts-daemon.yml - configuration file for mta-sts-daemon

== Description

This configuration file configures the listening socket, caching behaviour,
and manipulation of MTA-STS mode.

== Syntax

The file is in YAML syntax with the following elements:

*host*: (_str_) daemon bind address. Default: 127.0.0.1

*port*: (_int_) daemon bind port. Default: 8461

*path*: (_str_) daemon UNIX socket bind address (path). If specified, *host* and *port* are ignored and UNIX socket is bound instead of TCP.

*mode*: (_int_) file mode for daemon UNIX socket. If not specified default filemode is used. This option has effect only when UNIX socket is used. If file mode specified in octal form (most common case), it has to be prepended with leading zero. Example: 0666

*reuse_port*: (_bool_) allow multiple instances to share same port (available on Unix, Windows). Default: true

*cache_grace*: (_float_) age of cache entries in seconds which do not require policy refresh and update. Default: 60

*shutdown_timeout*: (_float_) time limit granted to existing client sessions for finishing when server stops. Default: 20

*cache*::

* *type*: (_str_: _internal_|_sqlite_|_redis_|_redis_sentinel_|postgres) cache backend type. Default: internal
* *options*:
 ** Options for _internal_ type:
  *** *cache_size*: (_int_) number of cache entries to store in memory. Default: 10000
 ** Options for _sqlite_ type:
  *** *filename*: (_str_) path to database file
  *** *threads*: (_int_) number of threads in pool for SQLite connections. Default: number of CPUs
  *** *timeout*: (_float_) timeout in seconds for acquiring connection from pool or DB lock. Default: 5
 ** Options for _redis_ type:
  *** All parameters are passed to `aioredis.from_url` [0]. Check there for a parameter reference.
 ** Options for _redis_sentinel_ type:
  *** *sentinel_master_name*: (_str_) name of the sentinel master
  *** *sentinels*: (_list_)(_tuple_) list of sentinels in form of IP/FQDN and port
  *** All other parameters are passed to `aioredis.sentinel.Sentinel` [1]. For additional details check [2].
 ** Options for _postgres_ type:
  *** *dsn*: (_str_) database connection string

*proactive_policy_fetching*::

* *enabled*: (_bool_) enable proactive policy fetching in the background. Default: false
* *interval*: (_int_) if proactive policy fetching is enabled, it is scheduled every this many seconds.
It is unaffected by `cache_grace` and vice versa. Default: 86400
* *concurrency_limit*: (_int_) the maximum number of concurrent domain updates. Default: 100
* *grace_ratio*: (_float_) proactive fetch for a particular domain is skipped if its cached policy age is less than `interval/grace_ratio`. Default: 2.0

*default_zone*::

* *strict_testing*: (_bool_) enforce policy for testing domains. Default: false
* *timeout*: (_int_) network operations timeout for resolver in that zone. Default: 4
* *require_sni*: (_bool_) add option `servername=hostname` to policy responses to make Postfix send SNI in TLS handshake as required by RFC 8461. Requires Postfix version 3.4+. Default: true
* *tlsrpt*: (_bool_) include response attributes for TLSRPT support (Postfix 3.10 and later). Default: false

*zones*::

* *ZONENAME*:
 ** Same as options in _default_zone_

The timeout is used for the DNS and HTTP requests.

MTA-STS "testing" mode can be interpreted as "strict" mode.  This may be
useful (though noncompliant) in the beginning of MTA-STS deployment, when many
domains operate under "testing" mode.

== Example

 host: 127.0.0.1
 port: 8461
 reuse_port: true
 shutdown_timeout: 20
 proactive_policy_fetching:
   enabled: true
   interval: 86400
   concurrency_limit: 100
   grace_ratio: 2
 cache:
   type: internal
   options:
     cache_size: 10000
 default_zone:
   strict_testing: false
   timeout: 4
 zones:
   myzone:
     strict_testing: false
     timeout: 4

== See also

*mta-sts-daemon*(1), *mta-sts-query*(1)

== Notes

0.::
  https://aioredis.readthedocs.io/en/latest/api/high-level/#aioredis.client.Redis.from_url
1.::
  https://aioredis.readthedocs.io/en/latest/getting-started/#redis-sentinel-client
2.::
  https://redis.readthedocs.io/en/stable/connections.html#sentinel-client
