SpamAssassin / activate Plugin ASN

SYSTEM INFORMATION
OS type and version Debian Linux 12
Webmin version 2.520
Virtualmin version 7.50.0 Professional
Webserver version Apache 2.4.65
Related packages SpamAssassin 4.0.1
Python Version 3.11.2

In the past, I have found the ASN plugin in SpamAssassin to be very useful.

Spam emails are often sent from the same or similar servers. These servers frequently send spam emails with slightly altered subject lines that may circumvent existing rules.

However, the ASN number of the server would then be the same, and since this would be taken into bayes database when declaring the email as spam, I think it is a good idea to activate the plugin.

Since I was previously able to configure this plugin directly via my old system (GUI), I currently lack the knowledge of how to

  • activate a SpamAssassin plugin cleanly
  • without affecting the configuration of Virtualmin

Are there any things I need to consider in the Virtualmin environment?

Of course, I searched Google diligently, but apart from the plugin description, I couldn’t find any really useful information on how to install the plugin or any other plugin properly.

If I understand correctly, plugins have to be compiled in SpamAssassin, or is that now obsolete?

I want to do it right, of course, so I’m checking with you first.

Hello everyone,

I have now found a solution. In the Virtualmin preferences, the ASN plugin and the RelayCountry plugin are not activated.

This is simply because the corresponding GeoDB databases must be stored for both plugins.

To do this, you must first register with maxmind, if you have not already done so, and download them.

The databases are stored in a standard directory, which is searched by SpamAssassin by default.

This can be, for example,

/usr/share/GeoIP

The plugin is activated by an entry. I would do this in the file

/etc/spamassassin/init.pre

with the entries

loadplugin Mail::SpamAssassin::Plugin::ASN
loadplugin Mail::SpamAssassin::Plugin::RelayCountry

I wrote the configuration of the plugins in the file

/etc/spamassassin/local.cf

as this allows you to maintain the entries via the UI of Virtualmin or Webmin.

The default entries for both plugins are listed in the documentation and can be customized if necessary.

Apache Plugin ASN

Apache Plugin RelayCountry

After the changes, the services would need to be restarted once.

There are many more plugins for SpamAssassin that can be used to further minimize the number of spam emails that get through. These are just two of them.

Thanks for the instructions. I will have a look at this when I get chance.

I hate spam.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.