SpamAssassin on Virtual Alias partly fails - How to force 'spam' setting ON?

I need a hint. My HamTrap/SpamTrap is NOT working at all :frowning:

I’ve dug in pretty hard on this, and discovered almost everything is fine… except:

  • Hamtrap/Spamtrap fails for email from/to my virtual alias domain that’s tightly linked to the email server host name/domain. (NO email is ever to/from the host domain – this adds security and a form of spam honeypot capability :wink: )

The actual issue, having dug into the spamtrap.pl code and more: Server settings aren’t the same for real vs alias server!

  • In the UI, only two of the six server services settings are visible for the alias (see below)
  • In the underlying database, the ‘spam’ setting is off for the alias (but on for primary)
  • This doesn’t affect normal spamassassin processing, but it DOES impact spamtrap/hamtrap.

spamtrap.pl processing is skipped for the alias domain due to this missing setting.

Six settings visible on main ‘real’ domain:


Two settings visible on virtual alias domain:

And in the spamtrap.pl code, "$d->{'spam'} is false for the alias domain, ie

 # Is this domain suitable
        if (!$d->{'spam'}) {
                print STDERR "$d->{'dom'}: spam filtering is not enabled\n"
                        if ($debug);
                next;
                }

QUESTION: Is there a way for me to force this setting on for the alias?

SYSTEM INFORMATION
Operating system Debian Linux 11
Webmin version 2.202
Usermin version 2.102
Virtualmin version 7.20.2
Authentic theme version 21.20.7