GMime.ParserOptions¶
Fields¶
None
Methods¶
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class GMime.ParserOptions¶
A set of parser options used by
GMime.Parser
and various other parsing functions.- classmethod get_default()¶
- Returns:
the default parser options.
- Return type:
Gets the default parser options.
- classmethod new()¶
- Returns:
a newly allocated set of
GMime.ParserOptions
with the default values.- Return type:
Creates a new set of
GMime.ParserOptions
.
- clone()¶
- Returns:
a newly allocated
GMime.ParserOptions
.- Return type:
Clones a
GMime.ParserOptions
.
- free()¶
Frees a set of
GMime.ParserOptions
.
- get_address_compliance_mode()¶
- Returns:
the compliance mode that is currently set.
- Return type:
Gets the compliance mode that should be used when parsing rfc822 addresses.
Note: Even in
GMime.RfcComplianceMode.STRICT
mode, the address parser is fairly liberal in what it accepts. Setting it toGMime.RfcComplianceMode.LOOSE
just makes it try harder to deal with garbage input.
- get_allow_addresses_without_domain()¶
-
Gets whether or not the rfc822 address parser should allow addresses without a domain.
In general, you’ll probably want this value to be
False
(the default) as it allows maximum interoperability with existing (broken) mail clients and other mail software such as sloppily written perl scripts (aka spambots) that do not properly quote the name when it contains a comma.This option exists in order to allow parsing of mailbox addresses that do not have a domain component. These types of addresses are rare and were typically only used when sending mail to other users on the same UNIX system.
- get_fallback_charsets()¶
-
Gets the fallback charsets to try when decoding 8-bit headers.
- get_parameter_compliance_mode()¶
- Returns:
the compliance mode that is currently set.
- Return type:
Gets the compliance mode that should be used when parsing Content-Type and Content-Disposition parameters.
Note: Even in
GMime.RfcComplianceMode.STRICT
mode, the parameter parser is fairly liberal in what it accepts. Setting it toGMime.RfcComplianceMode.LOOSE
just makes it try harder to deal with garbage input.
- get_rfc2047_compliance_mode()¶
- Returns:
the compliance mode that is currently set.
- Return type:
Gets the compliance mode that should be used when parsing rfc2047 encoded words.
Note: Even in
GMime.RfcComplianceMode.STRICT
mode, the rfc2047 parser is fairly liberal in what it accepts. Setting it toGMime.RfcComplianceMode.LOOSE
just makes it try harder to deal with garbage input.
- set_address_compliance_mode(mode)¶
- Parameters:
mode (
GMime.RfcComplianceMode
) – aGMime.RfcComplianceMode
Sets the compliance mode that should be used when parsing rfc822 addresses.
In general, you’ll probably want this value to be
GMime.RfcComplianceMode.LOOSE
(the default) as it allows maximum interoperability with existing (broken) mail clients and other mail software such as sloppily written perl scripts (aka spambots).Note: Even in
GMime.RfcComplianceMode.STRICT
mode, the address parser is fairly liberal in what it accepts. Setting it toGMime.RfcComplianceMode.LOOSE
just makes it try harder to deal with garbage input.
- set_allow_addresses_without_domain(allow)¶
- Parameters:
allow (
bool
) –True
if the parser should allow addresses without a domain orFalse
otherwise
Sets whether the rfc822 address parser should allow addresses without a domain.
In general, you’ll probably want this value to be
False
(the default) as it allows maximum interoperability with existing (broken) mail clients and other mail software such as sloppily written perl scripts (aka spambots) that do not properly quote the name when it contains a comma.This option exists in order to allow parsing of mailbox addresses that do not have a domain component. These types of addresses are rare and were typically only used when sending mail to other users on the same UNIX system.
- set_fallback_charsets(charsets)¶
-
Sets the fallback charsets to try when decoding 8-bit headers.
Note: It is recommended that the list of charsets start with utf-8 and end with iso-8859-1.
- set_parameter_compliance_mode(mode)¶
- Parameters:
mode (
GMime.RfcComplianceMode
) – aGMime.RfcComplianceMode
Sets the compliance mode that should be used when parsing Content-Type and Content-Disposition parameters.
In general, you’ll probably want this value to be
GMime.RfcComplianceMode.LOOSE
(the default) as it allows maximum interoperability with existing (broken) mail clients and other mail software such as sloppily written perl scripts (aka spambots).Note: Even in
GMime.RfcComplianceMode.STRICT
mode, the parameter parser is fairly liberal in what it accepts. Setting it toGMime.RfcComplianceMode.LOOSE
just makes it try harder to deal with garbage input.
- set_rfc2047_compliance_mode(mode)¶
- Parameters:
mode (
GMime.RfcComplianceMode
) – aGMime.RfcComplianceMode
Sets the compliance mode that should be used when parsing rfc2047 encoded words.
In general, you’ll probably want this value to be
GMime.RfcComplianceMode.LOOSE
(the default) as it allows maximum interoperability with existing (broken) mail clients and other mail software such as sloppily written perl scripts (aka spambots).Note: Even in
GMime.RfcComplianceMode.STRICT
mode, the parameter parser is fairly liberal in what it accepts. Setting it toGMime.RfcComplianceMode.LOOSE
just makes it try harder to deal with garbage input.
- set_warning_callback(warning_cb, *user_data)¶
- Parameters:
warning_cb (
GMime.ParserWarningFunc
) – aGMime.ParserWarningFunc
orNone
to clear the callbackuser_data (
object
orNone
) – data passed to the warning callback function
Registers the callback function being called if the parser detects any issues.