From LedHed's Wiki
Jump to: navigation, search


If you've installed from an RPM, there's a good chance that the packager went to the trouble of testing already. If you're building from sources, however, you'll need to find a way to ensure your configuration isn't broken.

Most software packages are supplied with a test suite to determine if the software is functioning properly. Since DSPAM's correct function relies primarily on having the correct permissions and mail server configuration, a test script fails to provide the level of testing required for such a package. The following exercise has been provided to test dspam's correct functioning on your system. This exercise does not test the Web UI, but only the core dspam agent.

Before running the test, you should have completed section 1.1's instructions for compiling and installing dspam as well as configured your mail server to support dspam.

1. Create a new user account on your system

It is important that this be a new account to prevent any unrelated email from being delivered during testing. Be sure to configure a spam alias for the test account.

2. Send a short email

Send a short email (10 words or less) to the account, and pick it up using your favorite mail client.

3. Run dspam_stats

dspam_state [username]

You should see a value of 1 for "TI" or "Total Innocent" as shown below:

 dspam-test            0 TP       1 TN       0 FN       0 FP

If you receive an error such as "unable to open /usr/local/var/dspam... for reading", then the dspam agent is not configured correctly. The problem could exist in either your mail server configuration or one or more of the permissions on the directory or agent. Check your configuration and permissions, and repeat this step until the correct results are experienced.

4. Run dspam_dump

dspam_dump [username]

This will get a complete list of tokens and their statistics. Each token should have an I: (innocent) hit count of 1. The tokens will be represented as 64-bit values, for example:

3126549390380922317              S:    0  I:    1  LH: Mon Aug  4 11:40:12 2003
13884833415944681423             S:    0  I:    1  LH: Mon Aug  4 11:40:12 2003
14519792632472852948             S:    0  I:    1  LH: Mon Aug  4 11:40:12 2003
8851970219880318167              S:    0  I:    1  LH: Mon Aug  4 11:40:12 2003

To view statistics for a particular token, run:

dspam_dump [username] [token]

Where token is the plain-text token value. For example:

%dspam_dump bill FREE
7717766825815048192  S: 00265  I: 00068  P: 0.7358

5. Forward the test message

Forward the test message to the spam alias you've created for the test account. Provide enough time for the message to have processed.

6. Run dspam_stats again

dspam_state [username]

Now, the value for TN should be zero and the value for FN (false negatives) should be 1 as shown below:

dspam-test            0 TP       0 TN       1 FN       0 FP

If this is not the case, check the group permissions of the dspam agent as well as the permissions your MTA uses when piping to aliases.

7. Run dspam_dump [username] again

dspam_dump [username] Make sure that EVERY token now has an I: of zero and a S: of 1:

3126549390380922317              S:    1  I:    0  LH: Mon Aug  4 11:44:29 2003
13884833415944681423             S:    1  I:    0  LH: Mon Aug  4 11:44:29 2003
14519792632472852948             S:    1  I:    0  LH: Mon Aug  4 11:44:29 2003
8851970219880318167              S:    1  I:    0  LH: Mon Aug  4 11:44:29 2003

If you have some tokens that do not have an S: of 1 or an I: of 0, the dspam signature was not found on the email, and this could be due to a lot of things.