spamassassin-milter/spamassassin-milter.8

176 lines
5.1 KiB
Groff

.TH SPAMASSASSIN-MILTER 8 2023-01-29 "SpamAssassin Milter 0.4.0"
.SH NAME
spamassassin-milter \- milter for spam filtering with SpamAssassin
.SH SYNOPSIS
.SY spamassassin-milter
.OP \-a
.OP \-B
.OP \-C CODE
.OP \-H
.OP \-n
.OP \-R MSG
.OP \-r
.OP \-S CODE
.OP \-s BYTES
.OP \-t NETS
.OP \-v
.I SOCKET
.RB [ \-\- ]
.RI [ SPAMC_ARGS ...]
.YS
.SH DESCRIPTION
.B spamassassin-milter
is a milter that filters email through SpamAssassin server using the
.B spamc
client.
It reads the response from SpamAssassin and adds its diagnostic
.B X-Spam-
headers to the message, and can optionally apply header and body rewriting to
messages flagged as spam, or reject such messages at the SMTP level.
A message “flagged as spam” is a message with a header
.BR "X-Spam-Flag: YES" .
.PP
The mandatory
.I SOCKET
argument specifies the listening socket to open.
.I SOCKET
can be either an IPv4/IPv6 TCP socket in the form
.BI inet: HOST : PORT
(for example,
.BR inet:localhost:3000 )
or a UNIX domain socket in the form
.BI unix: PATH
(for example,
.BR unix:/run/spamassassin-milter.sock ).
After the options and argument, the remaining arguments
.I SPAMC_ARGS
(optionally preceded by
.BR \-\- )
are gathered as arguments to pass to the
.B spamc
invocation.
.B spamassassin-milter
uses sensible defaults and if run with no options, will apply modifications
received from SpamAssassin server.
.PP
.B spamassassin-milter
is a light-weight integration component, enabling use of SpamAssassin with a
milter-capable MTA.
Users are advised to familiarize themselves with the setup and configuration
options of the components involved, namely, the SpamAssassin programs
.B spamd
(SpamAssassin server) and
.BR spamc ,
and the MTA (usually Postfix).
.SH OPTIONS
.TP
.BR \-a ", " \-\-auth-untrusted
Treat authenticated senders as untrusted.
If this option is not used, authenticated senders are trusted, and their
messages are not processed with SpamAssassin.
.TP
.BR \-n ", " \-\-dry-run
Process messages normally, but do not take action or apply any modifications.
Combined with
.BR \-\-verbose ,
this gives insight into what would happen if run without
.BR \-\-dry-run .
.TP
.BR \-h ", " \-\-help
Print usage information.
.TP
.BR \-s " \fIBYTES\fR, " \-\-max-message-size " \fIBYTES\fR"
Maximum message size in bytes to pass to
.BR spamc .
.I BYTES
should be equal to the max size configured for
.B spamc
(option
.BR \-\-max-size );
these two settings are designed to be in sync.
Messages with a size exceeding the maximum message size are not processed with
SpamAssassin.
Defaults to the
.B spamc
default,
.BR 512000 .
.TP
.BR \-B ", " \-\-preserve-body
Suppress rewriting of spam message body.
If this option is not used, the message body of messages flagged as spam is
replaced with the body received from SpamAssassin (as are the values of related
headers
.B MIME-Version
and
.BR Content-Type ,
if necessary).
.TP
.BR \-H ", " \-\-preserve-headers
Suppress rewriting of headers
.BR Subject ,
.BR From ,
and
.B To
of spam messages.
If this option is not used, these headers of messages flagged as spam will have
their values replaced with the values received from SpamAssassin, if necessary.
.TP
.BR \-r ", " \-\-reject-spam
Reject messages flagged as spam at the SMTP level.
Rejection results in a permanent or transient SMTP error reply being returned to
the client, and the message is not delivered.
.TP
.BR \-C " \fICODE\fR, " \-\-reply-code " \fICODE\fR"
Reply with SMTP reply code
.I CODE
when rejecting a message flagged as spam.
.I CODE
must be either a permanent (5XX) or transient (4XX) error reply code, and must
agree in the first digit with the enhanced status code
.RB ( \-\-reply-status-code ).
The default reply code is 550.
.TP
.BR \-S " \fICODE\fR, " \-\-reply-status-code " \fICODE\fR"
Reply with enhanced status code
.I CODE
when rejecting a message flagged as spam.
.I CODE
must be an enhanced status code per RFC 3463, indicating either permanent
(5.X.X) or transient (4.X.X) failure, and must agree in the first digit with the
SMTP reply code
.RB ( \-\-reply-code ).
The default enhanced status code is 5.7.1.
.TP
.BR \-R " \fIMSG\fR, " \-\-reply-text " \fIMSG\fR"
Reply with SMTP reply text
.I MSG
when rejecting a message flagged as spam.
For multiline replies, use an ASCII newline character as the line separator.
The default reply text is “Spam message refused”.
.TP
.BR \-t " \fINETS\fR, " \-\-trusted-networks " \fINETS\fR"
Trust connections coming from the IP networks or addresses
.IR NETS .
Connections from IP addresses contained in trusted networks are not processed
with SpamAssassin.
.I NETS
must be a comma-separated list of IP network addresses, for example,
.BR ::1/128,127.0.0.0/8,192.168.1.39 .
If
.I NETS
is empty, no IP addresses are trusted.
This option may be given multiple times.
If this option is not used, all connections from loopback addresses are trusted.
.TP
.BR \-v ", " \-\-verbose
Enable verbose operation logging.
If this option is not used, only unexpected error conditions are logged (that
is, printed to standard error).
.TP
.BR \-V ", " \-\-version
Print version information.
.SH SEE ALSO
.BR spamassassin (1),
.BR spamc (1),
.BR Mail::SpamAssassin::Conf (3),
.BR spamd (8)