7.8. Disconnect

This script is executed when the client has disconnected.

7.8.1. Variables

These are the read-only arguments available for each command. Depending on when the disconnect script is executed, the different objects may contain different information.

Variable Type Read-only Description
$arguments array yes Context/hook arguments
$connection array yes Connection/session bound
$transaction array yes Transaction bound (empty)
$context any no Connection bound user-defined (default none) Connection

Array item Type Example Description
remoteip string “” IP address of the connected client
remoteport number 41666 TCP port of connected client
remoteptr string “mail.example.org” Reverse DNS (FCrDNS) for remoteip (not always available)
localip string “” IP address of the server
localport number 25 TCP port of the server
serverid string “inbound” ID of the server
helo array   HELO information (not always available)
tls array   TLS information (if TLS was started)
auth array   AUTH information (not always available) HELO

Array item Type Example Description
verb string “EHLO” HELO or EHLO command
host string “mail.example.com” HELO hostname TLS

Array item Type Example Description
protocol string “TLSv1.3” The protocol
cipher string “ECDHE-RSA-AES256-SHA384” The cipher
keysize number 256 The keysize
peercert array   The peer certificate (if provided by the client) Peercert
Array item Type Example Description
x509 X509Resource   An X509Resource to be used with the X509 class
error number 18 The peer certificate validation error (see OpenSSLs SSL_get_verify_result(3)) AUTH

Array item Type Example Description
mechanism string “PLAIN” SASL mechanism (always in uppercase)
username string “mailuser” SASL username (not always available)

7.8.2. Functions


Terminate the disconnect script.

Returns:doesn’t return, script is terminated

7.8.3. On script error

On script error Pass() is called.

7.8.4. On implicit termination

If not explicitly terminated then Pass() is called.