<?xml version="1.0" ?>
<?xml-stylesheet href="/data/www.rudedog.org/docs/styles/document.xsl" type="text/xsl" ?>
<!DOCTYPE document SYSTEM "/share/www-lib/xml/dtd/document.dtd">
<!--
      $Id: index.xml,v 1.2 2002/04/28 21:36:45 dave Exp $
      $Source: /var/cvs/www/www/docs/assassind/index.xml,v $
      Copyright (c) 2002 Dave Carrigan
-->

<document title="Assassind" copyyears="2002">
  <section title='Warning'>
    <p>Note that under some circumstances, assassind can drop mail. As such, I do not recommend that it be used in a high-volume production environment. For a personal or small office server, it may be appropriate, but I would recommend a different approach for anything that is even moderately busy. One option is <link href='http://www.wdg.us/Content/rd/mta/spampd/spampd.html'>spampd</link>, which was inspired by assassind.
    </p>
  </section>
  <section title="Introduction" id="intro">
    <p>
      <object type='program' class='unix' value='assassind'/> is a SMTP
      mail relay that uses the <link
      href="http://spamassassin.org/">SpamAssassin</link> mail filtering
      system to flag messages as spam. It is meant to be used as a
      system-wide mail processor, especially on sites with multiple
      users who may have different requirements for filtering their
      spam. As such, it doesn't make any changes to message contents, or
      to a message's existing headers. Instead, it simply adds its own
      set of headers that users can then use in their message filtering
      systems (i.e., <link
      href="http://www.procmail.org/">procmail</link> or <link
      href="http://www.cyrusoft.com/sieve/">sieve</link>).
    </p>
  </section>

  <section title="Downloading and Installation" id="install">
    <section title="Debian GNU/Linux Users" id="debianinst">
      <p>
	If you are a <link href="http://www.debian.org/">Debian
	  GNU/Linux</link> user, simply add the following line to your
	<object type="unix" class="file" value="/etc/apt/sources.list"/>
	file, and install the <object type="unix" class="module"
	value="assassind"/> package.
      </p>
      <code>
