Gentoo Wiki


You can configure your favorite file manager, email or news client to use BitDefender Antivirus Scanner for Unices for an instant scan of some file or some email. In some cases this is as simple as a mouse click, key-shortcut or menu selection.

Here is how to use BitDefender Antivirus Scanner for Unices scan the emails from KMail.

BitDefender Antivirus Scanner for Unices

BitDefender Antivirus Scanner for Unices is a versatile antivirus scanning solution, that could be easily integrated in desktop and server software to perform an instant target scan.

You can find more on the BitDefender website.

Add the antivirus filter

Start from Settings → Configure filters.... Add a new filter and name it BitDefender Anti-Virus Check. In the Filter Criteria panel add a rule to select which messages to scan, for example a rule that will scan all messages. In the Filter Actions panel select Pipe Through and fill in the textbox Then check the boxes Apply to incoming message and Apply on manual filtering. Save the new rule by pressing the OK button

Copy the following script, name it and save it somewhere in your path.

# BitDefender KMail integration script
# Copyright (C) 1996-2006 SOFTWIN SRL. All rights reserved.

# Place this script in your PATH and name it
#, such as: ~/bin/

# Set some parameters

# Save the standard-input to a temporay file
cat > $TMPFILE

# Scan it with BitDefender, filter the output and echo the header
if $BDSCAN $TMPFILE | grep -q infected; then
  echo "X-Virus-Flag: yes"
  echo "X-Virus-Flag: no"

# Output the email and remove the temporary file

# End of the script

You can customize this filter by yourself. You can add a convenient button on the toolbar, to call the filter on the highlighted message.

Filter actions in KMail

Due to the current KMail structure, the script is called in the Actions section on the filter. That means the only action the filter can do is to add a header stating the message is infected or not. It is up to you to add another filter to check for this header and to perform any desired action.

Retrieved from ""

Last modified: Sat, 06 Sep 2008 15:51:00 +0000 Hits: 4,936