MailEnable Enterprise Guide
Appendix / Antivirus Configuration / Using your own antivirus scanner
In This Topic
    Using your own antivirus scanner
    In This Topic

    If antivirus support is enabled, attachments in messages are unpacked and scanned as they pass through the Mail Transfer Agent. The MTA moves mail messages internally within MailEnable. When the MTA picks up a message from a connector’s queue, it unpacks it into a scratch directory and uses the command line specified in the administration program to scan each unpacked file. In most cases, command line virus checkers have the ability to automatically delete files. If one of the scanned attachments of the message is deleted, the Antivirus filter assumes that it has a virus and when the message is reconstructed, it replaces the offending content with a note indicating that offending content was removed. MailEnable can also check the return code from a command line scanner in order to determine whether the item it processed is infected.

    For example, a sample argument line for a command line scanner is:

    "[AGENT]" "[FILENAME]" -remove -s -nb -nc

    This can be seen if you open the registry and access HKEY_LOCAL_MACHINE\SOFTWARE\Mail Enable\Mail Enable\Agents\MTA\Filters\[Virus Scanner Short Name].

    Note that the [AGENT] and [FILENAME] tokens in this registry setting are replaced by the path to the A/V Command Line Scanner and the attachment name (which is generated by the system). The "-remove -s -nb -nc" part of this registry value is the part that will vary depending on the scanner application being used.

    Ensuring that the A/V app supports auto deletion is a little limiting. As a result there are registry settings that allow the use of the scanners DOS error level or exit code.

    The respective settings are:

    "Exit Code Enabled": 0/1 - on/off

    "Exit Codes": eg: 1 2 9: space delimited string containing application exit codes

    "Exit Codes Error Inclusive": 0/1 - on/off: used to configure whether the "Exit Codes" indicate errors or successes

    A sample registry import file is outlined below:

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Mail Enable\Mail Enable\Agents\MTA\Filters\Custom]

    "Antivirus Notification Message"=">"

    "Antivirus Scratch Directory"="C:\\Program Files\\Mail Enable\\Scratch"

    "Antivirus Parameters"="\"[AGENT]\" \"[FILENAME]\" -s -nb -nc"

    "Antivirus Agent"="C:\\Program Files\\Virus Scanner\\CUSTOM.EXE"

    "Provider DLL"="MEAVGEN.DLL"

    "Program Name"="Custom"

    "Program Info"="This is a template for new virus scanners."

    "Exit Code Enabled"=dword:00000000

    "Exit Codes Error Inclusive"=dword:00000001

    "Exit Codes"="1"

    This can be copied into Notepad, saved as a .reg file and imported using the registry editor. Once imported into the registry, the settings can be edited to those required by the antivirus command line application.