FAQ & Knowledge Base

Welcome to our Knowledge Base. Search or browse through the topics below to find answers to your questions.

Categories: SpamAssassin in a Box | Show all categories

SpamAssassin, checks SPF records. You will find the default settings in the file 25_SPF.cf and the corresponding scores in the file 50_scores.cf. Both files can be found in the directory "C:\ProgramData\JAM Software\spamdService\sa-rules\updates_spamassassin_org".

If you are using the Exchange Server Toolbox or SmartPOP2Exchange, we recommend using the built-in editor to create customised SpamAssassin configuration files. You can find this under the Spam options. You can customise the scores of the SPF rules to your own requirements. To do this, add "score" followed by the name of the rule, followed by the new score in the configuration file: "score RULE_NAME 3.8".

Alternatively, you can also manually create your own .cf file in which you define your rules. Please note that this file should come last in alphabetical order, as SpamAssassin analyses the .cf files in numerical-alphabetical order. An example of the file name could be XMySettings.cf. For detailed information and instructions on writing rules in SpamAssassin, you can consult the official article in the SpamAssassin documentation. Here is the direct link to the article: Writing Rules in SpamAssassin

Don't forget to enter the SPF records in your MX record to ensure optimal functionality.

You can test spoofing using www.sendanonymousemail.net. This tool allows you to send anonymous emails, which can be useful for testing purposes.

Please note that this tool must not be misused for illegal activities or for sending spam. It is important to act responsibly and in accordance with applicable laws. Misuse can lead to serious legal consequences.

You can find more information about the possibilities with SpamAssassin on the official website: Apache SpamAssassin Wiki

URIBL (https://www.uribl.com) is a DNS-based Blackhole List which tracks IP addresses which are commonly used for sending spam mails. URIBL is enabled by default for SpamAssassin installations but allows only a certain amount of requests from the same IP every day. If this amount is exceeded, any further requests will be blocked by the URIBL servers with the info notification above.

This typically happens for SpamAssassin installations that use public DNS resolvers such as Google. As any request that is forwarded via the Google servers has the same IP when it reaches the Blackhole list, all requests will share the same limit. For usage of an alternative DNS, please follow these instructions.

For the following domains it is currently useful to set up forwarding to ensure the full functionality of SpamAssassin:

  • dbl.spamhaus.org
  • zen.spamhouse.org
  • sbl.spamhouse.org
  • list.dnswl.org
  • multi.uribl.com


Now determine the name server for each of the mentioned domains.
Open a command prompt and issue the following command (e.g. for "lists.dnswl.org"):

nslookup -querytype=ns list.dnswl.org.

Attention: Do not omit the dot at the end of the domain, otherwise nslookup will append your local domain and the command will not work.

Example output:
list.dnswl.org nameserver = b.ns.dnswl.org
list.dnswl.org name server = c.ns.dnswl.org
b.ns.dnswl.org internet address = 74.208.14.82
c.ns.dnswl.org internet address = 173.255.241.134
c.ns.dnswl.org AAAA IPv6 address = 2600:3c01::21:1000

  • Now create a "conditional forwarding" on your domain controller for each IP address.
  • Open the DNS management console on the server
     <Server Name> ' "Conditional Forwarding" ' Right click, "New Conditional Forwarding"
  • Enter the domain (in the example: "lists.dnswl.org") and then enter the IP addresses previously queried.

 

If you are using an enterprise firewall, you can also make these settings there. The function can be found in the 'DNS' section and is called 'DNS Request Routing' or 'DNS Redirection' or similar.

Please see the manual, section "Components and Plugins".

This happens if SpamAssassin finds rules with a score of zero. Tests with such a score a generally used in third party rule sets.
They check for a specific spam or ham sign but do not actually assign a score to leave it to the SpamAssassin admin if they want to use it or not to optimize their spam detection.
The message can be avoided by assigning a score to the related test or by removing the channel which belongs the particular rule from the sa-update call.
To assign a score, open 'local.cf' in the configuration directory (<%SACONFIGPATH%>) and add the line following line:

  • score YET_ANOTHER_TEST 0.0001

The path to rules and/or config dir is invalid. Make sure you run the executable (spamd.exe, spamassassin.exe, ...) from their main directory instead of specifying an absolute path to run.

Most likely SpamAssassin is not able to find a valid rule set. Please run sa-update.bat to download the latest rules.

To add your own SpamAssassin rules, please create a plain text file that has the file extension .cf and place it into the configuration directory "C:\ProgramData\JAM Software\spamdService\sa-config". You can now add your own rules using the following syntax:
header  JAM_ERECTION Subject =~ /e.?r.?e.?c.?t.?[i1|l!].?[o0].?n/i
describe  JAM_ERECTION Subject contains "erection"
score  JAM_ERECTION 1.0

This will create a rule which catches various spellings of the word "erection" in the subject of a mail. For more information on writing custom rules, please refer to the following topic in the official SpamAssassin Wiki: https://cwiki.apache.org/confluence/display/SPAMASSASSIN/WritingRules

Alternatively you can also define your rules in the "user_prefs" configuration file which is located in the user profile directory. For a regular user this is the following directory:
%userprofile%\.spamassassin
When executing SpamAssassin using the Windows system service account (which is the default when using SpamAssassin in a Box for example) the file will typically be located at the following directory:
"C:\Windows\System32\config\systemprofile\.spamassassin"

When using the SpamAssassin daemon (spamd.exe) for spam filtering, testing rules in the "user_prefs" file has the advantage that its contents are read for each mail and not only at the start of the process. This way you won't have to stop and start the SpamAssassin daemon each time you want to check if a certain change to your custom rule has the desired effect. If the rule is working as intended you can still copy it to a .cf file in the configuration directory (<%SACONFIGPATH%>). This is a good practice as a huge "user_prefs" file would decrease performance of the SpamAssassin daemon.

The SpamAssassin Bayes filter can be trained either using the sa-learn.exe or the spamc.exe. The main difference on a Windows system is that sa-learn will run under the currents user credentials while spamc will pass the mails that shall be trained to spamd (the SpamAssassin Daemon) which then trains the mail under the user credentials of spamd. This is especially important if you run SpamD for spam filtering under a separate user account, e.g. the Windows system user account (which is the default when using SpamAssassin in a Box for example). In this case you have to use spamc for training, as using sa-learn would just train the Bayes database for the local user.

For manual training we provide a batch script which can be used to train messages in a specific folder either as spam or ham. Besides the directory where the messages that shall be learned reside, the script requires you to decide whether the messages shall be learned as spam or ham. Please note that messages must be conform to the RFC822 format in order to make the Bayes filter work properly. For converting an Outlook message into a RFC822 conform message there are several tools available. The script tries learning using spamc first - if that fails because there is no local spamd instance available, it will "fallback" to sa-learn (assuming that learning shall be done using the local user account). To use the batch script, please follow these steps:

1. Open a command line prompt (run > cmd.exe).
2. Change directory (cd) to the installation directory of SpamAssassin in a Box .
3. Execute command: trainbayes.bat
4. Follow the instructions of the batch script.

If you want to set the folder path once without having to enter it every time you can add the line

if not defined FOLDER set "Folder=Your_path_goes_here"

below the line

set /P FOLDER=

in the trainbayes.bat.

In general, you need one license per installation. Therefore you only need one license if you administer multiple domains with a single installation.

All entries (Page 2 / 3)