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: Vec<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 or if the keys for some recipients are missing and encrypted message cannot be sent to them.
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 to
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: Vec<String>
List of Message-IDs for References
header.
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
impl MimeFactory
pub async fn from_msg(context: &Context, msg: Message) -> Result<MimeFactory>
pub async fn from_mdn( context: &Context, from_id: ContactId, rfc724_mid: String, additional_msg_ids: Vec<String>, ) -> Result<MimeFactory>
async fn peerstates_for_recipients( &self, context: &Context, ) -> Result<Vec<(Option<Peerstate>, String)>>
fn is_e2ee_guaranteed(&self) -> bool
fn verified(&self) -> bool
fn should_force_plaintext(&self) -> bool
fn should_skip_autocrypt(&self) -> bool
fn should_attach_profile_data(msg: &Message) -> bool
async fn should_attach_selfavatar(context: &Context, msg: &Message) -> bool
fn grpimage(&self) -> Option<String>
async fn subject_str(&self, context: &Context) -> Result<String>
pub fn recipients(&self) -> Vec<String>
Sourcepub async fn render(self, context: &Context) -> Result<RenderedEmail>
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
Sourcefn get_message_kml_part(&self) -> Option<MimePart<'static>>
fn get_message_kml_part(&self) -> Option<MimePart<'static>>
Returns MIME part with a message.kml
attachment.
Sourceasync fn get_location_kml_part(
&mut self,
context: &Context,
) -> Result<Option<MimePart<'static>>>
async fn get_location_kml_part( &mut self, context: &Context, ) -> Result<Option<MimePart<'static>>>
Returns MIME part with a location.kml
attachment.
async fn render_message( &mut self, context: &Context, headers: &mut Vec<(&'static str, HeaderType<'static>)>, grpimage: &Option<String>, is_encrypted: bool, ) -> Result<(MimePart<'static>, Vec<MimePart<'static>>)>
Sourcefn render_mdn(&mut self) -> Result<MimePart<'static>>
fn render_mdn(&mut self) -> Result<MimePart<'static>>
Render an MDN
Trait Implementations§
Source§impl Clone for MimeFactory
impl Clone for MimeFactory
Source§fn clone(&self) -> MimeFactory
fn clone(&self) -> MimeFactory
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for MimeFactory
impl RefUnwindSafe for MimeFactory
impl Send for MimeFactory
impl Sync for MimeFactory
impl Unpin for MimeFactory
impl UnwindSafe for MimeFactory
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.