Evolution Virus Scanning
Like many people, I receive an absurd number of Windows e-mail viruses in my e-mail. At times, I’ve received over 300 Win32/Gibe-F e-mail messages per day. While they don’t run (easily) on my Linux laptop, they are a real annoyance.
An anti-virus program. They do exist for Linux, and they are quite similar to their counterparts on Windows. The one I use is called ClamAV (http://clamav.elektrapro.com/) because it’s free, easy to get, and fairly effective. Commercial anti-virus products are also available for Linux.
Evolution can call ClamAV as part of it’s normal filtering of incoming filters using the “Pipe Message to Shell Command” facility. Here’s how to set it up:
- First thing first, make sure you have everything you need installed
- sudo apt-get install clamav clamav-base clamav-freshclam clamav-daemon
- Create a script called “evolution-clamav-helper”. This is worth doing because some versions of Evolution supposedly don’t parse the arguments to the command in the “Pipe Message to Shell Command” box. Since clamscan is in my path, the script I use looks like this:
FILE=/tmp/$$_outclam.tmp clamdscan - 1>$FILE if [ $? -eq 1 ]; then STRING=$(grep "FOUND" $FILE |cut -d: -f2) zenity --warning --title="Evolution: Virus detected" --text="$STRING" & exit 1 fi exit 0
- Make the script executable: “chmod +x evolution-clamav-helper”
- Move the file to /usr/local/bin “mv evolution-clamav-helper /usr/local/bin/”
- Start Evolution (if it isn’t already running), and go to the Edit menu and select Message Filters.
- Click the “Add” button.
- Set the criterion to “Pipe Message to Shell Command.
- Click the “Browse…” button and choose the script you created in /usr/local/bin
- Choose “Does Not Return” in the drop down box.
- Set the value to “0″ in the spinbox.
- Choose an appropriate action. Personally, I do all of the following:
- Set status to “read”.
- Assign a color. This is so that I easily see which filter caught the message, which is helpful in debugging the setup.
- Move to the “virii” folder.
- Stop processing. This ensures that no filter further down the list will act on this message.
When you’re done it should look like this:








