Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: HOWTO: Windows server 2003, Hmailserver, ClamAv,SaneSecurity
PostPosted: 2011-11-05 21:29 
New user
New user

Joined: 2011-11-04 21:39
Posts: 28
For those first timers :shock: :shock: :shock: :shock: :shock: or the ones that want to move from the outdated ClamAv/tbb version :( :( :( :( :( to the Win32 version, here is what you need to do.

Prerequisits
1. Download the latest release package of hmailserver from http://www.hmailserver.com/index.php?page=download
2. Download the latest package of ClamAv from http://sourceforge.net/projects/clamav/ ... mav/win32/ Donwload the I386 package for 32 bit OS and the X86_64 for 64 bit OS
3. Download Windows server 2003 resource toolkit and install it with the default settings http://www.microsoft.com/download/en/de ... x?id=17657
4. Download the ClamSup and rsync packages provided by our good friend Steve for use with sanesecurity signatures http://hideout.ath.cx/clamav/

Installation
1. Install hmailserver. Manuals can be found on the site.
2. Extract the clamav package and copy the extracted clamav folder to the root of C:
3. Extract the rsync package
4. Extract the clamsup package
5. Copy the contents of the extracted rsync folder to the extracted clamsup folder
6. Copy the clamsup folder to the root of C:\clamav folder
7. Copy and paste the clamd.conf and freshclam.conf files from C:\ClamAV\conf_examples tp the root of C:\Clamav folder
8. Delete or comment out the word Example found in both config files on line 8
9. Modify both files to meet your needs (usually default settings are well balanced). Be careful do not uncomment or modify the line of temporary folder in clamd.conf
10. Do not uncomment or modify the database path in both config files. Leave the default settings
11. Modify the LOCALFOLDER variable in C:\ClamSup\Clamsup.cfg file to point to C:\ClamAv\Database
12. Create two new folders on the root of C:\ClamAv. Name it database and Logs
13. Uncomment the LogFile variable in clamd.conf to point to C:/ClamAv/Logs/clamd.log
14. Uncomment the UpdateLogFile variable in freshclam.conf file to point to C:/ClamAv/logs/freshclam.log
15. Navigate through command prompt to C:\ClamAv directory and run Clamd.exe, as this will launch the clamd service
16. Run freshclam.exe and wait until it downloads the databases and notifies the clamd service about it
17. CD to ClamSup directory and run clamsup.bat. This will download all Sanesecurity signature databases (will take some time), once download is complete, restart the clamd (close the command prompt windows and repeat step 15). This step will help to load all the signatures
18. At this point you should check the clamd logs to see if there are any errors.
19. Now configure hmailserver to use clamav
20. Go to antivirus, external virus scanner, check the use external scanner button and enter the following for the executable
C:\clamav\clamdscan.exe --config-file=C:\clamav\clamd.conf "%FILE%"
Return value should be 1, save and exit.
21. At this point your hmailserver is already using clamav to scan for viruses

Install ClamD service
• Launch the command shell through Windows resource toolkit (start, programs, Windows Resource Kit Tools)
• Type the following command to create the ClamD service instsrv.exe ClamD “C:\Program Files\Windows Resource Kits\Tools\srvany.exe"
• At this point launch your services applet and check to see the newly created ClamD service
• Right click the service, properties,logon tab, enter the admin account and password
• Go to recovery tab and choose restart service for all three failures cases, click ok
• Do not start the service yet
• Now launch the registry editor (regedit)
• Navigate to HKEY local machine, system, current control set, services, clamD. Right click it and create a new key name it Parameters
• Right click Parameters and create new string value, name it Application, right click Application key, then modify and enter this C:\ClamAv\Clamd.exe -c C:\ClamAv\Clamd.conf , click ok
• Launch taskmanager, find and end the process ClamD
• From the services start the CLamD Service.

PS: Restarting the server at this point if possible, is a good idea.

Happy Messaging :D :D :D :D :D


Top
 Profile  
 
 Post subject: Re: HOWTO: Windows server 2003, Hmailserver, ClamAv,SaneSecu
PostPosted: 2011-11-05 22:06 
New user
New user

Joined: 2011-11-04 21:39
Posts: 28
Since i maxed out on my post, here is the test you should run after completing the installation.
Go to http://www.mtgsy.net/dns/virustest.php , enter your email address and click submit. this will send the Eicar virus testing email (not hurmfull) so you can make sure that ClamAv is working fine.


Top
 Profile  
 
 Post subject: Re: HOWTO: Windows server 2003, Hmailserver, ClamAv,SaneSecu
PostPosted: 2012-05-05 17:21 
Normal user

Joined: 2010-06-29 16:41
Posts: 48
Seems http://hideout.ath.cx/clamav/ is not available. Can we carry on regardless?

I already have a working hmail server & older tbb version of ClamAV running, and have no idea what ClamSup, rsync and sanesecurity are, am I safe to continue with your instructions to get an up to date ClamAV running?


Top
 Profile  
 
 Post subject: Re: HOWTO: Windows server 2003, Hmailserver, ClamAv,SaneSecu
PostPosted: 2012-05-07 23:17 
Normal user

Joined: 2010-06-29 16:41
Posts: 48
Carried on regardless!!

I have, however, got a bunch of problems. As far as I can tell, I've installed everything correctly and set up the service correctly, the problem is, the services widget claims ClamD is running, but it doesn't show in Task Manager >> Processes, the low memory usage on our box backs that up.

Since I was upgrading from an earlier version, I thought I'd try deleting everything in the data directory and re-populate it by running Freshclam, that hasn't had any effect.

For some reason I have a hunch that it's not reading the conf file, but all settings are correct.

Another thing I've noticed (maybe connected with above) is that if I try running it in my 'home' directory with c:\clamav\clamd.exe -c c\clamav\clamd.conf (note use of full path names here) I get the following error - ERROR: Can't open/parse the config file c\clamav\clamd.conf

I've also just added C:\clamav to the Path environment variable, but I don't think that takes effect until after a reboot which I can't do until the server is quiet

Any and all help appreciated


Top
 Profile  
 
 Post subject: Re: HOWTO: Windows server 2003, Hmailserver, ClamAv,SaneSecu
PostPosted: 2012-05-08 00:17 
Normal user

Joined: 2010-06-29 16:41
Posts: 48
Here we go again!! Noticed a typo somewhere, after correcting it ClamD is running properly, however, when using the supplied link to test HMS I'm getting the following in clamd.log -

Mon May 07 22:11:43 2012 -> C:\Program Files (x86)\hMailServer\Temp\{1F74A7DD-F013-4FDC-B176-68DF6091CEB6}.tmp: Can't unlink file ERROR

Any clues?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests



Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group