Plesk: spamdyke POP-Before-SMTP qmail (english)

Deutsche Version dieses Artikels

After installing spamdyke in Plesk POP-before-SMTP wasn’t properly working anymore. I googled for help, but all I could find simply stated this is not possible anymore and it’s bad anyhow, which isn’t much of a help when you have to find a solution. So we kept looking…

Plesk (or rather relaylock) saves IPs which are supposed to be authentificated by POP-before-SMTP in the table smtp_poplocks of the psa database. The following Perl script reads from this table and creates a list, which then can be used as an ip-white-list for spamdyke.

I decided to use a cronjob instead of a perl deamon since it’s very unlikely that a user is trying to send an email without SMTP auth in less than 59 seconds after establishing the POP3 connection.

Installation details:

# Download and check the script
wget "URL from end of this post"
chmod 700 spamdyke-pop-before-smtp*
nano spamdyke-pop-before-smtp*
# for debian users
apt-get install liblog-log4perl-perl
# for user of any other distribution
perl -MCPAN -e shell
install Log::Log4perl
# open /your/path/to/spamdyke.conf and add the following lines
# prepare the cronjob via "crontab -e"
*       *       *       *       *       /your/path/to/

Every sixty seconds the script is started. It then reads the database, writes the whitelist /var/qmail/spamdyke/pop-before-smtp and afterwards POP-before-SMTP is working like a charm again.

In case of an error the output will be logged in a file named /var/log/pop-before-smtp.log. If you want to receive an additional email as root, simply comment out the line
open STDERR, ‘>/dev/null’; (provided that your cron deamon was set up accordingly).

Download Link for Plesk x to Plesk 8:

Download Link for Plesk 9 to Plesk x:

  1. keraj
    20. Juli 2012, 00:45 | #1


    thanks for the script, but unfortunately it somehow does not work…
    The file generated only contains, and I don’t understand what is going on…

    Maybe you have updated version?

    Plesk version is 9

  2. keraj
    20. Juli 2012, 01:18 | #2

    I managed to solve this part, now the file is generated with the correct data… (POP3 was not enabled in the Plesk panel).

    But the problem persists, can’t still use pop3 before smtp.. while smtp auth works fine.

    Maybe you got some suggestions?

    Thank you!

  3. Dominik
    20. Juli 2012, 08:25 | #3

    Did you already install spamdyke?

    The configuration file /etc/spamdyke.conf has to contain the line:

    The perl script should generate this file. One ip address per line.

  1. 8. November 2010, 15:25 | #1