Skip to main content

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):

SectionDescription
ArgsArguments to pass to the function.
ReturnValue that the function returns.
Effective SMTP StagesSMTP stages where this function can be called from.
NoteAdditional comments for the function.
ExamplesCode examples using the function.
ErrorsErrors 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
This is the description section of the hello_world function.

This function returns a "hello world!" string.