SPAMASS-MILTER(1)

πŸ“¦
version 0.4.0 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

🌸 NAME 🌸

okay so bestie, welcome to the spamass-milter manual page πŸ’– β€” this is the sendmail milter for passing emails through SpamAssassin. that's the whole vibe. it sits between sendmail and SpamAssassin and does the filtering thing. iconic behavior, honestly. ✨


πŸ“œ SYNOPSIS πŸ“œ

spamass-milter -p socket [-b|-B spamaddress] [-C -rejectcode]
               [-d debugflags] [-D host] [-e defaultdomain] [-f]
               [-i networks] [-I] [-m] [-M] [-P pidfile] [-r nn]
               [-r -rejectmsg] [-u defaultuser] [-x]
               [-S -/path/to/sendmail] [-- spamc flags ...]

πŸ¦‹ DESCRIPTION πŸ¦‹

so the spamass-milter utility is a sendmail milter β€” a lil middle-man β€” that checks and modifies incoming email messages with SpamAssassin. that's the job. no cap. πŸ’…

the following options are available:

  • -p socket β€” tells it the pathname of a socket to create so it can talk to sendmail. 🫢 important bit: if that socket gets removed, sendmail straight up can't access the milter anymore. and depending on what's in sendmail's .cf file, that can make messages bounce, queue, or just get passed through unmiltered. so like... don't lose the socket. fr fr.
  • -b spamaddress β€” redirects tagged spam to the email address you give it. all envelope recipients get removed, and they get inserted into the message as X-Spam-Orig-To: headers instead. sneaky but documented.
  • -B spamaddress β€” literally the same as -b, except the original recipients are retained. and listen β€” only one of -b and -B may be used. pick a lane bestie. πŸ™ˆ
  • -C rejectcode β€” mail that gets rejected is rejected by default with a 5.7.1 code. this option lets you override that. see also, the -R -S option. πŸ‘‘
  • -d debugflags β€” enables logging. debugflags is a comma-separated list of tokens:
    • func β€” entry and exit of internal functions.
    • misc β€” other non-verbose logging.
    • net β€” lookups of the ignored netblocks list.
    • poll β€” low-level I/O to the child spamc process.
    • rcpt β€” recipient processing.
    • spamc β€” high-level I/O to the child spamc process.
    • str β€” calls to field lookup and string comparison functions.
    • uori β€” calls to the update_or_insert function.
    • 1 β€” (historical) same as func,misc.
    • 2 β€” (historical) same as func,misc,poll.
    • 3 β€” (historical) same as func,misc,poll,str,uori.
  • -D host β€” connects to a remote spamd server on host, instead of using one on localhost.
⚠️ bestie this option is deprecated β€” use -- -d host instead. the glow-up already happened, move on πŸ’…
  • -e defaultdomain β€” passes the full user@domain address to spamc. the default is to pass only the username part, on the assumption that all users are local. this flag is useful if you're using an SQL (or other username) backend with spamassassin and you've listed the full address in there. if the recipient name has no domain part (say, the recipient is on the local machine), then defaultdomain gets added. requires the -u flag. ⭐
  • -f β€” causes spamass-milter to fork into the background. bye bestie, going ghost πŸ‘»
  • -i networks β€” ignores messages if the originating IP is in the network(s) listed. the message gets passed through without calling SpamAssassin at all. networks is a comma-separated list, and each element can be either:
    • an IP address (nnn.nnn.nnn.nnn)
    • a CIDR network (nnn.nnn.nnn.nnn/nn)
    • or a network/netmask pair (nnn.nnn.nnn.nnn/nnn.nnn.nnn.nnn)

multiple -i flags will append to the list. for example, if you list all your internal networks, no outgoing emails will be filtered. πŸŽ€

  • -I β€” ignores messages if the sender has authenticated via SMTP AUTH. trust the homies. 🫢
  • -m β€” disables modification of the Subject: and Content-Type: headers and the message body. this is useful when SpamAssassin is configured with defang_mime 0 and report_header 1, or when SA is simply used to add headers for postprocessing later. heads up: updating the body through the milter interface can be slow for large messages. 😭
  • -M β€” like -m, but it also disables creation of any SpamAssassin X-Spam-* headers as well. both tagged and untagged mail gets passed through unchanged. to actually be useful, this option should be used with the -r, -b, or -B flags. and if -b is used, the X-Spam-Orig-To: headers will still be added. no cap.
  • -P pidfile β€” creates the file pidfile, containing the process id of the milter. so you can find it later. πŸ“
  • -r nn β€” rejects scanned email if it's greater than or equal to nn. if -1, it rejects scanned email if SpamAssassin tags it as spam (useful if you're also using the -u flag and users have changed their required_hits value).

for example, if you usually use procmail to redirect tagged email into a separate folder just in case of false positives, you can use -r 15 and reject flagrant spam outright while still receiving low-scoring messages. πŸ”₯

  • -R rejecttext β€” mail that is rejected is rejected with the message "Blocked by SpamAssassin". this option lets the user call with a different message instead. see also, the -C option.
  • -S /path/to/sendmail β€” this option is used in conjunction with the -x option to specify a path to sendmail if the default compiled-in choice is not satisfactory.
  • -u defaultuser β€” passes the username part of the first recipient to spamc with the -u flag. this is what lets user preferences files get used. if the message is addressed to multiple recipients, the username defaultuser is passed instead.
😭 and here's the messy part: spamass-milter does not know whether an email is incoming or outgoing. so a message from ⟨user1@localdomain.com⟩ to ⟨user2@yahoo.com⟩ will make spamass-milter pass -u user2 to spamc. it's doing its best okay.
  • -x β€” passes the recipient address through sendmail -bv, which will perform virtusertable and alias expansion. the resulting username is then passed to spamc. requires the -u flag. the spamass-milter configuration process does its best to find sendmail, but it is possible to override this compiled-in setting via the

(yeah. the sentence just... ends there. that's the manpage's fault, not mine πŸ’€)

  • -- spamc flags ... β€” passes all remaining options to spamc. this allows you to connect to a remote spamd with -d or -p. go off, king. πŸ‘‘

πŸ“ FILES πŸ“

  • /usr/bin/spamc β€” client interface to SpamAssassin. πŸ¦‹

πŸ‘€ SEE ALSO πŸ‘€

spamassassin(1), spamd(1)


πŸ’œ AUTHORS πŸ’œ

  • Georg C. F. Greve <greve@gnu.org>
  • Dan Nelson <dnelson@allantgroup.com>
  • Todd Kover <kovert@omniscient.com>

and that's the whole page bestie!! πŸŽ€βœ¨ this one came out of Debian, dated July 25, 2001, and it lives in section SPAMASS_MILTER(8) β€” so yeah, it's an old one, but she still serves. periodt. πŸ’…πŸ’–

πŸ“¦ where this page comes from