deb http://www.rudedog.org/ debian/
      </code>

    </section>

    <section title="All Others" id="otherinst">
      <p>
	<object type='program' class='unix' value='assassind'/> is a
	standard Perl script, and is available
	<link href="assassind">here</link>. The latest version is 1.0.9.
      </p>

      <p>
	In addition to the script, you need the following Perl packages:
      </p>
      <list type="bullet">
	<item>
	  <p>
	    <link href="http://spamassassin.org/">SpamAssassin</link>,
	    natch.
	  </p>
	  <p>
	    The <link
	    href="http://www.perl.com/CPAN/modules/by-module/Mail/">Mail-Audit</link>
	    package, which allows you to do all kinds of auditing on
	    mail messages. If you're using any SpamAssassin scripts, you
	    probably already have this package.
	  </p>
	  <p>
	    The <link
	    href="http://www.perl.com/CPAN/modules/by-module/Error/">Error</link>
	    package. This module lets Perl programs do exception
	    handling in a OO-ish way.
	  </p>
	  <p>
	    The <link
	    href="http://www.perl.com/CPAN/modules/by-module/Net/">Net-Server</link>
	    package, a fantastic module for creating network servers in
	    Perl.
	  </p>
	  <p>
	    The <link
	    href="http://www.perl.com/CPAN/modules/by-module/Net/">SMTP-Server</link>
	    module, by which implements a SMTP server.
	  </p>
	  <p>
	    The <link
	    href="http://www.perl.com/CPAN/modules/by-module/Net/">libnet</link>
	    package, used to implement a SMTP client.
	  </p>
	</item>
      </list>
    </section>
  </section>

  <section title="What It Does" id="whatitdoes">
    <p>
      When <object type='program' class='unix' value='assassind'/> runs,
      it makes no changes to the message or its existing
      headers. Instead, it adds the following headers.
    </p>
    <section title="X-Spam-Color" id="xspamcolor">
      <p>
	This header contains a single color, which represents the
	likelihood that the message is spam. It uses the colors green,
	blue, yellow, orange, and red. Green mail is probably not spam,
	while red mail is so likely to be spam that you probably don't
	even have to look at it. If you live in the USA, these color
	choices <link
	href="http://www.whitehouse.gov/news/releases/2002/03/20020312-1.html">may
	be familiar</link>.
      </p>   
    </section>

    <section title="X-Spam-Status" id="xspamstatus">
      <p>
	This header is text of the form <emph>X-Spam-Status: Yes/No,
	hits=n required=n=list_of_matching_tests</emph>. This is a
	standard SpamAssassin header. Hits is the number of spam tests
	that matched (i.e., the message's total spam score). Required is
	the number of tests required for SpamAssassin to flag the
	message as spam. Finally, tests is the list of tests that
	passed.
      </p>
    </section>

    <section title="X-Spam-Report" id="xspamreport">
      <p>
	Finally, <object type='program' class='unix' value='assassind'/> adds one or more of these headers that provide a
	verbose report from SpamAssassin about the message. This header
	is mostly for your information. These headers are only added if
	SpamAssassin believes that the message is spam. This is typically
	when the message has a score greater than five.
      </p>
    </section>

    <p>
      Here are some sample headers from a recent spam message that I
      received that was offering me a free credit report.
    </p>
    <code>
X-Spam-Color: yellow
X-Spam-Status: Yes, hits=6.60 required=5.00 tests=NO_REAL_NAME,PLING,CLICK_BELOW,EXCUSE_14,CALL_FREE,CLICK_HERE_LINK
X-Spam-Report: 
X-Spam-Report: SPAM: -------------------- Start SpamAssassin results ----------------------
X-Spam-Report: SPAM: This mail is probably spam.  The original message has been altered
X-Spam-Report: SPAM: so you can recognise or block similar unwanted mail in future.
X-Spam-Report: SPAM: See http://spamassassin.org/tag/ for more details.
X-Spam-Report: SPAM: 
X-Spam-Report: SPAM: Content analysis details:   (6.6 hits, 5 required)
X-Spam-Report: SPAM: Hit! (0.6 points)  From: does not include a real name
X-Spam-Report: SPAM: Hit! (0.5 points)  Subject has an exclamation mark
X-Spam-Report: SPAM: Hit! (1.5 points)  BODY: Asks you to click below
X-Spam-Report: SPAM: Hit! (1.1 points)  BODY: Tells you how to stop further SPAM
X-Spam-Report: SPAM: Hit! (1.1 points)  BODY: Contains a tollfree number
X-Spam-Report: SPAM: Hit! (1.8 points)  BODY: Tells you to click on a URL
X-Spam-Report: SPAM: 
X-Spam-Report: SPAM: -------------------- End of SpamAssassin results ---------------------
    </code>
  </section>

  <section title="Operation" id="operation">
    <p>
      There are a number of different ways to configure <object
      type='program' class='unix' value='assassind'/>. This section
      describes three common scenarios.
    </p>

    <section title="Running Between your Firewall and your Mail Server" id="scenario1">
      <image source="scenario1.png" description="Network diagram of scenario 1" width="648" height="220"/>
    </section>
    <p>
      In this scenario, the firewall accepts SMTP connections from the
      Internet, and is configured as a mail relay that forwards all
      messages to the system running <object type='program' class='unix' value='assassind'/>. <object type='program' class='unix' value='assassind'/> could be
      running on the same system as the mail server (but on a different
      port), or it could be running on a different system. <object type='program' class='unix' value='assassind'/>'s
      default operation assumes that it is running on port 2025 and on
      the same system as the mail server.
    </p>

    <p>
      If <object type='program' class='unix' value='assassind'/> and
      your mail server are on the same system, simply start <object
      type='program' class='unix' value='assassind'/> with the following
      command:
    </p>
    <code>
assassind
    </code>

    <p>
      If <object type='program' class='unix' value='assassind'/> is on a
      different system, start <object type='program' class='unix'
      value='assassind'/> with the following command:
    </p>

    <code>
assassind --relayhost=mailserver.dom.ain
    </code>

    <section title="Running on the Firewall With an Internal Mail Server" id="scenario2">
      <image source="scenario2.png" description="Network diagram of scenario 2" width="573" height="170"/>
      <p>
	In this scenario, the firewall itself is running <object type='program' class='unix' value='assassind'/>. It
	accepts messages on port 25 and forwards them to the mail
	server, which also listens on port 25. There are some drawbacks
	to this method:
      </p>
      <list type="bullet">
	<item>
	  <p>
	    SpamAssassin is fairly resource intensive, so you may need a
	    more powerful firewall.
	  </p>
	</item>

	<item>
	  <p>
	    <object type='program' class='unix' value='assassind'/> does no anti-relay checking, so your internal mail
	    server will have to do that. In addition, there may be some
	    relaying tricks that can be exploited by a clever
	    spammer. If you choose to go with this scenario, you should
	    verify that you haven't inadvertently turned your network
	    into a spam relay by using one of the standard open relay
	    blackhole testing systems.
	  </p>
	</item>

	<item>
	  <p>
	    SpamAssassin is a complicated piece of software, and may
	    have security bugs that may compromise your firewall.
	  </p>
	</item>

      </list>

      <p>
	To run <object type='program' class='unix' value='assassind'/> in this scenario, start it on your firewall with the command
      </p>
      <code>
assassin --relayhost=mailserver.dom.ain
      </code>
    </section>

    <section title="Running on a System Directly Connected to the Internet" id="scenario3">
      <image source="scenario3.png" description="Network diagram of scenario 3" width="447" height="129"/>

      <p>
	In this scenario, your mail server is directly connected to the
	Internet. To force the messages to go through <object type='program' class='unix' value='assassind'/>, your
	mail server is configured to listen on some other port (e.g.,
	port 2025), while <object type='program' class='unix' value='assassind'/> is configured to listen on port 25.
      </p>

      <p>
	To run <object type='program' class='unix' value='assassind'/> in this scenario, start it on your firewall with the command
      </p>
      <code>
assassind --port=25 --relayhost=localhost:2025
      </code>
    </section>
  </section>

  <section title="Other Documentation" id="otherdoc">
    <p>
      You may wish to peruse other documentation in addition to this page:
    </p>
    <list>
      <item>
	<p>
	  The <link href="assassind.man.html"><object type='program'
	  class='unix' value='assassind'/></link> man page.
	</p>
      </item>
      <item>
	<p>
	  The <link href="changelog">assassind change log.</link>
	</p>
      </item>
    </list>
  </section>

  <section title="Copyright and Disclaimer" id="copyright">
    <p>
	The <object type='program' class='unix' value='assassind'/>
	software is copyright <copyright years="2002">Dave
	Carrigan</copyright>. All Rights
      Reserved. This program is free software; you may redistribute it
      and/or modify it under the same terms as Perl itself.
    </p>
    <p>
      <object type='program' class='unix' value='assassind'/> is
      distributed "as is", without warranty of any kind, either
      expressed or implied, including, but not limited to, the implied
      warranties of merchantability and fitness for a particular
      purpose.  The entire risk as to the quality and performance of the
      program is with you. Should the program prove defective, you
      assume the cost of all necessary servicing, repair or correction.
    </p>
  </section>
</document>
