7.2. AUTH

The AUTH context allows trusted SMTP clients.

7.2.1. Pre-defined variables

These are the read-only pre-defined variables available for each AUTH command.

Variable Type Example Description
$messageid string “18c190a3-93f-47d7-bd...” ID of the message
$senderip string “192.168.1.11” IP address of the connected client
$senderport number 41666 TCP port of connected client
$serverip string “10.0.0.1” IP address of the mailserver
$serverport number 25 TCP port of the mailserver
$serverid string “mailserver:1” ID of the mailserver profile
$senderhelo string “mail.example.com” HELO message of sender
$tlsstarted boolean false Whether or not the SMTP session is using TLS
$saslusername string “mailuser” SASL username
$saslpassword string “secret” SASL password

These are the writable pre-defined variables available.

Variable Type Description
$context any Connection-bound variable

7.2.2. Functions

auth.Accept()

Authorize the login request.

Returns:doesn’t return, script is terminated
auth.Reject([reason[, options]])

Reject the login request.

Parameters:
  • reason (string) – the reject message
  • options (array) – an options array
Returns:

doesn’t return, script is terminated

The following options are available in the options array.

  • disconnect (boolean) disconnect the client. The default is false.
auth.Defer([reason[, options]])

Defer the login request with a temporary (454) error.

Parameters:
  • reason (string) – the defer message
  • options (array) – an options array
Returns:

doesn’t return, script is terminated

The following options are available in the options array.

  • disconnect (boolean) disconnect the client. The default is false.

7.2.3. On script error

On script error Defer() is called.

7.2.4. On implicit termination

If not explicitly terminated then Reject() is called.