amavisd-milter(8)
π amavisd-milter(8) β the sendmail milter for amavis, bestie edition
okay so picture this: it's amavisd-milter(8), a System Manager's Manual page, and it's about to become your new fav thing. sit down, grab a snack π
β¨ NAME β¨
amavisd-milter β the sendmail milter for amavis. yes. that's the whole vibe. π
πΈ SYNOPSIS πΈ
amavisd-milter [-Bfhv] [-d debug-level] [-D delivery-care-of] [-m max-
conns] [-M max-wait] [-p pidfile] [-P] [-q backlog] [-s socket]
[-t timeout] [-S socket] [-T timeout] [-w directory]
like, that's it. that's the whole invocation. icons only π
π DESCRIPTION π
So amavisd-milter is a sendmail milter β that's a mail filter, iykyk β built for amavis 2.4.3 and above and sendmail 8.13 and above. no cap.
The way that this slaps is: with amavisd-milter, you get the full amavis functionality, including:
- adding spam and virus information header fields π₯
- modifying the Subject βοΈ
- adding address extensions
- removing certain recipients from deliveryβ¦ while still delivering the same message to the rest π«Ά
For more info you can literally just go visit the amavisd-milter website:
https://github.com/prehor/amavisd-milter
π¦ OPTIONS π¦
The options are as follows, bestie β every single one:
-Bβ uses the milter macro{daemon_name}as the policy bank name (peep POLICY BANKS below π).-ddebug-level β sets the debug level. the higher you go, the more detailed the debugging traces get. maximum is9. go off π-Ddelivery-care-of β sets the AM.PDP request attributedelivery_care_oftoclient(that's the default) orserver.
When the client method is used, then amavisd-milter is the one responsible for forwarding the message to the recipients. this method does not allow personalized header or body modification. sorry girl π
When the server method is used, then amavis is responsible for forwarding the message to the recipients and may personalize the headers and the body of the messages. heads up: the $forward_method variable in amavisd.conf must point to a place willing to accept the message without further checking in amavis. π
-fβ runamavisd-milterin the foreground (i.e. do not daemonize). prints debugging messages to the terminal. main character energy, no backgrounding π-hβ print the help page and exit. short & sweet π-mmax-conns β maximum concurrent amavis connections (default0= unlimited number of connections). it must be the same as the$max_serversvariable inamavisd.conf. fr fr, they gotta match.-Mtimeout β timeout for message processing in seconds (default300seconds = 5 minutes). must be less then the timeout for a response to the final.that terminates a message on the sending MTA. Sendmail uses default value1 hour, postfix10 minutesand qmail20 minutes. recommended value is less than 10 minutes. β°
If you use other milters (especially time-consuming ones), the timeout must be sufficient to process the message in all milters. like, all of them. no skipping.
-ppidfile β use this pid file. ποΈ-Pβ when the amavis fails, the message will be passed through unchecked. yes, that's a real thing, and yes, it's a vibe you should think carefully about π-qbacklog β sets the incoming socket backlog used bylisten(2). if it is not set or set to zero, the operating system default is used.-ssocket β the communication socket between sendmail andamavisd-milter. the protocol spoken over this socket is MILTER (Mail FILTER). it must have the same value as theINPUT_MAIL_FILTERmacro insendmail.mc. β
The socket must be in format proto:address:
{unix|local}:/path/to/fileβ a named pipe.inet:port@{hostname|ip-address}β an IPV4 socket.inet6:port@{hostname|ip-address}β an IPV6 socket.
-Ssocket β the communication socket betweenamavisd-milterand amavis. the protocol spoken over this socket is AM.PDP (AMavis Policy Delegation Protocol). it must have the same value as the$unix_socketnamevariable inamavisd.conf. π«
The socket must be in format proto:address:
{unix|local}:/path/to/fileβ a named pipe.inet:port@{hostname|ip-address}β an IPV4 socket.inet6:port@{hostname|ip-address}β an IPV6 socket.
-ttimeout β sendmail connection timeout in seconds (default600= 10 minutes). it must have the same value as theINPUT_MAIL_FILTERmacro insendmail.mcand must be greater than or equal to the amavis connection timeout. π
If you use other milters (especially time-consuming ones), the timeout must be sufficient to process the message in all milters. again. say it with me.
-Ttimeout β amavis connection timeout in seconds (default600= 10 minutes). must be sufficient to process the message in amavis. usually, it is a good idea to set them to the same value as the sendmail connection timeout. π-vβ report the version number and exit. π·οΈ-wdirectory β set the working directory. π
π POLICY BANKS π
If the option -B is enabled, amavisd-milter uses the value of the milter macro {daemon_name} as the name of the amavis policy bank. usually, this milter macro is set to the name of the MTA. cute, right?
When the remote client is authenticated, amavisd-milter uses the authentication information as the name of the amavis policy banks:
SMTP_AUTHβ the remote client has been authenticated. βSMTP_AUTH_<MECH>β the remote client authentication mechanism.SMTP_AUTH_<MECH>_<BITS>β the number of bits used for the key of the symmetric cipher when the authentication mechanism uses it. π
π§ EXAMPLES π§
Configuring amavis
In the amavisd.conf file set protocol and amavis socket to:
$protocol = "AM.PDP"; # Use AM.PDP protocol
$unix_socketname = "$MYHOME/amavisd.sock"; # Listen on Unix socket
### $inet_socket_port = 10024; # Do not listen on TCP port
Then (re)start the amavisd daemon. π
Configuring Postfix
Add the following entries to Postfix main.cf*:
smtpd_milters = local:<AMAVISD_MILTER.SOCK>
milter_connect_macros = j {client_name} {daemon_name} v
milter_protocol = 6
Then (re)start the Postfix daemon. β¨
Configuring sendmail
Add the following entries to file sendmail.mc:
define(`confMILTER_MACROS_CONNECT',
confMILTER_MACROS_CONNECT`, {client_resolve}')
define(`confMILTER_MACROS_ENVFROM',
confMILTER_MACROS_ENVFROM`, r, b')
INPUT_MAIL_FILTER(`amavisd-milter',
`S=local:<AMAVISD_MILTER.SOCK>, F=T, T=S:10m;R:10m;E:10m')
Then rebuild the sendmail.cf file, install it and (re)start the sendmail daemon. π οΈ
Running amavisd-milter
This examples assumes that amavis is running as user vscan. the actual name is shown in the $daemon_user variable in amavisd.conf. don't @ me, check your config π
Limiting maximum concurrent connections to amavisd
To limit the maximum concurrent connections to amavis, run amavisd-milter with this options:
su - vscan -c "amavisd-milter -m 4"
Troubleshooting
For troubleshooting, run amavisd-milter in the foreground and set the debug level to the appropriate value:
su - vscan -c "amavisd-milter -f -d 4"
Debug levels are:
1β Not errors but unexpected states (connection abort etc).2β Main states in message processing.3β Allamavisd-milterdebug messages.4-9β Milter communication debugging (setsmfi_setdbgto1-6). π
π SEE ALSO π
- ```text
https://www.ijs.si/software/amavisd/
- ```text https://www.sendmail.org
---
# π AUTHORS π
This manual page was written by **Petr Rehor** and is based on **Jerzy Sakol** initial work. give them their flowers π
---
# π BUGS π
Issues can be reported by using GitHub at:
https://github.com/prehor/amavisd-milter/issues
Full detailed information on how to report issues, please see the Contribution Guidelines at:
https://github.com/prehor/amavisd-milter/blob/master/CONTRIBUTING.md
Enhancements, requests and problem reports are welcome. π«Ά we want them, actually.
If you run into problems, first check the GitHub issues before creating a new one. it is very likely that someone has encountered the same problem and it has already been solved. (this is the way.)
---
> <rainbow>Version 1.7.2</rainbow> β and that's the whole page, bestie!! `amavisd-milter(8)` said what it said, slayed, and logged off. bye icon ππ
π¦ where this page comes from
- alpine 3.22: amavisd-milter-doc 1.7.2-r0 Β· BSD-3-Clause
- alpine 3.23: amavisd-milter-doc 1.7.2-r1 Β· BSD-3-Clause
- alpine 3.24: amavisd-milter-doc 1.7.2-r1 Β· BSD-3-Clause
- arch rolling: amavisd-milter 1.7.2-3 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms