parse_smtp_mailbox (smtp/backend.rs)

himalaya · src/smtp/backend.rs · rust · Apache-2.0
email

Parses a 'local-part@domain' string into an io-smtp SmtpMailbox, validating format.

// Source: https://github.com/pimalaya/himalaya | License: Apache-2.0 | Copyright 2022-2026 soywod <pimalaya.org@posteo.net>
// Provided via justclaw.it.com; keep this notice with the code.
//! # SMTP backend
//!
//! The SMTP adapter of the shared cross-protocol client, a send-only
//! transport for the storage backends that cannot send themselves.
//!
//! The RFC 5321 envelope comes from [`SubmissionEnvelope`], derived from
//! the message headers. io-smtp then removes the `Bcc:` field from what
//! it transmits.

use io_smtp::client::SmtpClient as _;
use std::borrow::Cow;

use anyhow::{Result, anyhow, bail};
use io_smtp::{
    message::SmtpMessageSendOptions,
    rfc5321::{
        SmtpDomain, SmtpEhloDomain, SmtpForwardPath, SmtpLocalPart, SmtpMailbox, SmtpReversePath,
    },
};

use cr

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key