Rust

capabilities

Module

What a server advertised in its EHLO reply.

Contents

use utopia_smtp::Capabilities;
Rust
pub struct Capabilities

What the server advertised in its EHLO reply: each keyword, upper-cased, with its parameters.

Discarded and rebuilt after STARTTLS: RFC 3207 section 4.2 requires that anything learned before the handshake is forgotten.

Rust
use utopia_smtp::{Capabilities, Reply};

let reply = Reply::new(250, ["mail.example.test", "SIZE 35882577", "AUTH=PLAIN LOGIN"])?;
let capabilities = Capabilities::from_reply(&reply);

assert_eq!(capabilities.max_size(), Some(35_882_577));
assert_eq!(capabilities.mechanisms(), ["PLAIN", "LOGIN"]);
assert!(!capabilities.has("STARTTLS"));