Top |
Functions
Description
A GMimeParserOptions is used to pass various options to GMimeParser and all of the various other parser functions in GMime.
Functions
GMimeParserWarningFunc ()
void (*GMimeParserWarningFunc) (gint64 offset
,GMimeParserWarning errcode
,const gchar *item
,gpointer user_data
);
The function signature for a callback to g_mime_parser_options_set_warning_callback()
.
g_mime_parser_options_new ()
GMimeParserOptions *
g_mime_parser_options_new (void
);
Creates a new set of GMimeParserOptions.
g_mime_parser_options_free ()
void
g_mime_parser_options_free (GMimeParserOptions *options
);
Frees a set of GMimeParserOptions.
g_mime_parser_options_clone ()
GMimeParserOptions *
g_mime_parser_options_clone (GMimeParserOptions *options
);
Clones a GMimeParserOptions.
g_mime_parser_options_get_default ()
GMimeParserOptions *
g_mime_parser_options_get_default (void
);
Gets the default parser options.
g_mime_parser_options_get_address_compliance_mode ()
GMimeRfcComplianceMode
g_mime_parser_options_get_address_compliance_mode
(GMimeParserOptions *options
);
Gets the compliance mode that should be used when parsing rfc822 addresses.
Note: Even in GMIME_RFC_COMPLIANCE_STRICT mode, the address parser is fairly liberal in what it accepts. Setting it to GMIME_RFC_COMPLIANCE_LOOSE just makes it try harder to deal with garbage input.
g_mime_parser_options_set_address_compliance_mode ()
void g_mime_parser_options_set_address_compliance_mode (GMimeParserOptions *options
,GMimeRfcComplianceMode mode
);
Sets the compliance mode that should be used when parsing rfc822 addresses.
In general, you'll probably want this value to be GMIME_RFC_COMPLIANCE_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_RFC_COMPLIANCE_STRICT mode, the address parser is fairly liberal in what it accepts. Setting it to GMIME_RFC_COMPLIANCE_LOOSE just makes it try harder to deal with garbage input.
g_mime_parser_options_get_allow_addresses_without_domain ()
gboolean
g_mime_parser_options_get_allow_addresses_without_domain
(GMimeParserOptions *options
);
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.
g_mime_parser_options_set_allow_addresses_without_domain ()
void g_mime_parser_options_set_allow_addresses_without_domain (GMimeParserOptions *options
,gboolean allow
);
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.
g_mime_parser_options_get_parameter_compliance_mode ()
GMimeRfcComplianceMode
g_mime_parser_options_get_parameter_compliance_mode
(GMimeParserOptions *options
);
Gets the compliance mode that should be used when parsing Content-Type and Content-Disposition parameters.
Note: Even in GMIME_RFC_COMPLIANCE_STRICT mode, the parameter parser is fairly liberal in what it accepts. Setting it to GMIME_RFC_COMPLIANCE_LOOSE just makes it try harder to deal with garbage input.
g_mime_parser_options_set_parameter_compliance_mode ()
void g_mime_parser_options_set_parameter_compliance_mode (GMimeParserOptions *options
,GMimeRfcComplianceMode mode
);
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_RFC_COMPLIANCE_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_RFC_COMPLIANCE_STRICT mode, the parameter parser is fairly liberal in what it accepts. Setting it to GMIME_RFC_COMPLIANCE_LOOSE just makes it try harder to deal with garbage input.
g_mime_parser_options_get_rfc2047_compliance_mode ()
GMimeRfcComplianceMode
g_mime_parser_options_get_rfc2047_compliance_mode
(GMimeParserOptions *options
);
Gets the compliance mode that should be used when parsing rfc2047 encoded words.
Note: Even in GMIME_RFC_COMPLIANCE_STRICT mode, the rfc2047 parser is fairly liberal in what it accepts. Setting it to GMIME_RFC_COMPLIANCE_LOOSE just makes it try harder to deal with garbage input.
g_mime_parser_options_set_rfc2047_compliance_mode ()
void g_mime_parser_options_set_rfc2047_compliance_mode (GMimeParserOptions *options
,GMimeRfcComplianceMode mode
);
Sets the compliance mode that should be used when parsing rfc2047 encoded words.
In general, you'll probably want this value to be GMIME_RFC_COMPLIANCE_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_RFC_COMPLIANCE_STRICT mode, the parameter parser is fairly liberal in what it accepts. Setting it to GMIME_RFC_COMPLIANCE_LOOSE just makes it try harder to deal with garbage input.
g_mime_parser_options_get_fallback_charsets ()
const char **
g_mime_parser_options_get_fallback_charsets
(GMimeParserOptions *options
);
Gets the fallback charsets to try when decoding 8-bit headers.
g_mime_parser_options_set_fallback_charsets ()
void g_mime_parser_options_set_fallback_charsets (GMimeParserOptions *options
,const char **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.
g_mime_parser_options_get_warning_callback ()
GMimeParserWarningFunc
g_mime_parser_options_get_warning_callback
(GMimeParserOptions *options
);
Gets callback function which is called if the parser detects any issues.
g_mime_parser_options_set_warning_callback ()
void g_mime_parser_options_set_warning_callback (GMimeParserOptions *options
,GMimeParserWarningFunc warning_cb
,gpointer user_data
);
Registers the callback function being called if the parser detects any issues.
Parameters
options |
||
warning_cb |
a GMimeParserWarningFunc or |
|
user_data |
data passed to the warning callback function |
Types and Values
GMimeParserOptions
typedef struct _GMimeParserOptions GMimeParserOptions;
A set of parser options used by GMimeParser and various other parsing functions.
enum GMimeParserWarning
Issues the GMimeParser
detects. Note that the GMIME_CRIT_*
issues indicate that some parts of the GMimeParser
input may
be ignored or will be interpreted differently by other software products.
Members
Repeated exactly the same header which should exist only once. |
||
Repeated exactly the same header parameter. |
||
A header contains unencoded 8-bit characters. |
||
Invalid content type, assuming |
||
Invalid RFC 2047 encoded header value. |
||
No child parts detected within a multipart. |
||
The message is truncated. |
||
The message is malformed. |
||
Invalid header name, the parser may skip the message or parts of it. |
||
Conflicting header. |
||
Conflicting header parameter. |
||
A multipart lacks the required boundary parameter. |
||
Invalid header parameter. |
||
Invalid address list. |
||
The maximum MIME nesting level has been exceeded. |