Great Circle Associates Majordomo-Users
(September 1999)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: Blocking messages without a "Subject:" header
From: Mats Dufberg <Mats . Dufberg @ abc . se>
Date: Thu, 30 Sep 1999 21:01:32 +0100 (MET)
To: "James W. Durkin" <jwd @ Graphics . Cornell . EDU>
Cc: Majordomo Users List <majordomo-users @ GreatCircle . COM>
In-reply-to: <19990930093828.A4594@eyrie.graphics.cornell.edu>

On Thu, 30 Sep 1999, James W. Durkin wrote:

> I would like have Majordomo bounce (to the list admins) incoming
> messages that come in without any Subject: header at all.  Any
> suggestions on how to accomplish this?  "taboo_headers" doesn't seem
> to have a negation option of any sort.

You could add a filter before resend that checks the mail for the
existance of an explicit subject field. For those without one, you just
add an empty one, and the you can use the following test in taboo_headers

/^subject: *$/i


A filter could be as simple as (please test it before use in production):

#!/usr/local/bin/perl

while (<>) {
   if (!$headerdone and /^ *$/) {
      $headerdone = 1;
      if ($subjectfound) {
         print;
      } else {
         print "Subject:\n\n";
      };
   } elsif (!$headerdone) {
      $subjectfound = 1 if /^subject:/i;
      print;
   } else {
      print;
   };
};          	   


-----------------------------------------------------------------
Mats Dufberg                                  mats.dufberg@abc.se
Alvdalsvagen 133                              +46 8 38 48 59
SE-165 75 Hasselby, Sweden



References:
Indexed By Date Previous: Unix needed?
From: NAFTA Resources <nafta@sympatico.ca>
Next: Re: apparently-to list of addressees showing up in msg
From: Mats Dufberg <Mats.Dufberg@abc.se>
Indexed By Thread Previous: Blocking messages without a "Subject:" header
From: "James W. Durkin" <jwd@Graphics.Cornell.EDU>
Next: Majordomo ignoring parts of listame.config?
From: mjn <mjn@tc.umn.edu>

Google
 
Search Internet Search www.greatcircle.com