SMTP
Synopsis
Creates an SMTP server that receives email messages. Supports authentication, TLS encryption, and multiple workers with automatic message handling, and JSON conversion.
Schema
- id: <numeric>
name: <string>
description: <string>
type: smtp
tags: <string[]>
pipelines: <pipeline[]>
status: <boolean>
properties:
address: <string>
port: <numeric>
username: <string>
password: <string>
timeout: <numeric>
reuse: <boolean>
workers: <numeric>
buffer_size: <numeric>
stats_frequency: <numeric>
tls:
status: <boolean>
cert_name: <string>
key_name: <string>
Configuration
The following are the minimum requirements to define the device.
Device
Field | Required | Default | Description |
---|---|---|---|
id | Y | Unique identifier | |
name | Y | Device name | |
description | N | - | Optional description |
type | Y | Must be smtp | |
tags | N | - | Optional tags |
pipelines | N | - | Optional pre-processor pipelines |
status | N | true | Enable/disable the device |
Server
Field | Required | Default | Description |
---|---|---|---|
address | N | "0.0.0.0" | Listen address |
port | Y | Listen port | |
username | N | - | Authentication username |
password | N | - | Authentication password |
timeout | N | 15 | Connection timeout in seconds |
TLS
Field | Required | Default | Description |
---|---|---|---|
tls.status | N | false | Enable TLS encryption |
tls.cert_name | Y | TLS certificate file path (required if TLS enabled) | |
tls.key_name | Y | TLS private key file path (required if TLS enabled) |
The TLS certificate and key files must be placed in the service root directory.
Performance
Field | Required | Default | Description |
---|---|---|---|
reuse | N | false | Enable multi-worker mode |
workers | N | 4 | Number of worker processes when reuse enabled |
buffer_size | N | 9000 | Read buffer size in bytes |
stats_frequency | N | 300 | Statistics collection interval in seconds |
Advanced Features
The following are unique features that Director offers.
Emails
The server captures and processes email headers, sender information, recipient information, message content, attachments, and remote client information.
JSON Conversion
All email messages are automatically converted to JSON format with the following fields:
Field | Description |
---|---|
from | Sender address |
to | Recipient addresses |
subject | Email subject |
body | Message body |
headers | Email headers |
remoteAddr | Client IP address |
Multiple Workers
When reuse
is enabled, the server uses multiple worker processes which maintain a separate SMTP listener and process messages independently. Messages are automatically converted to JSON.
The worker count will be capped at the number of available CPU cores.
Examples
The following are commonly used configuration types.
Basic
A basic server can be easily created:
Creating a simple SMTP server... |
|
Secure
E-mail can be received securely:
Configuring TLS and authentication... |
|
Port 587 is commonly used for TLS-enabled SMTP (STARTTLS).
High-Volume
Performance can be enhanced for high email volumes:
Optimizing for high message volumes... |
|
Submissions
Message submission can be dedicated:
Configuring a message submission server... |
|
Pipelines
Emails can be pre-processed:
Applying custom processing to emails... |
|
Pipelines are processed sequentially and can modify or drop messages before ingestion.