MX V4.2 SPAM filter update

While the Mail eXchange VMS program became a commercial product in the late 1990s with version 5.0, many users chose to continue to use the last freeware version, V4.2. I've used this on VAX and Alpha for about a decade. The last changes to version 4.2 were some patches and an anti-Relay modification by someone named "TIZ" which allowed the restriction of the use of MX as an SMTP relay using a file called RELAY.DAT. This distribution is avaiable on the Internet.

Meanwhile one of the features of the commercial version was SPAM filtering. In the past few years SPAM became an increasingly worse problem. In May and June of 2007, after getting up to 250-300 SPAM messages per day I decided to add some SPAM filtering to the freeware version of MX. Some of the SPAM were invalid usernames which would bounce to the Postmaster account, others were using "localhost" or my own host name and domain in the HELO line. The SPAM filtering I employed uses three methods. The first is to accept or reject an email due to the HELO domain. The second is the username in the "RCPT TO" line. The third is the use of a DNSBL (DNS Blackhole List), such as zen.spamhaus.org, which keeps a list of IP addresses which are known sources of SPAM. These methods are controlled by two new logicals to control the MX SMTP_SERVER process.

New SPAM filter functionality for MX 4.2:

Logical: MX_SMTP_SERVER_DNSBL

  Defines the name of the SPAM DNS Blackhole list to use.
MX will take the remote address and check the blackhole
list specified.  If found on the list, the email will be
rejected at the RCPT_TO command with the error:

554 Mail rejected; remote host is listed in SPAM DNS blackhole list <...>

where <...> is the value of MX_SMTP_SERVER_DNSBL


Logical:  MX_SMTP_SERVER_SPAMCODE

  Defines which SPAM rules to use in filtering.
Value is the sum of the rules as follows:

Rule
 1   Reject connections which use localhost as the HELO domain and
     the connection does not originate from 127.0.0.1 or connections
     which use localhost.localdomain.  These will be rejected with
     the status:

     554 Fix your HELO domain, localhost usually means SPAM.

 2   Reject connections which use your hostname as the HELO domain
     and who's originating IP does not match.  This includes connections
     using your host IP number.  These will be rejected with the status:

     554 Fix your HELO domain, using mine usually means SPAM.

 4   Reject connections which do not use a fully qualified domain as
     the HELO domain.  Specifically, the name must contain a "." or it
     will be rejected with the status:

     504 Not a fully qualified domain name, usually means SPAM.

 8   Reject RCPT_TO addresses who's local part does not contain a ":" and
     is greater than 12 characters (the max VMS username) for the case where
     the remote server is not in the relay.dat list (i.e. the RCPT_TO should
     be directed to the local system).  These will be rejected with the status:

     550 Username is not valid on this system.

For example, if you wanted to use all the methods, you would
$ define/system/exec MX_SMTP_SERVER_SPAMCODE 15

The zip file MX_SPAM.ZIP contains three files to replace in the [.SMTP] directory of the MX source. Only the B32 bliss source is needed for Alpha compile (not tested).

Three files need to be replaced:
DESCRIP.MMS - Fixes compile errors for "ALIAS" lines for VAX by adding "/SYNTAX_LEVEL=2"
SERVER.OPT - Added "SYS$SHARE:VAXCRTL.EXE/SHARE" for VAX link
SMTP_SERVER.B32 - Modified SMTP_SERVER source with new features


Last modified February 12, 2008 by Vance R. Haemmerle
vance@toyvax.Glendale.CA.US