ClamWin Free Antivirus Forum Index
ClamWin Free Antivirus
Support and Discussion Forums
Reply to topic
Setting up mail notification from command line
nagaraja


Joined: 13 Dec 2007
Posts: 0
Reply with quote
Hi guys

first of all namy thanks for ClamWin. It's GREAT!!!

I'm trying to configure it using command line but when clamscan discovers a virus i cannot send an email notify.
In clamscan's commands i only can find --no-mail to disable it.

Where's to configure it? Do i need to use an external smtp agent?

Thanks in advance to anyone
View user's profileSend private message
budtse


Joined: 14 Jan 2006
Posts: 0
Location: Belgium
Reply with quote
Hi,

The email notifications are not handled by clamscan, but by clamtray (the tray icon application). If you don't want to use clamtray and want to use clamscan in scripting, you will have to write your own email-routines in that scripting (e.g. by using WMI scripting).

budtse
View user's profileSend private message
nagaraja


Joined: 13 Dec 2007
Posts: 0
Reply with quote
Hi,

in which way WMI scripting can help me with email sending? Do i need to check scheduled task status? report txt file parsing? something else?

Thanks a lot
View user's profileSend private message
budtse


Joined: 14 Jan 2006
Posts: 0
Location: Belgium
Reply with quote
nagaraja wrote:
Hi,

in which way WMI scripting can help me with email sending? Do i need to check scheduled task status? report txt file parsing? something else?

Thanks a lot


I'm sorry, I was wrong. What you need is CDO, not WMI. I'm not a script specialist, but i found an example of how to send an email using VBScript here: https://www.paulsadowski.com/WSH/cdo.htm https://www.paulsadowski.com/WSH/cdo.htm.

Roughly what you would need to do in the script is:
1. Start clamscan (save the report with --log parameter)
2. Check the return code of clamscan (see the documentation on clamav.net)
3. If viruses are detected (the return code will tell you this), send an email using the example in the link above. You can use the scan log file as email body.

I do not have the time to create the script for you now. If you do find the solution, please consider to publish it here (in the tutorials section). It might be usable for others too.

regards,
Peter
View user's profileSend private message
Setting up mail notification from command line
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic