Skip to main content

SafeMIMEMultipart

This class provides a secure implementation of multipart MIME messages by extending standard functionality with header validation. It ensures that all headers are processed to prevent multi-line injection attacks while maintaining compatibility with specified character encodings. The class inherits from both MIMEMixin and MIMEMultipart to support complex email structures with enhanced safety constraints.

Attributes

AttributeTypeDescription
encodingstringThe character set used to encode header values and prevent multi-line header injection vulnerabilities.

Constructor

Signature

def SafeMIMEMultipart(
_subtype: string = mixed,
boundary: string = null,
_subparts: list = null,
encoding: string = null,
**_params: dict = null
) - > null

Parameters

NameTypeDescription
_subtypestring = mixedThe MIME subtype of the multipart message.
boundarystring = nullThe boundary string used to separate parts.
_subpartslist = nullInitial subparts to include in the message.
encodingstring = nullThe character encoding to be used for headers and content.
**_paramsdict = nullAdditional parameters passed to the MIMEMultipart constructor.