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.pid
tempdir
: specify path to temporary directory. For maximum performance, it is recommended to put it on memory file system.
$TMPDIR
bind_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)
no
use_dcc
: flag that specify whether we should use DCC checks for mail
no
whitelist
: global recipients whitelist
no
our_networks
: treat mail from these networks as mail from authenticated users (list of ips or nets)
empty
Specifies ClamAV antivirus scanners.
servers
: clamd socket definitions in format:
/path/to/file
host[:port]
Sockets are separated by ,
empty
connect_timeout
: timeout in milliseconds for connecting to clamd
1s
port_timeout
: timeout in milliseconds for waiting for clamd port response
4s
results_timeout
: timeout in milliseconds for waiting for clamd response
20s
error_time
: time in seconds during which we are counting errors
10
dead_time
: time in seconds during which we are thinking that server is down
300
maxerrors
: maximum number of errors that can occur during error_time to make Rmilter thinking that this upstream is dead
10
whitelist
: list of ips or nets that should be not checked with Rspamd
empty
Specifies Rspamd scanners.
servers
: Rspamd socket definitions in format:
/path/to/file
host[:port]
connect_timeout
: timeout in milliseconds for connecting to rspamd
1s
results_timeout
: timeout in milliseconds for waiting for rspamd response
20s
error_time
: time in seconds during which we are counting errors
10
dead_time
: time in seconds during which we are thinking that server is down
300
maxerrors
: maximum number of errors that can occur during error_time to make Rmilter thinking that this upstream is dead
10
reject_message
: reject message for spam (quoted string)
Spam message rejected; If this is not spam contact abuse team
spamd_soft_fail
: if action is not reject use it for other actions (flag)
true
spamd_greylist
: greylist message only if action is greylist (flag)
true
spam_header
: add specified header if action is add_header and spamd_soft_fail os turned on
X-Spam
rspamd_metric
: Rspamd metric that would define whether we reject message as spam or not (quoted string)
default
whitelist
: list of ips, nets or hostnames that should be not checked with Rspamd
empty
extended_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)
false
extended_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)
empty
spamd_never_reject
: never reject a message even if Rspamd action is reject
, add header instead (flag)
false
spamd_temp_fail
: return temporary failure if spam servers could not be reached (ignore otherwise) (flag)
false
spamd_settings_id
: pass additional settings id for Rspamd (e.g. to distinguish inbound and outbound messages)
empty
Defines Redis servers for grey/whitelisting and ratelimits.
servers_grey
: Redis servers for greylisting in format: host[:port][, host[:port]]
.
empty
servers_white
: Redis servers for whitelisting in format similar to that is used in servers_grey
empty
servers_limits
: Redis servers used for limits storing
empty
servers_id
: Redis servers used for storing messages IDs (used in replies checks)
empty
servers_spam
: Redis servers used to broadcast messages that are rejected as spam
empty
servers_copy
: Redis servers used to broadcast copies of messages (amount is defined by copy_probability
)
empty
copy_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
1s
error_time
: time in seconds during which we are counting errors
10
dead_time
: time in seconds during which we are thinking that server is down
300
maxerrors
: maximum number of errors that can occur during error_time to make Rmilter thinking that this upstream is dead
10
It 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
300s
expire
: time during which we save a greylisting record
1d
whitelist
: list of ip addresses or networks that should be whitelisted from greylisting
empty
enable
: enable or disable greylisting (from 1.9.1), binary flag
true
Rate 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
empty
limit_whitelist_rcpt
: don’t check limits for specified recipients
no
limit_bounce_addrs
: list of address that require more strict limits
postmaster, mailer-daemon, symantec_antivirus_for_smtp_gateways, null, fetchmail-daemon
limit_bounce_to
: limits bucket for bounce messages (only rcpt to)
5:0.000277778
limit_bounce_to_ip
: limits bucket for bounce messages (only rcpt to per one source ip)
5:0.000277778
limit_to
: limits bucket for non-bounce messages (only rcpt to)
20:0.016666667
limit_to_ip
: limits bucket for non-bounce messages (only rcpt to per one source ip)
30:0.025
limit_to_ip_from
: limits bucket for non-bounce messages (msg from, rcpt to per one source ip)
100:0.033333333
enable
: enable or disable rate limits (from 1.9.1), binary flag
true
DKIM can be used to sign messages by. DKIM support must be provided by OpenDKIM library.
header_canon
: canonization of headers (simple
or relaxed
)
simple
body_canon
: canonization of body (simple
or relaxed
)
simple
sign_alg
: signature algorithm (sha1
and sha256
)
sha1
auth_only
: sign mail for authorized users only
yes
domain
: 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)
empty
enable
: enable or disable DKIM signing (from 1.9.2), binary flag
true
rspamd_sign
: use rspamd signing instead of the own logic (from 1.10.0)
false