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 Value
--rustmailer-http-portRUSTMAILER_HTTP_PORT15630
--rustmailer-grpc-portRUSTMAILER_GRPC_PORT16630
--rustmailer-bind-ipRUSTMAILER_BIND_IP"0.0.0.0"
--rustmailer-public-urlRUSTMAILER_PUBLIC_URL"http://localhost:15630"
--rustmailer-grpc-enabledRUSTMAILER_GRPC_ENABLEDtrue

Configuration Explanations

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

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

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

--rustmailer-public-url

--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 Value
--rustmailer-log-levelRUSTMAILER_LOG_LEVEL"info"
--rustmailer-ansi-logsRUSTMAILER_ANSI_LOGStrue
--rustmailer-log-to-fileRUSTMAILER_LOG_TO_FILEfalse
--rustmailer-json-logsRUSTMAILER_JSON_LOGSfalse
--rustmailer-max-server-log-filesRUSTMAILER_MAX_SERVER_LOG_FILES5

Configuration Explanations

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.

rustmailer-ansi-logs

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

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.

rustmailer-json-logs

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

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 Value
--rustmailer-cors-originsRUSTMAILER_CORS_ORIGINS"http://localhost:15630, *"
--rustmailer-cors-max-ageRUSTMAILER_CORS_MAX_AGE86400
--rustmailer-enable-access-tokenRUSTMAILER_ENABLE_ACCESS_TOKENfalse
--rustmailer-enable-rest-httpsRUSTMAILER_ENABLE_REST_HTTPSfalse
--rustmailer-enable-grpc-httpsRUSTMAILER_ENABLE_GRPC_HTTPSfalse
--rustmailer-encrypt-passwordRUSTMAILER_ENCRYPT_PASSWORD"change-this-default-password-now"

Configuration Explanations

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

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

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

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

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

--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 Value
--rustmailer-email-tracking-urlRUSTMAILER_EMAIL_TRACKING_URL"http://localhost:15630/email-track"
--rustmailer-email-tracking-enabledRUSTMAILER_EMAIL_TRACKING_ENABLEDtrue
--rustmailer-max-email-content-lengthRUSTMAILER_MAX_EMAIL_CONTENT_LENGTH100000

Configuration Explanations

--rustmailer-email-tracking-url

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

--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 Value
--rustmailer-send-mail-workersRUSTMAILER_SEND_MAIL_WORKERS20
--rustmailer-event-hook-workersRUSTMAILER_EVENT_HOOK_WORKERS20
--rustmailer-metadata-cache-sizeRUSTMAILER_METADATA_CACHE_SIZE134217728
--rustmailer-task-queue-cache-sizeRUSTMAILER_TASK_QUEUE_CACHE_SIZE67108864
--rustmailer-envelope-cache-sizeRUSTMAILER_ENVELOPE_CACHE_SIZE1073741824
--rustmailer-grpc-compressionRUSTMAILER_GRPC_COMPRESSION"gzip"
--rustmailer-http-compression-enabledRUSTMAILER_HTTP_COMPRESSION_ENABLEDtrue

Configuration Explanations

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

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

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

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

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

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

--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 Value
--rustmailer-root-dirRUSTMAILER_ROOT_DIR"D:\rustmailer_data"
--rustmailer-backup-dirRUSTMAILER_BACKUP_DIRnull
--rustmailer-max-backupsRUSTMAILER_MAX_BACKUPS10
--rustmailer-cleanup-interval-hoursRUSTMAILER_CLEANUP_INTERVAL_HOURS72

Configuration Explanations

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

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

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

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