Koozali.org: home of the SME Server

Cron ClamAV on Mailboxes

Offline purvis

  • *****
  • 567
  • +0/-0
Re: Cron ClamAV on Mailboxes
« Reply #15 on: March 20, 2013, 04:50:51 PM »
Simtro
Thanks it does take a lot of time for sure when my skills and knowledge in linux and its running processes are low.
But I do have a lot of money invested in books and it takes a long time to filter the code found on the internet to get proper working code.

I am still testing and have improving some functions and testing seeing where improvement can be.
I do not know how most this stuff works and trying to find areas where some things do not work.
It is better that software just work as expected and there would be no since having to work around
issues from developer.
With simplicity comes complexity.

In the beginnnig, I did not realize that clamscan can be slow and I also did not understand what clamscan and clamdscan options to use.
I did not realize clamdscan can scan directories either, I thought clamdscan could only scan one file at a time, but it can scan directories.
clamdscan scans files faster than clamscan in my test and they run for hours, specially on equipment with lower resources.
I also have some new learned programming skills with bash and linux commands that can better these scripts.
We got it to run,  now it needs to run better

If you have any thoughts on possible areas of issues or how you would like to have some of the bash routines run. Now is a good time to broadcast it.

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Cron ClamAV on Mailboxes
« Reply #16 on: March 20, 2013, 06:15:53 PM »
Stefano
Is this dangerous to do or just for some other reason
Code: [Select]
cd /home/e-smith/files/users
clamscan -r --include=./*/Maildir/

I ask because i would like to  scan for viruses in emails often by many different means.
I worked on a program to read emails and save them in files on workstations.
The program is not complete as of yet and i am scared of viruses and such.
I never mind having a program to do more work if that is what it takes.

sorry Purvis, didn't see your question

it's dangerous because you can have concurrent access from 2 clamscan processes..
even if it were not a problem, your server will "sit down" because virus scan is a cpu and I/O consuming activity

Offline purvis

  • *****
  • 567
  • +0/-0
Re: Cron ClamAV on Mailboxes
« Reply #17 on: March 20, 2013, 08:04:38 PM »
Thanks Stefano
I am already seeing  the need to possibly not use the daily or weekly virus scan and use another script.
I am finding where you can use clamdscan rather than clamscan seems more attractive.

I have worked on some code and coming up with some new approaches that will look for running processes of clamscan and clamdscan.
I also have some ideas not presented to the forums just yet, sort of gathering my eggs now.
« Last Edit: March 20, 2013, 08:06:53 PM by purvis »

Offline Smitro

  • *
  • 350
  • +0/-0
Re: Cron ClamAV on Mailboxes
« Reply #18 on: June 27, 2013, 02:16:59 PM »
Hi Purvis,

I've got to thank you.. I've only recently had some spare time to sit and play with this again. I set it up just over a week ago and it's working well (it has caught a few already). I made a slight modification, on the third scan instead of scanning the whole mail box, I went for just the junkmail. From what I've seen it seems like these viruses are only making it into the inbox or they're being marked as spam. If on the off chance (hasn't happened yet) the email has some how made it to somewhere else in their mail folder, I'll leave the weekly scan (full system scan) to find these. This makes the scan a lot quicker, otherwise it would take most of the day to complete a scan.

Thanks for all your research, hopefully others will benefit from it as much as I did.

Smitro.
.........