Mercury/32 Daemon to Interface with POPFile

  1. Introduction.
  2. Support.
  3. Change History.



POPFile ( 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.

The version of POPFileD you need to download depends on the version of POPFile you are using.

POPFile VersionDownload
0.20.xPOPFileD 1.0.1
0.21.xPOPFileD 1.1.0 or POPFileD 1.2.2
0.22.xPOPFileD 1.22.4
1.0.0POPFileD 1.22.4
1.1.0POPFileD 1.22.4


Regular Expressions

(This feature is not available in POFileD Version 1.1.x and earlier.)

The Daemon can compare the headers of a message against a set of text strings called regular expressions. If the header lines match the regular expressions then the Daemon will allow the message to proceed without passing it to POPFile for classification. Possible uses of this feature are:

For a good explanation of Regular Expressions see the Mercury/32 Help file. For consistency, the Daemon uses the same regular expressions as Mercury/32.



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.



Change History

New in Version 1.22.4

POPFileD 1.22.4 contains internal modifications to use hooks implemented in Mercury/32 V4.10 and newer that provide a documented way for the Daemon to modify incoming messages. In Mercury/32 V4.01b and earlier, there was no documented way to do this, and as a result POPFileD would sometimes not be able to work when other Mercury/32 daemons were installed. POPFileD is backwards compatible and will still work with Mercury/32 V4.01b and earlier using the old method of message modification.

POPFileD 1.22.4 allows extensive debugging output, which should simplify the diagnosis of problems

POPFileD 1.22.4 also contains a change in the installation procedure that eliminates some minor glitches in the POPFile user interface when using POPFile Version 0.22.4. It is recommended that all POPFileD users upgrade to this new version of the Daemon:

  1. Shut POPFile down
  2. Reinstall POPFile (now is the time to upgrade to the latest version). This will reinstall the original POPFile user interface internationalization files, which were replaced when you installed an older version of the Daemon.
  3. Install POPFileD following the instructions in this document

New in Version 1.22.0

POPFileD 1.22.0 is the successor to POPFileD 1.2.2. It was created for compatibility with POPFile 0.22.x, and can only be used with this version of POPFile. If you are using POPFile 0.21.x, you should be using POPFileD 1.2.2. The POPFileD version numbering has been changed to track the POPFile version numbers. POPFileD 1.22.0 only contains modifications to the PERL modules, to account for the design and implementation changes between POPFile 0.21.x and POPFile 0.22.0. There are no functionality changes n POPFileD 1.22.0 .

New in Version 1.2.x

The following are the salient differences beween PopFileD 1.2.x and 1.1.x:

Version 1.2.1: Correct problem with filename passed incorrectly to POPFile when -f option not given in Daemon command line.

Version 1.2.2: Correct bug causing Daemon to delete blank line separating header from body.

New in Version 1.1.x

PopFileD version 1.1.x was created for compatibility with POPFile 0.21.0. If you are using POPFile 0.20.x, you should use PopFileD version 1.0.1.

The following are the salient differences beween PopFileD 1.0.x and 1.1.x: