Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have a dedicated server running Plesk 9.5.4 (yes I know that's old) with Qmail as the MTA and Spamassassin and Spamdyke installed.

Spamdyke works a treat for blocking inbound mail based on rDNS etc, and Spamassassin for scanning inbound email, but we've had problems recently with large volumes of spam being sent through the server by authenticated mail users (AFAIK).

I would like to scan all outbound (remote-delivery and local-delivery) email for spam content, and also block/reject email based on a spam score.

I'm struggling to determine how to reconfigure qmail to do this.

Here's the current /etc/xinetd.d/smtp_psa, /etc/xinetd.d/smtps_psa and /etc/xinetd.d/submission_psa:

service smtp
{
    socket_type     = stream
    protocol        = tcp
    wait            = no
    disable         = no
    user            = root
    instances       = UNLIMITED
    env             = SMTPAUTH=1 SHORTNAMES=1
    server          = /var/qmail/bin/tcp-env
    server_args     = -Rt0 /usr/local/bin/spamdyke -f /etc/spamdyke.conf /var/qmail/bin/relaylock /var/qmail/bin/qmail-smtpd /var/qmail/bin/smtp_auth /var/qmail/bin/true /var/qmail/bin/cmd5checkpw /var/qmail/bin/true
}

service smtps
{
    socket_type     = stream
    protocol        = tcp
    wait            = no
    disable         = no
    user            = root
    instances       = UNLIMITED
    env             = SMTPAUTH=1 SHORTNAMES=1
    server          = /var/qmail/bin/tcp-env
    server_args     = -Rt0 /usr/local/bin/spamdyke -f /etc/spamdyke.conf /var/qmail/bin/relaylock /var/qmail/bin/qmail-smtpd /var/qmail/bin/smtp_auth /var/qmail/bin/true /var/qmail/bin/cmd5checkpw /var/qmail/bin/true
}

service submission
{
    socket_type     = stream
    protocol        = tcp
    wait            = no
    disable         = no
    user            = qmaild
    instances       = UNLIMITED
    env             = SUBMISSION=1 SMTPAUTH=1 SHORTNAMES=1
    server          = /var/qmail/bin/tcp-env
    server_args     = -Rt0 /usr/local/bin/spamdyke -f /etc/spamdyke.conf /var/qmail/bin/qmail-smtpd /var/qmail/bin/smtp_auth /var/qmail/bin/true /var/qmail/bin/cmd5checkpw /var/qmail/bin/true
}

Qmail's defaultdelivery file contains:

| /usr/bin/deliverquota ./Maildir

My understanding is that I should be able to modify the server_args so that emails are passed through spamc (or passed over to spamd), but I'm not sure how the return codes would be handled by the following processes in the server_args list...

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I eventually discovered you can create mail handlers in Plesk, which are specified here.

I had to write my own script based on the information in the document linked above and place it in a new directory /usr/local/psa/handlers/user-hooks/ and then run Plesk's mailmng program to enable the mail handler.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.