Configuring Anti-Spam scan settings for a rule

August 21, 2023

ID 56135

To configure the Anti-Spam scan message processing settings:

  1. Export rule settings to an XML file using the following command:

    # /opt/kaspersky/klms/bin/klms-control \

    --get-rule-settings <rule ID> -f <rule settings file name> or

    --get-rule-settings <rule name> -n -f <rule settings file name>

    The <rule name> should be enclosed in double quotes if it contains blanks.

  2. Open the rule settings XML file for editing.
  3. Specify the action you want the application to take on messages. To do so, in the <asScanSettings>section, specify the value Skip, DeleteMessage or Reject for the following settings:
    • <spamAction>, if the message has the status Spam;
    • <probableSpamAction>, if the message has the status ProbableSpam;
    • <blacklistedAction>, if the message has the status Blacklisted;
    • <massMailAction>, if the message has status as MassMail.

    The default action for all statuses is Skip.

  4. If you selected the DeleteMessage action at the previous step of the procedure, you can configure the application to move a copy of the message to Backup before deleting the message. To do so, in the <asScanSettings> section, specify the value 1 for the following settings:
    • <backupSpam>, if the message has the status Spam;
    • <backupProbableSpam>, if the message has the status ProbableSpam;
    • <backupBlacklisted>, if the message has the status Blacklisted;
    • <backupMassMail>, if the message has status as MassMail.

      The default value for all statuses is set to 0, do not move a message copy to Backup.

  5. If you selected Skip at Step 3 of the sequence, you can edit the text of the tag added to the Subject field of the message. To do so, in the <asScanSettings> section, specify the text of the stamp as the value for the following settings:
    • <spamMark>, if the message has the status Spam;
    • <probableSpamMark>, if the message has the status ProbableSpam;
    • <blacklistedMark>, if the message has the status Blacklisted;
    • <massMailMark>, if the message has status as MassMail.
  6. In the <maxSizeLimit> subsection, specify the maximum size of messages (in bytes) to be scanned by Anti-Spam. The value 0 is interpreted as the absence of a limit on the maximum message size.

    By default, the value is set to 1.5 MB.

  7. In the <externalServices> subsection, specify external services to use for scanning messages:
    • <useDns> – enables / disables the use of external services when scanning messages. When the value is set to 0, the use of all external services is disabled.

      The use of external services is enabled by default.

    • <useSpf> – enables / disables the SPF technology when scanning messages.

      SPF technology is enabled by default.

    • <useSurbl> – enables / disables the use of a custom list of SURBL servers when scanning messages. You can specify the list of SURBL servers when configuring the general Anti-Spam scanning settings.

      The SURBL service is enabled by default.

    • <useSurblDefaultList> – enables / disables message scanning with use of SURBL servers whose list is provided with application database updates.

      The use of the standard list of SURBL servers is enabled by default.

    • <useDnsbl> – enables / disables the use of a custom list of DNSBL servers when scanning messages. You can specify the list of DNSBL servers when configuring the general Anti-Spam scanning settings.

      The use of the custom list of DNSBL servers is enabled by default.

    • <useDnsblDefaultList> – enables / disables message scanning with use of DNSBL servers whose list is provided with application database updates.

      The use of the standard list of DNSBL servers is enabled by default.

    • <dnsHostInDns> – enables / disables the scanning of DNS for the address of the message sender.

      The scanning of DNS for the address of the message sender is enabled by default.

    • <dnsDynamicResolvedFrom> – enables / disables the scanning of the message sender against the database of bot nets. The scan uses a reverse DNS lookup of the sender's IP address.

      If your mail server has users connected via a dial-up link, enabling this scan is not recommended.

      The scanning of the message sender against the database of bot nets is disabled by default.

  8. In the <advancedOptions> subsection, specify the values of additional Anti-Spam scan settings:
    • <parseRtf> – enables / disables the scanning of RTF attachments.

      The scanning of RTF attachments is disabled by default.

    • <useGsg> – enables / disables enables graphics analysis technology during scanning.

      Graphics analysis technology is enabled by default.

    • <disableLangChinese> – enables / disables a higher spam rating for messages written in Chinese.

      A higher spam rating for messages written in Chinese is disabled by default.

    • <disableLangKorean> – enables / disables a higher spam rating for messages written in Korean.

      A higher spam rating for messages written in Korean is disabled by default.

    • <disableLangThai> – enables / disables a higher spam rating for messages written in Thai.

      A higher spam rating for messages written in Thai is disabled by default.

    • <disableLangJapanese> – enables / disables a higher spam rating for messages written in Japanese.

      A higher spam rating for messages written in Japanese is disabled by default.

    • <disableLangCyrillic> – enables / disables a higher spam rating for messages written in Cyrillic font.

      A higher spam rating for messages written in Cyrillic font is disabled by default.

  9. Save the changes made.
  10. To import rule settings from an XML file, use the following command:

    # /opt/kaspersky/klms/bin/klms-control \

    --set-rule-settings <rule ID> -f <rule settings file name> or

    --set-rule-settings <rule name> -n -f <rule settings file name>

    The <rule name> should be enclosed in double quotes if it contains blanks.

Did you find this article helpful?
What can we do better?
Thank you for your feedback! You're helping us improve.
Thank you for your feedback! You're helping us improve.