Spamd
Installing it:
cd /usr/ports/mail/spamd
make install
make cleanEnable spamd in rc.conf:
- enable spamd
obspamd_enable="YES"
obspamlogd_enable="YES"Edit /etc/fstab:
- mount for spamd
fdescfs /dev/fd fdescfs rw 0 0and mount it with:
mount -aCreate the configuration file:
cd /usr/local/etc/spamd
cp spamd.conf.sample spamd.confWe log the entries in a seperate file, edit /etc/syslog.conf for this:
!spamd
daemon.err;daemon.warn;daemon.info /var/log/spamdand restart it:
touch /var/log/spamd
chmod 644 /var/log/spamd
touch /usr/local/etc/mail/spamd-mywhite
chmod 644 /usr/local/etc/mail/spamd-mywhite
/etc/rc.d/syslogd restartWe enable log rotating by editing /etc/newsyslog.conf:
/var/log/spamd 644 7 100 * JCand reload the config with:
/etc/rc.d/newsyslog restartNow start it with:
/usr/local/etc/rc.d/obspamd start
/usr/local/etc/rc.d/obspamlogd startNow we redirect the traffic by using pf. Make sure you have something like the following lines in your /etc/rc.conf:
# enable pf
pf_enable="YES"
pf_rules="/etc/pf.conf"
pf_flags=""
pflog_enable="YES"
pflog_logfile="/var/log/pflog"
pflog_flags=""Now edit your /etc/pf.conf and add:
table <spamd-white> persist
table <spamd-mywhite> persist file "/usr/local/etc/mail/spamd-mywhite"
# redirect unkown mail sender to spamd
no rdr inet proto tcp from <spamd-white> to any \\
port smtp
no rdr inet proto tcp from <spamd-mywhite> to any \\
port smtp
rdr pass inet proto tcp from any to any \\
port smtp -> 127.0.0.1 port spamdand reload pf with:
/etc/rc.d/pf restart