Function vsmtp_rule_engine::api::message::prepend_header
pub fn prepend_header(
ncc: NativeCallContext<'_>,
header: &str,
value: &str
) -> EngineResult<()>Expand description
Add a new header on top all other headers in the message.
Args
header- the name of the header to prepend.value- the value of the header to prepend.
Effective smtp stage
All of them. Even though the email is not received at the current stage,
vsmtp stores new headers and will add them on top of the ones received once
the preq stage is reached.
Examples
"X-My-Header: 250 foo\r\n",
"Subject: Unit test are cool\r\n",
"\r\n",
"Hello world!\r\n",
#{
preq: [
rule "prepend_header" || {
msg::prepend_header("X-My-Header-2", "bar");
msg::prepend_header("X-My-Header-3", identifier("baz"));
}
]
}