procmail
[Top] [All Lists]

Revisited - Re: Removing [somelist] from subject lines

2001-02-13 06:46:08
On Sat, 20 Jan 2001, Mike A. Harris wrote:

I just found an excellent solution to my problem courtesy of
Sven Koch <haegar(_at_)sdinet(_dot_)de> on the linux-kernel mailing list.
(Yes a full blown OT thread)  ;o)

The many suggestions that everyone provided were useful learning
tools, and I ended up building a recipe out of all the great
advice that was given, however it wasn't a flawless recipe.

My main goals were what is in my below initial posting, with an
emphasis on it removing all occurances of [Xpert] from a subject
line from a specific mailing list (xpert(_at_)xfree86(_dot_)org), and having
as simple a recipe as possible.  I'd trade a fork to an external
filter app to an overly complex looking procmail-fu recipe.

Here is the solution that I am now successfully using, which I've
tested the heck out of with numerous tests on a dummy setup:

:0 fhw
* ^List-Id:.*xpert.XFree86.Org
| sed -e '/^Subject:/ s/\[Xpert\]//g'
:0 A:
XPERT


As you can see, it is VERY simple, and elegant, only a single
call to sed, which is certainly reasonable, especially since it
only gets called if it is a message from this one particular
mailing list.  When I consider the backup filter, dupefilter, and
other filters I'm using forking out various apps, this single sed
call is not going to kill me.  ;o)

I'd like to thank everyone again for their great varied responses
of useful procmail-fu.  I learned some cool stuff from it.  The
above recipe is my contribution back to everyone.  To use it with
other braindead mailing lists that put [Something] in the subject
headers of all the messages, just change the match line, the sed
substitution word (Xpert), and of course - the folder to file it
into at the bottom.

Enjoy clean subject lines!  ;o)

TTYL



Date: Sat, 20 Jan 2001 09:29:53 -0500 (EST)
From: Mike A. Harris <mharris(_at_)opensourceadvocate(_dot_)org>
To: Procmail mailing list <procmail(_at_)informatik(_dot_)rwth-aachen(_dot_)de>
Content-Type: TEXT/PLAIN; charset=US-ASCII
Subject: Removing [somelist] from subject lines

I looked at the procmail faq's thinking this *must* be an faq,
however I didn't find anything.  I'm on a few lists that
idiotically insist on adding [listname] to the beginning of every
message, and I want to have procmail auto-remove this crap.

I'd prefer it if someone could point me to some faq page or other
resource out there as this almost has to be talked to death.

Also, this topic is a breeding ground for flamewar/religious wars
about what goes in the subject line and what shouldn't.  I'm not
interested at all in that debate as it does not end in a solution
that pleases everyone, however procmail allows each person to
choose their solution - which is what I'm looking for.  Please
don't be "that guy" that starts the thread, ok?  ;o)

Sorry to post this, but I spent 2 hours hunting and found no
adequate solution.

----------------------------------------------------------------------
    Mike A. Harris  -  Linux advocate  -  Free Software advocate
          This message is copyright 2001, all rights reserved.
  Views expressed are my own, not necessarily shared by my employer.
----------------------------------------------------------------------

Are you an open source developer?  Need web space?  Your own project mailing
lists?  Bug tracking software?  CVS Repository?  Build environments?
Head over to http://sourceforge.net for all of that, and more, for free!

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>
  • Revisited - Re: Removing [somelist] from subject lines, Mike A. Harris <=