Ok i've successfully got spamdyke working on the server but I thought I'd post my findings in case anyone else gets stuck with things or wonders how to set it up with Plesk.
I found a
tutorial in German on setting up spamdyke with Plesk which had some useful config examples but I found that their use of some settings was too restrictive so I pared them down.
So after installing spamdyke I created the file below:
/etc/spamdyke.conf
log-level=3
local-domains-file=/var/qmail/control/rcpthosts
max-recipients=20
idle-timeout-secs=60
graylist-dir=/var/qmail/spamdyke/greylist
graylist-min-secs=300
graylist-max-secs=1814400
sender-blacklist-file=/var/qmail/spamdyke/blacklist_senders
recipient-blacklist-file=/var/qmail/spamdyke/blacklist_recipients
ip-in-rdns-keyword-file=/var/qmail/spamdyke/blacklist_keywords
ip-blacklist-file=/var/qmail/spamdyke/blacklist_ip
rdns-whitelist-file=/var/qmail/spamdyke/whitelist_rdns
ip-whitelist-file=/var/qmail/spamdyke/whitelist_ip
greeting-delay-secs=5
never-greylist-ip-file=/var/qmail/spamdyke/never_greylist
tls-certificate-file=/var/qmail/control/servercert.pem
local-domains-file=/var/qmail/control/rcpthosts
Then you need to create some directories and files:
mkdir -p /var/qmail/spamdyke/greylist
touch /var/qmail/spamdyke/blacklist_ip \
/var/qmail/spamdyke/blacklist_recipients \
/var/qmail/spamdyke/whitelist_ip \
/var/qmail/spamdyke/blacklist_keywords \
/var/qmail/spamdyke/blacklist_senders \
/var/qmail/spamdyke/whitelist_rdns
I also found that setting the ownership of the new files was important, so:
chown -R qmaild:nofiles /var/qmail/spamdyke
Next I backed up the original smtp and smtps xinetd.d files:
cp /etc/xinetd.d/smtp_psa /etc/xinetd.d/smtp_psa.orig
cp /etc/xinetd.d/smtps_psa /etc/xinetd.d/smtps_psa.orig
Changed the smtp_psa and smtps_psa files so that on the server_args line between "/var/qmail/bin/relaylock" and "/var/qmail/bin/qmail-smtpd" I had "/usr/local/bin/spamdyke -f /etc/spamdyke.conf"
I also copied the full server_args line to a new file (which I called spamdyke-test-config), added --config-test to the spamdyke arguments. This allows me to quickly test the spamdyke config without having to copy and paste bits.
So after running the config test I found that it complained about a lack of domains in the greylist directory (which should list all domains to be protected) so I ran the following:
cd /var/qmail/spamdyke/greylist/
for i in `ls -1 /var/qmail/mailnames`; do mkdir $i; done
Finally I added an event on 'Domain creation' and 'Domain alias creation' in Event Manager in the CP to:
mkdir /var/qmail/spamdyke/<new_domain_name>;
chown qmaild:nofiles /var/qmail/spamdyke/<new_domain_name>
(I've not tested this bit yet as I've not created a new domain but I assume it will work!)
Finally a quick:
/etc/init.d/xinetd condrestart
Once everything is running ok i guess you can lower the log level in the config.
If users complain about mail being rejected with DENIED_GRAYLISTING when they send mail it is because they are not using SMTP authentication... I did a few 'grep DENIED /usr/local/psa/var/log/maillog' to see where blocks were occuring...
If anyone has any suggestions please let me know...