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:
- Use environment variables for sensitive values
- Always change default credentials
- Review security-related parameters before deployment
Network Configuration
CLI Argument | Env Variable | Default Value | Explanation Section |
---|---|---|---|
--rustmailer-http-port | RUSTMAILER_HTTP_PORT | 15630 | HTTP Port |
--rustmailer-grpc-port | RUSTMAILER_GRPC_PORT | 16630 | gRPC Port |
--rustmailer-bind-ip | RUSTMAILER_BIND_IP | "0.0.0.0" | Bind IP |
--rustmailer-public-url | RUSTMAILER_PUBLIC_URL | "http://localhost:15630" | Public URL |
--rustmailer-grpc-enabled | RUSTMAILER_GRPC_ENABLED | true | gRPC 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
- Valid Values: Valid URLs (e.g., "http://localhost:15630", "https://example.com")
- Description: Specifies the public URL used to access the service, typically for generating links or redirects. The default is "http://localhost:15630", pointing to the local HTTP server.
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 Argument | Env Variable | Default Value | Explanation Section |
---|---|---|---|
--rustmailer-log-level | RUSTMAILER_LOG_LEVEL | "info" | Log Level |
--rustmailer-ansi-logs | RUSTMAILER_ANSI_LOGS | true | ANSI Logs |
--rustmailer-log-to-file | RUSTMAILER_LOG_TO_FILE | false | Log to File |
--rustmailer-json-logs | RUSTMAILER_JSON_LOGS | false | JSON Logs |
--rustmailer-max-server-log-files | RUSTMAILER_MAX_SERVER_LOG_FILES | 5 | Max 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 Argument | Env Variable | Default Value | Explanation Section |
---|---|---|---|
--rustmailer-cors-origins | RUSTMAILER_CORS_ORIGINS | "http://localhost:15630, *" | CORS Origins |
--rustmailer-cors-max-age | RUSTMAILER_CORS_MAX_AGE | 86400 | CORS Max Age |
--rustmailer-enable-access-token | RUSTMAILER_ENABLE_ACCESS_TOKEN | false | Enable Access Token |
--rustmailer-enable-rest-https | RUSTMAILER_ENABLE_REST_HTTPS | false | Enable REST HTTPS |
--rustmailer-enable-grpc-https | RUSTMAILER_ENABLE_GRPC_HTTPS | false | Enable gRPC HTTPS |
--rustmailer-encrypt-password | RUSTMAILER_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 Argument | Env Variable | Default Value | Explanation Section |
---|---|---|---|
--rustmailer-email-tracking-url | RUSTMAILER_EMAIL_TRACKING_URL | "http://localhost:15630/email-track" | Email Tracking URL |
--rustmailer-email-tracking-enabled | RUSTMAILER_EMAIL_TRACKING_ENABLED | true | Email Tracking Enabled |
--rustmailer-max-email-content-length | RUSTMAILER_MAX_EMAIL_CONTENT_LENGTH | 100000 | Max Email Content Length |
Email Configuration Explanations
Email Tracking URL
--rustmailer-email-tracking-url
RUSTMAILER_EMAIL_TRACKING_URL
- Valid Values: Valid URL (e.g., "http://localhost:15630/email-track")
- Description: Specifies the URL used for tracking email interactions, such as opens or clicks. The default value "http://localhost:15630/email-track" points to the local server’s tracking endpoint.
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 Argument | Env Variable | Default Value | Explanation Section |
---|---|---|---|
--rustmailer-send-mail-workers | RUSTMAILER_SEND_MAIL_WORKERS | 20 | Send Mail Workers |
--rustmailer-event-hook-workers | RUSTMAILER_EVENT_HOOK_WORKERS | 20 | Event Hook Workers |
--rustmailer-metadata-cache-size | RUSTMAILER_METADATA_CACHE_SIZE | 134217728 | Metadata Cache Size |
--rustmailer-task-queue-cache-size | RUSTMAILER_TASK_QUEUE_CACHE_SIZE | 67108864 | Task Queue Cache Size |
--rustmailer-envelope-cache-size | RUSTMAILER_ENVELOPE_CACHE_SIZE | 1073741824 | Envelope Cache Size |
--rustmailer-grpc-compression | RUSTMAILER_GRPC_COMPRESSION | "gzip" | gRPC Compression |
--rustmailer-http-compression-enabled | RUSTMAILER_HTTP_COMPRESSION_ENABLED | true | HTTP 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 Argument | Env Variable | Default Value | Explanation Section |
---|---|---|---|
--rustmailer-root-dir | RUSTMAILER_ROOT_DIR | "D:\rustmailer_data" | Root Directory |
--rustmailer-backup-dir | RUSTMAILER_BACKUP_DIR | null | Backup Directory |
--rustmailer-max-backups | RUSTMAILER_MAX_BACKUPS | 10 | Max Backups |
--rustmailer-cleanup-interval-hours | RUSTMAILER_CLEANUP_INTERVAL_HOURS | 72 | Cleanup 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.