ietf-corpus

rfc-6068

The 'mailto' URI Scheme

M. Duerst, L. Masinter, J. Zawinski
date2010-10 streamIETF wgnon working group statusPROPOSED STANDARD pages17 canonicalhttps://www.rfc-editor.org/rfc/rfc6068 doi10.17487/RFC6068 errataview
This document defines the format of Uniform Resource Identifiers (URIs) to identify resources that are reached using Internet mail. It adds better internationalization and compatibility with Internationalized Resource Identifiers (IRIs; RFC 3987) to the previous syntax of 'mailto' URIs (RFC 2368). [STANDARDS-TRACK]

obsoletes

Extracted elements (27)

design-rationale §2

The "body" pseudo header field is primarily intended for short text messages for automatic processing (e.g., mailing list subscribe commands), not general MIME bodies. This limitation avoids the complexity of full MIME encoding in URIs.

email

design-rationale §2

URI producers SHOULD provide internationalized domain names in IDNA encoding rather than percent-encoded form to maximize interoperability with legacy 'mailto' URI interpreters that do not understand UTF-8-based percent-encoding for domain names.

email

interoperability-note §2

Combining a 'to' address in both the <to> component and a 'to' hfvalue (e.g., mailto:addr1@example.com?to=addr2@example.com) is syntactically valid but NOT RECOMMENDED because different user agents handle this case differently; some existing clients ignore 'to' hfvalues.

email

interoperability-note §5

HTML forms historically encode spaces as '+', but this is problematic in 'mailto' URIs because a '+' cannot be distinguished from a literal '+' (used in subaddressing). All spaces SHOULD be encoded as %20 when producing 'mailto' URIs.

email, http

interoperability-note §8.1

Interoperability for 'mailto' URIs with UTF-8-based percent-encoding may be lower than for US-ASCII-only 'mailto' URIs, due to legacy implementations that do not support the internationalization extensions added by RFC 6068.

email

normative-requirement §2 MUST

Characters that cannot appear in a URI per STD66, as well as "%", and gen-delims except "@" and ":" (i.e., "/", "?", "#", "[", "]") MUST be percent-encoded in addr-spec. Among sub-delims, "&", ";", and "=" also MUST be percent-encoded.

email

normative-requirement §4 MUST

Clients that resolve 'mailto' URIs into mail messages MUST be able to correctly create RFC 5322-compliant mail messages using at minimum the "subject" header field and "body".

email

normative-requirement §2 MUST

For internationalized domain names in addr-spec, non-ASCII characters MUST first be encoded as UTF-8 and then each octet MUST be percent-encoded. URI-producing applications MUST NOT use percent-encoding in domain names unless it represents a UTF-8 character sequence.

email, v6ops

normative-requirement §2 SHOULD NOT

Fragment identifiers SHOULD NOT be used on 'mailto' URIs and SHOULD be ignored upon resolution. The "#" character in hfvalues MUST be escaped as %23.

email

normative-requirement §2 MUST

Header fields related to message encoding (e.g., Content-Transfer-Encoding) in a 'mailto' URI are irrelevant and MUST be ignored.

email

normative-requirement §2 MUST NOT

Implementations MUST NOT produce two "To:" header fields in a message; the "To:" header field may occur at most once. Creators of 'mailto' URIs MUST NOT include other message header fields multiple times if those fields can only appear once.

email

normative-requirement §5 MUST

Line breaks in the body of a message MUST be encoded with "%0D%0A". All spaces SHOULD be encoded as %20; '+' characters MAY be encoded as %2B.

email

normative-requirement §2 MUST

Non-ASCII characters in the local-part of an addr-spec MUST first be encoded as UTF-8 and then percent-encoded. Any other percent-encoding of non-ASCII characters in local-part is prohibited.

email

normative-requirement §2 MUST NOT

<obs-local-part> and <NO-WS-CTL> as defined in RFC 5322 MUST NOT be used in a 'mailto' URI addr-spec.

email

normative-requirement §3 MUST

Originator fields (From, Date), routing fields (Resent-*, etc.), trace fields, and MIME header fields (MIME-Version, Content-*) present in a 'mailto' URI MUST be ignored by the mail client.

email

normative-requirement §4 SHOULD NOT

The user agent interpreting a 'mailto' URI SHOULD NOT create a message if any header fields are considered dangerous; it MAY create a message with only a subset of the header fields given in the URI.

email, security

normative-requirement §2 MUST

When an internationalized domain name is used to compose a message, it MUST be transformed to IDNA encoding (RFC 5891). URI producers SHOULD provide domain names in IDNA encoding rather than percent-encoded to maximize interoperability with legacy 'mailto' URI interpreters.

email

normative-requirement §5 MUST

When creating 'mailto' URIs, any reserved characters MUST be encoded so that URI interpreters can read them. Client software reading URIs MUST decode strings before creating the mail message.

email

normative-requirement §2 MUST NOT

Whitespace and comments within <local-part> and <domain> of an addr-spec in a 'mailto' URI MUST NOT be used, as they would have no operational semantics.

email

protocol-element §2

The special hfname "body" indicates the associated hfvalue is the message body, intended for the first text/plain body part. No additional encoding (e.g., base64 or quoted-printable) is used for the body field value beyond UTF-8-based percent-encoding.

email

registry §8.2

IANA has registered the "Body" header field in the Message Header Fields Registry (RFC 3864) with status "reserved" and applicable protocol "None", to prevent its use as an actual message header field and avoid conflicts with 'mailto' URI semantics.

email, registry

registry §8.1

The IANA registry of URI schemes is updated so that the 'mailto' URI scheme registration (previously pointing to RFC 2368) now references RFC 6068. The scheme is permanent status.

email, registry

security-consideration §7 SHOULD NOT

A mail client SHOULD NOT send a message based on a 'mailto' URI without first disclosing and showing to the user the full message (including all header fields), fully decoded, and asking for user approval. The client SHOULD also make clear that an email will be sent.

email, security

security-consideration §7

'mailto' URIs on public web pages expose all included mail addresses (including bcc hfvalues) to harvesting. Addresses in a "bcc" hfvalue are still publicly visible in the URI even though not sent to 'to' recipients.

email, security, privacy

security-consideration §7 SHOULD

Programs interpreting 'mailto' URIs SHOULD ensure that the SMTP envelope return path address (MAIL FROM argument) is set and correct, and that the resulting email is a complete, workable message.

email, security

security-consideration §7

Programs manipulating 'mailto' URIs must take care not to double-escape or double-unescape, and must apply URI and mail address escaping/unescaping conventions in the correct order. Implementations must sanity-check URIs to avoid buffer overflows and code execution.

email, security

wire-format §2

The 'mailto' URI syntax is defined as: mailtoURI = "mailto:" [ to ] [ hfields ], where to is one or more comma-separated addr-spec values, and hfields are key=value pairs separated by '&' and introduced by '?'. The addr-spec is local-part "@" domain, with local-part being dot-atom-text or quoted-string.

email