NAME
Mail::MIMEDefang::MIME::Base64 - base64 decoder that notices concatenated streams
DESCRIPTION
A base64 part is supposed to be a single stream: padding (=) may only
appear at its very end. Some software nevertheless produces parts made of
several base64 streams glued together, and some mail clients decode every
stream separately and join the results.
Mail::MIMEDefang::MIME::Base64 is a subclass of
MIME::Decoder::Base64 that behaves exactly like its parent but also notes
whenever data follows padding, so that MIMEDefang can log the message and let
the filter act on it (see md_concatenated_base64 in
Mail::MIMEDefang::MIME). This works with any MIME-tools version.
The module is used by MIMEDefang itself and is not meant to be called from
mimedefang-filter.
METHODS
-
activate
Class method. Installs this decoder for the
base64encoding, unless something other than the stock MIME::Decoder::Base64 has been installed already (a site-provided decoder is left alone). Returns 1 if the watching decoder is in place and 0 otherwise. Safe to call repeatedly. -
reset_count
Sets the number of concatenated base64 parts seen back to zero. MIMEDefang calls this before parsing each message.
-
count
Returns the number of base64 parts made of concatenated streams decoded since the last call to
reset_count.