procmail
[Top] [All Lists]

Re: Removing list footers -- and sed case insensitivity

2004-12-23 01:25:50
* David W. Tamkin <dattier(_at_)panix(_dot_)com> [2004-12-22 11:25]:

I don't know how well the '\
' syntax in a procmail action line becomes a hard newline to sed, for 
one thing; "\\
" does pass backslash-newline to sed, I've found.  You might try it 
without the backslashes, since procmail will honor the apostrophes and 
take it as one long action line in my experience.

That was a style I began with when initially writing multi-line sed
scripts; and it was working, but it irritated me because I'm not sure
exactly why it works.  I have abandoned that style in more recent
scripts.

Personally, I prefer evading it by using multiple -e options when I
call sed inside a procmail rcfile.

Same here.. that's how I've been doing it recently.  Here is the
cleaned up version, which is also generalized for other lists:

  DOLLAR=\$

  :0 fbw
  * 
^X-BeenThere:.*\/(sox-users|procmail|dia-list|pstricks|magic-users|gimp-user)
  | $SED -e '/^.*$/N'\
         -e '/^.*\n__*$/N'\
         -e "/__*\n$MATCH mailing list$DOLLAR/I,/listinfo\/$MATCH$DOLLAR/Id"

This one really screws up.  There is no error reported in the log
file, but it simply trashes the entire body of the message that passes
through it.  Only the header survives.

There's also the possibility that the sed you invoke during an
interactive shell login is not the one procmail finds.

That was my initial thought, so I've taken care to specify literal
pathnames, which was not successful.

____________________________________________________________
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