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
| Attribute | Type | Description |
|---|---|---|
| encoding | string | The 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
| Name | Type | Description |
|---|---|---|
| _subtype | string = mixed | The MIME subtype of the multipart message. |
| boundary | string = null | The boundary string used to separate parts. |
| _subparts | list = null | Initial subparts to include in the message. |
| encoding | string = null | The character encoding to be used for headers and content. |
| **_params | dict = null | Additional parameters passed to the MIMEMultipart constructor. |