spamkiller(1)

NAME
spamkiller - discard messages marked as spam by SpamAssassin

SYNOPSIS
spamkiller [ -dvc=sendcmd -q -r=prefix -s=dirname ]

DESCRIPTION
spamkiller is designed to be inserted in a pipeline immediately after spamc to trap and discard or quarantine messages that SpamAssassin has marked as spam. All other messages are forwarded to the MTA by piping them to sendcmd, a mail delivery agent that forwards them to the MTA.

A message is written to the mail log to indicate whether the mail message was discarded, quarantined or forwarded to the MTA, preceded by lines showing the subject and sender. These are used by the Logwatch skdiscards script to monitor mail messages discarded by spamkiller. Any spamkiller errors are also written to the mail log.

OPTIONS
-?
display summary help for spamkiller
-d
display debugging output. This option may appear twice. Its second appearance causes debugging output to be more verbose.
-c=sendcmd
the mail delivery agent that will be used to forward non-spam to the MTA. If it requires command line arguments, it and the arguments should be enclosed in double quotes.
-q
causes spam to be quarantined rather than discarded.
-q=filename
causes a quarantined message to be stored using filename the supplied name in place of the automatically generated name. This is only intended for regression testing. It should not be used for live operation.
-r
causes an additional message to be written to the mail log listing all the Spamassassin rules that were fired by the mail message. The log message is not written if no rules were fired.
-r=prefix
causes an additional message to be written to the mail log listing all the Spamassassin rules whose names start with prefix that were fired by the mail message. This filter is intended to allow just locally written messages to be monitored. By convention these have a distinctive rule name prefix. If no rules match the filtering prefix then this log message is not output. If more than one -r=prefix option is given, the last one takes precedence. An -r=prefix option always overrides an -r option.
-s=dirname
overrides the name of the directory where quarantined spam is stored. The default is quarantined in the program's current working directory. dirname may also be an absolute or relative path name. If the directory does not exist, it will be created, but this only applies to the final directory on the path: if more than the terminal directory is missing, spamkiller will abandon the run with a diagnostic error.
-v
use verbose output. This causes the arguments to be logged to the maillog before any further processing takes place. It is useful for diagnosing calling problems.

EXIT CODES
If spamkiller terminates successfully, it returns 0 to notify fetchmail that the mail was successfully discarded or forwarded to the MTA.

If spamkiller detects an internal error or the delivery agent failed to deliver the message to the MTA a non-zero termination code whose value identifies the type of error is returned. This notifies fetchmail that the message was not forwarded. Details of the error are sent to the mail log.

EXAMPLE
In this example mail is retrieved from the ISP's mail server with fetchmail which passes it to spamc to determine whether it is spam or not. spamc pipes it to spamkiller which decides what to do with each message. If it is spam it is discarded. Other messages are forwarded to the MTA using sendmail as the delivery agent. The pipeline used by fetchmail to process and forward messages is:

    CMD="sendmail -i "$@" "
    spamc | spamkiller -c="$CMD"

REPORTING
The default installation adds a section to Logwatch which lists any errors reported by spamkiller during normal operation. The logged errors are extracted from the mail log by skerrors, a Perl script. The skerrors.conf file defines it as a Logwatch local service.

BUGS
spamkiller will discard all messages marked as spam including false positives. Additional local SpamAssassin rules can be defined to prevent this happening.