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 |
--rustmailer-oauth2-success-redirect | RUSTMAILER_OAUTH2_SUCCESS-REDIRECT | null | OAuth2 success redirect URL |
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.
OAuth2 Success Redirect
--rustmailer-oauth2-success-redirect
RUSTMAILER_OAUTH2_SUCCESS_REDIRECT
- Valid Values: A valid URL string or
null - Description: The URL to which the user is redirected after a successful OAuth2 authentication. If not set (
null), RustMailer will redirect to its built-in OAuth2 success page.
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 |