procmail
[Top] [All Lists]

Re: Filtering out unwanted mime attachments

1997-10-16 14:04:36
Excerpts from mail: (16-Oct-97) Re: Filtering out unwanted mime attachments by 
J Daniel Smith
This line-by-line parsing could be useful...the only problem I had was
with blank lines.  I couldn't get the reg-exp modified right, so I
used scoring to fix things up; there's probalby a better way.

I'm not sure what could be causing this problem with blank lines. Are we
talking blank lines at the end of the body or blank lines interspersed
thoughout the body? Are you using 3.11pre5 or higher? I believe that, prior
to 3.11pre5, the trailing newline of a $MATCH would be stripped. Could that
be causing what you are seeing?

As for blank lines at the end of the body, I think that can be solved by
changing

# Now recurse if there are any remaining lines.
:0
* REMAININGLINES ?? .

to

  # Now recurse if there are any remaining lines.
  :0
  * REMAININGLINES ?? (.|$)

in the generic case, assuming one wants to preserve blank lines at the end of
the body. (I'm so used to using "VAR ?? ." to check to see whether a variable
is set or not, I forgot momentarily that "." won't match newlines.)

Later,
Ed