Skip to main content

resolve_from

Function resolve_from 

Source
pub fn resolve_from(
    send_as: &[SendAs],
    from: &Mailbox,
) -> Result<Option<Mailbox>>
Expand description

Checks from against the account’s send-as addresses and returns the mailbox to write as the draft’s From, or None to leave From to Gmail.

The address matches sendAsEmail case-insensitively and is written in the stored spelling. An alias still awaiting verification is refused, as is an address that isn’t one of send_as: Gmail would send from the primary address instead, or not at all.

Without a name in from, the name is the alias’s non-blank displayName, else the primary address’s, which is the name Gmail itself sends a nameless alias under. When that leaves the primary address with no name, the result is None: Gmail fills in the primary address and the Google account’s name, which a nameless From would lose.