Re: Cutting lines (removing signature)

2003-09-16 11:16:39
On September 16, 2003 at 16:35, "Jeroen " FF " Heijmans" wrote:

I made a copy of to with the same
user:group and permissions.

I added your line in front of the first $$data tag:
(this one)
# <CR><LF> => <LF> to make parsing easier
$$data =~ s/\r\n/\n/g;

I added next lines as first ones in my blog.mrc (from the site):
application/x-patch;     m2h_text_plain::filter;
message/delivery-status;   m2h_text_plain::filter;
message/partial;         m2h_text_plain::filter;
text/*;                          m2h_text_plain::filter;
text/plain;              m2h_text_plain::filter;
x-sun-attachment;        m2h_text_plain::filter;

But still the signatures stay in de posts.
I'm I doing stuff on the wrong lines ?

Existing archived messages will not be affected, only newly archived
messages.  You'll have to do a rebuild from original data if you want
existing messages to be affected.

BTW, a better way to implement is something like
the following:

  package iy_text_plain;

  sub filter {
    my($fields, $data, $is_decoded, $filter_args) = @_;

    # strip signature
    $$data =~ s/\r\n/\n/g;
    $$data =~ s/^-- \n[\s\S]*//m;

    # call mhonarc's default filter to do everything else
    return m2h_text_plain::filter($fields, $data, $is_decoded, $filter_args);

And then register via MIMEFILTERS:

  application/x-patch;     my_text_plain::filter;
  message/delivery-status; my_text_plain::filter;
  message/partial;         my_text_plain::filter;
  text/*;                  my_text_plain::filter;
  text/plain;              my_text_plain::filter;
  x-sun-attachment;        my_text_plain::filter;

With this implementation, your customization will inherit any new
capabilities (and bug fixes) of the default plain text filter without
have to update your filter each time you upgrade mhonarc.


To sign-off this list, send email to majordomo(_at_)mhonarc(_dot_)org with the