Gnus development mailing list
 help / color / mirror / Atom feed
From: Colin Rafferty <craffert@ml.com>
Subject: Re: Split mail on two headers
Date: 07 Apr 1998 15:35:13 -0400	[thread overview]
Message-ID: <ocremz9zaq6.fsf@ml.com> (raw)
In-Reply-To: Harry Putnam's message of "07 Apr 1998 11:30:28 -0700"

Harry Putnam writes:

> Probably should be using 'fancy-splitting' but have tried to read it
> several times, and it is just to complicated for my level of
> experience. (A 'correct'  way of saying: I couldn't make heads or tails
> of it)

For getting started with fancy splitting, just start it at one simple
level to do your basic splitting.  Then add fancy stuff as you need it 
later.

> I want to see a regexp capable of splitting a message on both 'From' and
> 'To' headers.  In other words some way to match on more than one line.

You cannot do this in basic or fancy splitting.  Everything is just
one line at a time.

> Something like this seems it should work to split Joes' mail to me into
> 'Box' and let his mail to <whatever> go in a different direction, but
> does not.

> ("Box" "From:.*Joe Blow\\(.\\|\n\\)*To:.*reader")

This is one of my fancy mail splitting rules that does something
similar to what you want:

	    (from mail
		  (| ("\\(resent-\\)?\\(to\\|cc\\)" "craffert" "mail.daemon")
		     "mail.auto.spam"))

`from' and `mail' are predefined regexp's that match the "From:" field 
and the mailer-daemon sender, respectively.

If a message is "from" "mail", then I do a subsplit.  If it is
actually "to" me, I want it in "mail.daemon".  If it is not to me, it
is probably spam, so put it in the spam box.

Your version may look like this:

	    (from "Joe_Blow"
		  (| ("\\(resent-\\)?\\(to\\|cc\\)" "reader" "Box")
		     "Different.Box"))

> So can it be made to match on more than one line in the 'head'?

No.  You could write your own split function to do that, but it might
be more work than you need.

> Or, even more complicated, can it be made to match on a string in the
> body? (might be fun to play with)

No.  You cannot even write a split function that does this, since the
split is called narrowed to the header.

-- 
Colin


  reply	other threads:[~1998-04-07 19:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-04-07 18:30 Harry Putnam
1998-04-07 19:35 ` Colin Rafferty [this message]
1998-04-07 22:35   ` Harry Putnam
1998-04-07 23:24     ` Ken Raeburn
1998-04-08  1:06       ` Harry Putnam
1998-04-08  1:40       ` Harry Putnam
1998-04-08  2:22     ` Justin Sheehy
1998-04-08  8:59       ` Harry
1998-04-08  9:09         ` Hrvoje Niksic
1998-04-08 15:41           ` Harry Putnam
1998-04-09 13:37             ` Hrvoje Niksic
1998-04-09  3:36           ` Harry Putnam
1998-04-08  9:37         ` Kai Grossjohann
1998-04-08  9:44           ` Hrvoje Niksic
1998-04-08 10:15             ` Kai Grossjohann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ocremz9zaq6.fsf@ml.com \
    --to=craffert@ml.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).