Installing the daemon
=====================

1. Edit config.h (BSD/Linux specific defines)


2. Run "make webfiltd"


3. Copy webfiltd to /usr/local/sbin


4. Create /etc/webfiltd.conf:
myip		127.0.0.1
user		nobody
sessiondir	/var/sessions


5. Create directory /var/sessions, mode 0700 owned by root


6. Insert new service into inetd.conf and restart
profile	stream  tcp     nowait  root    /usr/local/sbin/webfiltd


7. Copy storelast.sh to /usr/local/bin (for users' .procmailrc)



Installing the CGI
==================

1. Run "make webfilt"


2. Copy the resulting webfilt.cgi to your cgi-bin directory


3. Make sure the CGI is called over HTTPS, for password security



Configuring users
=================

1. Create directories where copies of last mail will be stored
mkdir $HOME/lastmail
mkdir $HOME/lastmail/good
mkdir $HOME/lastmail/spam


2. Add two .procmailrc rules, adjust for whatever spam filter you use
# Keep copies of last spam received
:0 ci
* ^X-SpamProbe: SPAM
| /usr/local/bin/storelast.sh $HOME/lastmail/spam

# Keep copies of last good mail received
:0 ci
* ^X-SpamProbe: GOOD
| /usr/local/bin/storelast.sh $HOME/lastmail/good


3. Add cron cleanup scripts. This assumes you have GNU find and xargs!
0 0 * * *  find $HOME/lastmail -name "*.txt" -ctime +5 -print0 | xargs -0 rm -f


4. Create .webfiltrc in $HOME
# Use full paths to directories, otherwise SWAP feature doesn't work
dir.good	/home/user/lastmail/good
dir.spam	/home/user/lastmail/spam
exec.score	/usr/bin/spamprobe score
exec.good	/usr/bin/spamprobe train-good
exec.spam	/usr/bin/spamprobe train-spam


5. Test out the daemon: telnet localhost profile
You should be able to enter command: "LOGIN username password 0"
The server should with "+secret...." and wait. Enter QUIT to exit.
If the login does not succeed with a valid account, check syslog
for the error (daemon, log level warning).

