pub enum BounceEvent {
SenderNotification {
base: BaseEvent,
original_queue_id: String,
bounce_queue_id: String,
},
PostmasterNotification {
base: BaseEvent,
original_queue_id: String,
bounce_queue_id: String,
},
Warning {
base: BaseEvent,
warning_type: BounceWarningType,
details: String,
},
}Expand description
BOUNCE事件类型定义
基于Postfix BOUNCE守护进程的实际功能开发 BOUNCE守护进程负责:
- 生成投递失败通知邮件
- 生成发送者和邮件管理员通知
- 处理格式错误请求
- 管理退信和延迟通知的生成
Variants§
SenderNotification
发送者投递失败通知事件
当邮件投递失败时,BOUNCE守护进程为原始发送者生成一个投递失败通知邮件 这是BOUNCE组件最主要的功能,占95%+的日志量
示例日志: “5FC392A20996: sender non-delivery notification: 732B92A209A3”
Fields
PostmasterNotification
邮件管理员投递失败通知事件
当邮件投递失败且需要通知邮件管理员时生成 通常在复杂的投递失败场景中出现
示例日志: “633F488423: postmaster non-delivery notification: 6DFA788422”
Fields
Warning
BOUNCE守护进程警告事件
处理BOUNCE服务过程中出现的各种警告 包括格式错误、配置问题、资源限制等
示例日志: “warning: malformed request”
Implementations§
Source§impl BounceEvent
impl BounceEvent
Sourcepub fn event_type(&self) -> &'static str
pub fn event_type(&self) -> &'static str
获取事件类型的字符串表示
Sourcepub fn is_notification(&self) -> bool
pub fn is_notification(&self) -> bool
检查是否为通知事件(投递失败通知)
Sourcepub fn is_warning(&self) -> bool
pub fn is_warning(&self) -> bool
检查是否为警告事件
Sourcepub fn get_queue_ids(&self) -> Option<(&str, &str)>
pub fn get_queue_ids(&self) -> Option<(&str, &str)>
获取通知相关的队列ID(如果是通知事件)
Sourcepub fn get_warning_info(&self) -> Option<(&BounceWarningType, &str)>
pub fn get_warning_info(&self) -> Option<(&BounceWarningType, &str)>
获取警告信息(如果是警告事件)
Sourcepub fn format_description(&self) -> String
pub fn format_description(&self) -> String
格式化为人类可读的描述
Trait Implementations§
Source§impl Clone for BounceEvent
impl Clone for BounceEvent
Source§fn clone(&self) -> BounceEvent
fn clone(&self) -> BounceEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BounceEvent
impl Debug for BounceEvent
Source§impl<'de> Deserialize<'de> for BounceEvent
impl<'de> Deserialize<'de> for BounceEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for BounceEvent
impl PartialEq for BounceEvent
Source§impl Serialize for BounceEvent
impl Serialize for BounceEvent
impl StructuralPartialEq for BounceEvent
Auto Trait Implementations§
impl Freeze for BounceEvent
impl RefUnwindSafe for BounceEvent
impl Send for BounceEvent
impl Sync for BounceEvent
impl Unpin for BounceEvent
impl UnsafeUnpin for BounceEvent
impl UnwindSafe for BounceEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more