Skip to main content

ServerCapabilities

Struct ServerCapabilities 

Source
#[non_exhaustive]
pub struct ServerCapabilities { /* private fields */ }
Expand description

Server capabilities parsed from EHLO response (RFC 5321 Section 4.1.1.1).

Implementations§

Source§

impl ServerCapabilities

Source

pub fn greeting_name(&self) -> &str

Returns the server’s greeting name from the EHLO response.

Source

pub fn extensions(&self) -> &[SmtpExtension]

Returns the server’s advertised extensions.

Source

pub fn supports_auth(&self, mechanism: &AuthMechanism) -> bool

Check if the server supports a given auth mechanism.

RFC 4954 Section 3 / RFC 4422 Section 3.1: SASL mechanism names are case-insensitive, so this method performs case-insensitive matching for AuthMechanism::Other variants.

Source

pub fn supports_auth_extension(&self) -> bool

Check if the server advertises the AUTH extension at all.

RFC 4954 Section 3: the EHLO AUTH keyword advertises support for the AUTH command and the MAIL FROM AUTH parameter.

Source

pub fn supports_starttls(&self) -> bool

Check if the server advertises STARTTLS.

Source

pub fn supports_chunking(&self) -> bool

Check if the server supports CHUNKING (BDAT).

Source

pub fn supports_size(&self) -> bool

Check if the server supports the SIZE extension (RFC 1870).

Returns true when the server advertises SIZE, regardless of whether a numeric limit was included. Use Self::size_limit to retrieve the limit value.

Source

pub fn size_limit(&self) -> Option<u64>

Get the SIZE limit, if advertised.

Source

pub fn supports_8bitmime(&self) -> bool

Check if the server supports 8BITMIME (RFC 1652).

Source

pub fn supports_binarymime(&self) -> bool

Check if the server supports BINARYMIME (RFC 3030).

Source

pub fn supports_8bit_or_binary(&self) -> bool

Check if the server supports either 8BITMIME (RFC 1652) or BINARYMIME (RFC 3030).

RFC 1652 Section 1 / RFC 3030 Section 2: when neither extension is advertised, the SMTP client is limited to 7-bit US-ASCII content. Either extension satisfies the requirement for non-7-bit BODY parameters.

Source

pub fn supports_pipelining(&self) -> bool

Check if the server supports PIPELINING (RFC 1854).

Source

pub fn supports_smtputf8(&self) -> bool

Check if the server supports SMTPUTF8 (RFC 6531).

Source

pub fn supports_sasl_ir(&self) -> bool

Check whether the server advertised the legacy SASL-IR keyword.

RFC 4954 Section 4 already allows SMTP AUTH initial responses without a separate capability. This accessor is retained only so callers can inspect the EHLO response as advertised.

Source

pub fn supports_dsn(&self) -> bool

Check if the server supports DSN (RFC 3461).

When advertised, the server accepts Delivery Status Notification parameters on MAIL FROM (RET, ENVID) and RCPT TO (NOTIFY, ORCPT) per RFC 3461 Sections 4.1–4.4.

Source

pub fn supports_requiretls(&self) -> bool

Check if the server supports REQUIRETLS (RFC 8689).

When advertised, the client may include the REQUIRETLS parameter on MAIL FROM to enforce TLS on every hop (RFC 8689 Sections 2–4).

Source

pub fn supports_future_release(&self) -> bool

Check if the server supports FUTURERELEASE (RFC 4865).

Source

pub fn future_release_max_interval(&self) -> Option<u64>

Get the server-advertised FUTURERELEASE maximum hold interval in seconds, if any (RFC 4865 Section 4).

Source

pub fn future_release_max_datetime(&self) -> Option<&str>

Get the server-advertised FUTURERELEASE maximum hold-until datetime string, if any (RFC 4865 Section 4).

Source

pub fn supports_deliver_by(&self) -> bool

Check if the server supports DELIVERBY (RFC 2852).

Source

pub fn deliver_by_min(&self) -> Option<u64>

Get the server-advertised DELIVERBY minimum time in seconds, if any (RFC 2852 Section 2).

Source

pub fn supports_mt_priority(&self) -> bool

Check if the server supports MT-PRIORITY (RFC 6758).

Source

pub fn supports_vrfy(&self) -> bool

Check if the server supports VRFY (RFC 5321 Section 4.1.1.6).

Source

pub fn supports_expn(&self) -> bool

Check if the server supports EXPN (RFC 5321 Section 4.1.1.7).

Source

pub fn supports_enhanced_status_codes(&self) -> bool

Check if the server supports Enhanced Status Codes (RFC 2034).

When advertised, the server includes enhanced status codes (class.subject.detail) in its response text per RFC 2034 Section 3.

Trait Implementations§

Source§

impl Clone for ServerCapabilities

Source§

fn clone(&self) -> ServerCapabilities

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ServerCapabilities

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ServerCapabilities

Source§

fn default() -> ServerCapabilities

Returns the “default value” for a type. Read more
Source§

impl Hash for ServerCapabilities

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ServerCapabilities

Source§

fn eq(&self, other: &ServerCapabilities) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for ServerCapabilities

Source§

impl StructuralPartialEq for ServerCapabilities

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more