Mercury/32 Daemon to Interface with POPFile

POPFile (http://popfile.sourceforge.net/) is a program that uses Bayesian techniques to classify email into one of several categories ("buckets") by examining the words that make up the message. It is typically used to classify mail as spam or non-spam. The standard implementation of POPFile is as a proxy, either between the Internet and the mail server or between the mail server and the mail readers. Figure A shows an SMTP Proxy that receives mail from the internet and Classifies it using Bayesian techniques before handing it off to a mail server. Figure B shows a POP3 proxy, that retrieves mail from a mail server on behalf of a mail client program, classifies it using Bayesian techniques and then hands it off to the mail client that requested the mail

POPFileD is a Mercury/32 Daemon that implements a third way to use POPFile, by having Mercury/32 call POPFile to examine mail. This allows Mercury/32 to serve as the direct interface both to the Internet and to the mail reader clients, without having POPFile as a proxy. Figure C shows the mail server receiving mail directly from the Internet, passing it to the Bayesian Classifier for classification, and then giving it to a mail client when needed

 

The sequence of processing using POPFileD is as follows:

  1. Mercury/32 receives an email message.
  2. The Mercury/32 Daemon passes a file with the email to POPFile. This takes place before Policies, Content Filters and Mail Filtering Rules are applied. For this communication, The Daemon uses port 111 to communicate with POPFile but this is configurable.
  3. POPFile classifies the email and returns to Mercury/32 the name of the bucket where the email belongs.
  4. Mercury/32 adds a header to the email containing the name of the bucket.
  5. Mercury/32 then continues processing the email. Either the Mercury/32 filters or the end recipient’s filters can check for the header that contains the bucket name and take appropriate action.

The Mercury/32 daemon has optional features to reduce unnecessary processing and to aid in the handling of spam once it has been detected.

Note that mail from a local sender to a local recipient must always be checked, because the sender could actually be a spammer forging the local sender's address.

Installation Instructions

You should have received the following files:

POPFileD.dllMercury Daemon DLL
daemon.iniMercury Daemon description file
MERC.pmPOPFile side of the interface
English.msgPOPFile text string.
POPFileD.htmlThis file
proxies.gifThe graphics in this document.

Both Mercury/32 and POPFile should already be installed on the same computer. Mercury should be operational and correctly handling your mail without using POPFile as a proxy. This version of the Daemon works with POPFile Version 0.20.1. POPFile should not be running.

  1. Copy POPFileD.dll to the directory where Mercury.exe is installed.
  2. If your Mercury directory does not have a file called daemon.ini, copy the file provided to this directory.
  3. If your Mercury directory already has a file called daemon.ini, append the text from the file provided to your file.
  4. Use Notepad to edit the file daemon.ini. It should have at least two lines that look like this:

    [Global Daemons]
    PopFileD = c:\mercury\POPFiled.dll;-p111 -s50 -l -t -bnon_spam

    Leave the first line as-is. The second line should have on the right of the equal sign:
  5. Restart Mercury/32. Check the messages in the System Messages window; make sure the daemon has started. To view the System messages window, click on Window/System Messages.
  6. Copy the file MERC.pm to the "proxy" subdirectory of your POPFile installation. The name of the file is case sensitive. Since you will not be using POPFile as a proxy, you can delete the file POP3.pm and the file SMTP.pm (if it exists) from that directory, or move them to a safe place. Do not remove the file Proxy.pm from that directory, without it POPFile will not run.
  7. Copy the file English.msg to the languages subdirectory of your POPFile installation, replacing the file by that name already there. This file contains text strings used by POPFile to construct its browser interface. POPFileD adds four lines at the end of this file. If you are using a language other than American English, you will need to copy those four lines to the appropriate language file in your languages directory, and translate the text to your language. Sorry, but my technical Spanish is rusty and my Bulgarian is non-existent.
  8. Start POPFile. Use its configuration interface to verify that the Mercury module has been recognized and that it is listening on the same IP port that you configured in step 4 (the default is 111). If you need to, change the port number and restart POPFile. Also verify that you have defined the correct bucket names as given to Mercury/32 in step 4.
  9. Test by sending an email into your Mercury/32 server. Check the System Messages window in Mercury/32 for errors.

 

Support

I can provide support only via e-mail and on my spare time, which usually means evenings. Send support questions and suggestions to

Sorry, but a Javascript-enabled browser is required to email me.

.

 

Terms and conditions of use

PopFile Daemon is free software and may be used by any number of users on any number of systems without fee or obligation, subject only to the terms and conditions laid out below.

PopFIle Daemon is NOT in the public domain - the author, Marketing Matrix, Inc., retains ownership and copyright, and exclusively reserves all rights to the software. In countries where assertion of the right to be identified as the author is required for copyright purposes, Marketing Matrix, Inc. asserts its right to be recognized as the author and owner of the PopFile Daemon and all its associated components.

Modification of the program or its resources or associated data files without the author's explicit written permission is strictly forbidden. Unauthorized modifications of any component of the PopFIle Daemon DLL constitute a breach of intellectual property laws in most countries and will be pursued vigorously to the full extent of the law.

PopFIle Daemon may be used by anyone and may be freely distributed via any medium, either commercial or non-commercial, provided the following conditions are met:

  1. Distribution: PopFile Daemon must be distributed complete and unaltered in the original ZIP archive file or self-extracting archive, with all messages intact. System administrators and ISPs wishing to repackage the PopFile Daemon archive for supply to their users may do so provided some basic guidelines are followed - please send e-mail to the address above for more information on this. In the event that the PopFile Daemon software is being distributed as part of another package or software bundle, or in association with software or services for which a charge is being levied, the author's permission must be obtained before distribution occurs. We will authorize by fax or by an e-mail message signed with our public key signature at our discretion. Bona fide Internet Service Providers are exempted from the requirement to obtain formal permission (see section 6, below).
  2. Charging for distribution: No charge may be directly levied for the PopFile Daemon itself. Fair copying and support charges may be applied but you must not represent that you are actually selling the software itself. The intent of this statement is to allow book publishers to distribute the system freely with books, and to permit Software Libraries and BBS systems to distribute PopFile Daemon in their catalogues provided only reasonable handling and duplication fees are charged.
  3. Prohibited supply: The supply or promotion of PopFile Daemon for the purpose of sending bulk, unsolicited e-mail is incompatible with the basic aims of the program, which revolve around the free provision of a service that enhances the quality of communication between people. PopFile Daemon may not be included in any package designed for this purpose, whether free or otherwise, nor may vendors of such packages use the "PopFile Daemon" trademark or other related material in the promotion of their package. Similarly, we do not consider bulk, unsolicited e-mail to be an appropriate use of PopFile Daemon and reserve the right to decline technical support to people using it for this purpose.
  4. Prohibited use: PopFile Daemon may not be used for the purpose of sending Bulk Unsolicited Commercial Electronic Mail. For the purposes of this section, this shall be construed to mean electronic mail sent to a total of more than 50 recipients for the purpose of advertising a commercial product or service, where the recipient has not explicitly expressed interest in receiving such advertisements.
  5. Ownership: Ownership of the PopFile Daemon Software remains vested in the author, Marketing Matrix, Inc. You may not represent ownership or copyright in the system in the course of distribution, and you must not represent any specific connection with, or authorization or license from the author.
  6. Distribution by ISPs: Bona-fide Internet Service Providers are explicitly granted permission to bundle the PopFile Daemon Software with their standard subscriber access package if they wish, even if a charge is levied for that access package, provided the conditions laid out in section (1) above are met. If you supply PopFile Daemon as a separate item (as opposed to being part of an access bundle), you may only charge a reasonable duplication or handling fee and must otherwise abide by all other terms and conditions defined herein.
  7. No liability: Although all possible care has been taken to ensure that the PopFile Daemon Software is as reliable as possible, the diversity of environments in which it might be used means that we can accept no responsibility for loss or damage, whether real or consequential, arising from its use. By using the software you explicitly agree to hold the author blameless for any such losses or damages.
  8. All rights reserved: We reserve the right to change the terms and conditions of use and distribution of PopFile Daemon without specific notice, although we will make reasonable efforts to advise of any such change through normal channels (user groups, mailing lists and so on). The current terms and conditions of use of PopFile Daemon can be obtained at any time by sending a message to the address above requesting them.

All the legalese aside, it is our strong desire that PopFile Daemon be as widely used as is possible in the hope that by furthering communication between people, we may in some small way come to understand and accept each other better.