Files
kumomta/docs/reference/address/user.md
T
Wez Furlong 937611feb9 rfc5321: improve handling of quoted local parts in envelope addresses
This commit refactors the EnvelopeAddress types(!) so that the brains
of them are centralized in the rfc5321 crate, removes the one from
the log-types crate, and replaces the internals of the one in the
message crate with the rfc5321 implementation.

This revised implementation accommodates quoted local parts more
consistently and exposes the local part via a normalizing accessor which
is in turn used when comparing addresses for equality.

This means that `"foo"@` and `foo@` now compare the same, and if you
have setup a maildir that generates per-user maildirs, we'll use the
normalized form of the local part rather than whatever is on the
incoming address.

Another side effect of this commit is that we can now accept exotic
quoted addresses like `"info@"@example.com` without falsely complaining
about having too many `@` signs in the address.

closes:  https://github.com/KumoCorp/kumomta/issues/495
2026-03-28 07:20:35 +00:00

832 B

user

local user = address.user

Returns the mailbox portion of the address. For example, if the address is "first.last@example.com", address.user will evaluate as "first.last".

See also address.domain.

Quoted Local Part

{{since('dev')}}

Prior releases of KumoMTA had inconsistent behavior around handling envelope addresses whose local part was a quoted string. The behavior has been improved, and this user field will now return the normalized local part from the address.

Normalization removes any quoting and quotes from the local part.

Some examples of how this works are shown in the table below:

Address Normalized Local Part
foo@example.com foo
"foo"@example.com foo
"f\oo"@example.com foo
"info@"@example.com info@