pub struct EmailMessage {
pub message_id: String,
pub from: String,
pub to: String,
pub client_ip: Option<IpAddr>,
pub helo_domain: Option<String>,
/* private fields */
}Expand description
Fields§
§message_id: StringUnique message identifier, RFC 5322 message-id format.
from: StringSender address, RFC 5322 address format.
to: StringRecipient address, RFC 5322 address format.
client_ip: Option<IpAddr>IP address of the connecting SMTP client (for SPF verification).
helo_domain: Option<String>HELO/EHLO domain presented by the connecting client (for SPF verification).
Implementations§
Source§impl EmailMessage
impl EmailMessage
pub fn new(from: String, to: String, raw: String) -> Self
pub fn from_raw(from: &str, to: &str, raw: &str) -> Self
pub fn with_id( message_id: String, from: String, to: String, subject: String, raw: String, ) -> Self
Sourcepub fn header(&self, name: &str) -> Option<&str>
pub fn header(&self, name: &str) -> Option<&str>
Returns the first header value matching name (case-insensitive).
Sourcepub fn original_raw(&self) -> &str
pub fn original_raw(&self) -> &str
Returns the original raw email as received, before any transformer modifications.
Use this for byte-exact operations such as DKIM signature verification, where the original byte sequence must be preserved.
Sourcepub fn has_headers(&self) -> bool
pub fn has_headers(&self) -> bool
Returns whether the message has any MIME headers.
Sourcepub fn prepend_header(&mut self, name: &str, value: &str)
pub fn prepend_header(&mut self, name: &str, value: &str)
Trait Implementations§
Source§impl Clone for EmailMessage
impl Clone for EmailMessage
Source§fn clone(&self) -> EmailMessage
fn clone(&self) -> EmailMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EmailMessage
impl RefUnwindSafe for EmailMessage
impl Send for EmailMessage
impl Sync for EmailMessage
impl Unpin for EmailMessage
impl UnsafeUnpin for EmailMessage
impl UnwindSafe for EmailMessage
Blanket Implementations§
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
Mutably borrows from an owned value. Read more