| Top |
| gboolean | g_mime_smtp_address_try_validate () |
| gboolean | g_mime_smtp_address_try_validate_mailbox () |
| gboolean | g_mime_smtp_utf8_address_try_validate () |
| gboolean | g_mime_smtp_utf8_address_try_validate_mailbox () |
These validators accept a bare mailbox, not a MIME address header. SMTP validates RFC 5321 syntax and ASCII; SMTPUTF8 additionally applies the Unicode, NFC, contextual and script policies of MimeKit's implementation of draft-ietf-mailmaint-smtputf8-syntax-06. Unicode 18.0.0 tables are pinned, independently of the system GLib Unicode/IDNA version.
gboolean g_mime_smtp_address_try_validate (const char *address,gssize length,GMimeSmtpAddressValidationOptions options,GMimeSmtpAddressError *error);
Checks the complete address without trimming, parsing display names, or changing it. Invalid UTF-8 and embedded NUL bytes are syntax errors. Syntax errors precede non-ASCII errors, which precede optional length errors. Quotes and escape sequences count toward the length limits. Domain literals are exempt from label/domain limits, but not the overall address limit.
Since: 4.0
gboolean g_mime_smtp_address_try_validate_mailbox (GMimeMailboxAddress *mailbox,GMimeSmtpAddressValidationOptions options,GMimeSmtpAddressError *error);
Validates the mailbox's address as stored, ignoring the display name and route. Does not convert its domain to an IDN-encoded form.
Since: 4.0
gboolean g_mime_smtp_utf8_address_try_validate (const char *address,gssize length,GMimeSmtpUtf8AddressValidationOptions options,GMimeSmtpUtf8AddressError *error);
Validates syntax, optional lengths, A-label policy, PRECIS code points, NFC, context rules, and script mixtures, in that order. Invalid UTF-8 and embedded NUL bytes are syntax errors. Unicode 18.0.0 data is used on every platform.
Local-part and whole-address limits use the original UTF-8 bytes; domain lengths use raw Punycode A-label sizes. Lengths are checked before IDN decoding. Decoded A-labels must be canonical, at most 63 octets, and satisfy the same Unicode rules as U-labels. Local-part A-label atoms are never decoded.
The input is not normalized, mapped, case-folded, or modified. Passing a NULL
error
provides a simple validity check. This policy is stricter than the
SMTPUTF8 transport grammar and is not a guarantee against all spoofing.
Since: 4.0
gboolean g_mime_smtp_utf8_address_try_validate_mailbox (GMimeMailboxAddress *mailbox,GMimeSmtpUtf8AddressValidationOptions options,GMimeSmtpUtf8AddressError *error);
Validates the mailbox's address as stored using
g_mime_smtp_utf8_address_try_validate(), ignoring the display name and route.
Since: 4.0
Optional SMTPUTF8 validation policies.
Validation results, in precedence order. Length errors require the length option. These are results, not a GError domain.
Validation results, in precedence order. Length errors require the length option. These are results, not a GError domain.
|
Valid address. |
||
|
Invalid mailbox syntax or invalid UTF-8. |
||
|
Local-part exceeds 64 UTF-8 octets. |
||
|
Domain label exceeds 63 A-label octets. |
||
|
Domain exceeds 253 A-label octets. |
||
|
Address exceeds 254 UTF-8 octets. |
||
|
Forbidden or invalid A-label. |
||
|
Code point is not permitted. |
||
|
Address is not NFC. |
||
|
A contextual rule is unsatisfied. |
||
|
Disallowed script mixture. |