[Spambayes] What is spam?

Greg Ward gward@python.net
Mon, 16 Sep 2002 21:09:26 -0400


On 16 September 2002, Neale Pickett said:
> 1.  When people forward spam to me, it gets tagged as spam.  I have a
>     lot of forwarded spam in my inbox; I've asked people to send me
>     stuff is the past so I can get a feel for what sort of spam is being
>     sent to my users.  I use this feel to blacklist domains in the MAIL
>     FROM: SMTP command.  It works pretty well when I stay on top of it.

I do something similar with python.org -- mail sent to spam@python.org
is dumped straight into /var/mail/nc-spam ("not caught") without going
through SpamAssassin.  In theory, I occasionally look at that folder and
tweak SpamAssassin to do a better job on those messages.

Rather than try to fool SpamAssassin into accepting anything for
spam@python.org, I simply bypass SA entirely; since this is all done in
Python code (I embed a Python interpreter because I didn't want to write
the local_scan() function in C):

  def local_scan (fd, headers, info):
      # Immediately accept any messages that originated locally.
      sender_ip = info.sender_host_address
      if (sender_ip is None or
          sender_ip == "127.0.0.1"):
          return

      # Immediately accept any messages destined for the "uncaught spam"
      # or "uncaught virus" folders.
      if (len(info.recipients_list) == 1 and
          info.recipients_list[0] in ("spam@python.org",
                                      "virus@python.org",
                                      "spam@zope.org",
                                      "virus@zope.org")):
          return

      [... now we do virus- and spam-checking ...]

For other MTAs, your mileage may vary.  But if you ask people to send
you spam, you probably want to keep that mail from going close to your
spam detector in the first place.

        Greg
-- 
Greg Ward <gward@python.net>                         http://www.gerg.ca/
Money is truthful.  If a man speaks of his honor, make him pay cash.