Crate vsmtp_rule_engine
Expand description
vSMTP rule engine
vSMTP server is built with a runtime also called rule engine
.
This runtime can execute code provided in our superset of the
https://rhai.rs language.
The viridIT scripting language (vsl) is a simple language that allow
you to define rules
and object
to control the traffic on your MTA.
Further details on the official book of vSMTP: https://vsmtp.rs/reference/vSL/vsl.html
Re-exports
pub use rhai;
Modules
- Module containing the backend for the vsl’s Rust API.
Macros
- Fetch rule engine global variables by calling the rhai system functions.
- A bail macro for rhai context similar to
anyhow::bail
macro. - An error formatting macro for rhai context similar to the
anyhow::anyhow
macro. - Transforms a generic error into the rhai boxed eval alt result.
- Handle
std::sync::RwLock
andstd::sync::Mutex
error. - Transforms a generic error in a result into the rhai boxed eval alt result.
Structs
- a sharable rhai engine. contains an ast representation of the user’s parsed .vsl script files, and modules / packages to create a cheap rhai runtime.
- a state container that bridges rhai’s & rust contexts.
- Encapsulate all ASTs of rules split by domain and transaction type.
Enums
- State of vsl rules execution
Functions
- Create a new command module.
- Create a new smtp module.