Difference between revisions of "HSL"

From Halon, SMTP software for hosting providers
Jump to: navigation, search
 
Line 1: Line 1:
 
{| cellspacing="10" cellpadding="0" style="margin:0em 0em 1em 0em; border:1px solid #1DA0E7; background:#B3DDF4;width:100%"
 
{| cellspacing="10" cellpadding="0" style="margin:0em 0em 1em 0em; border:1px solid #1DA0E7; background:#B3DDF4;width:100%"
| The scripting language is documented in the [http://docs.halon.se/hsl/ HSL reference manual].
+
| The scripting language is documented in the [https://docs.halon.io/hsl/ HSL reference manual].
 
|}
 
|}
 
[[Image:Features.png |thumb|right|200px|At its core, Halon is a scriptable SMTP server]]
 
[[Image:Features.png |thumb|right|200px|At its core, Halon is a scriptable SMTP server]]
 
The '''Halon Scripting Language''' ('''HSL''') is an email-centric, [https://en.wikipedia.org/wiki/Domain-specific_language domain-specific] language that's at the core of the {{HalonProdName}}.
 
The '''Halon Scripting Language''' ('''HSL''') is an email-centric, [https://en.wikipedia.org/wiki/Domain-specific_language domain-specific] language that's at the core of the {{HalonProdName}}.
  
The language itself implements a set of [[HSL core functions|standard library]] functions. In addition to that, there are ''contexts'' (or extensions) that are implemented by the different [https://en.wikipedia.org/wiki/Daemon_(computing) daemon processes]; most importantly the e-mail oriented flows that maps to SMTP commands; [http://docs.halon.se/hsl/connect.html CONNECT], [http://docs.halon.se/hsl/auth.html AUTH] (SASL), [http://docs.halon.se/hsl/mailfrom.html MAIL FROM], [http://docs.halon.se/hsl/rcptto.html RCPT TO], [http://docs.halon.se/hsl/data.html DATA] and queue processing [http://docs.halon.se/hsl/predelivery.html pre] and [http://docs.halon.se/hsl/postdelivery.html post-] delivery, but also the [http://docs.halon.se/hsl/api.html API] and [http://docs.halon.se/hsl/firewall.html IP firewall] context (used to control access to HTTP, SNMP, SSH and FTP - not SMTP, for that use the [http://docs.halon.se/hsl/connect.html CONNECT] context). The contexts define additional functions, as well as pre-defined variables.
+
The language itself implements a set of [[HSL core functions|standard library]] functions. In addition to that, there are ''contexts'' (or extensions) that are implemented by the different [https://en.wikipedia.org/wiki/Daemon_(computing) daemon processes]; most importantly the e-mail oriented flows that maps to SMTP commands; [https://docs.halon.io/hsl/connect.html CONNECT], [https://docs.halon.io/hsl/auth.html AUTH] (SASL), [https://docs.halon.io/hsl/mailfrom.html MAIL FROM], [https://docs.halon.io/hsl/rcptto.html RCPT TO], [https://docs.halon.io/hsl/data.html DATA] and queue processing [https://docs.halon.io/hsl/predelivery.html pre] and [https://docs.halon.io/hsl/postdelivery.html post-] delivery, but also the [https://docs.halon.io/hsl/api.html API] and [https://docs.halon.io/hsl/firewall.html IP firewall] context (used to control access to HTTP, SNMP, SSH and FTP - not SMTP, for that use the [https://docs.halon.io/hsl/connect.html CONNECT] context). 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.
 
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.
  
* [http://docs.halon.se/hsl/ HSL reference manual]
+
* [https://docs.halon.io/hsl/ HSL reference manual]
 
* [[HSL code examples]]
 
* [[HSL code examples]]
  
Line 20: Line 20:
 
! Context !! Process !! Description
 
! Context !! Process !! Description
 
|-
 
|-
| [http://docs.halon.se/hsl/functions.html Standard library] || <i>all processes</i> || Shared among all contexts
+
| [https://docs.halon.io/hsl/functions.html Standard library] || <i>all processes</i> || Shared among all contexts
 
|-
 
|-
| [http://docs.halon.se/hsl/connect.html CONNECT] || <tt>smtpd</tt> || Handling IP packets, like a scripted firewall
+
| [https://docs.halon.io/hsl/connect.html CONNECT] || <tt>smtpd</tt> || Handling IP packets, like a scripted firewall
 
|-
 
|-
| [http://docs.halon.se/hsl/auth.html AUTH] || <tt>smtpd</tt> || Handling SMTP AUTH (SASL) requests  
+
| [https://docs.halon.io/hsl/auth.html AUTH] || <tt>smtpd</tt> || Handling SMTP AUTH (SASL) requests  
 
|-
 
|-
| [http://docs.halon.se/hsl/mailfrom.html MAIL FROM] || <tt>smtpd</tt> || Handling the SMTP MAIL FROM commands
+
| [https://docs.halon.io/hsl/mailfrom.html MAIL FROM] || <tt>smtpd</tt> || Handling the SMTP MAIL FROM commands
 
|-
 
|-
| [http://docs.halon.se/hsl/rcptto.html RCPT TO] || <tt>smtpd</tt> || Handling the SMTP RCPT TO commands
+
| [https://docs.halon.io/hsl/rcptto.html RCPT TO] || <tt>smtpd</tt> || Handling the SMTP RCPT TO commands
 
|-
 
|-
| [http://docs.halon.se/hsl/data.html DATA] || <tt>smtpd</tt> || Handling the SMTP DATA command; in other words "the mail message"
+
| [https://docs.halon.io/hsl/data.html DATA] || <tt>smtpd</tt> || Handling the SMTP DATA command; in other words "the mail message"
 
|-  
 
|-  
| [http://docs.halon.se/hsl/predelivery.html Pre-delivery] || <tt>mailqueued</tt> || Decides what is to be done before a delivery is attempted
+
| [https://docs.halon.io/hsl/predelivery.html Pre-delivery] || <tt>mailqueued</tt> || Decides what is to be done before a delivery is attempted
 
|-  
 
|-  
| [http://docs.halon.se/hsl/postdelivery.html Post-delivery] || <tt>mailqueued</tt> || Decides what is to be done when a delivery attempt is done
+
| [https://docs.halon.io/hsl/postdelivery.html Post-delivery] || <tt>mailqueued</tt> || Decides what is to be done when a delivery attempt is done
 
|-
 
|-
| [http://docs.halon.se/hsl/api.html API authentication] || <tt>backend</tt> || Handling administration (SOAP API) sign-ins, suitable for RADIUS/TACACS+ integration
+
| [https://docs.halon.io/hsl/api.html API authentication] || <tt>backend</tt> || Handling administration (SOAP API) sign-ins, suitable for RADIUS/TACACS+ integration
 
|-
 
|-
| [http://docs.halon.se/hsl/firewall.html IP Firewall] || <i>(http, snmp, ssh, ftp)</i> || Firewall processing for services (not SMTP related)
+
| [https://docs.halon.io/hsl/firewall.html IP Firewall] || <i>(http, snmp, ssh, ftp)</i> || Firewall processing for services (not SMTP related)
 
|}
 
|}

Latest revision as of 12:42, 19 January 2018

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 platform.

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; most importantly the e-mail oriented flows that maps to SMTP commands; CONNECT, AUTH (SASL), MAIL FROM, RCPT TO, DATA and queue processing pre and post- delivery, but also the API and IP firewall context (used to control access to HTTP, SNMP, SSH and FTP - not SMTP, for that use the CONNECT context). 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 recognized by their lowercase names, and can be used in any context. Most functions are indeed standard library functions, for re-usability. 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
CONNECT smtpd Handling IP packets, like a scripted firewall
AUTH smtpd Handling SMTP AUTH (SASL) requests
MAIL FROM smtpd Handling the SMTP MAIL FROM commands
RCPT TO smtpd Handling the SMTP RCPT TO commands
DATA smtpd 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
IP Firewall (http, snmp, ssh, ftp) Firewall processing for services (not SMTP related)