Koozali.org: home of the SME Server

DansGuardian Mail

Offline GlitchFreak

  • ****
  • 97
  • +0/-0
DansGuardian Mail
« 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?


Offline stephen noble

  • *
  • 607
  • +1/-0
    • Dungog
Re: DansGuardian Mail
« Reply #1 on: November 08, 2007, 01:32:49 PM »
before you try, check the logs for how often users hit a blocked page...

Offline GlitchFreak

  • ****
  • 97
  • +0/-0
Re: DansGuardian Mail
« Reply #2 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.


Offline stephen noble

  • *
  • 607
  • +1/-0
    • Dungog
Re: DansGuardian Mail
« Reply #3 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

Offline GlitchFreak

  • ****
  • 97
  • +0/-0
Re: DansGuardian Mail
« Reply #4 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.

Offline cool34000

  • *
  • 339
  • +0/-0
Re: DansGuardian Mail
« Reply #5 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!
« Last Edit: November 11, 2007, 01:51:08 AM by cool34000 »

Offline GlitchFreak

  • ****
  • 97
  • +0/-0
Re: DansGuardian Mail
« Reply #6 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.

Offline cool34000

  • *
  • 339
  • +0/-0
Re: DansGuardian Mail
« Reply #7 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

Offline GlitchFreak

  • ****
  • 97
  • +0/-0
Re: DansGuardian Mail
« Reply #8 on: November 11, 2007, 07:49:46 PM »
Thanks Sylvian, saved me lots of scripting...  :shock: