pub struct MimeFactory<'a> {
Show 14 fields from_addr: String, from_displayname: String, sender_displayname: Option<String>, selfstatus: String, recipients: Vec<(String, String)>, timestamp: i64, loaded: Loaded, msg: &'a Message, in_reply_to: String, references: String, req_mdn: bool, last_added_location_id: Option<u32>, sync_ids_to_delete: Option<String>, pub attach_selfavatar: bool,
}
Expand description

Helper to construct mime messages.

Fields§

§from_addr: String§from_displayname: String§sender_displayname: Option<String>

Goes to the Sender:-header, if set. For overridden names, sender_displayname is set to the config-name while from_displayname is set to the overridden name. From the perspective of the receiver, a set Sender:-header is used as an indicator that the name is overridden; names are alsways read from the From:-header.

§selfstatus: String§recipients: Vec<(String, String)>

Vector of pairs of recipient name and address

§timestamp: i64§loaded: Loaded§msg: &'a Message§in_reply_to: String§references: String

Space-separated list of Message-IDs for References header.

Each Message-ID in the list may or may not be enclosed in angle brackets, angle brackets must be added during message rendering as needed.

§req_mdn: bool§last_added_location_id: Option<u32>§sync_ids_to_delete: Option<String>

If the created mime-structure contains sync-items, the IDs of these items are listed here. The IDs are returned via RenderedEmail and must be deleted if the message is actually queued for sending.

§attach_selfavatar: bool

True if the avatar should be attached.

Implementations§

source§

impl<'a> MimeFactory<'a>

source

pub async fn from_msg( context: &Context, msg: &'a Message ) -> Result<MimeFactory<'a>>

source

pub async fn from_mdn( context: &Context, msg: &'a Message, additional_msg_ids: Vec<String> ) -> Result<MimeFactory<'a>>

source

async fn peerstates_for_recipients( &self, context: &Context ) -> Result<Vec<(Option<Peerstate>, String)>>

source

fn is_e2ee_guaranteed(&self) -> bool

source

fn verified(&self) -> bool

source

fn should_force_plaintext(&self) -> bool

source

fn should_skip_autocrypt(&self) -> bool

source

async fn should_do_gossip( &self, context: &Context, multiple_recipients: bool ) -> Result<bool>

source

async fn should_attach_selfavatar(context: &Context, msg: &Message) -> bool

source

fn grpimage(&self) -> Option<String>

source

async fn subject_str(&self, context: &Context) -> Result<String>

source

pub fn recipients(&self) -> Vec<String>

source

pub async fn render(self, context: &Context) -> Result<RenderedEmail>

Consumes a MimeFactory and renders it into a message which is then stored in smtp-table to be used by the SMTP loop

source

fn get_message_kml_part(&self) -> Option<PartBuilder>

Returns MIME part with a message.kml attachment.

source

async fn get_location_kml_part( &mut self, context: &Context ) -> Result<Option<PartBuilder>>

Returns MIME part with a location.kml attachment.

source

fn add_message_text(&self, part: PartBuilder, text: String) -> PartBuilder

source

async fn render_message( &mut self, context: &Context, headers: &mut MessageHeaders, grpimage: &Option<String>, is_encrypted: bool ) -> Result<(PartBuilder, Vec<PartBuilder>)>

source

async fn render_mdn(&mut self, context: &Context) -> Result<PartBuilder>

Render an MDN

Trait Implementations§

source§

impl<'a> Clone for MimeFactory<'a>

source§

fn clone(&self) -> MimeFactory<'a>

Returns a copy 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<'a> Debug for MimeFactory<'a>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for MimeFactory<'a>

§

impl<'a> Send for MimeFactory<'a>

§

impl<'a> Sync for MimeFactory<'a>

§

impl<'a> Unpin for MimeFactory<'a>

§

impl<'a> UnwindSafe for MimeFactory<'a>

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
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32 ) -> TaggedParser<'a, Implicit, Self, E>

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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>,

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
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