Koozali.org: home of the SME Server

Obsolete Releases => SME 7.x Contribs => Topic started by: GlitchFreak on November 08, 2007, 11:35:43 AM

Title: DansGuardian Mail
Post by: GlitchFreak on November 08, 2007, 11:35:43 AM
Morning

I'd like to modify the dansguardian.pl script to send me a mail when a user hits a blocked page.

Questions

Do I have to use sendmail or can I use "mail -s" etc?
Which dansguardian.pl should I edit? the one in primary/cgi-bin or the /etc/dansguardian/dansguardian.pl?

Title: Re: DansGuardian Mail
Post by: stephen noble on November 08, 2007, 01:32:49 PM
before you try, check the logs for how often users hit a blocked page...
Title: Re: DansGuardian Mail
Post by: GlitchFreak on November 09, 2007, 01:48:45 PM
It occurs a few times a day. My primary concern is that, being a school, I want the relevant teachers to be immediately notified if someone on their class is trying to surf porn etc.

Title: Re: DansGuardian Mail
Post by: stephen noble on November 09, 2007, 11:13:58 PM
use primary/cgi-bin
make a copy it will be overwritten on an upgrade

I'd expect most sites to have hundreds/thousands of hits a day (if you blocked ads)

I don't see the urgency, the student is blocked,
you can either have a quiet word with them later after checking logs
or change the wording so they know their activity is logged
Title: Re: DansGuardian Mail
Post by: GlitchFreak on November 09, 2007, 11:21:09 PM
I see your point. Problem is that it's a primary school and the users all use a generic proxy login. Too many students to assign credentials.
Title: Re: DansGuardian Mail
Post by: cool34000 on November 11, 2007, 01:47:13 AM
Hi,

If I remember well, you can modify this parameter directly in dansguardian.conf

I use it to send me an alert mail each time a virus is detected on the surf. You can also activate a function like that each time a page is blocked.
This was working well, but I turned off this stuff (too many alerts!)

You can also install SARG. Very nice web interface for looking dansguardian logs and internet surf history!
Title: Re: DansGuardian Mail
Post by: GlitchFreak on November 11, 2007, 07:10:33 PM
Cool34000, would you be able to tell me where you found this parameter please. I looked in the config file but alas I found nothing.
Title: Re: DansGuardian Mail
Post by: cool34000 on November 11, 2007, 07:28:21 PM
Hi,

Sorry, I didn't verify before posting... The right file look is dansguardianf1.conf
Related lines:
Code: [Select]
# Email reporting - original patch by J. Gauthier

# Use SMTP
# If on, will enable system wide events to be reported by email.
# need to configure mail program (see 'mailer' in global config)
# and email recipients
# default usesmtp = on
usesmtp = on

# mailfrom
# who the email would come from
# example: mailfrom = 'dansguardian@mycompany.com'
mailfrom = 'dansguardian'

# avadmin
# who the virus emails go to (if notify av is on)
# example: avadmin = 'admin@mycompany.com'
avadmin = 'admin'

# contentdmin
# who the content emails go to (when thresholds are exceeded)
# and contentnotify is on
# example: contentadmin = 'admin@mycompany.com'
contentadmin = 'admin'

# avsubject
# Subject of the email sent when a virus is caught.
# only applicable if notifyav is on
# default avsubject = 'dansguardian virus block'
avsubject = 'dansguardian virus block'

# content
# Subject of the email sent when violation thresholds are exceeded
# default contentsubject = 'dansguardian violation'
contentsubject = 'dansguardian violation'

# notifyAV
# This will send a notification, if usesmtp/notifyav is on, any time an
# infection is found.
# Important: If this option is off, viruses will still be recorded like a
# content infraction.
notifyav = on

# notifycontent
# This will send a notification, if usesmtp is on, based on thresholds
# below
notifycontent = off
In my config file, as you can see, notifycontent is turned off.

Hope it helped...
Sylvain
Title: Re: DansGuardian Mail
Post by: GlitchFreak on November 11, 2007, 07:49:46 PM
Thanks Sylvian, saved me lots of scripting...  :shock: