.env.example 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. APP_PORT=3025
  2. APP_BASE_URL=https://mailhub.example.com
  3. ADMIN_USER=admin
  4. ADMIN_EMAIL=admin@example.com
  5. ADMIN_PASSWORD=change-this-admin-password
  6. SESSION_SECRET=change-this-long-random-session-secret
  7. # Require administrator approval after a newly registered user verifies their email.
  8. REGISTRATION_REQUIRES_APPROVAL=false
  9. # Legacy admin send token. New users should generate their own token in the web UI.
  10. API_TOKEN=change-this-legacy-api-token
  11. SUBMISSION_ENABLED=true
  12. SUBMISSION_HOST=smtp.mailhub.example.com
  13. SUBMISSION_BIND=0.0.0.0
  14. SUBMISSION_PORTS=25:smtp,587:smtp,465:smtps,2525:smtp
  15. SUBMISSION_ALT_PORT=2525
  16. SUBMISSION_ALLOW_INSECURE_AUTH=false
  17. SUBMISSION_TLS_CERT=/certs/mailhub.example.com.crt
  18. SUBMISSION_TLS_KEY=/certs/mailhub.example.com.key
  19. # Optional host directory containing fullchain.pem and privkey.pem. Deploy and scheduled jobs sync it into ./certs.
  20. # The sync detects the running app container group, writes cert=0644/key=0640, and verifies container ports 465 and 993.
  21. MAILHUB_CERT_SOURCE_DIR=
  22. SUBMISSION_USERNAME=change-this-smtp-user
  23. SUBMISSION_PASSWORD=change-this-smtp-password
  24. # Legacy Node protocol backend only. Docker Compose always exposes Dovecot on
  25. # 143/993 and 110/995; use IMAP_BIND/POP3_BIND or a Compose override/firewall
  26. # when either public protocol must be restricted.
  27. IMAP_ENABLED=true
  28. IMAP_BIND=0.0.0.0
  29. IMAP_PORTS=143:imap,993:imaps
  30. POP3_ENABLED=true
  31. POP3_BIND=0.0.0.0
  32. POP3_PORTS=110:pop3,995:pop3s
  33. MAIL_ACCESS_ALLOW_INSECURE_AUTH=false
  34. # Docker deployments delegate IMAP/POP3 to Dovecot. The authentication bridge
  35. # is available only on the private Compose network and uses a generated secret.
  36. MAIL_ACCESS_BACKEND=dovecot
  37. DOVECOT_AUTH_ENABLED=true
  38. DOVECOT_AUTH_HOST=0.0.0.0
  39. DOVECOT_AUTH_PORT=3001
  40. DOVECOT_AUTH_SECRET_FILE=/run/secrets/dovecot_auth_secret
  41. # Low-resource hosts should keep CPU-bound password verification concurrency modest.
  42. UV_THREADPOOL_SIZE=2
  43. # Relative path for host-side migration commands. Compose overrides this with /data/maildir.
  44. MAILDIR_ROOT=./data/maildir
  45. MAILDIR_SYNC_INTERVAL_MS=300000
  46. # Optional Roundcube one-click login. The browser receives only a single-use
  47. # POST ticket; Roundcube exchanges it over the private network for an expiring
  48. # mhw_ credential. Generate a separate hexadecimal secret at
  49. # ./data/secrets/webmail_sso_secret and expose it read-only to Roundcube.
  50. WEBMAIL_SSO_URL=
  51. WEBMAIL_SSO_SECRET_FILE=./data/secrets/webmail_sso_secret
  52. # Host-side reader gid for a same-host Roundcube PHP worker. Debian/Apache
  53. # images commonly use www-data gid 33. Leave 1000 when no external reader exists.
  54. WEBMAIL_SSO_READER_GID=1000
  55. WEBMAIL_SSO_TICKET_TTL_SECONDS=60
  56. WEBMAIL_SSO_CREDENTIAL_TTL_SECONDS=43200
  57. # Outbound hostname is authorized through the SPF a: mechanism and used for HELO/Postfix.
  58. # The sending IP drives the managed A record and PTR health check, not a direct SPF ip4 entry.
  59. MAIL_HOSTNAME=smtp.mailhub.example.com
  60. SENDING_IP=203.0.113.10
  61. # Extra SPF mechanisms to preserve coexistence with third-party senders.
  62. # Examples: include:spf.mailjet.com include:_netblocks.m.feishu.cn
  63. DEFAULT_SPF_MECHANISMS=
  64. DNS_RESOLVERS=1.1.1.1,8.8.8.8
  65. DNS_AUTO_CHECK_ENABLED=true
  66. DNS_AUTO_CHECK_INTERVAL_MS=60000
  67. DNS_AUTO_CHECK_LIMIT=25
  68. # SMTP service used by the web API. In docker-compose this is the internal Postfix service.
  69. SMTP_HOST=postfix
  70. SMTP_PORT=25
  71. SMTP_HELO=smtp.mailhub.example.com
  72. SEND_REQUIRES_VERIFIED=false
  73. DELIVERY_TRACKING_ENABLED=true
  74. POSTFIX_LOG_POLL_INTERVAL_MS=5000
  75. # Engagement tracking uses opaque public links and a stable encryption key.
  76. TRACKING_SECRET=change-this-separate-long-random-tracking-secret
  77. ENGAGEMENT_TRACKING_ENABLED=false
  78. TRACKING_RETENTION_DAYS=180
  79. TRUST_PROXY=true
  80. # Optional deliverability headers. One-click should only be enabled when the URL accepts compliant unsubscribe POSTs.
  81. LIST_UNSUBSCRIBE_MAILTO=
  82. LIST_UNSUBSCRIBE_URL=
  83. LIST_UNSUBSCRIBE_POST_ENABLED=false
  84. FEEDBACK_ID_ENABLED=true
  85. REPORT_ABUSE_TO=
  86. CSA_COMPLAINTS_TO=
  87. # Optional bounce envelope sender. Keep disabled until this mailbox/domain receives and processes bounces.
  88. BOUNCE_ADDRESS=
  89. BOUNCE_ENVELOPE_ENABLED=false
  90. # DMARC defaults.
  91. DMARC_POLICY=none
  92. DMARC_RUA=