| Top |
Parsed Authentication-Results and ARC-Authentication-Results values, with MimeKit-compatible recovery for Office365 and dotted authentication methods. Collections retain references, preserve order and allow duplicate objects. The models describe reported results; they neither authenticate a message nor establish whether a header or its authentication service is trustworthy.
Constructors and setters store UTF-8 strings without syntax validation.
Comments retain their inner comment syntax, including escapes and nesting.
Use GMimeHeader to fold serialized values for transport.
g_mime_authentication_results_to_string() produces unfolded model text,
not a complete header.
GMimeAuthenticationResults *
g_mime_authentication_results_new (const char *authserv_id);
Creates a model, copying authserv_id
without validating its syntax.
GMimeAuthenticationResults * g_mime_authentication_results_parse (const char *text,gssize length,GError **error);
Parses a bounded value, including ARC instance numbers and common Office365 deviations. Missing methods become "none". Numbers must be nonnegative signed 32-bit integers. Comments and quoted strings are unfolded; property quoting is retained. Invalid UTF-8 in text values is replaced with U+FFFD, while embedded NUL bytes are rejected.
text |
the header value, without the field name |
|
length |
the byte length, or -1 for a NUL-terminated string |
|
error |
return location for a parse error. |
[nullable] |
char *
g_mime_authentication_results_to_string
(GMimeAuthenticationResults *results);
Formats the service, optional numbers and ordered method results.
const char *
g_mime_authentication_results_get_authentication_service_identifier
(GMimeAuthenticationResults *results);
Gets the identifier of the service reporting these results.
gboolean g_mime_authentication_results_get_instance (GMimeAuthenticationResults *results,int *instance);
Gets the optional ARC instance without conflating zero with absence.
void g_mime_authentication_results_set_instance (GMimeAuthenticationResults *results,int instance);
Sets the instance without range validation, as in MimeKit.
void
g_mime_authentication_results_clear_instance
(GMimeAuthenticationResults *results);
Removes the optional ARC instance.
gboolean g_mime_authentication_results_get_version (GMimeAuthenticationResults *results,int *version);
Gets the optional header version without conflating zero with absence.
void g_mime_authentication_results_set_version (GMimeAuthenticationResults *results,int version);
Sets the version without range validation, as in MimeKit.
void
g_mime_authentication_results_clear_version
(GMimeAuthenticationResults *results);
Removes the optional version.
int
g_mime_authentication_results_get_result_count
(GMimeAuthenticationResults *results);
Gets the size of the ordered method-result collection.
GMimeAuthenticationMethodResult * g_mime_authentication_results_get_result (GMimeAuthenticationResults *results,int index);
Gets an existing entry without adding a reference.
void g_mime_authentication_results_set_result (GMimeAuthenticationResults *results,int index,GMimeAuthenticationMethodResult *result);
Retains the replacement before releasing the old entry. Duplicates are allowed.
results |
authentication results |
|
index |
an existing result index |
|
result |
the replacement result. |
[transfer none] |
void g_mime_authentication_results_add_result (GMimeAuthenticationResults *results,GMimeAuthenticationMethodResult *result);
Appends a retained reference, allowing duplicates.
void g_mime_authentication_results_insert_result (GMimeAuthenticationResults *results,int index,GMimeAuthenticationMethodResult *result);
Inserts a retained reference at index
.
results |
authentication results |
|
index |
an index from zero through the result count |
|
result |
the result to insert. |
[transfer none] |
int g_mime_authentication_results_index_of_result (GMimeAuthenticationResults *results,GMimeAuthenticationMethodResult *result);
Searches by object identity, not by serialized value.
gboolean g_mime_authentication_results_contains_result (GMimeAuthenticationResults *results,GMimeAuthenticationMethodResult *result);
Tests collection membership by object identity.
gboolean g_mime_authentication_results_remove_result (GMimeAuthenticationResults *results,GMimeAuthenticationMethodResult *result);
Removes only the first occurrence, preserving the remaining order.
void g_mime_authentication_results_remove_result_at (GMimeAuthenticationResults *results,int index);
Releases and removes the entry at index
.
void
g_mime_authentication_results_clear_results
(GMimeAuthenticationResults *results);
Releases all results without changing the service, version or instance.
GMimeAuthenticationMethodResult * g_mime_authentication_method_result_new (const char *method,const char *result);
Creates a method result, copying both strings without syntax validation.
char *
g_mime_authentication_method_result_to_string
(GMimeAuthenticationMethodResult *result);
Formats the method, result and associated details without folding.
const char *
g_mime_authentication_method_result_get_method
(GMimeAuthenticationMethodResult *result);
Gets the authentication method, such as "dkim" or "spf".
const char *
g_mime_authentication_method_result_get_result
(GMimeAuthenticationMethodResult *result);
Gets the reported outcome, such as "pass" or "fail".
const char *
g_mime_authentication_method_result_get_office365_authentication_service_identifier
(GMimeAuthenticationMethodResult *result);
Gets the nonstandard per-method service identifier, when present.
gboolean g_mime_authentication_method_result_get_version (GMimeAuthenticationMethodResult *result,int *version);
Gets the optional method version without conflating zero with absence.
void g_mime_authentication_method_result_set_version (GMimeAuthenticationMethodResult *result,int version);
Sets the version without range validation, as in MimeKit.
void
g_mime_authentication_method_result_clear_version
(GMimeAuthenticationMethodResult *result);
Removes the optional method version.
const char *
g_mime_authentication_method_result_get_result_comment
(GMimeAuthenticationMethodResult *result);
Gets the first comment following the result, retaining inner escapes and nesting.
void g_mime_authentication_method_result_set_result_comment (GMimeAuthenticationMethodResult *result,const char *comment);
Copies the comment without escaping, unfolding or syntax validation.
const char *
g_mime_authentication_method_result_get_reason
(GMimeAuthenticationMethodResult *result);
Gets the explanatory reason associated with the result.
void g_mime_authentication_method_result_set_reason (GMimeAuthenticationMethodResult *result,const char *reason);
Copies the reason. A nonempty reason takes precedence over an action when serializing; an empty or absent reason allows the parsed action.
const char *
g_mime_authentication_method_result_get_action
(GMimeAuthenticationMethodResult *result);
Gets the nonstandard action reported by the authentication service.
int
g_mime_authentication_method_result_get_property_count
(GMimeAuthenticationMethodResult *result);
Gets the size of the ordered property collection.
GMimeAuthenticationMethodProperty * g_mime_authentication_method_result_get_property (GMimeAuthenticationMethodResult *result,int index);
Gets an existing entry without adding a reference.
void g_mime_authentication_method_result_set_property (GMimeAuthenticationMethodResult *result,int index,GMimeAuthenticationMethodProperty *property);
Retains the replacement before releasing the old entry. Duplicates are allowed.
result |
a method result |
|
index |
an existing property index |
|
property |
the replacement property. |
[transfer none] |
void g_mime_authentication_method_result_add_property (GMimeAuthenticationMethodResult *result,GMimeAuthenticationMethodProperty *property);
Appends a retained reference, allowing duplicates.
void g_mime_authentication_method_result_insert_property (GMimeAuthenticationMethodResult *result,int index,GMimeAuthenticationMethodProperty *property);
Inserts a retained reference at index
.
result |
a method result |
|
index |
an index from zero through the property count |
|
property |
the property to insert. |
[transfer none] |
int g_mime_authentication_method_result_index_of_property (GMimeAuthenticationMethodResult *result,GMimeAuthenticationMethodProperty *property);
Searches by object identity, not by serialized value.
gboolean g_mime_authentication_method_result_contains_property (GMimeAuthenticationMethodResult *result,GMimeAuthenticationMethodProperty *property);
Tests collection membership by object identity.
gboolean g_mime_authentication_method_result_remove_property (GMimeAuthenticationMethodResult *result,GMimeAuthenticationMethodProperty *property);
Removes only the first occurrence, preserving the remaining order.
void g_mime_authentication_method_result_remove_property_at (GMimeAuthenticationMethodResult *result,int index);
Releases and removes the entry at index
.
void
g_mime_authentication_method_result_clear_properties
(GMimeAuthenticationMethodResult *result);
Releases every property without changing other result fields.
GMimeAuthenticationMethodProperty * g_mime_authentication_method_property_new (const char *ptype,const char *property,const char *value);
Empty values and values containing MIME token specials are quoted when serialized. Parsed properties instead preserve their original quoting, except that empty values are always quoted.
const char *
g_mime_authentication_method_property_get_property_type
(GMimeAuthenticationMethodProperty *property);
Gets the property namespace, such as "header" or "smtp".
const char *
g_mime_authentication_method_property_get_property
(GMimeAuthenticationMethodProperty *property);
Gets the name within the property namespace.
const char *
g_mime_authentication_method_property_get_value
(GMimeAuthenticationMethodProperty *property);
Gets the property value without its surrounding quoting syntax.
char *
g_mime_authentication_method_property_to_string
(GMimeAuthenticationMethodProperty *property);
Formats the type, name and value as a property assignment.
typedef struct _GMimeAuthenticationResults GMimeAuthenticationResults;
An Authentication-Results or ARC-Authentication-Results header value.
typedef struct _GMimeAuthenticationMethodResult GMimeAuthenticationMethodResult;
An authentication method, its result and ordered properties.