### Install Ruby Dependencies Source: https://github.com/postalserver/postal/blob/main/CONTRIBUTING.md Installs the necessary Ruby gems for Postal using Bundler. Ensure Ruby 3.2.2 or compatible is installed beforehand. ```ruby bundle install ``` -------------------------------- ### Run Postal in Development Source: https://github.com/postalserver/postal/blob/main/CONTRIBUTING.md Starts all components of the Postal application using Foreman, suitable for development and testing. ```shell bin/dev ``` -------------------------------- ### Initialize Database and Create User Source: https://github.com/postalserver/postal/blob/main/CONTRIBUTING.md Initializes the Postal database schema and creates the first user account for the application. These commands are essential after setting up the environment. ```shell postal initialize postal make-user ``` -------------------------------- ### Run Postal Binary Source: https://github.com/postalserver/postal/blob/main/CONTRIBUTING.md Executes the Postal binary, providing access to running individual components or other command-line tools within the application. ```shell bin/postal ``` -------------------------------- ### Clone Postal Repository Source: https://github.com/postalserver/postal/blob/main/CONTRIBUTING.md Clones the Postal server repository from GitHub using Git. This is the first step to obtain the project's source code. ```git git clone git@github.com:postalserver/postal ``` -------------------------------- ### Generate Signing Key Source: https://github.com/postalserver/postal/blob/main/CONTRIBUTING.md Generates a 2048-bit RSA private key using OpenSSL, required for signing purposes within the Postal configuration. ```shell openssl genrsa -out config/postal/signing.key 2048 ``` -------------------------------- ### Postal Server Configuration Options Source: https://github.com/postalserver/postal/blob/main/doc/config/environment-variables.md Lists and describes the configurable parameters for the Postal Server. These settings control various aspects of the server's behavior, including network timeouts, migration processes, and authentication methods. ```APIDOC SMTP_CLIENT_READ_TIMEOUT: Type: Integer Description: The read timeout for outgoing SMTP connections. Default: 30 MIGRATION_WAITER_ENABLED: Type: Boolean Description: Wait for all migrations to run before starting a process. Default: false MIGRATION_WAITER_ATTEMPTS: Type: Integer Description: The number of attempts to try waiting for migrations to complete before start. Default: 120 MIGRATION_WAITER_SLEEP_TIME: Type: Integer Description: The number of seconds to wait between each migration check. Default: 2 OIDC_ENABLED: Type: Boolean Description: Enable OIDC authentication. Default: false OIDC_LOCAL_AUTHENTICATION_ENABLED: Type: Boolean Description: When enabled, users with passwords will still be able to login locally. If disabled, only OpenID Connect will be available. Default: true OIDC_NAME: Type: String Description: The name of the OIDC provider as shown in the UI. Default: OIDC Provider OIDC_ISSUER: Type: String Description: The OIDC issuer URL. Default: "" OIDC_IDENTIFIER: Type: String Description: The client ID for OIDC. Default: "" OIDC_SECRET: Type: String Description: The client secret for OIDC. Default: "" OIDC_SCOPES: Type: Array of strings Description: Scopes to request from the OIDC server. Default: ["openid", "email"] OIDC_UID_FIELD: Type: String Description: The field to use to determine the user's UID. Default: sub OIDC_EMAIL_ADDRESS_FIELD: Type: String Description: The field to use to determine the user's email address. Default: email OIDC_NAME_FIELD: Type: String Description: The field to use to determine the user's name. Default: name OIDC_DISCOVERY: Type: Boolean Description: Enable discovery to determine endpoints from .well-known/openid-configuration from the Issuer. Default: true OIDC_AUTHORIZATION_ENDPOINT: Type: String Description: The authorize endpoint on the authorization server (only used when discovery is false). Default: "" OIDC_TOKEN_ENDPOINT: Type: String Description: The token endpoint on the authorization server (only used when discovery is false). Default: "" OIDC_USERINFO_ENDPOINT: Type: String Description: The user info endpoint on the authorization server (only used when discovery is false). Default: "" OIDC_JWKS_URI: Type: String Description: The JWKS endpoint on the authorization server (only used when discovery is false). Default: "" ``` -------------------------------- ### Application and Environment Settings Source: https://github.com/postalserver/postal/blob/main/doc/config/environment-variables.md General application settings, including the Rails environment and secret key management. ```env RAILS_ENVIRONMENT: The Rails environment to run the application in RAILS_SECRET_KEY: The secret key used to sign and encrypt cookies and session data in the application ``` -------------------------------- ### 404 Error Page Styling (CSS) Source: https://github.com/postalserver/postal/blob/main/public/404.html Provides the CSS rules for styling the 404 Not Found error page. It defines the layout, colors, fonts, and box shadows for the page elements, ensuring a consistent user experience for missing pages. ```css body { background-color: #EFEFEF; color: #2E2F30; text-align: center; font-family: arial, sans-serif; margin: 0; } div.dialog { width: 95%; max-width: 33em; margin: 4em auto 0; } div.dialog > div { border: 1px solid #CCC; border-right-color: #999; border-left-color: #999; border-bottom-color: #BBB; border-top: #B00100 solid 4px; border-top-left-radius: 9px; border-top-right-radius: 9px; background-color: white; padding: 7px 12% 0; box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17); } h1 { font-size: 100%; color: #730E15; line-height: 1.5em; } div.dialog > p { margin: 0 0 1em; padding: 1em; background-color: #F7F7F7; border: 1px solid #CCC; border-right-color: #999; border-left-color: #999; border-bottom-color: #999; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-color: #DADADA; color: #666; box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17); } ``` -------------------------------- ### DNS Configuration Source: https://github.com/postalserver/postal/blob/main/doc/config/environment-variables.md Settings for DNS record management, including MX records, SPF, return path domains, tracking domains, HELO hostnames, DKIM identifiers, and verification prefixes. ```env DNS_MX_RECORDS: The names of the default MX records DNS_SPF_INCLUDE: The location of the SPF record DNS_RETURN_PATH_DOMAIN: The return path hostname DNS_ROUTE_DOMAIN: The domain to use for hosting route-specific addresses DNS_TRACK_DOMAIN: The CNAME which tracking domains should be pointed to DNS_HELO_HOSTNAME: The hostname to use in HELO/EHLO when connecting to external SMTP servers DNS_DKIM_IDENTIFIER: The identifier to use for DKIM keys in DNS records DNS_DOMAIN_VERIFY_PREFIX: The prefix to add before TXT record verification string DNS_CUSTOM_RETURN_PATH_PREFIX: The domain to use on external domains which points to the Postal return path domain DNS_TIMEOUT: The timeout to wait for DNS resolution DNS_RESOLV_CONF_PATH: The path to the resolv.conf file containing addresses for local nameservers ``` -------------------------------- ### Configure Robots.txt Access Rules Source: https://github.com/postalserver/postal/blob/main/public/robots.txt This snippet defines rules for web crawlers and search engine bots accessing the Postal server. It uses standard robots.txt directives to control crawling behavior, such as disallowing access to specific paths or the entire site. The configuration is essential for managing search engine indexing and preventing unwanted bot activity. ```robots.txt # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file # # To ban all spiders from the entire site uncomment the next two lines: # User-agent: * # Disallow: / ``` -------------------------------- ### SMTP Server Configuration Source: https://github.com/postalserver/postal/blob/main/doc/config/environment-variables.md Settings related to the primary SMTP server's behavior, including bind addresses, health server ports, TLS settings, connection limits, and logging. ```env SMTP_SERVER_DEFAULT_BIND_ADDRESS: The default bind address the SMTP server should listen on unless overriden by the BIND_ADDRESS environment variable SMTP_SERVER_DEFAULT_HEALTH_SERVER_PORT: The default port for the SMTP server health server to listen on SMTP_SERVER_DEFAULT_HEALTH_SERVER_BIND_ADDRESS: The default bind address for the SMTP server health server to listen on SMTP_SERVER_TLS_ENABLED: Enable TLS for the SMTP server (requires certificate) SMTP_SERVER_TLS_CERTIFICATE_PATH: The path to the SMTP server's TLS certificate SMTP_SERVER_TLS_PRIVATE_KEY_PATH: The path to the SMTP server's TLS private key SMTP_SERVER_TLS_CIPHERS: Override ciphers to use for SSL SMTP_SERVER_SSL_VERSION: The SSL versions which are supported SMTP_SERVER_PROXY_PROTOCOL: Enable proxy protocol for use behind some load balancers (supports proxy protocol v1 only) SMTP_SERVER_LOG_CONNECTIONS: Enable connection logging SMTP_SERVER_MAX_MESSAGE_SIZE: The maximum message size to accept from the SMTP server (in MB) SMTP_SERVER_LOG_IP_ADDRESS_EXCLUSION_MATCHER: A regular expression to use to exclude connections from logging ``` -------------------------------- ### Spam and Virus Scanning Integration Source: https://github.com/postalserver/postal/blob/main/doc/config/environment-variables.md Configuration options for integrating with external services like Rspamd, SpamAssassin, and ClamAV for message inspection. ```env RSPAMD_ENABLED: Enable rspamd for message inspection RSPAMD_HOST: The hostname of the rspamd server RSPAMD_PORT: The port of the rspamd server RSPAMD_SSL: Enable SSL for the rspamd connection RSPAMD_PASSWORD: The password for the rspamd server RSPAMD_FLAGS: Any flags for the rspamd server SPAMD_ENABLED: Enable SpamAssassin for message inspection SPAMD_HOST: The hostname for the SpamAssassin server SPAMD_PORT: The port of the SpamAssassin server CLAMAV_ENABLED: Enable ClamAV for message inspection CLAMAV_HOST: The host of the ClamAV server CLAMAV_PORT: The port of the ClamAV server ``` -------------------------------- ### Outgoing SMTP Client Configuration Source: https://github.com/postalserver/postal/blob/main/doc/config/environment-variables.md Settings for how the Postal server connects to and sends mail through external SMTP servers, including host, port, authentication, TLS, and timeouts. ```env SMTP_HOST: The hostname to send application-level e-mails to SMTP_PORT: The port number to send application-level e-mails to SMTP_USERNAME: The username to use when authentication to the SMTP server SMTP_PASSWORD: The password to use when authentication to the SMTP server SMTP_AUTHENTICATION_TYPE: The type of authentication to use SMTP_ENABLE_STARTTLS: Use STARTTLS when connecting to the SMTP server and fail if unsupported SMTP_ENABLE_STARTTLS_AUTO: Detects if STARTTLS is enabled in the SMTP server and starts to use it SMTP_OPENSSL_VERIFY_MODE: When using TLS, you can set how OpenSSL checks the certificate. Use 'none' for no certificate checking SMTP_FROM_NAME: The name to use as the from name outgoing emails from Postal SMTP_FROM_ADDRESS: The e-mail to use as the from address outgoing emails from Postal SMTP_CLIENT_OPEN_TIMEOUT: The open timeout for outgoing SMTP connections ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.