MILTER-SPAMD(8)

NAME
milter-spamd - sendmail milter plugin for SpamAssassin spamd

SYNOPSIS
milter-spamd [-d] [-i RE] [-p pipe] [-u user] [-U spamd-user]

DESCRIPTION
The milter-spamd plugin can be used with the milter API of sendmail(8) to filter mails based on decisions from SpamAssassin's spamd(1) daemon. Mails are piped to the daemon, which decides whether a mail is spam or not according to its own configuration. Spam mails are rejected with an SMTP 554 ("Transaction failed") reply, containing the score from spamd. This typically causes the remote MTA to generate a bounce message to the sender. Non-spam mails are accepted without any modifications.

The options are as follows:

-d  Do not detach from controlling terminal. Produce verbose output on stdout for debugging.

-i RE
    Accept mails without invoking spamd for peers whose host names or IP addresses match the specified regular expression. The argument is a case-insensitive extended regular expression (like an argument of egrep(1) -i). Example:

        # milter-spamd -i '(^127\.|^10\.1\.|\.benzedrine\.cx$)'

    would skip filtering for senders whose host names end in .benzedrine.cx or whose IP addresses start with 127. or 10.1.

-p pipe
    Use the specified pipe to interface sendmail(8). Default is unix:/var/spool/milter-spamd/sock.

-u user
    Run as the specified user instead of the default, _milter-spamd. When milter-spamd is started as root, it calls setuid(2) to drop privileges. The non-privileged user should have read access to the configuration file and read-write access to the pipe.

-U spamd-user
    Pass the specified user to spamd, so that user's SpamAssassin settings are used instead of the default system-wide ones.

SENDMAIL CONFIGURATION
The plugin needs to be registered in the sendmail(8) configuration, by adding the following lines to the .mc file

    INPUT_MAIL_FILTER(`milter-spamd',
    	`S=unix:/var/spool/milter-spamd/sock, T=S:30s;R:2m')

rebuilding /etc/mail/sendmail.cf from the .mc file using m4(1), and restarting sendmail(8).

LOGGING
milter-spamd sends log messages to syslogd(8) using facility daemon and, with increasing verbosity, level err, notice, info and debug. The following syslog.conf(5) section can be used to log messages to a dedicated file:

    !milter-spamd
    daemon.err;daemon.notice	/var/log/milter-spamd

SEE ALSO
egrep(1), mailstats(1), regex(3), syslog.conf(5), re_format(7), sendmail(8), syslogd(8) Simple Mail Transfer Protocol, RFC 2821. Enhanced Mail System Status Codes, RFC 1893.

HISTORY
The first version of milter-spamd was written in 2004.

AUTHORS
Daniel Hartmeier <daniel@benzedrine.cx>