7.8. Disconnect
This script is executed when the client has disconnected.
7.8.1. Variables
These are the pre-defined variables available for each command. Depending on when the disconnect script is executed, the different objects may contain different information.
Variable |
Type |
Read-only |
Description |
|---|---|---|---|
array |
yes |
Context/hook arguments |
|
array |
yes |
Connection/session bound |
|
$transaction |
array |
yes |
Transaction bound (empty) |
$context |
any |
no |
Connection bound user-defined (default none) |
7.8.1.1. Arguments
Array item |
Type |
Example |
Description |
|---|---|---|---|
close |
string |
|
Who initialized the disconnect ( |
array |
|
A SMTP protocol response (if available) |
|
array |
|
If an error occurred (if available) |
7.8.1.1.1. Error
Array item |
Type |
Example |
Description |
|---|---|---|---|
reason |
string |
|
The error message |
type |
string |
|
The type of error (if avilable, |
code |
number |
|
The error code (for |
7.8.1.1.2. Reply
Array item |
Type |
Example |
Description |
|---|---|---|---|
code |
number |
|
A SMTP status code |
enhanced |
array |
|
A SMTP enhanced status code |
reason |
array |
|
A SMTP response text |
string |
|
An enum to indicate which issued SMTP command triggerd the disconnect |
7.8.1.2. Connection
Array item |
Type |
Example |
Description |
|---|---|---|---|
id |
string |
|
ID of the connection |
priority |
number |
|
The connection priority |
remoteip |
string |
|
IP address of the connected client |
remoteport |
number |
|
TCP port of connected client |
remoteptr |
string |
|
Reverse DNS (FCrDNS) for remoteip (not always available) |
remoteuid |
number |
|
UNIX socket remote user id (not always available) |
localip |
string |
|
IP address of the server |
localport |
number |
|
TCP port of the server |
serverid |
string |
|
ID of the server |
array |
HELO information (not always available) |
||
array |
TLS information (if TLS was started) |
||
array |
AUTH information (not always available) |
7.8.1.2.1. HELO
Array item |
Type |
Example |
Description |
|---|---|---|---|
verb |
string |
|
HELO or EHLO command |
host |
string |
|
HELO hostname |
7.8.1.2.2. TLS
Array item |
Type |
Example |
Description |
|---|---|---|---|
protocol |
string |
|
The protocol |
cipher |
string |
|
The cipher |
keysize |
number |
|
The keysize |
sni |
string |
|
The SNI hostname (not always available) |
array |
The peer certificate (if provided by the client) |
7.8.1.2.2.1. Peercert
Array item |
Type |
Example |
Description |
|---|---|---|---|
x509 |
X509Resource |
An X509Resource to be used with the |
|
chain |
array |
An array of X509Resource (the chain) |
|
error |
number |
|
The peer certificate validation error (see OpenSSLs SSL_get_verify_result(3)) |
7.8.1.2.3. AUTH
Array item |
Type |
Example |
Description |
|---|---|---|---|
mechanism |
string |
|
SASL mechanism (always in uppercase) |
username |
string |
|
SASL username (not always available) |
7.8.2. Functions
- Pass()
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.