pub struct Vacation {
pub days: u32,
pub subject: Option<String>,
pub from: Option<String>,
pub message: String,
}Expand description
Configuration for the vacation action (RFC 5230).
days defaults to 7 (the RFC default for an omitted :days). The
engine resolves the reply-to sender from envelope data at evaluation
time and applies respond-once-per-sender-per-period semantics via the
caller-supplied dedup hook (see
EvalContext); the outcome carries enough
information (to, days) for hosts that prefer to dedup themselves.
Fields§
§days: u32Minimum days between responses to the same sender (:days).
subject: Option<String>Override subject for the reply (:subject); when unset the engine
uses Re: <original subject>.
from: Option<String>Override From address for the reply (:from).
message: StringResponse body text (the positional message argument).
Implementations§
Source§impl Vacation
impl Vacation
Sourcepub fn new(message: impl Into<String>) -> Self
pub fn new(message: impl Into<String>) -> Self
Create a vacation action with the RFC-default 7-day respond period.
Sourcepub fn with_subject(self, subject: impl Into<String>) -> Self
pub fn with_subject(self, subject: impl Into<String>) -> Self
Set the reply subject override (:subject).
Sourcepub fn with_from(self, from: impl Into<String>) -> Self
pub fn with_from(self, from: impl Into<String>) -> Self
Set the reply From address override (:from).
Sourcepub fn validate(&self) -> Result<(), FilterError>
pub fn validate(&self) -> Result<(), FilterError>
Validate the configuration: non-empty message and days >= 1.
§Errors
Returns FilterError::InvalidVacation when the message body is
empty or the period is zero.