Gnus development mailing list
 help / color / mirror / Atom feed
From: David Moore <dmoore@UCSD.EDU>
Subject: Re: Fancy splitting: storing outgoing messages in the same folder
Date: 05 Apr 1997 18:19:23 -0700	[thread overview]
Message-ID: <rvybaxymlg.fsf@sdnp5.ucsd.edu> (raw)
In-Reply-To: Matt Pharr's message of 05 Apr 1997 17:14:48 -0700

Matt Pharr <mmp@graphics.stanford.edu> writes:

> I've got myself in Bcc in the default headers, and need to get splitting to
> do the rest of it. Given something like this:

> I'd like to do someting like:
> 
> (setq nnmail-split-fancy
>       '(| (from friends "mail.friends")
> 	  (from me and to friends "mail.friends")   ;; <-- ack!
> 	  (from me "mail.mmp")
> 	  "mail.misc"))

For the and situation you list you can do:

(setq nnmail-split-fancy
      '(| (from friends "mail.friends")
	  (from me
	    (to friends "mail.friends"))
	  (from me "mail.mmp")
	  "mail.misc"))


Or you might just want to use the preprovided 'any' instead of dealing
with from/to:

(setq nnmail-split-fancy
      '(| (any friends "mail.friends")
	  (from me "mail.mmp")
	  "mail.misc"))

Of course this behaves differently if you get a message sent to both you
and a friend by an "unknown".  The first will go in mail.misc, the
second will go in mail.friends.



My .gnus file on the web site does show this, but there are no
comments. :)  Note that I extend 'any' to include x-originally-to.  I
should probably just append on, rather than blasting over it.  I've
stuck a couple ';;; ' comments on the beginning of three lines to show
where this kind of an 'and' operation is being done.

Basically, you can make the 3rd arg to any split be another split, which 
is only tried if the message already matches.

The majority of my filing rules are filled in via another data-structure
which I use to specify a regexp and folder, as well as group specific
control info for bbdb.

(setq
 nnmail-split-abbrev-alist
 '((any . "from\\|to\\|cc\\|sender\\|apparently-to\\|resent-from\\|resent-to\\|resent-cc\\|x-originally-to")
   (mail . "mailer-daemon\\|postmaster\\|uucp"))
 nnmail-split-methods		'nnmail-split-fancy
 nnmail-split-fancy
 `(|
     ;; Sneak off duplicate message warnings.
     ("gnus-warning" "duplicate of message" "mail.duplicate")

     ;; Don't crosspost mailer daemon messages.
     ("from" mail "mail.daemon")

;;; HERE is an example of an 'and' like operation.  It must be from me
;;; and have the right subject.
     ;; Grab off timed reminders to myself.
     ("from" "dmoore"
      ("subject" "Auto-Anniversary\\|Auto-Birthday"
       "personal.danger.danger.will.robinson"))

     ;; Grab off mailing list admin mail instead of crossposting.
     (|
      (any "tinymuck-sloggers-\\(manager\||owner\\|request\\)@tcp.com"
	   "mail.list.muck.sloggers.admin")
      (any "ucsdsic-\\(owner\\|request\\)@oj.egbt.org"
	   "mail.list.ucsdsic.admin")
      (any "owner-ai@.*ucsd.edu"
	   "mail.list.ai.admin")
      )

     ;; Grab off crashs@xemacs.org also via a non-normal header.
     (any "crashes@xemacs.org" "mail.list.xemacs.crashes")
     ("X-Mailing-List" "crashes@xemacs.org" "mail.list.xemacs.crashes")

     ;; Crosspost everything else as appropriate, except don't file to
     ;; a person's box if we're hitting them on a list.
     (& 
      ;; Normal distribution boxes.
      ,@(mapcar '(lambda (x) (list 'any (car x) (cdr x)))
		(dmoore::gnus-procmail-select
		 dmoore::gnus-procmail-addresses-list nil '(create t nil)))
      ,@(mapcar '(lambda (x) (list "subject" (car x) (cdr x)))
		(dmoore::gnus-procmail-select
		 dmoore::gnus-procmail-subjects-list nil '(create t nil)))
      )

     ;; Do boxes for people, but first try the `From' address before
     ;; recipients.  Also don't crosspost any of this now, since I
     ;; tend to end up with junk when I hit E in one group and it just
     ;; gets marked at read in another.
     (|
      ,@(mapcar '(lambda (x) (list "From" (car x) (concat "people." (cadr x))))
		dmoore::gnus-procmail-people-list)
      ,@(mapcar '(lambda (x) (list 'any (car x) (concat "people." (cadr x))))
		dmoore::gnus-procmail-people-list)
      )

     ;; Anything else which is a followup to a message by me.  Optional
     ;; "s because I've had some mail come back with them.
     ("references\\|in-reply-to"
      "\"?rv[0-9a-z]+\\.fsf\"?@sdnp5\\.ucsd\\.edu"
      "mail.followup")

;;; HERE is a somewhat strange 'and' like operation, although we use 
;;; a complete split in the 3rd spot.
     ;; Grab off mail from xxx that has been bounced not forwarded.
     ;; Assume it goes into mail.list.yucks.
     ("Return-Path" "xxx@\\(\\|mailbox[12].\\)ucsd.edu"
      (|
       ("Newsgroups" "humor"			"mail.list.yucks")
       ("Newsgroups" "alt.sysadmin.recovery"	"mail.list.yucks")
       ("Newsgroups" "babylon5"			"mail.list.lurkers-ucsd")
       "people.xxx"))

;;; HERE is another 'and' like operation.  Must have both the correct
;;; return-path and the correct received headers.
     ;; Augh, someone bounces cert advisories to managers.
     ("Return-Path" "list-relay@\\(\\|mailbox[12].\\)ucsd.edu"
      ("Received" "by UCSD.EDU.* for <managers@ucsd.edu" "mail.list.managers"))

     ;; Totally unmatched mail.
     "mail.misc")
)



-- 
David Moore <dmoore@ucsd.edu>       | Computer Systems Lab      __o
UCSD Dept. Computer Science - 0114  | Work: (619) 534-8604    _ \<,_
La Jolla, CA 92093-0114             | Fax:  (619) 534-1445   (_)/ (_)
<URL:http://oj.egbt.org/dmoore/>    | In a cloud bones of steel.


  reply	other threads:[~1997-04-06  1:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-06  0:14 Matt Pharr
1997-04-06  1:19 ` David Moore [this message]
1997-04-06  2:58 ` Jens Lautenbacher

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=rvybaxymlg.fsf@sdnp5.ucsd.edu \
    --to=dmoore@ucsd.edu \
    /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).