Filtering Reference
This section reference all Rhai functions used through the rule engine and vSMTP configuration. Those functions are split by modules.
They list:
- All standard functions available for email filtering. (referred by the
fn
keyword) - Operators. (referred by the
op
keyword) - Objects getters. (referred by the
get
keyword) - Objects setters. (referred by the
set
keyword)
Documentation
Documentation for each function is written using markdown, and is split between sections (tabs):
Section | Description |
---|---|
Args | Arguments to pass to the function. |
Return | Value that the function returns. |
Effective SMTP Stages | SMTP stages where this function can be called from. |
Note | Additional comments for the function. |
Examples | Code examples using the function. |
Errors | Errors that can happen during the execution of the function. |
Errors
A function that is marked with the Errors
section can fail. (It can throw a Rhai exception)
Exceptions stops the evaluation of the rule engine and return a deny code.
To handle exceptions, you can use the try catch
statement in Rhai.
Example
fn
my_function
fn hello_world() -> String
- Description
- Effective smtp stage
- Return
- Example
This is the description section of the
hello_world
function.This function returns a "hello world!" string.
All of them!
String
- A "hello world!" string.
let hello_world = hello_world(); // Returns "Hello World!".