You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 29 Next »

Integrated into several varieties of MTA

Amavisd-new is a high-performance interface between mailer (message transfer agent - MTA) and one or more content checkers: virus scanners, and/or SpamAssassin. It is written entirely in Perl, assuring high reliability, portability and maintainability. It talks to MTA via (E)SMTP or LMTP, or by using helper programs. Best with Postfix, works with Exim, sendmail/milter or with any MTA as a SMTP relay. [http://www.ijs.si/software/amavisd/]

MailScanner now includes support for SpamAssassin. This is "a virus scanner for e-mail designed for use on e-mail gateways. It can also detect a large proportion of unsolicited commercial e-mail (spam) passing through it." [http://www.sng.ecs.soton.ac.uk/mailscanner/]

Another option is to use a filtering SMTP proxy such as spampd. It is typically used to filter the mail between an external-facing MTA instance/relay, and an "internal" MTA instance.
[http://www.worlddesign.com/index.cfm/rd/mta/spampd.htm]

Integrated into Sendmail

With Sendmail, Spamassassin can be called for every user by editing /etc/procmailrc . More details at http://www.stearns.org/doc/spamassassin-setup.current.html#sitewide

An alternative is to use the smtp-vilter high-performance content filter using the sendmail milter API which has a backend for Spamassassins spamd. More details at http://www.msys.ch/products/software/unix/sendmail/smtp-vilter/

MIMEDefang, a sendmail milter written by Roaring Penguin Software, filters all e-mail messages sent via SMTP through a sendmail installation, blocking common mail virii, and now – with the help of SpamAssassin – spam. "You can use SpamAssassin to test for spam, and then all of the MIMEDefang goodies to reject, manipulate or otherwise mangle the message." [http://www.roaringpenguin.com/mimedefang/]

spamass-milt [http://savannah.gnu.org/projects/spamass-milt/] is a sendmail milter by Georg C. F. Greve, which allows sendmail users to filter spam at the heart of the sendmail message pipeline. It also allows SpamAssassin to be used for UUCP sites. If you plan to use this, be sure to read Kevin [McGrail]'s walkthrough at Peregrine Hardware. [http://www.peregrinehw.com/downloads/SpamAssassin/INSTALL-spamassmilter].

milter-spamd [http://www.benzedrine.cx/milter-spamd.html] is a simple BSD-licensed sendmail milter by Daniel Hartmeier.

BSM Development have released [MailCorral] and SpamCorral for use on UNIX and Linux systems, mail/spam filtering software using the sendmail milter interface.
[http://www.bsmdevelopment.com/]

Yet Another Sendmail-SpamAssassin Interface Milter, milter-spamc by Snert [http://www.snert.com/Software/milter-spamc/index.shtml]

Integrated into Postfix

The easiest way to integrate postfix and spamassassin is to use spamd. First, edit master.cf, find the smtp line and just add "-o content_filter=spamassassin" to the end of the line.

Then, go to the end of the file, and add this:

spamassassin unix - n n - - pipe user=nobody argv=/path/to/spamc -f -e /path/to/postfix/sendmail -oi -f ${sender} ${recipient}

Then, setup spamd to start with the system, and you are ready to go. If you wish to provide spamassassin preferences, change "user=nobody" to a valid system user, and add .spamassassin into their home directory.

Alternatively, a more complex scheme is to integrate it using Amavis, as described in IntegratedInPostfixWithAmavis.

Integrated into Qmail

Can be integrated via qmail-scanner, an add-on to qmail. Info available at http://qmail-scanner.sourceforge.net/

This is actually quite easy. SA is auto-detected when you install qmail-scanner, and uses the spamd/spamc combo if available. Here is my configure line (sans private data):

$ ./configure --spooldir /var/lib/qmailscan --qmaildir /var/qmail --bindir /var/qmail/bin \
--qmail-queue-binary /var/qmail/bin/qmail-queue  --admin postmaster@example.com --domain example.com \
--notify none --local-domains example1.com,example3.com,some.other.domain.net --silent-viruses auto \
--lang de_DE --debug 1 --unzip 0 --add-dscr-hdrs 0 --archive 1 --redundant no --log-details \
--fix-mime 1  --scanners "verbose_spamassassin" --install 1

Since qmail allows users to configure their own delivery options via ~/.qmail files, an alternative option, if you have spamd running, is to use [http://www.gbnet.net/~jrg/qmail/ifspamh/ ifspamh], which is a spamc wrapper that you can use as a command in any ~/.qmail file. If the message passed to ifspamh is suspected to be spam, it is redelivered to an address specified as the argument to ifspamh (typically an alias which is handled by another .qmail file). Otherwise, the message is usually allowed to be processed by the next line in the .qmail file. In either case, ~/.spamassassin/user_prefs is honored, and ifspamh returns the proper exit codes required of a command; see dot-qmail(8) and qmail-command(8).

A sample ~/.qmail to test mail to myuserid@myhost with ifspamh, delivering spam to myuserid-spam(@myhost), and feeding non-spam to procmail:

|/usr/local/bin/ifspamh myuserid-spam
|/var/qmail/bin/preline /usr/local/bin/procmail

And a ~/.qmail-spam to handle what gets sent to myuserid-spam:

 /home/myuserid/mail/spambox

Integrated into Exim

SpamAssassin can be integrated into [http://www.exim.org/ Exim] in three ways:

  1. As an [http://duncanthrax.net/exiscan-acl/ Exiscan]-extended ACL condition stack, Exim can reject spam after reading the body, but before Exim acknowledges acceptance of the email. [http://www.debian.org/ Debian Linux]'s exim4-daemon-heavy comes with the exiscan patch built in. You can discover its presence in your distro's exim binary directly with the command exim -bV or exim4 -bV; look for the phrase Contains exiscan-acl patch.

  2. As an Exim 4.x loadable module or local_scan.c replacement. [http://marc.merlins.org/linux/exim/sa.html SA-Exim] also allows SpamAssassin to reject spam before its accepted by your MTA.

  3. As an [http://dman13.dyndns.org/~dman/config_docs/exim-spamassassin/ Exim transport].

Integrated into Courier-MTA

If you use the Courier MTA, you probably also use maildrop. If so, you may follow these steps:

First, install SpamAssassin and Courier MTA according to their installation docs. Make sure they are functioning on their own. You may want to use spamc/spamd for better performance. What's left is the connection between Courier and SpamAssassin.

If you have virtual users (as opposed to plain *nix users), it is vital that you make sure that courier-mta (as well as courier-imap and courier-pop) uses the authdaemon as authentication module. That means that in /etc/courier/esmtpd, imapd and pop3d the variable AUTHMODULES should be set to "authdaemon". Keep in mind that your courier config files may be in another directory. The authdaemon has to be configured to use the right authentication modules (mysql, userdb, whatever). Then patch SpamAssassin according to [http://da.andaka.org/Doku/courier-spamassassin.html] so that SpamAssassin can ask authdaemon for the whereabouts of the maildirs of virtual users (and plain users too — but if you only have plain users, you may skip this step).

To let Courier MTA use maildrop as default for delivery, edit /etc/courier/courierd and set DEFAULTDELIVERY to "| /usr/bin/maildrop" (or whereever your maildrop binary is). Then edit /etc/courier/maildroprc, the central maildrop script:

exception {
        xfilter "/usr/bin/spamc"
}
exception {
        include "$HOME/.mailfilter"
}

Via the xfilter line, maildrop pipes its contents through spamc; via the include line, the user's mailfilter script is called.

There is a rudimentary HOWTO at [http://forums.gentoo.org/viewtopic.php?t=28392 the Gentoo forums] for integrating SpamAssassin and f-prot with Courier-MTA.

There is a HOWTO at [http://da.andaka.org/Doku/imapspamfilter.html] to feed SpamAssassin's bayes filter via Courier-IMAP.

Integrated into CommuniGate Pro

CGPSA external filter: http://www.tffenterprises.com/cgpsa/

CGPAV external filter: http://program.farit.ru/doc/cgpav.html

SpamAssassin plugin for CommuniGate Pro 4.x

Installation and usage instructions can be found at
http://www.stalker.com/CGPSpamCatcher/#Integrate

ftp://ftp.vsu.ru/pub/apps/CGatePro/sa-cgp.c
ftp://ftp.vsu.ru/pub/apps/CGatePro/Mail-SpamAssassin-2.63-ai.diff (required)

Build:
AIX: cc_r sa-cgp.c libspamc.c utils.c -o sa-cgp
Solaris: cc -mt sa-cgp.c libspamc.c utils.c -o sa-cgp -lsocket -lnsl

Integrated into XMail (Unix)

SpamAssassin Filter (sa_filter.pl) is an [http://www.xmailserver.org/ XMail] filter send incoming email messages to SpamAssassin for spam filtering.

sa_filter.pl calls spamc, the SpamAssassin client (spamc calls spamd) and passes the output of spamc back to XMail for delivery. Neither sa_filter.pl nor spamc will delete emails that are flagged as spam.

Please find the filter source code and documentation at [http://www.drakeconsult.com/xmail/ Drake Consulting]

Integrated into Exchange (Windows)

See: http://www.christopherlewis.com/ExchangeSpamAssassin.htm

Notes for MTA-Integration Developers

See MtaIntegrationDevNotes.

  • No labels