Koozali.org: home of the SME Server

spamfilter + vacation - mailer daemon bounces

jbath

spamfilter + vacation - mailer daemon bounces
« on: January 11, 2006, 11:44:35 PM »
I'm using Jesper's spamfilter and antivirus on a 6.01 server.  In addition I have vacation installed.  The problem is this; we turn on the vacation message and it autoreplies to every single message that comes through the server to that person.  This includes every bit of spam that is supposed to be filtered with procmail.

What I'd like to do is set it up so that a message goes through vacation ONLY if it has been marked clean by spamassassin.  So that a mail goes through spamassassin, is found to be negative for spam, then into the procmail filter, and onto the vacation message. A message marked positive for spam gets procmailed into the junkmail folder and stops there.

I would think that the template I want to alter is the ,qmail file template, am I wrong?  Has anyone dealt with this particular problem in the past and has found a solution?

Thanks in advanced,

Jason

jbath

spamfilter + vacation - mailer daemon bounces
« Reply #1 on: January 11, 2006, 11:51:15 PM »
Just a quick thought on this....  Would it or would it not be easier to put the vacation message information into the .procmailrc file?  In our case a line that does not have the X-Spam-Flag gets piped through vacation as the X-Spam-Flag header only gets added if it is found to be such in my particular setup.

Offline Alex Schaft

  • ****
  • 97
  • +0/-0
Vacation and spam
« Reply #2 on: January 12, 2006, 04:56:53 AM »
Hi,

I actually did a change to /usr/local/bin/vacation for this. Works like a charm:

sub check_headers
{
    my($header);

    $/ = '';                    # Read in paragraph mode

    $header = <STDIN>;
    $header =~ s/\n\s+/ /g;     # Join continuation lines

    $* = 1;                     # Multi line matching within a string

    exit(0) if ($header =~ /^Precedence:\s+(bulk|junk)/i);
    exit(0) if ($header =~ /^From.*-REQUEST\@/i);
    exit(0) if ($header =~ /^Mailing-List:/i);

   # Added by Alex Schaft 11/01/2006
    exit(0) if ($header =~ /^X-Spam-Flag:\s+YES/i);

    if ($check_to_and_cc)
......