SpamAssassin

От: Dmitry Smirnov <CGatePro_at_mx_ru>
Дата: Sat 11 Oct 2003 - 20:10:26 MSD

Добрый день!

Помогите разобраться со связкой CG+SpamAssassin Берем:
SpamAssassin 2.60
CG 4.1.5
FreeBSD 5.1 (ну или 4.8 - cуть не меняется)

В Server-Wide Rules создаем правило:
Data
Header Field is-not X-Spam-Status*
Execute [STDERR] [FILE] [RETPATH] [RCPT] /var/CommuniGate/scanspam.sh Disсard

scanspam.sh из себя представляет следующее:



#!/bin/sh

myCgate="/var/CommuniGate"
myLogFile="/var/CommuniGate/spam-result.out" spamcCommand="/usr/local/bin/spamc -d 127.0.0.1 -f"

#Comment out following two lines if you don't want to echo the passed
variable info to
#the spam-result.out file.

myDate=`date +%Y-%m-%d\ %H:%M:%S`
echo "Date $myDate " $@ >> $myLogFile

#Get the fileid of the message file

QueuePath=$2
NewFile=`basename $QueuePath`'.tmp'
FinalFile=$NewFile'.sub'

# Formulate return-path and Envelope-To addresses from command line args.
# shift out the first 3 arguments, make sure one > to create a new file
shift 3
echo "Return-Path:" $1 > /var/CommuniGate/Submitted/$NewFile
# shift out 5 command arguments. and start appending
shift 2
Envelope=$1
shift
while [ $# -gt 0 ]
do
  Envelope=$Envelope','$1
  shift
done

# Formulate the envelope Header file.

echo "Envelope-To: " $Envelope >> $myCgate/Submitted/$NewFile
# Append an X-Spam header in there. This is very important. Without this
# tag, if spamc fails to call spamd, it will send the message back without
# a tag and your message will fall into an UGLY loop. This alleviates that.
echo "X-Spam-Status: Scanner Called" >> $myCgate/Submitted/$NewFile
# strip out CommuniGate stuff for SpamAssassin first
# using awk, and then send to spamc.

gawk '/Received/, /\n/' $myCgate/$QueuePath | $spamcCommand >> /var/CommuniGate/Submitted/$NewFile

#Now submit the file by renameing it to .sub
mv /var/CommuniGate/Submitted/$NewFile /var/CommuniGate/Submitted/$FinalFile

exit 0;


Шлем письмо.
Смотрим в логи SpamAssassin


Date 2003-10-11 19:48:36  -f Queue/10043.msg -p <xxx@xxx.ru> -r yyy@yyy.ru
Date 2003-10-11 19:48:36  -f Queue/10044.msg -p <> -r xxx@xxx.ru
-----------------------------------------------

Письмо приходит пустышка:



Return-Path: <xxx@xxx.ru>
Received: from [1.1.1.1] (HELO xxx.ru)
  by xxx.ru (CommuniGate Pro SMTP 4.1.5)   with ESMTP id 5994505 for yyy@yyy.ru; Sat, 11 Oct 2003 19:48:02 +0400 Received: by m-10.ru (CommuniGate Pro PIPE 4.1.5)   with PIPE id 10048; Sat, 11 Oct 2003 19:48:51 +0400 X-Spam-Status: Scanner Called
Date: Sat, 11 Oct 2003 19:48:51 +0400
Message-ID: <auto-000000010048@xxx.ru>

И все... больше ничего нет.

Что не так и в каком месте копать подскажите плиз?

C уважением,
Дмитрий Смирнов Получено Sat Oct 11 16:09:40 2003

Этот архив был сгенерирован hypermail 2.1.8 : Fri 24 Apr 2015 - 16:12:45 MSK