Back to Postal

Environment Variables

doc/config/environment-variables.md

3.3.611.4 KB
Original Source

Environment Variables

This document contains all the environment variables which are available for this application.

NameTypeDescriptionDefault
POSTAL_WEB_HOSTNAMEStringThe hostname that the Postal web interface runs onpostal.example.com
POSTAL_WEB_PROTOCOLStringThe HTTP protocol to use for the Postal web interfacehttps
POSTAL_SMTP_HOSTNAMEStringThe hostname that the Postal SMTP server runs onpostal.example.com
POSTAL_USE_IP_POOLSBooleanShould IP pools be enabled for this installation?false
POSTAL_DEFAULT_MAXIMUM_DELIVERY_ATTEMPTSIntegerThe maximum number of delivery attempts18
POSTAL_DEFAULT_MAXIMUM_HOLD_EXPIRY_DAYSIntegerThe number of days to hold a message before they will be expired7
POSTAL_DEFAULT_SUPPRESSION_LIST_AUTOMATIC_REMOVAL_DAYSIntegerThe number of days an address will remain in a suppression list before being removed30
POSTAL_DEFAULT_SPAM_THRESHOLDIntegerThe default threshold at which a message should be treated as spam5
POSTAL_DEFAULT_SPAM_FAILURE_THRESHOLDIntegerThe default threshold at which a message should be treated as spam failure20
POSTAL_USE_LOCAL_NS_FOR_DOMAIN_VERIFICATIONBooleanDomain verification and checking usually checks with a domain's nameserver. Enable this to check with the server's local nameservers.false
POSTAL_USE_RESENT_SENDER_HEADERBooleanAppend a Resend-Sender header to all outgoing e-mailstrue
POSTAL_SIGNING_KEY_PATHStringPath to the private key used for signing$config-file-root/signing.key
POSTAL_SMTP_RELAYSArray of stringsAn array of SMTP relays in the format of smtp://host:port[]
POSTAL_TRUSTED_PROXIESArray of stringsAn array of IP addresses to trust for proxying requests to Postal (in addition to localhost addresses)[]
POSTAL_QUEUED_MESSAGE_LOCK_STALE_DAYSIntegerThe number of days after which to consider a lock as stale. Messages with stale locks will be removed and not retried.1
POSTAL_BATCH_QUEUED_MESSAGESBooleanWhen enabled queued messages will be de-queued in batches based on their destinationtrue
WEB_SERVER_DEFAULT_PORTIntegerThe default port the web server should listen on unless overriden by the PORT environment variable5000
WEB_SERVER_DEFAULT_BIND_ADDRESSStringThe default bind address the web server should listen on unless overriden by the BIND_ADDRESS environment variable127.0.0.1
WEB_SERVER_MAX_THREADSIntegerThe maximum number of threads which can be used by the web server5
WORKER_DEFAULT_HEALTH_SERVER_PORTIntegerThe default port for the worker health server to listen on9090
WORKER_DEFAULT_HEALTH_SERVER_BIND_ADDRESSStringThe default bind address for the worker health server to listen on127.0.0.1
WORKER_THREADSIntegerThe number of threads to execute within each worker2
MAIN_DB_HOSTStringHostname for the main MariaDB serverlocalhost
MAIN_DB_PORTIntegerThe MariaDB port to connect to3306
MAIN_DB_USERNAMEStringThe MariaDB usernamepostal
MAIN_DB_PASSWORDStringThe MariaDB password
MAIN_DB_DATABASEStringThe MariaDB database namepostal
MAIN_DB_POOL_SIZEIntegerThe maximum size of the MariaDB connection pool5
MAIN_DB_ENCODINGStringThe encoding to use when connecting to the MariaDB databaseutf8mb4
MESSAGE_DB_HOSTStringHostname for the MariaDB server which stores the mail server databaseslocalhost
MESSAGE_DB_PORTIntegerThe MariaDB port to connect to3306
MESSAGE_DB_USERNAMEStringThe MariaDB usernamepostal
MESSAGE_DB_PASSWORDStringThe MariaDB password
MESSAGE_DB_ENCODINGStringThe encoding to use when connecting to the MariaDB databaseutf8mb4
MESSAGE_DB_DATABASE_NAME_PREFIXStringThe MariaDB prefix to add to database namespostal
LOGGING_RAILS_LOG_ENABLEDBooleanEnable the default Rails loggerfalse
LOGGING_SENTRY_DSNStringA DSN which should be used to report exceptions to Sentry
LOGGING_ENABLEDBooleanEnable the Postal logger to log to STDOUTtrue
LOGGING_HIGHLIGHTING_ENABLEDBooleanEnable highlighting of log linesfalse
GELF_HOSTStringGELF-capable host to send logs to
GELF_PORTIntegerGELF port to send logs to12201
GELF_FACILITYStringThe facility name to add to all log entries sent to GELFpostal
SMTP_SERVER_DEFAULT_PORTIntegerThe default port the SMTP server should listen on unless overriden by the PORT environment variable25
SMTP_SERVER_DEFAULT_BIND_ADDRESSStringThe default bind address the SMTP server should listen on unless overriden by the BIND_ADDRESS environment variable::
SMTP_SERVER_DEFAULT_HEALTH_SERVER_PORTIntegerThe default port for the SMTP server health server to listen on9091
SMTP_SERVER_DEFAULT_HEALTH_SERVER_BIND_ADDRESSStringThe default bind address for the SMTP server health server to listen on127.0.0.1
SMTP_SERVER_TLS_ENABLEDBooleanEnable TLS for the SMTP server (requires certificate)false
SMTP_SERVER_TLS_CERTIFICATE_PATHStringThe path to the SMTP server's TLS certificate$config-file-root/smtp.cert
SMTP_SERVER_TLS_PRIVATE_KEY_PATHStringThe path to the SMTP server's TLS private key$config-file-root/smtp.key
SMTP_SERVER_TLS_CIPHERSStringOverride ciphers to use for SSL
SMTP_SERVER_SSL_VERSIONStringThe SSL versions which are supportedSSLv23
SMTP_SERVER_PROXY_PROTOCOLBooleanEnable proxy protocol for use behind some load balancers (supports proxy protocol v1 only)false
SMTP_SERVER_LOG_CONNECTIONSBooleanEnable connection loggingfalse
SMTP_SERVER_MAX_MESSAGE_SIZEIntegerThe maximum message size to accept from the SMTP server (in MB)14
SMTP_SERVER_LOG_IP_ADDRESS_EXCLUSION_MATCHERStringA regular expression to use to exclude connections from logging
DNS_MX_RECORDSArray of stringsThe names of the default MX records["mx1.postal.example.com", "mx2.postal.example.com"]
DNS_SPF_INCLUDEStringThe location of the SPF recordspf.postal.example.com
DNS_RETURN_PATH_DOMAINStringThe return path hostnamerp.postal.example.com
DNS_ROUTE_DOMAINStringThe domain to use for hosting route-specific addressesroutes.postal.example.com
DNS_TRACK_DOMAINStringThe CNAME which tracking domains should be pointed totrack.postal.example.com
DNS_HELO_HOSTNAMEStringThe hostname to use in HELO/EHLO when connecting to external SMTP servers
DNS_DKIM_IDENTIFIERStringThe identifier to use for DKIM keys in DNS recordspostal
DNS_DOMAIN_VERIFY_PREFIXStringThe prefix to add before TXT record verification stringpostal-verification
DNS_CUSTOM_RETURN_PATH_PREFIXStringThe domain to use on external domains which points to the Postal return path domainpsrp
DNS_TIMEOUTIntegerThe timeout to wait for DNS resolution5
DNS_RESOLV_CONF_PATHStringThe path to the resolv.conf file containing addresses for local nameservers/etc/resolv.conf
SMTP_HOSTStringThe hostname to send application-level e-mails to127.0.0.1
SMTP_PORTIntegerThe port number to send application-level e-mails to25
SMTP_USERNAMEStringThe username to use when authentication to the SMTP server
SMTP_PASSWORDStringThe password to use when authentication to the SMTP server
SMTP_AUTHENTICATION_TYPEStringThe type of authentication to uselogin
SMTP_ENABLE_STARTTLSBooleanUse STARTTLS when connecting to the SMTP server and fail if unsupportedfalse
SMTP_ENABLE_STARTTLS_AUTOBooleanDetects if STARTTLS is enabled in the SMTP server and starts to use ittrue
SMTP_OPENSSL_VERIFY_MODEStringWhen using TLS, you can set how OpenSSL checks the certificate. Use 'none' for no certificate checkingpeer
SMTP_FROM_NAMEStringThe name to use as the from name outgoing emails from PostalPostal
SMTP_FROM_ADDRESSStringThe e-mail to use as the from address outgoing emails from Postal[email protected]
RAILS_ENVIRONMENTStringThe Rails environment to run the application inproduction
RAILS_SECRET_KEYStringThe secret key used to sign and encrypt cookies and session data in the application
RSPAMD_ENABLEDBooleanEnable rspamd for message inspectionfalse
RSPAMD_HOSTStringThe hostname of the rspamd server127.0.0.1
RSPAMD_PORTIntegerThe port of the rspamd server11334
RSPAMD_SSLBooleanEnable SSL for the rspamd connectionfalse
RSPAMD_PASSWORDStringThe password for the rspamd server
RSPAMD_FLAGSStringAny flags for the rspamd server
SPAMD_ENABLEDBooleanEnable SpamAssassin for message inspectionfalse
SPAMD_HOSTStringThe hostname for the SpamAssassin server127.0.0.1
SPAMD_PORTIntegerThe port of the SpamAssassin server783
CLAMAV_ENABLEDBooleanEnable ClamAV for message inspectionfalse
CLAMAV_HOSTStringThe host of the ClamAV server127.0.0.1
CLAMAV_PORTIntegerThe port of the ClamAV server2000
SMTP_CLIENT_OPEN_TIMEOUTIntegerThe open timeout for outgoing SMTP connections30
SMTP_CLIENT_READ_TIMEOUTIntegerThe read timeout for outgoing SMTP connections30
MIGRATION_WAITER_ENABLEDBooleanWait for all migrations to run before starting a processfalse
MIGRATION_WAITER_ATTEMPTSIntegerThe number of attempts to try waiting for migrations to complete before start120
MIGRATION_WAITER_SLEEP_TIMEIntegerThe number of seconds to wait between each migration check2
OIDC_ENABLEDBooleanEnable OIDC authenticationfalse
OIDC_LOCAL_AUTHENTICATION_ENABLEDBooleanWhen enabled, users with passwords will still be able to login locally. If disable, only OpenID Connect will be available.true
OIDC_NAMEStringThe name of the OIDC provider as shown in the UIOIDC Provider
OIDC_ISSUERStringThe OIDC issuer URL
OIDC_IDENTIFIERStringThe client ID for OIDC
OIDC_SECRETStringThe client secret for OIDC
OIDC_SCOPESArray of stringsScopes to request from the OIDC server.["openid", "email"]
OIDC_UID_FIELDStringThe field to use to determine the user's UIDsub
OIDC_EMAIL_ADDRESS_FIELDStringThe field to use to determine the user's email addressemail
OIDC_NAME_FIELDStringThe field to use to determine the user's namename
OIDC_DISCOVERYBooleanEnable discovery to determine endpoints from .well-known/openid-configuration from the Issuertrue
OIDC_AUTHORIZATION_ENDPOINTStringThe authorize endpoint on the authorization server (only used when discovery is false)
OIDC_TOKEN_ENDPOINTStringThe token endpoint on the authorization server (only used when discovery is false)
OIDC_USERINFO_ENDPOINTStringThe user info endpoint on the authorization server (only used when discovery is false)
OIDC_JWKS_URIStringThe JWKS endpoint on the authorization server (only used when discovery is false)