qmail-spamc
Section: User Commands (1)
Index
Return to Main Contents
NAME
qmail-spamc - feed message through SpamAssassin
SYNOPSIS
Can be invoked by
qmail-qfilter
or
qmail-local.
qmail-spamc [-hsr] [-t threshold] [-m message] [/path/to/spamc spamc args]
DESCRIPTION
If the environment variable
QMAILSPAMC
is set and equal to "1",
qmail-spamc
will test the message on stdin for spamishness. stdin must be a seekable file.
If
/path/to/spamc
is provided,
qmail-spamc
will pass the message to
spamc
to determine the spam rating.
qmail-spamc
expects that the first line of output from
spamc
will be of the form x/y. Consequently,
spamc
must be given the
c
or
R
flag.
If
/path/to/spamc
is not provided,
qmail-spamc
will look for the value of the header
X-Spam-Rating
which must be of the form x/y.
qmail-spamc
considers a message spam if the spam rating is
x/y, where x >= y. The following flags determine how
qmail-spamc
deals with a message that is spam.
- -h
-
Adds
X-Spam-Flag,
X-Spam-Level
and
X-Spam-Rating
headers to the message. If
spamc
returns any text after the the first line, the text
is added as a
X-Spam-Report
header. Any existing headers, including
X-Spam-Checker-Version
and
X-Spam-Status,
are deleted.
- -s
-
Inserts the string "[SPAM *]" in the subject field, where the number of
asterisks is determined by the spam rating of the message, up to a
maximum of 10.
- -r
-
The message is rejected if
the spam rating of the message exceeds the reject threshold.
- -t threshold
-
Set the spam rating threshold at which spam is rejected. Default is
infinite.
- -m message
-
If rejected, the string
message
is used in the SMTP reject response. Default is the standard qmail reject
response, "554 mail server permanently rejected message (#5.3.0)".
If
message
is prefixed with
env:,
the rest of the string is treated as the name of an environment variable
that contains the reject response.
If a message is not classified as spam, it will not be modified.
NOTES
The default settings of
SpamAssassin
can take some to process a message. The time can be reduced
(with the loss of some results) by disabling some tests in
local.cf:
-
use_auto_whitelist 0
use_dcc 0
use_pyzor 0
use_razor2 0
use_bayes 0
skip_rbl_checks 1
In addition, the modules loaded by
init.pre
can be disabled by commenting out the load instructions.
USAGE
With
qmail-qfilter:
-
#!/bin/bash
export SPAMREJECT="Mail looks exceedingly spammy"
/path/to/qmail-qfilter \
/path/to/qmail-spamc -h -r -t 50 -m env:SPAMREJECT /path/to/spamc -c
As a delivery instruction for
qmail-local:
-
|/path/to/qmail-spamc -r -t 20 > /dev/null
|/path/to/qmail-spamc -s | forward user@exchange
SEE ALSO
SpamAssassin
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- NOTES
-
- USAGE
-
- SEE ALSO
-
This document was created by
man2html,
using the manual pages.
Time: 09:21:51 GMT, May 04, 2005