On Mon, 19 Jul 1999, Earl Hood wrote:

> On July 19, 1999 at 13:34, John Stumbles wrote:
> 
> >     I could write a perl filter to spot and excise such messages
> > before MHonArc sees them, but since such a script would have to do the
> > same parsing of messages that MHonArc does it would seem logical to do it
> > in one place. It would seem that the mechanism you have implemented to
> > ignore messages with the no-archive flag set would be the candidate for me
> > to look at. 

> I've thought about it.  I have been considering what the best approach
> will be.  Maybe something like:
> 
> <MsgExcludeFilter>
> /^Subject: DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA/m;
> </MsgExcludeFilter>
> 
> Basically, the resource allows you to use Perl code to determine if a
> message should be skipped.  $_ will contain the raw message header.  If
> MSGEXCLUDEFILTER evaulates to a true value, the message will be
> excluded.
> 
> Comments?

        I like this: you could do other useful things such as:

/^Subject: .*(money fast|XXX sex|business opportunity|your web site|test
message|unsubscribe)/im

        (Couldn't excluding messages with the X-no-archive header set have
been done this way too?)

        What might be useful would be a way of ANDing and ORing 
expressions to match on e.g.

<MsgExcludeFilter>
  <!-- implicit OR: exclude if any of following rules matches -->
  <FilterRule>
      /^Subject: DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA/m;
  </FilterRule>
  <FilterRule>
      /^Subject: unsubscribe/im
  </FilterRule>
  <FilterRule>
      /^Subject: test message/im
  </FilterRule>
  <FilterRule>
      <!-- implicit AND: this rule matches if both of following
                         regexps match -->
      /^From: \w+\@(aol|hotmail)\.com/im
      /^Subject: .*(money|opportunity|your web)/im
  </FilterRule>
</MsgExcludeFilter>

        This still seems a bit clunky to me: I have a feeling it could be
made more elegant and expressive, but I can't see how .... and I don't
know how any of this would be to implement. 

        Anyway, that's my 0.02 ECUs worth for today :-)


--
John Stumbles                                      [EMAIL PROTECTED]
I.T. Services Centre,   University of Reading  http://www.rdg.ac.uk/~visstmbl 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
          Press any key to continue or any other key to quit.

Reply via email to