SpamCheck Header

Julian Field jkf at ecs.soton.ac.uk
Wed May 22 01:00:30 IST 2002


At 23:46 21/05/2002, you wrote:
>At 17:44 21/05/2002, you wrote:
>>I have been using MailScanner for several months now, and I am very happy
>>with well it works.  Thanks Julian!
>>
>>I have configured MailScanner to only add a header to an email if it is
>>tagged as spam, and not to modify the subject.  I have told our users how to
>>filter their email based on this header.  The header I have told them to
>>filter on is "X-MailScanner-SpamCheck:".
>>
>>With the new option Always Include SpamAssassin Report, it seems that this
>>header will now be in every message.  I know that I don't have to set that
>>configuration option in my setup, but I am finding that there are others
>>(especially those on this list) that have it set, and so the header gets
>>added, and then filtered as spam when it comes to my mailbox.
>>
>>I am probably going to have to change the header that I filter on to
>>"X-MailScanner-SpamCheck: SpamAssassin", and tell all of my users the same
>>thing.  But, before I do all of that work, I have some questions.
>>
>>*  Does it even make sense to check for spam in your outgoing email?  Maybe
>>it does, but do you really want the Spam Assassin report on your outgoing
>>email?  Should there be an option to always include the Spam Assassin report
>>only on incoming email?
>
>I don't bother checking outgoing mail. Checking inbound mail stops your
>machines getting infected by the latest worm in the first place, so you are
>unlikely to send out any nasties anyway. But it seems a lot of people do
>check outbound even so. You can always rename the header to be
>         X-MyISP-SpamCheck:
>You don't have to stick to the supplied header names, feel free to
>personalise them a bit. Of course I prefer people to leave MailScanner in
>the header somewhere, as it gets me more hits (and hence publicity, and
>hence users) from the search engines.
>
>>*  Is it possible that this header will change again?  Rather than having to
>>change the filtering rules again, can we have a specific header for mail
>>that was tagged as Spam, separate from the Spam Assassin report?
>>(X-MailScanner-FoundToBeSpam or something like that).  Or maybe make this
>>header configurable?
>
>If you look for "X-MailScanner-SpamCheck: not spam" then you know it isn't
>spam, even though it might include a SpamAssassin header. Oh, and allow for
>the non-spam case where there isn't a SpamCheck header at all.

How about, if the SpamCheck header is going to be there (because you've
asked to always get the SpamAssassin report) and the message isn't spam,
then I add "not spam (whitelisted)" instead of the current "not spam", so
you know why it got marked as spam? It's only about 1 line to change in the
code.

The following patch is *only* for the latest version of the code, and has
not been completely tested. But if you are confused by the current
behaviour, it should make it easier for your users to understand.

=============================================
--- /usr/local/mailscanner/mailscanner/bin/sendmail.pl  Mon May 20 13:50:27
2002
+++ sendmail.pl Wed May 22 00:59:13 2002
@@ -261,7 +261,9 @@

      # Add "not spam, " to start of header if it isn't spam but we
      # have included a SpamAssassin header.
-    $SpamHeader = "not spam, " . $SpamHeader
+    $SpamHeader = "not spam" .
+                  ($IsOnWhiteList?" (whitelisted), ":", ") .
+                 $SpamHeader
        if $IsSpam->{$mID} != 1 && $SpamHeader ne "";

      if ($SpamHeader ne "") {
=============================================

This patch will be rolled into the next release unless anyone reports any
nasty bugs.

--
Julian Field                Teaching Systems Manager
jkf at ecs.soton.ac.uk         Dept. of Electronics & Computer Science
Tel. 023 8059 2817          University of Southampton
                             Southampton SO17 1BJ



More information about the MailScanner mailing list