Page 1 of 1

gamera and spamdyke -- how?

Posted: Mon Oct 27, 2014 10:14 am
by faris
Wow, I'm completely confused by the way qmail is initiated on a Gamera box.

I got into such a pickle trying to get spamdyke to work with it that I had to restore from a backup.

I need to use spamdyke for consistency and to make sure I know how everything works. Best of all, Spamdyke5 can check to see if an address exists before accepting mail for it, which is great on a mailscanner box.

Unfortunately I can't figure out which configuration file I need to edit to add the required bits to put spamdyke in front of qmail-smtp. I thought it would be /services/smtpd/run, but if it is then I'm adding it incorrectly and all I do is cause email to stop working completely -- even when I remove my edits.

I've done a grep -ri but can't find what I'm looking for.

Can someone point me in the right direction please?

The instructions say:

Code: Select all

6) Find the script that runs qmail when an incoming connection is established.

   If you followed the instructions at lifewithqmail.org or qmailrocks.org, look
   for:
        /service/qmail-smtpd/run
   If you installed qmail from the Debian packages, look for:
        /etc/init.d/qmail
   If your qmail installation is part of Plesk, look for:
        /etc/xinetd.d/smtp_psa

   Insert the spamdyke command before the "/var/qmail/bin/qmail-smtpd" command.
   Something like this:
--------------------------------------------------------------------------------
   ... /usr/local/bin/spamdyke -FLAGS /var/qmail/bin/qmail-smtpd 2>&1
--------------------------------------------------------------------------------
   Sometimes, the spamdyke command should be placed within a variable that is
   substituted into the command line.  If the script includes the rblsmtpd
   command, it can be replaced with the spamdyke command.

   Older installations of qmail may use the "softlimit" program as well.  You
   should probably remove it from the qmail start script; it tends to cause more
   problems than it prevents.
and /service/smtpd/run contains

Code: Select all

#!/bin/sh
. /usr/share/qmail/run-functions

# If rblsmtpd is installed, process rbltimeout rbldomains, and antirbldomains
if [ -x /usr/bin/rblsmtpd ]; then
        readdefault domains antirbldomains ""
        for domain in $domains; do
                rblopts="$rblopts -a $domain"
        done
        readdefault domains rbldomains ""
        for domain in $domains; do
                rblopts="$rblopts -r $domain"
        done
        readdefault timeout rbltimeout 60
        if [ -n "$rblopts" ]; then
                rbl="/usr/bin/rblsmtpd -v -t $timeout $rblopts"
        fi
fi

# Start daemons.
readdefault concurrency concurrencysmtpd 20
readdefault ulimitdata ulimitdata 80000000

exec \
softlimit -m $ulimitdata \
envuidgid qmaild \
tcpserver -DRUvX -c "$concurrency" -l "`head -1 /var/qmail/control/me`" \
        -x /etc/tcpcontrol/smtp.cdb 0 smtp \
fixcrio $rbl qmail-smtpd
so I figured all I had to do was replace "$rbl" with "/usr/local/spamdyke -f /etc/spamdyke.conf" but nope....

Re: gamera and spamdyke -- how?

Posted: Mon Oct 27, 2014 3:24 pm
by faris
ach, it was a basic mistake. qmail-smtpd is an argument to spamdyke, and so needs a full path.

Code: Select all

 fixcrio /usr/local/bin/spamdyke -f /etc/spamdyke.d/spamdyke.conf /var/qmail/bin/qmail-smtpd
And for completeness, to get changes made here to take effect, you need to do a "svc-stop smtpd" (and an equivalent start)