Skip to main content

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

Configuration

The following are the minimum requirements 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

Server

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

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

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

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

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

Submissions

Message submission can be dedicated:

Configuring a message submission server...

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

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