deltachat::mimefactory

Struct MimeFactory

source
pub struct MimeFactory {
Show 16 fields from_addr: String, from_displayname: String, sender_displayname: Option<String>, selfstatus: String, recipients: Vec<String>, to: Vec<(String, String)>, past_members: Vec<(String, String)>, member_timestamps: Vec<i64>, timestamp: i64, loaded: Loaded, 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>

Vector of actual recipient addresses.

This is the list of addresses the message should be sent to. It is not the same as the To header, because in case of “member removed” message removed member is in the recipient list, but not in the To header. In case of broadcast lists there are multiple recipients, but the To header has no members.

If bcc_self configuration is enabled, this list will be extended with own address later, but MimeFactory is not responsible for this.

§to: Vec<(String, String)>

Vector of pairs of recipient name and address that goes into the To field.

The list of actual message recipient addresses may be different, e.g. if members are hidden for broadcast lists.

§past_members: Vec<(String, String)>

Vector of pairs of past group member names and addresses.

§member_timestamps: Vec<i64>

Timestamps of the members in the same order as in the recipients followed by past_members.

If this is not empty, its length should be the sum of recipients and past_members length.

§timestamp: i64§loaded: Loaded§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

True if the message requests Message Disposition Notification using Chat-Disposition-Notification-To header.

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

source

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

source

pub async fn from_mdn( context: &Context, from_id: ContactId, rfc724_mid: String, additional_msg_ids: Vec<String>, ) -> Result<MimeFactory>

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

fn should_attach_profile_data(msg: &Message) -> 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 Vec<Header>, grpimage: &Option<String>, is_encrypted: bool, ) -> Result<(PartBuilder, Vec<PartBuilder>)>

source

fn render_mdn(&mut self) -> Result<PartBuilder>

Render an MDN

Trait Implementations§

source§

impl Clone for MimeFactory

source§

fn clone(&self) -> MimeFactory

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 Debug for MimeFactory

source§

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

Formats the value using the given formatter. Read more

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
§

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

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

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

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

source§

type Output = T

Should always be Self
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.
§

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
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T