Skip to content
This repository was archived by the owner on May 25, 2022. It is now read-only.

Commit 521f90d

Browse files
committed
Update server.md
1 parent f7ea88e commit 521f90d

File tree

1 file changed

+47
-22
lines changed

1 file changed

+47
-22
lines changed

guide/docs/server.md

Lines changed: 47 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,48 @@ ___
3232

3333
## Optional Configuration
3434

35-
- `maxRecipients` The maximum amount of recipients the server accepts per message.
36-
```kotlin
37-
maxRecipients = 4000 // (default is 1000)
38-
```
39-
40-
- `maxConnections` The maximum amount of connections the server allows at once.
41-
```kotlin
42-
maxConnections = 2000 // (default is 1000)
43-
```
44-
45-
- `prefferedMaxMessageSize` The maximum size of a message. This won't be enforced, this is just an information for the connected client.
46-
```kotlin
47-
prefferedMaxMessageSize = 8000 // (default is null)
48-
```
49-
50-
- `connectionTimeout` The timeout for waiting for data on a connection.
51-
```kotlin
52-
connectionTimeout = 2 to TimeUnit.MINUTES // (default is 1 minute)
53-
```
35+
#### Configuration variables
36+
37+
Inside the SMTP server builder, you have access to the following configuration variables:
38+
39+
<table>
40+
<thead>
41+
<tr>
42+
<th>Option</th>
43+
<th>Description</th>
44+
</tr>
45+
</thead>
46+
<tbody>
47+
<tr>
48+
<td><b>maxRecipients</b></td>
49+
<td>
50+
The maximum amount of recipients the server accepts per message. <br> <i>default</i> = <code>1000</code>
51+
</td>
52+
</tr>
53+
<tr>
54+
<td><b>maxConnections</b></td>
55+
<td>
56+
The maximum amount of connections the server allows at once. <br> <i>default</i> = <code>1000</code>
57+
</td>
58+
</tr>
59+
<tr>
60+
<td><b>prefferedMaxMessageSize</b></td>
61+
<td>
62+
The maximum size of a message. This won't be enforced, this is just an information for the connected client. <br> <i>default</i> = <code>null</code> (no limit)
63+
</td>
64+
</tr>
65+
<tr>
66+
<td><b>connectionTimeout</b></td>
67+
<td>
68+
The maximum size of a message. This <i>won't be enforced</i>, this is just an information for the connected client. <br> <i>default</i> = <code>1 to TimeUnit.MINUTES</code> (1 minute) <br><br>
69+
The best way to set this is the following
70+
```kotlin
71+
connectionTimeout = 2 to TimeUnit.MINUTES
72+
```
73+
</td>
74+
</tr>
75+
</tbody>
76+
</table>
5477

5578
#### TLS (Secure connections)
5679

@@ -60,6 +83,8 @@ Go to the dedicated [TLS page](tls.md) for more details.
6083

6184
With listeners, you can receive and **process emails**.
6285

86+
### Commands
87+
6388
#### Mail (easiest)
6489

6590
Listen to the `DATA` command (called last, therefore has the most information):
@@ -104,7 +129,7 @@ recipientListener {
104129
}
105130
```
106131

107-
##### Reject Connections
132+
### Reject Connections
108133

109134
You can reject connections after receiving any command. Both functions have parameters for a custom reponse and status code.
110135
```kotlin
@@ -114,9 +139,9 @@ it.reject()
114139
it.dropConnection()
115140
```
116141

117-
##### Common
142+
### MessageContext
118143

119-
You can do the following inside every callback:
144+
The context gives you more information about the current connection.
120145
```kotlin
121146
// get the MessageContext
122147
it.context

0 commit comments

Comments
 (0)