AV scanning on all email using free Virtualmin

Is there any set of instructions to have clamav(or another AV) scan all incoming email on the GPL/Fre version of virtualmin? It doesn’t even have to be on a per domain basis.

Thank you!<br><br>Post edited by: jmunjr, at: 2009/02/09 07:33

Howdy,

Actually, if you installed Virtualmin using the install.sh script, you should already be setup to have it scan all incoming email.

Just to verify though – in System Settings -> Features and Plugins, make sure "Virus Filtering" is enabled.

Then, go into Edit Virtual Server, click Features and Settings, and verify that "Virus filtering enabled" is checked for the domain.
-Eric

Well, virus filtering is not enabled and I can’t unless spam filtering is enabled, but when I try to enable spam filtering I get the message:

"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."

Spamassassin is working on my server though… any ideas?

Can you post your /etc/procmailrc file?

Here you go. Thanks fpr helping me out.

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

  • ^X-Spam-Status: Yes
    $DEFAULT
    DEFAULT=$HOME/Maildir/
    ORGMAIL=$HOME/Maildir/

Hmm yeah I initially installed Virtualmin over two years ago…

The script /etc/webmin/virtual-server/lookup-domain.pl doesn’t exist on my system… nor does procmail.log or the folder /etc/webmin/virtual-server/procmail/

sigh…

This message:

"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."

Means you setup Procmail with the Webmin SpamAssassin module (or some other method that uses a generic system-wide Procmail rule). This is incompatible with Virtualmin’s way of processing spam.

Replace your procmailrc with the one Eric suggested, and then you should be able to enable/disable spam options within Virtualmin.

The script /etc/webmin/virtual-server/lookup-domain.pl doesn't exist on my system.. nor does procmail.log or the folder /etc/webmin/virtual-server/procmail/

If you enable/disable spam/AV scanning in Virtualmin, it will build these files and directories.

Don’t agonize over it. This is not serious. :wink:

Er, I mean, enable/disable/enable. It’s the enabling that creates the stuff.

Thanks a bunch. I figured it out earlier by commenting out the offending lines and turning it all on. Seems to work fine now.

It seems messages with viruses get deleted. Is there and easy was to change this so we still get the message just with the virus/file removed? Or do I have to edit something manually?

Also where is the spamassassin config file to edit to get more advanced config on how to handle various scenarios (e.g. delete messages with a score over 10 but deliver those betwen 5 and 10)

Anyway thanks so much…

Is there and easy was to change this so we still get the message just with the virus/file removed?

No, but I assure you there will never be a “good” message with a virus attached. That’s just not the way viruses work these days.

Howdy,

In regards to your spam filtering questions – you can set the default spam and virus options for new domains in System Settings -> Module Config -> Spam Filtering options.

You can set them per-domain in Server Configuration -> Spam and Virus filtering.
-Eric

Hi, all!
I have the same situation as jmunjr but I haven’t understand exactly how to fix this (sad, I know, after a year of virtualmin I’m still a noob :))
Can someone please guide me, step by step, on what to do to enable the smap&virus check? I haven’t understood, do I have to remove procmail or spamassasin, or replace them with other programs?!
Thank you!

My situation:
When trying to enable those (spam&virus) I get the same:

"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."
The etc/procmailrc file is this:
DROPPRIVS=yes :0fw | /usr/bin/spamassassin :0 * ^X-Spam-Status: Yes $HOME/spam
Can someone please guide me, step by step, on what to do to enable the smap&virus check? I haven't understood, do I have to remove procmail or spamassasin, or replace them with other programs?!

No. Removing them would completely remove all mail filtering capabilities. That’s the exact opposite of what you should do. :wink:

"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."

You’ve enabled SpamAssassin in the Webmin SpamAssassin module. This is incompatible with the way Virtualmin manages mail processing. You must remove the rules added by that module.

In other words, your procmailrc would contain none of this:

:0fw
| /usr/bin/spamassassin
:0

  • ^X-Spam-Status: Yes
    $HOME/spam

But, you are also missing a ton of other stuff.

Why didn’t you install Virtualmin using the install script? It handles configuring mail processing and lots of other stuff automatically.

If this system isn’t in product yet, I would strongly recommend you start fresh and install Virtualmin using the install.sh script. You will save yourself many hours and a lot of frustration (or at least a lot of reading).

Oh, is working already, and I don’t even remember how I installed it in the first place.
Anyway, coming back to the issue:
What do I have to do now to enable the spam&virus check?

Sorry, I meant to say the server is working already for a year now, can’t install again using the script.
However, I’ve replaced the content of procmailrc with the one you suggested and after trying to enable the spam/virus I got this:

Failed to save enabled features : The procmail command /usr/bin/procmail is owned by group mail, when it should be owned by root. Email may not be properly delivered or checked for spam.

So I assigned the /usr/bin/procmail file to root and after that it worked.
Thank you for your help, Joe!

So I assigned the /usr/bin/procmail file to root and after that it worked.

Probably not (unless you’re using sendmail). Virtualmin just isn’t complaining any more…but I doubt it is delivering mail.

You need procmail-wrapper for this to work with Postfix.

We have packages for all of our supported operating systems in the various repositories (including the GPL repos).

Is getting more complicated.
I’ve installed procmail-wrapper, is this it?
How do I test if the spam&virus check are working, if the virtualmin shows is activated?.. without sending myself a virus, of course :slight_smile:
This is confusing me.

Indeed, it’s a complicated problem :slight_smile:

procmail-wrapper will only help if Postfix is configured properly. And various other little things :slight_smile:

This is why Joe always recommends the install.sh :wink:

But I know you have a live server now, so there are some ways to test if it’s working.

First, if you look at the email headers, if SpamAssassin ran, it would have one or more X-Spam related headers.

Second, you can send yourself a “test virus”. It’s a file that ClamAV will tag as bad, but it’s not a real virus.

You can download it here:

http://www.eicar.org/anti_virus_test_file.htm#

Also, you might want to take a peek in the procmail.log file for signs of any problems:

/var/log/procmail.log

You’re delivery configuration in Postfix needs to point to procmail-wrapper instead of procmail:

mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME

There is a script that sets up just mail, but it’s probably something you’d just want to look at, rather than run, since you are in production. It might give you some ideas about steps you’re missing, if any.

http://software.virtualmin.com/lib/mail-setup.pl

Well, I think I got it. I wasn’t able to send myself the virus-test file, though. I guess this will be the ultimete test.
If anyone has the time to do it, please send me an email with one of the files from http://www.eicar.org/anti_virus_test_file.htm at atatATatatDOTro.
Thanks