How to enable SpamAssasin and ClamAV per vps

Hi,

I am running Ubuntu 22 and virtualmin 7.3, PostFix v3.6.4. I created a vps and enabled nginx, mariadb and mail. I then wanted to enable spamassasin and clamav(for the vpserver), but noticed no items to check in the edit sever menu. Do I need to enable these somewhere else and do I have to have mysql and apache installed and enabled to use mail with virtualmin? Is there a tutorial explaining how this all fits together as how mail works is a bit unclear at this stage and understanding how the components interact would be good for troubleshooting later on?

Cheers,
Dion

In the post-install wizard that ran automatically after you installed Virtualmin on your VPS, did you elect to enable options for spamassasin and clamav?

No, I don’t think so, though that’s an unusual configuration option for use with Virtualmin. If you wish to use use Virtualmin only for mail, I suggest you install mysql and apache, as usual, and then disable them for the specific virtual servers that do not need web and database when you create the virtual server in Virtualmin. Likewise you could enable spam filtering if it is not enabled by default.

See:

Thanks for the reply. I cant remember if I enabled the options for spamassasin and clamav. I do know that when checking spam filtering and virus filtering and then saving under System Settings > Features and Plugins, I get the following response -
Failed to save enabled features : SpamAssassin is configured to be run from the global Procmail configuration /etc/procmailrc, which is not needed as Virtualmin will set it up on a per-domain basis.

When looking under Edit Virtual Server, the only email type option I can check on a per virtual server basis is ‘Mail for Domain enabled’. It sounds like there should be options for spamassasin and clamav? Or are these running? How do I check?

Thank you.

Did you choose the --minimal installation? That one does not include ClamAV or SpamAssassin (because it is trying to be minimal, and ClamAV is, by far, the biggest thing in a Virtualmin system).

This means you browsed to the Webmin SpamAssassin module and enabled spam processing system-wide. If you want to control it per-domain, you have to let Virtualmin manage it instead of the Webmin default method.

Thanks Joe. How do I do this?

You need to enable it in Features and Plugins. But, first you’ll have to undo what you did in the Webmin SpamAssassin module. I don’t know if there’s a button for that, or if you just need to manually edit the procmailrc to clean it up.

Then, once it’s enabled in Features and Plugins, you’ll be able to turn it on/off on a per-domain basis.

This is currently what the procmailrc file looks like:

DROPPRIVS=yes
:0fw
| /bin/spamassassin
:0

  • ^X-Spam-Status: Yes
    $HOME/spam
    LOGFILE=/var/log/procmail.log
    TRAP=/etc/webmin/virtual-server/procmail-logger.pl
    ORGMAIL=$HOME/Maildir/
    DEFAULT=$HOME/Maildir/
    DROPPRIVS=yes
    :0
    $DEFAULT

Not sure how to clean it up