clamav-milter.conf(5)
π clamav-milter.conf π
okay bestie, gather round, because this is the manual page for clamav-milter.conf(5) β aka the config file situation for the Clam AntiVirus milter. no cap, it's shorter than you think and honestly kinda iconic. let's get into it π¦
β¨ NAME β¨
clamav-milter.conf β the configuration file for clamav-milter. that's it. that's the name. short, sweet, slays π
πΈ DESCRIPTION πΈ
clamav-milter.conf contains the configuration options for clamav-milter(8). like, every knob you can turn lives in here. periodt.
π FILE FORMAT π
the file is just comments and options-with-arguments, bestie. super simple:
- any line that starts with a hash (
#) is straight-up ignored by the parser. it's giving "not my problem" energy π - options and their arguments are case sensitive and look like
Option Argument
the arguments come in these flavors:
BOOLβ a Boolean value, soyes/noortrue/falseor1/0. pick your fighter.STRINGβ a string with no blank characters in it. none. zero. nope.SIZEβ a size in bytes. you can use'M'or'm'modifiers for megabytes and'K'or'k'for kilobytes πNUMBERβ an unsigned integer. no negatives, we don't do that here.
π MAIN OPTIONS π
Exampleβ if this option is set,clamav-milterwill not run. yes bestie, that's literally what it says πMilterSocket STRINGβ defines the interface we use to talk to sendmail. this option is mandatory! (like, no really, you cannot skip it π₯) possible formats are:
[[unix|local]:]/path/to/file - to specify a unix domain socket
inet:port@[hostname|ip-address] - to specify an ipv4 socket
inet6:port@[hostname|ip-address] - to specify an ipv6 socket
Default: unset
MilterSocketGroup STRINGβ sets the group ownership for the (unix) milter socket. Default:disabled(the primary group of the user runningclamd)MilterSocketMode STRINGβ sets the permissions on the (unix) milter socket to the mode you specify. Default:disabled(obey umask)FixStaleSocket BOOLβ removes the stale socket after an unclean shutdown. tidy queen behavior β¨ Default:yesUser STRINGβ run as another user. heads up:clamav-miltermust be started by root for this option to actually work. Default:unset(don't drop privileges)ReadTimeout NUMBERβ waiting for data fromclamdwill time out after this many seconds. clock's ticking β° Default:120Foreground BOOLβ don't fork into the background. stay right here with me. Default:noChroot STRINGβ chroot to the specified directory. the chrooting happens just after reading the config file and before dropping privileges. Default:unset(don't chroot)PidFile STRINGβ write the daemon's pid to the specified file. Default:disabledTemporaryDirectory STRINGβ optional path to the global temporary directory. Default: system specific (usually/tmpor/var/tmp).
π¦ CLAMD OPTIONS π¦
ClamdSocket STRINGβ defines theclamdsocket to connect to for scanning. this option is mandatory! syntax goes like this:
ClamdSocket unix:path
ClamdSocket tcp:host:port
the first syntax specifies a local unix socket (it needs an absolute path), e.g.:
ClamdSocket unix:/run/clamav/clamd.sock
the second syntax specifies a tcp local or remote tcp socket: the host can be a hostname or an ip address; the ":port" field is only required for IPv6 addresses, otherwise it defaults to 3310, e.g.:
ClamdSocket tcp:192.168.0.1
this option can be repeated several times with different sockets, or even with the same socket: clamd servers will be selected in a round-robin fashion π Default: no default
π EXCLUSIONS π
LocalNet STRINGβ messages originating from these hosts/networks will not be scanned. this option takes a host(name)/mask pair in CIRD notation and can be repeated several times. if"/mask"is omitted, a host is assumed. to specify a locally originated, non-smtp, email, use the keyword"local". Default:unset(scan everything regardless of the origin)AllowList STRINGβ this one specifies a file containing a list of basic POSIX regular expressions. addresses (sent to or from β see below) that match these regexes will not be scanned. optionally, each line can start with the string"From:"or"To:"(note: no whitespace after the colon) indicating whether it's, respectively, the sender or the recipient that is to be allowed. if the field is missing,"To:"is assumed. lines starting with#,:or!are ignored. Default:unset(no exclusion applied)SkipAuthenticated STRINGβ messages from authenticated SMTP users matching this extended POSIX regular expression (egrep-like) will not be scanned. as an alternative, a file containing a plain (not regex) list of names (one per line) can be specified using the prefix"file:", e.g.SkipAuthenticated file:/etc/good_guys. Note: this is the AUTH login name! Default:unset(no allowing based on SMTP auth)MaxFileSize SIZEβ messages larger than this value won't be scanned. make sure this value is lower or equal thanStreamMaxLengthinclamd.confβ οΈ Default:100M
π ACTIONS π
this next group of options controls the delivery process under different circumstances. here's the menu of actions you can pick from:
- Accept: the message is accepted for delivery β
- Reject: immediately refuse delivery (a
5xxerror is returned to the peer) - Defer: return a temporary failure message (
4xx) to the peer - Blackhole (not available for
OnFail): like Accept but the message is sent to oblivion π³οΈ - Quarantine (not available for
OnFail): like Accept but the message is quarantined instead of being delivered. NOTE: in Sendmail the quarantine queue can be examined viamailq -qQ. for Postfix this causes the message to be placed on hold.
okay now the actual options:
OnClean STRINGβ action to be performed on clean messages (mostly useful for testing π§ͺ) Default:AcceptOnInfected STRINGβ action to be performed on infected messages. Default:QuarantineOnFail STRINGβ action to be performed on error conditions. and bestie, "error conditions" is doing a LOT of heavy lifting here: this includes failure to allocate data structures, no scanners available, network timeouts, unknown scanner replies and the like π Default:DeferRejectMsg STRINGβ this option lets you set a specific rejection reason for infected messages, so it's therefore only useful together with"OnInfected Reject". the string"%v", if present, will be replaced with the virus name. Default: MTA specificAddHeader STRINGβ if this option is set to"Replace"(or"Yes"), an"X-Virus-Scanned"and an"X-Virus-Status"header will be attached to each processed message, possibly replacing existing headers. if it's set toAdd, the X-Virus headers are added, possibly on top of the existing ones. note that while"Replace"can potentially break DKIM signatures,"Add"may confuse procmail and similar filters. pick your chaos π«Ά Default:noReportHostname STRINGβ whenAddHeaderis in use, this option lets you set the reported hostname. this may be desirable in order to avoid leaking internal names π if unset, the real machine name is used. Default:disabledVirusAction STRINGβ execute a command (possibly searchingPATH) when an infected message is found. the following parameters are passed to the invoked program, in this order: virus name, queue id, sender, destination, subject, message id, message date.- Note #1: this requires MTA macroes to be available (see
LogInfectedbelow). - Note #2: the process is invoked in the context of
clamav-milter. - Note #3:
clamav-milterwill wait for the process to exit. be quick or fork to avoid unnecessary delays in email delivery. no pressure tho π₯ Default:disabled
- Note #1: this requires MTA macroes to be available (see
β LOGGING OPTIONS β
LogFile STRINGβ enable logging to the selected file. Default:noLogFileUnlock BOOLβ disable a system lock that protects against runningclamdwith the same configuration file multiple times. Default:noLogFileMaxSize SIZEβ limit the size of the log file. the logger will be automatically disabled if the file is greater thanSIZE. a value of0disables the limit. Default:1MLogTime BOOLβ log time for each message. timestamps, bestie β±οΈ Default:noLogSyslog BOOLβ use the system logger (can work together withLogFile). Default:noLogFacility STRINGβ specify the type of syslog messages. please refer toman syslogfor facility names. Default:LOG_LOCAL6LogVerbose BOOLβ enable verbose logging. yap yap yap π£οΈ Default:noLogInfected STRINGβ this option lets you tune what is logged when a message is infected. possible values areOff(the default β nothing is logged),Basic(minimal info logged),Full(verbose info logged). Note: for this to work properly in sendmail, make sure themsg_id,mail_addr,rcpt_addrandimacroes are available ineom. in other words, add a line like:
Milter.macros.eom={msg_id}, {mail_addr}, {rcpt_addr}, i
to your .cf file. alternatively use the macro:
define(`confMILTER_MACROS_EOM', `{msg_id}, {mail_addr}, {rcpt_addr}, i')
Postfix should be working fine with the default settings. Default: disabled
LogClean STRINGβ this option lets you tune what is logged when no threat is found in a scanned message. seeLogInfectedfor possible values and caveats. useful in debugging but drastically increases the log size π¬ Default:disabledSupportMultipleRecipients BOOLβ this option affects the behaviour ofLogInfected,LogCleanandVirusActionwhen a message with multiple recipients is scanned:- if
SupportMultipleRecipientsis off (the default), then one single log entry is generated for the message and, in case the message is determined to be malicious, the command indicated byVirusActionis executed just once. in both cases, only the last recipient is reported. - if
SupportMultipleRecipientsis on, then one line is logged for each recipient and the command indicated byVirusActionis also executed once for each recipient. - Note: although it's probably a good idea to enable this option, the default value is currently set to
offfor legacy reasons. (legacy reasons, the eternal excuse π) Default:no
- if
π§ NOTES π§
all options expressing a size are limited to a max of 4GB. values in excess will be reset to the maximum. so don't try it, the cap is capping π
π FILES π
/etc/clamav/clamav-milter.conf
π AUTHOR π
aCaB <acab@clamav.net>
π₯ SEE ALSO π₯
clamav-milter(8), clamd(8), clamd.conf(5)
and that's the whole page, bestie, you ate it up π this one's from ClamAV 1.5.4, dated Feb 25, 2009 β iconic since day one, and honestly? still serving. mwah π β¨π
π¦ where this page comes from
- arch rolling: clamav 1.5.4-1 Β· GPL-2.0-only
- nixpkgs unstable: clamav 1.5.4
- ubuntu jammy: clamav-milter 1.5.4+dfsg-0ubuntu0.22.04.1 Β· GPL-2.0-only
- ubuntu noble: clamav-milter 1.5.4+dfsg-0ubuntu0.24.04.1 Β· GPL-2.0-only
- ubuntu resolute: clamav-milter 1.5.4+dfsg-0ubuntu0.26.04.1 Β· GPL-2.0-only
- ubuntu stonking: clamav-milter 1.5.4+dfsg-0ubuntu1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms