---
title: How to determine the number of spam and non-spam messages Bayesian Filter has learned
description: The following command can be used to determine how many messages have been processed and studied by the Bayesian filter in MDaemon's MDSpamD.
---

[Skip to content](https://knowledge.mdaemon.com/determine-messages-the-bayesian-filter-has-learned#main-content)

[![](https://knowledge.mdaemon.com/hs-fs/hubfs/MDaemon-Technologies_logo.png?width=200&height=150&name=MDaemon-Technologies_logo.png)](https://mdaemon.com/)

- [Knowledge Base Home](https://knowledge.mdaemon.com/)
- [Go to www.mdaemon.com](https://mdaemon.com/)

Open main navigation

Close main navigation

- [Knowledge Base Home](https://knowledge.mdaemon.com/)
- [Go to www.mdaemon.com](https://mdaemon.com/)
- [Contact Us](https://mdaemon.com/pages/contact-us)

[Contact Us](https://mdaemon.com/pages/contact-us)

 Knowledge Base

- There are no suggestions because the search field is empty.

1. [Knowledge Base Home](https://knowledge.mdaemon.com/?hsLang=en)
2. [MDaemon Email Server](https://knowledge.mdaemon.com/mdaemon-email-server?hsLang=en)

# How to determine the number of spam and non-spam messages Bayesian Filter has learned

## The following command can be used to determine how many messages have been processed and studied by the Bayesian filter in MDaemon's MDSpamD.

Open a command line from the start menu in Windows (type 'cmd' followed by enter).

Navigate to the disk that MDaemon is installed on.

Change the directory to the SpamAssassin directory under MDaemon (ex: cd c:\\MDaemon\\spamassassin).

Type the following, followed by enter: sa-learn -C ./rules --siteconfigpath=./default\_rules --dump magic

You should see a table in response like this:

C:\\MDaemon\\SpamAssassin\> sa-learn -C ./rules --siteconfigpath=./default\_rules --dump magic

0.000 0 2 0 non-token data: bayes db version  
0.000 0 3 0 non-token data: nspam  
0.000 0 35 0 non-token data: nham  
0.000 0 1403 0 non-token data: ntokens  
0.000 0 1102728654 0 non-token data: oldest atime  
0.000 0 1106169895 0 non-token data: newest atime  
0.000 0 0 0 non-token data: last journal sync atime  
0.000 0 0 0 non-token data: last expiry atime  
0.000 0 0 0 non-token data: last expire atime delta  
0.000 0 0 0 non-token data: last expire reduction count

The numbers you are interested are the **nspam** and **nham** values. In this example, SpamAssassin has learned from 3 spam messages and 35 ham (non-spam) messages.

The ntokens value indicates the number of tokens the database contains.  The maximum number of tokens in a default database is 150,000 tokens. 

- [MDaemon Email Server](https://knowledge.mdaemon.com/mdaemon-email-server?hsLang=en#main-content)

    - [Mobile Device Management](https://knowledge.mdaemon.com/mdaemon-email-server?hsLang=en#mobile-device-management)
- [MDaemon AntiVirus (SecurityPlus)](https://knowledge.mdaemon.com/mdaemon-antivirus-securityplus?hsLang=en)
- [ActiveSync for MDaemon](https://knowledge.mdaemon.com/activesync-for-mdaemon?hsLang=en)
- [MDaemon Connector for Outlook (Outlook Connector)](https://knowledge.mdaemon.com/mdaemon-connector-for-outlook-outlook-connector?hsLang=en)
- [SecurityGateway for Email Servers](https://knowledge.mdaemon.com/securitygateway-for-email-servers?hsLang=en)
- [RelayFax Network Software](https://knowledge.mdaemon.com/relayfax-network-software?hsLang=en)

[![Chill listening crop-3](https://knowledge.mdaemon.com/hs-fs/hubfs/belch.io/template-assets/MDaemon-Technologies_logo.png?width=199&height=41&name=MDaemon-Technologies_logo.png "Chill listening crop-3")](https://www.mdaemon.com)

[Knowledge Base Home](https://knowledge.mdaemon.com?hsLang=en)

<https://www.youtube.com/c/MDaemonTechnologies> <https://www.linkedin.com/company/mdaemon-technologies/> <https://www.facebook.com/MDaemon.Technologies/> <https://www.twitter.com/MDaemon_Email>

Copyright © 2025, MDaemon Technologies