[−][src]Struct milter::ActionContext
Context of the end of message, ie actions stage.
Fields
data: DataHandle<T>
A handle on managed data in this context.
Methods
impl<T> ActionContext<T>
[src]
pub fn new(ptr: *mut SMFICTX) -> Self
[src]
Constructs a new action context from the milter library-supplied raw context pointer.
You do not normally need to use this method; an ActionContext
is
already supplied to the on_eom
callback.
Panics
Panics if ptr
is null.
pub fn macro_value(&self, name: &str) -> Result<Option<&str>>
[src]
Same as
Context::macro_value
.
pub fn set_error_reply(
&self,
code: &str,
ext_code: Option<&str>,
msg_lines: Vec<&str>
) -> Result<()>
[src]
&self,
code: &str,
ext_code: Option<&str>,
msg_lines: Vec<&str>
) -> Result<()>
Same as
Context::set_error_reply
.
pub fn shut_down(&self)
[src]
Same as Context::shut_down
.
pub fn change_sender(
&self,
mail_from: &str,
esmtp_args: Option<&str>
) -> Result<()>
[src]
&self,
mail_from: &str,
esmtp_args: Option<&str>
) -> Result<()>
Replaces the envelope sender (MAIL FROM
address) of the current
message.
This action is enabled with the flag Actions::CHANGE_SENDER
.
pub fn add_recipient(
&self,
rcpt_to: &str,
esmtp_args: Option<&str>
) -> Result<()>
[src]
&self,
rcpt_to: &str,
esmtp_args: Option<&str>
) -> Result<()>
Adds an envelope recipient (RCPT TO
address) for the current message.
This action is enabled with two distinct flags:
Actions::ADD_RECIPIENT
if no ESMTP arguments are specifiedActions::ADD_RECIPIENT_EXT
if additional ESMTP arguments are specified
pub fn delete_recipient(&self, rcpt_to: &str) -> Result<()>
[src]
Removes an envelope recipient (RCPT TO
address) from the current
message.
This action is enabled with the flag Actions::DELETE_RECIPIENT
.
pub fn add_header(&self, name: &str, value: &str) -> Result<()>
[src]
Appends a header to the list of headers of the current message. If the
header value is to span multiple lines, use \n
(followed by
whitespace) as the line separator, not \r\n
.
This action is enabled with the flag Actions::ADD_HEADER
.
pub fn insert_header(&self, index: usize, name: &str, value: &str) -> Result<()>
[src]
Inserts a header at index
in the list of headers of the current
message.
This action is enabled with the flag Actions::ADD_HEADER
.
pub fn change_header(
&self,
name: &str,
index: usize,
value: Option<&str>
) -> Result<()>
[src]
&self,
name: &str,
index: usize,
value: Option<&str>
) -> Result<()>
‘Changes’, that is, replaces, removes, or appends a header at the
index
’th occurrence of headers with the given name
for the current
message. The index is 1-based (starts at 1).
More precisely,
- replaces the
index
’th occurrence of headers namedname
with the specified value; - if the value is
None
, that header is instead removed; - if index is greater than the number of occurrences of headers named
name
, a new header is instead appended.
This action is enabled with the flag Actions::CHANGE_HEADER
.
pub fn append_new_body(&self, content: &[u8]) -> Result<()>
[src]
Appends content to the new message body of the current message.
This method may be called repeatedly: initially empty, the new body is augmented with additional content with each call. If this method is not called, the original message body remains unchanged.
This action is enabled with the flag Actions::CHANGE_BODY
.
pub fn quarantine(&self, reason: &str) -> Result<()>
[src]
Quarantines the current message for the given reason.
This action is enabled with the flag Actions::QUARANTINE
.
pub fn keepalive(&self) -> Result<()>
[src]
Signals to the milter library that this milter is still alive, causing it to reset timeouts.
Auto Trait Implementations
impl<T = ()> !Send for ActionContext<T>
impl<T = ()> !Sync for ActionContext<T>
impl<T> Unpin for ActionContext<T>
impl<T> UnwindSafe for ActionContext<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T = ()> !RefUnwindSafe for ActionContext<T>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,