procmail
[Top] [All Lists]

Removing list footers -- and sed case insensitivity

2004-12-21 21:14:33
I'm trying to write a script that will remove the footers from mailman
mailing lists.  Here's what I have for this list (which works):

  :0 fbw
  * ^X-BeenThere:.*procmail
  | sed -e '/^[ \t]*$/N \
            /^[ \t]*\n__*/N \
            /^[ \t]*\n__*[ \t]*\nprocmail.*org\//,/http.*procmail$/d'

The problem is that I now want to generalize this to cover all lists,
which requires case insensitivity.  I know that my version of sed
supports case insenstive matching by this test:

  $echo caseSensitive | sed -e 's/casesensitive/caseInSensitive/I'
  caseInSensitive

But when I try to use the 'I' flag on the following experimental
version of the script above:

  :0 fbw
  * ^X-BeenThere:.*procmail
  | sed -e '/^[ \t]*$/N \
            /^[ \t]*\n__*/N \
            /^[ \t]*\n__*[ \t]*\nProcMail.*org\//,/http.*ProcMail$/Id'

it fails to delete the address space, and the footer remains in the
message.  Can anyone see what my problem is?

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail