Skip to main content

Configuration Reference

Rustmailer supports dual configuration methods:

  • Command-line arguments: --parameter_name value
  • Environment variables: RUSTMAILER_PARAMETER_NAME=value

For boolean command-line arguments, include the flag to enable it (e.g., --rustmailer-ansi-logs sets it to true). Omit the flag to disable it (e.g., defaults to false or the specified default).

Production Best Practices:

  1. Use environment variables for sensitive values
  2. Always change default credentials
  3. Review security-related parameters before deployment

Network Configuration

CLI ArgumentEnv VariableDefault ValueExplanation Section
--rustmailer-http-portRUSTMAILER_HTTP_PORT15630HTTP Port
--rustmailer-grpc-portRUSTMAILER_GRPC_PORT16630gRPC Port
--rustmailer-bind-ipRUSTMAILER_BIND_IP"0.0.0.0"Bind IP
--rustmailer-public-urlRUSTMAILER_PUBLIC_URL"http://localhost:15630"Public URL
--rustmailer-grpc-enabledRUSTMAILER_GRPC_ENABLEDtruegRPC Enabled

Network Configuration Explanations

HTTP Port

--rustmailer-http-port RUSTMAILER_HTTP_PORT

  • Valid Values: Positive integers (1-65535)
  • Description: Specifies the port number on which the HTTP server listens for incoming requests. The default value is 15630, allowing the server to accept HTTP connections on this port.

gRPC Port

--rustmailer-grpc-port RUSTMAILER_GRPC_PORT

  • Valid Values: Positive integers (1-65535)
  • Description: Defines the port number used by the gRPC server for handling gRPC requests. The default value is 16630, enabling gRPC clients to connect on this port.

Bind IP

--rustmailer-bind-ip RUSTMAILER_BIND_IP

  • Valid Values: Valid IP addresses (e.g., "0.0.0.0", "127.0.0.1")
  • Description: Sets the IP address to which the server binds. The default value "0.0.0.0" allows the server to listen on all available network interfaces, making it accessible from any IP address.

Public URL

--rustmailer-public-url RUSTMAILER_PUBLIC_URL

gRPC Enabled

--rustmailer-grpc-enabled RUSTMAILER_GRPC_ENABLED

  • Valid Values: Boolean values ("true", "false")
  • Description: Controls whether the gRPC server is enabled. The default value "true" activates the gRPC server, while "false" disables gRPC functionality.

Logging Configuration

CLI ArgumentEnv VariableDefault ValueExplanation Section
--rustmailer-log-levelRUSTMAILER_LOG_LEVEL"info"Log Level
--rustmailer-ansi-logsRUSTMAILER_ANSI_LOGStrueANSI Logs
--rustmailer-log-to-fileRUSTMAILER_LOG_TO_FILEfalseLog to File
--rustmailer-json-logsRUSTMAILER_JSON_LOGSfalseJSON Logs
--rustmailer-max-server-log-filesRUSTMAILER_MAX_SERVER_LOG_FILES5Max Server Log Files

Logging Configuration Explanations

Log Level

--rustmailer-log-level RUSTMAILER_LOG_LEVEL

  • Valid Values: "trace", "debug", "info", "warn", "error"
  • Description: Controls the level of detail in the application's log output. "trace" is the most verbose, while "error" is the least verbose.

ANSI Logs

--rustmailer-ansi-logs RUSTMAILER_ANSI_LOGS

  • Valid Values: true, false
  • Description: When enabled, logs include ANSI color codes to enhance readability in terminal environments that support colors.

Log to File

--rustmailer-log-to-file RUSTMAILER_LOG_TO_FILE

  • Valid Values: true, false
  • Description: When set to true, logs are written to a file instead of being output to the console.

JSON Logs

--rustmailer-json-logs RUSTMAILER_JSON_LOGS

  • Valid Values: true, false
  • Description: When enabled, logs are formatted as JSON, making them suitable for automated processing and analysis.

Max Server Log Files

--rustmailer-max-server-log-files RUSTMAILER_MAX_SERVER_LOG_FILES

  • Valid Values: Positive integers
  • Description: Defines the maximum number of log files to keep when log rotation is enabled, preventing excessive disk usage. Log files are rotated daily.

Security Configuration

CLI ArgumentEnv VariableDefault ValueExplanation Section
--rustmailer-cors-originsRUSTMAILER_CORS_ORIGINS"http://localhost:15630, *"CORS Origins
--rustmailer-cors-max-ageRUSTMAILER_CORS_MAX_AGE86400CORS Max Age
--rustmailer-enable-access-tokenRUSTMAILER_ENABLE_ACCESS_TOKENfalseEnable Access Token
--rustmailer-enable-rest-httpsRUSTMAILER_ENABLE_REST_HTTPSfalseEnable REST HTTPS
--rustmailer-enable-grpc-httpsRUSTMAILER_ENABLE_GRPC_HTTPSfalseEnable gRPC HTTPS
--rustmailer-encrypt-passwordRUSTMAILER_ENCRYPT_PASSWORD"change-this-default-password-now"Encrypt Password

Security Configuration Explanations

CORS Origins

--rustmailer-cors-origins RUSTMAILER_CORS_ORIGINS

  • Valid Values: Comma-separated list of URLs or "*" for all origins
  • Description: Specifies the allowed origins for Cross-Origin Resource Sharing (CORS). The default value "http://localhost:15630, *" allows requests from the local server and all origins, enabling flexible client access.

CORS Max Age

--rustmailer-cors-max-age RUSTMAILER_CORS_MAX_AGE

  • Valid Values: Positive integers (seconds)
  • Description: Defines the maximum duration (in seconds) that CORS preflight request results can be cached by clients. The default value 86400 corresponds to 24 hours, reducing repeated preflight requests.

Enable Access Token

--rustmailer-enable-access-token RUSTMAILER_ENABLE_ACCESS_TOKEN

  • Valid Values: Boolean values ("true", "false")
  • Description: Controls whether access token authentication is required for API requests. The default value "false" disables token-based authentication, allowing open access unless enabled.

Enable REST HTTPS

--rustmailer-enable-rest-https RUSTMAILER_ENABLE_REST_HTTPS

  • Valid Values: Boolean values ("true", "false")
  • Description: Determines whether HTTPS is enabled for REST API endpoints. The default value "false" means HTTP is used, while setting to "true" enables secure HTTPS communication.

Enable gRPC HTTPS

--rustmailer-enable-grpc-https RUSTMAILER_ENABLE_GRPC_HTTPS

  • Valid Values: Boolean values ("true", "false")
  • Description: Specifies whether HTTPS is enabled for gRPC endpoints. The default value "false" uses plain gRPC communication, while "true" enables secure gRPC over HTTPS.

Encrypt Password

--rustmailer-encrypt-password RUSTMAILER_ENCRYPT_PASSWORD

  • Valid Values: String (secure password)
  • Description: Sets the password used for encrypting sensitive data. The default value "change-this-default-password-now" is a placeholder and must be replaced with a strong, unique password to ensure security.

Email Configuration

CLI ArgumentEnv VariableDefault ValueExplanation Section
--rustmailer-email-tracking-urlRUSTMAILER_EMAIL_TRACKING_URL"http://localhost:15630/email-track"Email Tracking URL
--rustmailer-email-tracking-enabledRUSTMAILER_EMAIL_TRACKING_ENABLEDtrueEmail Tracking Enabled
--rustmailer-max-email-content-lengthRUSTMAILER_MAX_EMAIL_CONTENT_LENGTH100000Max Email Content Length

Email Configuration Explanations

Email Tracking URL

--rustmailer-email-tracking-url RUSTMAILER_EMAIL_TRACKING_URL

Email Tracking Enabled

--rustmailer-email-tracking-enabled RUSTMAILER_EMAIL_TRACKING_ENABLED

  • Valid Values: Boolean values ("true", "false")
  • Description: Controls whether email tracking (e.g., open or click tracking) is enabled. The default value "true" activates tracking, while "false" disables it.

Max Email Content Length

--rustmailer-max-email-content-length RUSTMAILER_MAX_EMAIL_CONTENT_LENGTH

  • Valid Values: Positive integers
  • Description: Defines the maximum allowed length (in bytes) for email content, including headers and body. The default value 100000 ensures emails do not exceed this size to prevent performance issues.

Performance Configuration

