[Exim] Spamassassin at SMTP time with local_scan

Top Page
Delete this message
Reply to this message
Author: Marc MERLIN
Date:  
To: exim-users
Subject: [Exim] Spamassassin at SMTP time with local_scan
Doing this was my holy grail:

220 gandalf.merlins.org ESMTP Exim 4.02 #23 Tue, 16 Apr 2002 00:23:40 -0700 - mm1
mail from: merlin@gandalf
250 OK
rcpt to: merlin@gandalf
250 Accepted
data
354 Enter message, ending with "." on a line by itself
From: merlin@gandalf
To: merlin@gandalf

test
.
550 Heuristics guessed that this message was spam: hits=8.0 required=7.0

2002-04-16 00:34:53 16xNUA-0001uI-00 rejected by local_scan(): Heuristics guessed that this message was spam: hits=8.0 required=7.0
Envelope-from: <merlin@gandalf>
Envelope-to: <merlin@gandalf>
P Received: from localhost ([127.0.0.1]:38896 ident=root)
        by gandalf.merlins.org with smtp (Exim 4.02 #23 (Debian))
        id 16xNUA-0001uI-00
        for <merlin@gandalf>; Tue, 16 Apr 2002 00:34:46 -0700
F From: merlin@gandalf
T To: merlin@gandalf
I Message-Id: <E16xNUA-0001uI-00@???>
  Date: Tue, 16 Apr 2002 00:34:46 -0700
  X-Spam-Status: Yes, hits=8.0 required=7.0 tests=SUBJ_ALL_CAPS,NO_REAL_NAME,FROM_MALFORMED,TO_MALFORMED,FROM_AND_TO_SAME,NO_MX_FOR_FROM version=2.11
  X-Spam-Flag: YES
  X-Spam-Checker-Version: SpamAssassin 2.11 (devel $Id: SpamAssassin.pm,v 1.68 2002/03/04 01:22:24 hughescr Exp $)
  X-Spam-Report:   8 hits, 7 required;
  *  2.0 -- Subject is all capitals
  *  0.6 -- From: does not include a real name
  *  3.5 -- From: has a malformed address
  * -0.1 -- To: has a malformed address
  *  0.2 -- From and To the same address
  *  1.8 -- No MX records for the From: domain



rset
250 Reset OK
mail from: merlin@gandalf
250 OK
rcpt to: merlin@gandalf
250 Accepted
data
354 Enter message, ending with "." on a line by itself
From: merlin@gandalf
To: merlin@gandalf
Subject: foo

test
.
250 OK id=16xNZ1-0001zy-00

==> /var/log/exim/mainlog <==
2002-04-16 00:39:59 16xNZ1-0001zy-00 SA score: hits=6.0 required=7.0
2002-04-16 00:39:59 16xNZ1-0001zy-00 <= merlin@gandalf H=localhost [127.0.0.1]:38910 I=[127.0.0.1]:25 U=root P=smtp S=473 T="foo" from <merlin@gandalf> for merlin@gandalf


Ok, the code is *not* finished. This is a pre-release for C coders so that
you can give me feedback, doublecheck I got all the pointers and string
handling right and critique my code if necessary (it's been 5 years since I
actually coded in C, so I'm a bit rusty)
(I patch other people's C all the time, but I code my own stuff in perl)

I wish local_scan could actually be in a shared library that you'd specify
in exim.conf, but in the meantime, you need to replace src/local_scan.c with
this version, and rebuilt exim:
http://marc.merlins.org/linux/exim/local_scan.c

Let me know what you think

Cheers,
Marc
--
Microsoft is to operating systems & security ....
                                      .... what McDonalds is to gourmet cooking


Home page: http://marc.merlins.org/ | Finger marc_f@??? for PGP key