Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Re: Mailing list split
       [not found] <874qpqet2m.fsf@mega.ist.utl.pt>
@ 2004-06-05  6:47 ` Paul Johnson
       [not found]   ` <8765a4h70c.fsf@lizard.king>
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Johnson @ 2004-06-05  6:47 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 2135 bytes --]

pocm@mega.ist.utl.pt (Paulo Jorge O. C. Matos) writes:

> I'm subscribed to dozens of mailing lists and I have an email
> account through which I receive all my mailing list mails. Is
> there a way to split the mail from that account automatically
> based on the mailing list headers?

I solved this one with procmail myself (I grok procmail more than I do
lisp[1]).

A portion of ~/.procmailrc follows...
*start*
############################## 
#
# Dynamic Mail filters The following set of rules use the matching
# ability of procmail to dynamically filter mail based on parsing one
# of the possible mailing list headers.  This means you can subscribe
# to new mailing lists without having to add lines to your procmail
# filters.  Very Good Thing (tm).  When I first found this list, I
# think there were 4 entries.  I add a new entry every time some new
# mailing list ends up in my inbox (i.e. it is not covered by the
# current ruleset.)  Comments appear where I can remember them.

#  Used by the perl6-all list to break out into seperate mailboxes
:0:
* ^X-Mailing-List-Name: \/[^@]+
`echo $MATCH | sed -e 's/[\/]/_/g'`

#  Majordomo uses Sender header to tell when it is coming from
:0:
* ^Sender: owner-\/[^@]+
`echo $MATCH | sed -e 's/[\/]/_/g'`

:0:
* ^Delivered-To: mailing list \/[^@]+
`echo $MATCH | sed -e 's/[\/]/_/g'`

:0:
* ^X-Mailing-List: <\/[^@]+
`echo $MATCH | sed -e 's/[\/]/_/g'`

:0:
* ^X-Loop: \/[^@]+
`echo $MATCH | sed -e 's/[\/]/_/g'`

:0:
* ^X-List-ID: <\/[^@\.]+
`echo $MATCH | sed -e 's/[\/]/_/g'`

:0:
* ^X-list: \/[^@\.]+
`echo $MATCH | sed -e 's/[\/]/_/g'`

:0:
* ^X-BeenThere: \/[^@]+
`echo $MATCH | sed -e 's/[\/]/_/g'`

*end*

Hope this helps...




[1] If I futz around with lisp for too long, I start getting the same
sort of frustrated, pissed off mood I get when some idiot beeps my
headset two minutes before the system stop taking any more incoming
calls, meaning I'm going to be the last out of the office just because
the putz couldn't sleep on it a few hours for the early-bird shift to come
in...

-- 
Paul Johnson
<baloo@ursine.ca>
Linux.  You can find a worse OS, but it costs more.

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

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

* Re: Mailing list split
       [not found]   ` <8765a4h70c.fsf@lizard.king>
@ 2004-06-06 21:55     ` Xavier Maillard
  0 siblings, 0 replies; 2+ messages in thread
From: Xavier Maillard @ 2004-06-06 21:55 UTC (permalink / raw)


On  6 Jun 2004, Maciek Pasternacki wrote:

> Sorry for posting a level lower than I should; I'm writing from
> gnus-agent offline and I don't have original article here.
> 
> On Boomtime, Confusion 11, 3170 YOLD, Paul Johnson wrote:
> 
> > > I'm subscribed to dozens of mailing lists and I have an email
> > > account through which I receive all my mailing list mails. Is
> > > there a way to split the mail from that account automatically
> > > based on the mailing list headers?
> 
> [cut]
> 
> (setq nnmail-split-methods 'nnmail-split-fancy)
> (setq nnmail-split-fancy 
> '(|        
> ;;; cut -- `priority' splitting to root@myhost, abuse@myhost,
> ;;; postmaster@myhost, different adrdesses I use for work etc.
> 
> ;;; Mailing lists go here
> 
> ;; Yahoo groups go to listserv.<group-address>
> ("Mailing-List"    "list   \\([-a-z0-9]*\\)@yahoogroups.com;   contact
> .*-owner@yahoogroups.com" "listserv.\\1")
> 
> ;; Groups managed by ezmlm also.
> ("Mailing-List"
> "contact \\([-a-z0-9]*\\)-help@[^;]*; run by ezmlm"
> "listserv.\\1")
> 
> ;; This is single group that is on two independent servers
> ;; (Polish listserver and on yahoogroups -- everyone is
> ;; subscribed to both in case one wouldn't work or someone has
> ;; trouble sending to one of them) that should go to single mailbox
> (to "stachuriada@.*"
> "listserv.stachuriada")
> 
> ;; Not really newsgroups, just aliases to more than one person
> (to "przedluzacz@some.host.dont.matter"
> "listserv.przedluzacz")
> (to "towarzystwo@some.other.unmeaningful.host"
> "listserv.towarzystwo")
> 
> ;; Groups that use List-Id header, usually managed by Mailman
> ;; I should write a regexp like for ezmlm or yahoogroups, but
> ;; this one is a bit tricky (I even don't remember why now,
> ;; but it was) and I don't have time at the moment.
> ("List-Id" "tlug.linux.gda.pl" "listserv.tlug")
> ("List-Id" "tkabber.jabber.ru" "listserv.tkabber")
> ("List-Id" "jadmin.jabber.org" "listserv.jadmin")
> ("List-Id" "transwers.kombinat.nh.pl" "listserv.transwers")
> ("List-Id" "zope-dev.zope.org" "listserv.zope-dev")
> ("List-Id" "zope.zope.org" "listserv.zope")
> ("List-Id" "ekg2-commit.lists.ziew.org" "listserv.ekg2-commit")
> ("List-Id" "ekg2-devel.lists.ziew.org" "listserv.ekg2-devel")
> 
> ;; Some totally non-standard lists
> ("X-Mailing-List"           "oneiro@dont.give.full.address.to.spammers"
> "listserv.oneiro")   ("List-Help"  "http://www.postfix.org/lists.html"
> "listserv.postfix")
> 
> ;;; Here goes splitting rest of mail via BBDB to mailboxen for
> ;;; people I know and finally to mbox.misc for miscellaneous spam.
> 
> ))
> 
> Hope it helps.
> 
> Greets,
> 		--japhy

I use these rules which are quite powerful and efficient:

         ("list-unsubscribe" ".*<mailto:\\([^<>, \t\n]+\\)-ctl@.*" "INBOX.list.\\1")
         ("list-unsubscribe" ".*<mailto:\\([^<>, \t\n]+\\)-request@.*" "INBOX.list.\\1")
         ("list-unsubscribe" ".*<mailto:\\([^<>, \t\n]+\\)-unsubscribe@.*" "INBOX.list.\\1")
         ("list-unsubscribe" ".*=unsubscribe%20\\([^<>, \t\n]+\\)>.*" "INBOX.list.\\1")

These can deal with almost all my ML I am currently subscribed.


-- 
"sometimes i feel like we're making emacs better and better because we don't 
 know what to do with emacs once it is finished."

    -- AlexSchroeder on #emacs @OPN


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

end of thread, other threads:[~2004-06-06 21:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <874qpqet2m.fsf@mega.ist.utl.pt>
2004-06-05  6:47 ` Mailing list split Paul Johnson
     [not found]   ` <8765a4h70c.fsf@lizard.king>
2004-06-06 21:55     ` Xavier Maillard

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