Skip to main content
Version: 1.3.0

SMTP

Push

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>
tls:
status: <boolean>
cert_name: <string>
key_name: <string>

Configuration​

The following fields are used to define the device:

Device​

FieldRequiredDefaultDescription
idYUnique identifier
nameYDevice name
descriptionN-Optional description
typeYMust be smtp
tagsN-Optional tags
pipelinesN-Optional pre-processor pipelines
statusNtrueEnable/disable the device

Connection​

FieldRequiredDefaultDescription
addressN"0.0.0.0"Listen address
portYListen port
usernameN-Authentication username
passwordN-Authentication password
timeoutN15Connection timeout in seconds

TLS​

FieldRequiredDefaultDescription
tls.statusNfalseEnable TLS encryption
tls.cert_nameYTLS certificate file path (required if TLS enabled)
tls.key_nameYTLS private key file path (required if TLS enabled)
note

The TLS certificate and key files must be placed in the service root directory.

Performance​

FieldRequiredDefaultDescription
reuseNfalseEnable multi-worker mode
workersN4Number of worker processes when reuse enabled
buffer_sizeN9000Read buffer size in bytes

Key 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:

FieldDescription
fromSender address
toRecipient addresses
subjectEmail subject
bodyMessage body
headersEmail headers
remoteAddrClient 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.

note

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...

devices:
- id: 1
name: basic_smtp
type: smtp
properties:
address: "0.0.0.0"
port: 25

Secure​

E-mail can be received securely:

Configuring TLS and authentication...

devices:
- id: 2
name: secure_smtp
type: smtp
properties:
address: "0.0.0.0"
port: 587
username: "mailuser"
password: "secret"
timeout: 30
tls:
status: true
cert_name: "smtp.crt"
key_name: "smtp.key"
note

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...

devices:
- id: 3
name: performant_smtp
type: smtp
properties:
address: "0.0.0.0"
port: 25
timeout: 60
reuse: true
workers: 4
buffer_size: 32768

Submissions​

Message submission can be dedicated:

Configuring a message submission server...

devices:
- id: 4
name: submission_smtp
type: smtp
properties:
address: "0.0.0.0"
port: 587
username: "mailuser"
password: "secret"
timeout: 30
tls:
status: true
cert_name: "smtp.crt"
key_name: "smtp.key"
reuse: true
workers: 2

Pipelines​

Emails can be pre-processed:

Applying custom processing to emails...

devices:
- id: 5
name: pipeline_smtp
type: smtp
pipelines:
- email_parser
- spam_filter
properties:
address: "0.0.0.0"
port: 25
timeout: 30
note

Pipelines are processed sequentially and can modify or drop messages before ingestion.