I think I've found the spamassassin
plugin directory. Anyone who knows
more than I do, please please correct
me. On my computer, the plugin directory
seems to be here:
/etc/spamassassin
I was looking to see if the MIME-type
plugin was enabled in my version of
spamassassin. Indeed it seems to be.
The following grep command yields
the following result when executed in
the above /etc/spamassassin directory:
$ grep -i mimeheader *
v310.pre:# MIMEHeader - apply regexp rules
against MIME headers in the message
v310.pre:loadplugin
Mail::SpamAssassin::Plugin::MIMEHeader
OK. It appears that I do have a
plugin called MIMEHeader
which is plugged into Spamassassin.
Here's how I got more information
on this plugin:
perldoc Mail::SpamAssassin::Plugin::MIMEHeader
Reading the documentation, I learned
that there is a raw version
of the MIME type. Learning this
has helped me solve a problem.
I learned that the raw version of
the MIME type does not clean up
newlines while the regular version
does.
This has caused me to use the Perl
match operator a bit differently.
I had wondered why my match operator
was not matching multi-line data.
A little digging in the Perl documentation
and I realized that I need to and an
s suffix to match the raw
version, because the raw version
does not replace newlines but instead leaves
them intact.
Here's what I've done. I've gone from
this:
m|matchme.*matchme|i
to this:
m|matchme.*matchme|is
I'm hoping the s suffix
in the above match operator
will allow me to cross newline
boundaries with my .* pattern.
The other solution seems to be to
drop the :raw namespace off
the end of the MIME type so that
newlines are cleaned up for me.
All this is supposition. I'll
have to see whether or not my
new Spamassassin rule is now able
to cross newline boundaries unhindered.
Ed Abbott
No comments:
Post a Comment