CLI ArgumentEnv VariableDefault ValueExplanation Section
--rustmailer-send-mail-workersRUSTMAILER_SEND_MAIL_WORKERS20Send Mail Workers
--rustmailer-event-hook-workersRUSTMAILER_EVENT_HOOK_WORKERS20Event Hook Workers
--rustmailer-metadata-cache-sizeRUSTMAILER_METADATA_CACHE_SIZE134217728Metadata Cache Size
--rustmailer-task-queue-cache-sizeRUSTMAILER_TASK_QUEUE_CACHE_SIZE67108864Task Queue Cache Size
--rustmailer-envelope-cache-sizeRUSTMAILER_ENVELOPE_CACHE_SIZE1073741824Envelope Cache Size
--rustmailer-grpc-compressionRUSTMAILER_GRPC_COMPRESSION"gzip"gRPC Compression
--rustmailer-http-compression-enabledRUSTMAILER_HTTP_COMPRESSION_ENABLEDtrueHTTP Compression Enabled

Performance Configuration Explanations

Send Mail Workers

--rustmailer-send-mail-workers RUSTMAILER_SEND_MAIL_WORKERS

  • Valid Values: Positive integers
  • Description: Specifies the number of worker threads dedicated to sending emails. The default value of 20 ensures concurrent email delivery for improved throughput.

Event Hook Workers

--rustmailer-event-hook-workers RUSTMAILER_EVENT_HOOK_WORKERS

  • Valid Values: Positive integers
  • Description: Defines the number of worker threads for processing event hooks (e.g., webhooks or callbacks). The default value of 20 supports concurrent event handling.

Metadata Cache Size

--rustmailer-metadata-cache-size RUSTMAILER_METADATA_CACHE_SIZE

  • Valid Values: Positive integers (bytes)
  • Description: Sets the size of the cache for storing email metadata, in bytes. The default value of 134217728 (128 MB) balances memory usage and performance.

Task Queue Cache Size

--rustmailer-task-queue-cache-size RUSTMAILER_TASK_QUEUE_CACHE_SIZE

  • Valid Values: Positive integers (bytes)
  • Description: Specifies the size of the cache for the task queue, in bytes. The default value of 67108864 (64 MB) optimizes task queuing efficiency.

Envelope Cache Size

--rustmailer-envelope-cache-size RUSTMAILER_ENVELOPE_CACHE_SIZE

  • Valid Values: Positive integers (bytes)
  • Description: Defines the size of the cache for email envelopes, in bytes. The default value of 1073741824 (1 GB) supports large-scale email processing.

gRPC Compression

--rustmailer-grpc-compression RUSTMAILER_GRPC_COMPRESSION

  • Valid Values: Compression algorithms (e.g., "gzip", "none")
  • Description: Specifies the compression algorithm used for gRPC communication. The default value "gzip" reduces data size for efficient network transfer.

HTTP Compression Enabled

--rustmailer-http-compression-enabled RUSTMAILER_HTTP_COMPRESSION_ENABLED

  • Valid Values: Boolean values ("true", "false")
  • Description: Controls whether HTTP response compression is enabled. The default value "true" enables compression to reduce bandwidth usage.

Storage & Maintenance

CLI ArgumentEnv VariableDefault ValueExplanation Section
--rustmailer-root-dirRUSTMAILER_ROOT_DIR"D:\rustmailer_data"Root Directory
--rustmailer-backup-dirRUSTMAILER_BACKUP_DIRnullBackup Directory
--rustmailer-max-backupsRUSTMAILER_MAX_BACKUPS10Max Backups
--rustmailer-cleanup-interval-hoursRUSTMAILER_CLEANUP_INTERVAL_HOURS72Cleanup Interval Hours

Storage & Maintenance Explanations

Root Directory

--rustmailer-root-dir RUSTMAILER_ROOT_DIR

  • Valid Values: Valid file system path
  • Description: Specifies the root directory for storing application data, such as logs and persistent state. The default value "D:\rustmailer_data" sets the storage location on a Windows system.

Backup Directory

--rustmailer-backup-dir RUSTMAILER_BACKUP_DIR

  • Valid Values: Valid file system path or null
  • Description: Defines the directory for storing backups. The default value "null" disables backups unless a valid path is provided.

Max Backups

--rustmailer-max-backups RUSTMAILER_MAX_BACKUPS

  • Valid Values: Positive integers
  • Description: Sets the maximum number of backup files to retain. The default value of 10 limits storage usage by removing older backups when exceeded.

Cleanup Interval Hours

--rustmailer-cleanup-interval-hours RUSTMAILER_CLEANUP_INTERVAL_HOURS

  • Valid Values: Positive integers (hours)
  • Description: Specifies the interval, in hours, for running cleanup tasks, such as removing expired data. The default value of 72 triggers cleanup every three days.