Gnus development mailing list
 help / color / mirror / Atom feed
* There's gotta be an easier way...
@ 1999-12-04  0:31 dave-mlist
  1999-12-05 22:55 ` Kai Großjohann
  0 siblings, 1 reply; 3+ messages in thread
From: dave-mlist @ 1999-12-04  0:31 UTC (permalink / raw)


Here's my split methods (with some names changed to protect the guilty):
There must be an easier way.  Tell me what you think.

Objectives: (1) to have all mailing list mail separated into groups
with the same name as the mailing list.  (2) to have non-list mail
filed under the email address it was sent to.

here's what nnmail-split-fancy evals to:
(| ("to\\|cc" "\\(dave\\|fred\\|ethel\\|barney\\)\\(-?[^@]*\\)@\\(bfnet.com\\|wuertele.com\\|this.net\\|that.net\\|andtheother.net\\)" "\\&") ("sender\\|to\\|cc" ".*ding.*" "ding") ("sender\\|to\\|cc" ".*netfilter.*" "netfilter") ("sender\\|to\\|cc" ".*netdev.*" "netdev") ("sender\\|to\\|cc" ".*tcpsat.*" "tcpsat") ("sender\\|to\\|cc" ".*etcetera.*" "etcetera"))

Dave

(setq nnmail-split-methods 'nnmail-split-fancy)
(setq nnmail-split-fancy 
      (let ((domains (list "bfnet.com" "wuertele.com" "this.net" "that.net" "andtheother.net"))
	    (usernames (list "dave" "fred" "ethel" "barney"))
	    (groupnames (list "ding" "netfilter" "netdev" "tcpsat" "etcetera"))
	    )
	(append '(|)

                ; setup a group for each personal email sent to 
		(list
		 (list
		  "to\\|cc"
		 (concat
		  "\\("
		  (mapconcat (lambda (username)
			       (format "%s" username))
			     usernames "\\|")
                  ; this part in parens is for qmail name extensions
		  "\\)\\(-?[^@]*\\)@\\("
		  (mapconcat (lambda (domain)
			       (format "%s" domain))
			     domains "\\|")
		  "\\)"
		  )
		 "\\&"))

                ; setup groups for each mailing list
		(mapcar (lambda (groupname) (list "sender\\|to\\|cc" (format ".*%s.*" groupname) groupname)) groupnames)
		))
      )


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-12-08 15:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-04  0:31 There's gotta be an easier way dave-mlist
1999-12-05 22:55 ` Kai Großjohann
1999-12-08 15:16   ` E. David Bell

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).