1. Introduction
  2. Download
  3. Requirements
  4. Features
  5. Installation
  6. Troubleshooting
  7. Help


1. Introduction

Postfilter is an antispam filter for InterNetNews, a widely used NNTP server. Unlike cleanfeed - which checks remote articles, those messages sent through other sites - postfilter scans local posts and tries to reject spam and various abuses. Even if it's designed for large sites, notably USENET servers, postfilter can be safety used also by small or private hosts that need a less strong protection against abuses.
Postfilter is released under the terms of GPLv2 license.


2. Download

The postfilter source code can be downloaded from a github repository. All users should use an updated version.


3. Requirements

  1. INN >= 2.4.0 compiled with perl support (--with-perl). It's recommended to use INN >= 2.4.4. Everybody should note that postfilter is fully compatible with INN 2.6 even if some new feature of INN isn't still used.
  2. The following perl modules:
    1. Date::Parse
    2. Net::DNS
    3. Digest
    4. Digest::HMAC
    5. Digest::MD5
    6. DBI


4. Features

  1. A higly configurable banlist (see banlist.conf(5))
  2. DNSBL, URIBL and TOR support
  3. The maximum number of
    1. Messages
    2. Bytes
    3. Groups
    4. Followups
    5. Identical messages
    6. Rejected messages before being banned
    can be limited per
    1. UserID
    2. Domain
    3. IP address
    and per two units of time (by default: 1 Day and 10 Minutes)
  4. Headers can be deeply modified
  5. Builtin log system for data that need to be kept for legal reasons (notably sender's IP address of each locally posted message) with an expernal script (postlegal that is included in this package) which handles these logs (expiration of old logs and searches)
  6. A simple and fast dictionary of forbidden words (see badwords.conf)
  7. Easy to customize


5. Installation

  1. Automatic installation:
    $ su root
    $ stop            # Stop INND
    $ ./postfilter-install -c # Check dependacies
    $ ./postfilter-install -i # Install postfilter
    $ start           # Start INND
  2. Installation by hands:
    1. Download source code and uncompress it:
      $ wget
      $ tar zxvf postfilter-0.8.1.tar.gz
      $ cd postfilter/
    2. Edit the top of src/ and set the right innshellconfvar path
    3. Copy the directory ./etc/ in the same directory of all INND configuration files with the name /postfilter/
      $ cp -r etc/ /etc/news/postfilter/
      $ chown news:news /etc/news/postfilter -R
    4. Change the postfilter configuration (see postfilter.conf(5))
    5. Copy all files in src/ in your pathfilter directory (the same which contains Debian sets this to /etc/news/filter/
      $ mkdir [pathfilter]/postfilter/
      $ cp -r src/* [pathfilter]/postfilter
      $ chown news:news [pathfilter]/postfilter/ -R
      Those who need to know where is [pathfilter] can execute (innconfval could be - notably with debian - outside binary paths)
      $ innconfval pathfilter
    6. Make a backup copy of your original file than link to
      $ mv [pathfilter]/ [pathfilter]/
      $ ln -s [pathfilter]/postfilter/ [pathfilter]/
      $ chown news:news [pathfilter]/
    7. Create inside your spooldir (usually /var/spool/news/ ) a directory called "postfilter" with a subdir called "saved". This directory must be writable by 'news' user.
      $ mkdir -p [spooldir]/postfilter/saved
      $ touch [spooldir]/access.log
      $ touch [spooldir]/legal.log
      $ chown news:news -R [spooldir]/postfilter/*
      $ chmod +w [spooldir]/postfilter/
      Those who need to know where is [pathfilter] can execute (innconfval could be - notably with debian - outside binary paths)
      $ innconfval pathspool
    8. Copy other files in the right location
      $ cp -r man/man1/* /usr/share/man/man1/
      $ cp -r sbin/* /sbin/
      $ chown root:root /sbin/postlegal
      $ chmod +rx /sbin/postlegal


6. Troubleshooting

  1. Enable news.debug syslog facility adding the following line in syslog.conf
    news.debug                      -/var/log/news/news.debug
  2. Check whether postfilter is correctly installed:
    $ perl -wc [pathfilter]/postfilter/
    $ postfilter-installer -c
    $ su root
    $ postfilter-installer -v
  3. Restart INND. Please restart it instead of reloading the configuration settings.
    $ su root
    $ stop
    $ start
  4. Try to post a test message
      $ telnet localhost 119
    >>> Trying
    >>> Connected to localhost.
    >>> Escape character is '^]'.
    >>> 200 InterNetNews server INN 2.4.5 ready
    >>> 200 localhost InterNetNews NNRP server INN 2.4.5 ready (posting ok).
    <<< POST
    >>> 340 Ok, recommended ID <ha550k$be9$>
    <<< Newsgroups: local.test                           
    <<< From: Aioe <>
    <<< Subject: test
    <<< This is a test, only a test
    >>> 240 Article posted <ha550k$be9$>
    >>> QUIT
  5. Read all news.debug informations related with postfilter
    $ tail -f -n 200 /var/log/news/news.debug | grep " filter: "
  6. If postfilter complaints about configuration errors, read
    $ man postfilter
    $ man postfilter.conf
    $ man banlist.conf      


7. Help

Those who need help can ask for assistance using:

  1. news:// (an USENET newsgroup)
  2. news:// (a local group)