From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/27642 Path: main.gmane.org!not-for-mail From: dave-mlist@bfnet.com Newsgroups: gmane.emacs.gnus.general Subject: There's gotta be an easier way... Date: 03 Dec 1999 19:31:35 -0500 Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035164632 25614 80.91.224.250 (21 Oct 2002 01:43:52 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 01:43:52 +0000 (UTC) Return-Path: Original-Received: from bart.math.uh.edu (bart.math.uh.edu [129.7.128.48]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id TAA20751 for ; Fri, 3 Dec 1999 19:41:29 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by bart.math.uh.edu (8.9.1/8.9.1) with ESMTP id SAB10200; Fri, 3 Dec 1999 18:39:44 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Fri, 03 Dec 1999 18:36:01 -0600 (CST) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id SAA02465 for ; Fri, 3 Dec 1999 18:35:44 -0600 (CST) Original-Received: from knave.rad.directint.net (knave.rad.directint.net [207.168.228.90]) by sclp3.sclp.com (8.8.5/8.8.5) with SMTP id TAA20723 for ; Fri, 3 Dec 1999 19:35:18 -0500 (EST) Original-Received: (qmail 6495 invoked by uid 2001); 4 Dec 1999 00:31:35 -0000 Original-To: ding@gnus.org In-Reply-To: Lars Magne Ingebrigtsen's message of "03 Dec 1999 20:46:40 +0100" Original-Lines: 42 User-Agent: Gnus/5.070099 (Pterodactyl Gnus v0.99) Emacs/20.4 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:27642 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:27642 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) )) )