hMailServer has built-in support for the Open Source antivirus software, ClamWin
. To use a different virus scanner, apply the External virus scanner
feature. It enables you to run any anti virus scanner that supports command line scanning. In the Scanner executable
- field, you specify the command line that should be used when scanning. In the Return value
- field, you specify the value that the virus scanner will return when a virus is found. This value varies depending on the virus scanner. See the bottom of this page for a list of virus scanners and their command lines.
A useful tip. If you use the macro %FILE% in the command line, hMailServer will replace %FILE% with the full path to the file that needs to be scanned.
Configuring hMailServer to use an external virus scanner
This example shows how to set up hMailServer to use AVG Free
. It assumes you have AVG Free
C:\Program Files\Grisoft\AVG Free
- Start hMailServer Administrator
- Navigate to Settings -> Protocols -> SMTP -> AntiVirus
- Select the External virus scanner page.
- Select Use external scanner
the following command line. The quotation marks (") should be included
"C:\Program Files\Grisoft\AVG Free\avgscan.exe" /EXT=* /NOBOOT /NOMEM /SCAN /NOSELF /NOHIMEM /ARC "%FILE%"
6 as the return value. (
Avgscan.exe will return a value of 6 if a virus is found.)
Scanner command lines
"C:\Program Files\Grisoft\AVG Free\avgscan.exe"
/EXT=* /NOBOOT /NOMEM /SCAN /NOSELF /NOHIMEM /ARC "%FILE%"
Since testing with real viruses is risky, you can use the Eicar anti-virus test file. It is treated as a virus by anti-virus scanners, but is safe to use since it is not a real virus. These sites enable you to send out email containing the Eicar anti-virus test file:
- The %FILE%-macro functionality only applies to hMailServer 4.0 build 85 and later.