This document describes Rmilter configuration options.
The configuration file has format:
name = value ;
Value may be:
yes/no or true/false)127.0.0.1, 192.168.1.0/24, [::1]/128, "example.com", "example.com/24"). Please note that hostnames must be enclosed in double quotes. If a hostname has multiple IP addresses they all will be added to the list.host:port or /path/to/socket or fd:3 for systemd socket)value1, value2, value3)user, user@domain, @domain)10s, 5d)Some directives MUST be specified only in specified sections. Section definition looks like:
section_name {
section_directive;
...
}
Directives that can be defined in configuration file:
Defines global options.
pidfile: specify path to pidfile
/var/run/rmilter.pidtempdir: specify path to temporary directory. For maximum performance, it is recommended to put it on memory file system.
$TMPDIRbind_socket: socket credits for local bind:
bind_socket = unix:/var/tmp/rmilter.sock
unix:/path/to/file - bind to local socketinet:[port@host] - bind to inet socketmax_size: maximum size of scanned message for ClamAV, Rspamd and DCC.
0 (no limit)strict_auth: strict checks for mails from authenticated senders (if it is no then messages originated from authenticated users and our_networks are NOT checked - that’s a default value)
nouse_dcc: flag that specify whether we should use DCC checks for mail
nowhitelist: global recipients whitelist
noour_networks: treat mail from these networks as mail from authenticated users (list of ips or nets)
emptySpecifies ClamAV antivirus scanners.
servers: clamd socket definitions in format:
/path/to/filehost[:port]
Sockets are separated by ,
emptyconnect_timeout: timeout in milliseconds for connecting to clamd
1sport_timeout: timeout in milliseconds for waiting for clamd port response
4sresults_timeout: timeout in milliseconds for waiting for clamd response
20serror_time: time in seconds during which we are counting errors
10dead_time: time in seconds during which we are thinking that server is down
300maxerrors: maximum number of errors that can occur during error_time to make Rmilter thinking that this upstream is dead
10whitelist: list of ips or nets that should be not checked with Rspamd
emptySpecifies Rspamd scanners.
servers: Rspamd socket definitions in format:
/path/to/filehost[:port]connect_timeout: timeout in milliseconds for connecting to rspamd
1sresults_timeout: timeout in milliseconds for waiting for rspamd response
20serror_time: time in seconds during which we are counting errors
10dead_time: time in seconds during which we are thinking that server is down
300maxerrors: maximum number of errors that can occur during error_time to make Rmilter thinking that this upstream is dead
10reject_message: reject message for spam (quoted string)
Spam message rejected; If this is not spam contact abuse teamspamd_soft_fail: if action is not reject use it for other actions (flag)
truespamd_greylist: greylist message only if action is greylist (flag)
truespam_header: add specified header if action is add_header and spamd_soft_fail os turned on
X-Spamrspamd_metric: Rspamd metric that would define whether we reject message as spam or not (quoted string)
defaultwhitelist: list of ips, nets or hostnames that should be not checked with Rspamd
emptyextended_spam_headers: add extended Rspamd headers to messages NOT originated from authenticated users or our_networks, is useful for debugging or private mail servers (flag)
falseextended_headers_rcpt: add extended Rspamd headers to messages if EVERY envelope recipient match this list (e.g. a list of domains mail server responsible for) (from 1.10.0, recipients list)
emptyspamd_never_reject: never reject a message even if Rspamd action is reject, add header instead (flag)
falsespamd_temp_fail: return temporary failure if spam servers could not be reached (ignore otherwise) (flag)
falsespamd_settings_id: pass additional settings id for Rspamd (e.g. to distinguish inbound and outbound messages)
emptyDefines Redis servers for grey/whitelisting and ratelimits.
servers_grey: Redis servers for greylisting in format: host[:port][, host[:port]].
emptyservers_white: Redis servers for whitelisting in format similar to that is used in servers_grey
emptyservers_limits: Redis servers used for limits storing
emptyservers_id: Redis servers used for storing messages IDs (used in replies checks)
emptyservers_spam: Redis servers used to broadcast messages that are rejected as spam
emptyservers_copy: Redis servers used to broadcast copies of messages (amount is defined by copy_probability)
emptycopy_probability: a number that defines average amount of messages being copied to servers_copy, should be in range from 0.0 to 1.0 (e.g. 0.5 means that half of messages are copied in average)
1.0 - copy all if servers_copy is setconnect_timeout: timeout in milliseconds for connecting to redis-server
1serror_time: time in seconds during which we are counting errors
10dead_time: time in seconds during which we are thinking that server is down
300maxerrors: maximum number of errors that can occur during error_time to make Rmilter thinking that this upstream is dead
10It is also possible to set DB number and password for Redis:
dbname: number of Redis database (see Redis documentation for details), should be quoted string (e.g. dbname = "3";)password: password to access Redis, quoted stringRmilter can also set custom prefixes for the keys pushed into Redis:
grey_prefix: used for greylisting recordswhite_prefix: used to whitelist records after greylistingid_prefix: used to store message idsCopying messages to Pub/Sub channels also requires to setup channels in Redis:
spam_channel: channel for spam messagescopy_channel: channel for copiesGreylisting related options.
timeout: time during which we mark message greylisted
300sexpire: time during which we save a greylisting record
1dwhitelist: list of ip addresses or networks that should be whitelisted from greylisting
emptyenable: enable or disable greylisting (from 1.9.1), binary flag
trueRate limits are implemented as leaked bucket, so first value is bucket burst - is peak value for messages in bucket (after reaching it bucket is counted as overflowed and new messages are rejected), second value is rate (how much messages can be removed from bucket each second). It can be schematically displayed as following:

limit_whitelist_ip: don’t check limits for specified ips, networks or hostnames
emptylimit_whitelist_rcpt: don’t check limits for specified recipients
nolimit_bounce_addrs: list of address that require more strict limits
postmaster, mailer-daemon, symantec_antivirus_for_smtp_gateways, null, fetchmail-daemonlimit_bounce_to: limits bucket for bounce messages (only rcpt to)
5:0.000277778limit_bounce_to_ip: limits bucket for bounce messages (only rcpt to per one source ip)
5:0.000277778limit_to: limits bucket for non-bounce messages (only rcpt to)
20:0.016666667limit_to_ip: limits bucket for non-bounce messages (only rcpt to per one source ip)
30:0.025limit_to_ip_from: limits bucket for non-bounce messages (msg from, rcpt to per one source ip)
100:0.033333333enable: enable or disable rate limits (from 1.9.1), binary flag
trueDKIM can be used to sign messages by. DKIM support must be provided by OpenDKIM library.
header_canon: canonization of headers (simple or relaxed)
simplebody_canon: canonization of body (simple or relaxed)
simplesign_alg: signature algorithm (sha1 and sha256)
sha1auth_only: sign mail for authorized users only
yesdomain: domain entry must be enclosed in a separate section
key - path to private keydomain - domain to be used for signing (this matches with SMTP FROM data). If domain is * then Rmilter tries to search key in the key path as keypath/domain.selector.key for any domain.selector - dkim DNS selector (e.g. for selector dkim and domain example.com DNS TXT record should be for dkim._domainkey.example.com).sign_networks - specify internal networks to perform signing as well (hostnames could also be used)
emptyenable: enable or disable DKIM signing (from 1.9.2), binary flag
truerspamd_sign: use rspamd signing instead of the own logic (from 1.10.0)
false