HSL

From Halon, SMTP software for hosting providers
Jump to: navigation, search
The scripting language is documented in the HSL reference manual.
At its core, Halon is a scriptable SMTP server

The Halon Scripting Language (HSL) is an email-centric, domain-specific language that's at the core of the Halon SMTP software.

The language itself implements a set of standard library functions. In addition to that, there are contexts (or extensions) that are implemented by the different daemon processes; such as API authentication, IP firewall and most importantly the e-mail oriented flows that maps to SMTP commands; AUTH (SASL), RCPT TO, DATA and queue processing pre- and post- delivery. The contexts define additional functions, as well as pre-defined variables.

Although the syntax and function names in HSL are very much similar to PHP, Python, Perl and C, it's important to remember that HSL is a completely different language. There are syntax differences, and the performance characteristics of different coding styles are not comparable between these languages.

Functions and contexts

Standard library functions are recognised by their lowercase names, and can be used in any context. Most functions are indeed standard library functions, for reusability. The other (context) functions, such as Reject($msg) (giving a 500 SMTP error), have capitalized names.

Below is a table relating functions and SMTP commands to HSL contexts

Context Process Description
Standard library all processes Shared among all contexts
IP ippolicyd Handling IP packets, like a scripted firewall
AUTH mailpolicyd Handling SMTP AUTH (SASL) requests
RCPT TO mailpolicyd Handling the SMTP MAIL FROM and RCPT TO commands
DATA mailscand Handling the SMTP DATA command; in other words "the mail message"
Pre-delivery mailqueued Decides what is to be done before a delivery is attempted
Post-delivery mailqueued Decides what is to be done when a delivery attempt is done
API authentication backend Handling administration (SOAP API) sign-ins, suitable for RADIUS/TACACS+ integration