include("menu/menu.php");
?>
Welcome at lindeman.org
XMail Filters
AntiVirus Filter 1.9
I have created a filter script
which integrates anti-virus protection into XMail. It is based on a
filter created by Lukas Frey.
You can find the original filter here : http://www.web4free.ch/xmail/
What you need :
- XMail server (http://www.xmailserver.org)
- McAfee AntiVirus for Linux (http://www.nai.com)
- F-Prot for Linux (http://www.f-prot.com/)
- AntiVir for Linux (http://www.antivir.de)
- ClamAV for Linux (http://clamav.elektrapro.com)
Note : You don't need all four AV engines but you need at least one
- Perl 5.8.0
- Mail-Sendmail perl unit, used to send the
email (#perl
-MCPAN -e 'install Mail::Sendmail')
- Digest-Md5 perl unit, used to calculate a md5
hash (#perl -MCPAN -e 'install Digest::MD5')
(the version included in Perl 5.8.0 can be used as well)
- FindBin unit (included with Perl 5.8.0)
- Switch unit (found here : http://search.cpan.org/CPAN/authors/id/D/DC/DCONWAY/Switch-2.09.tar.gz)
- Reformime (http://courier.sourceforge.net/).
The reformime binary file is also included in my tar file.
The script needs at least McAfee,
F-Prot,
AntiVir or ClamAV to work.
Furthermore you need "reformime" which I included in this tar file.
You can get it from the Courier package and build it yourself. (http://courier.sourceforge.net/)
A message can be sent to the
postmaster to notify her/him of an error. To prevent a bounce loop the
script checks a semaphore file.
If the last time it ran is less then an hour ago, no message will be
sent.
Installation :
- You need to have root
permissions. Un-tar the archive in the directory of your choice.
- Filter install for XMail <= XMail 1.12
- Copy the .tab, checkvirus.pl,
reformime files to the $MailRoot/filter
directory.
Make sure checkvirus.pl and reformime have the x bit set.
- If you have modified your perl
installation, make sure the first line of the checkvirus.pl script
points to the correct perl directory.
- Edit the path in the .tab file if
needed.
- Filter install for XMail >= XMail 1.14
- Copy av-filter.tab, checkvirus.*,
mailto_*, reformime, and scanner_error.txt files into the
$MailRoot/filters directory. Make sure checkvirus.pl and
reformime have the x bit set.
- Copy the files filters.in.tab and
filters.out.tab in your $MailRoot directory.
If you allready have something in these files then just add this line
to both of them:
"*"[tab]"*"[tab]"0.0.0.0/0"[tab]"0.0.0.0/0"[tab]"av-filter.tab"[newline]
Note: [tab] is the real TAB character and [newline] is real RETURN !!
- Edit the path in the av-filter.tab
file if needed.
The av-filter.tab has the following layout:
"/var/MailRoot/filters/checkvirus.pl"[tab]"@@FILE"[tab]"@@FROM"[tab]"@@RCPT"[tab]"@@MSGID"[newline]
- Edit checkvirus.cfg according to
your preferences and needs.
If you use XMail version 1.16 or higher select "our $xmail_version =
116;". Otherwise choose "our $xmail_version = 115;"
- You can edit the txt files which
will be used (if configured so in the checkvirus.cfg) to send to
sender, recipient and postmaster.
- If you have modified your perl
installation, make sure the first line of the checkvirus.pl script
points to the correct perl directory.
- If you are not running any other
filters you can copy the filters.in.tab and filters.out.tab over the
existing files in the /yourpath/MailRoot directory. Otherwise, just
copy the line containing the filter parameters into your existing
files. It's a good idea to put the anti-virus filter parameters ahead
of any spam filter parameters.
- Save your changes and it should be working. No
need to restart XMail.
- Send a test virus file to see if the filter is
working. You can get test virus file at http://www.eicar.org
- In case of problems, run Xmail in debug mode:
#/$MailRoot/bin/XMail --debug -Md
This way you can see if the filter is firing up or not. (Debug info
about running filters was introduced in XMail 1.17 !!)
You can download the script here
If you like the filter let me know by sending me an email. It is nice
to know who is using it :-)
If you've got
questions or problems installing the filter you can reach me at peter@lindeman.nl