mailserver.env 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  1. # -----------------------------------------------
  2. # --- Mailserver Environment Variables ----------
  3. # -----------------------------------------------
  4. # DOCUMENTATION FOR THESE VARIABLES IS FOUND UNDER
  5. # https://docker-mailserver.github.io/docker-mailserver/edge/config/environment/
  6. # -----------------------------------------------
  7. # --- General Section ---------------------------
  8. # -----------------------------------------------
  9. # empty => uses the `hostname` command to get the mail server's canonical hostname
  10. # => Specify a fully-qualified domainname to serve mail for. This is used for many of the config features so if you can't set your hostname (e.g. you're in a container platform that doesn't let you) specify it in this environment variable.
  11. OVERRIDE_HOSTNAME=
  12. # 0 => Debug disabled
  13. # 1 => Enables debug on startup
  14. DMS_DEBUG=0
  15. # critical => Only show critical messages
  16. # error => Only show erroneous output
  17. # **warn** => Show warnings
  18. # info => Normal informational output
  19. # debug => Also show debug messages
  20. SUPERVISOR_LOGLEVEL=
  21. # 0 => mail state in default directories
  22. # 1 => consolidate all states into a single directory (`/var/mail-state`) to allow persistence using docker volumes
  23. ONE_DIR=1
  24. # empty => postmaster@domain.com
  25. # => Specify the postmaster address
  26. POSTMASTER_ADDRESS=
  27. # Check for updates on container start and then once a day
  28. # If an update is available, a mail is sent to POSTMASTER_ADDRESS
  29. # 0 => Update check disabled
  30. # 1 => Update check enabled
  31. ENABLE_UPDATE_CHECK=1
  32. # Customize the update check interval.
  33. # Number + Suffix. Suffix must be 's' for seconds, 'm' for minutes, 'h' for hours or 'd' for days.
  34. UPDATE_CHECK_INTERVAL=1d
  35. # Set different options for mynetworks option (can be overwrite in postfix-main.cf)
  36. # **WARNING**: Adding the docker network's gateway to the list of trusted hosts, e.g. using the `network` or
  37. # `connected-networks` option, can create an open relay
  38. # https://github.com/docker-mailserver/docker-mailserver/issues/1405#issuecomment-590106498
  39. # empty => localhost only
  40. # host => Add docker host (ipv4 only)
  41. # network => Add all docker containers (ipv4 only)
  42. # connected-networks => Add all connected docker networks (ipv4 only)
  43. PERMIT_DOCKER=
  44. # In case you network interface differs from 'eth0', e.g. when you are using HostNetworking in Kubernetes,
  45. # you can set NETWORK_INTERFACE to whatever interface you want. This interface will then be used.
  46. # - **empty** => eth0
  47. NETWORK_INTERFACE=
  48. # empty => modern
  49. # modern => Enables TLSv1.2 and modern ciphers only. (default)
  50. # intermediate => Enables TLSv1, TLSv1.1 and TLSv1.2 and broad compatibility ciphers.
  51. TLS_LEVEL=intermediate
  52. # Configures the handling of creating mails with forged sender addresses.
  53. #
  54. # empty => (not recommended, but default for backwards compatibility reasons)
  55. # Mail address spoofing allowed. Any logged in user may create email messages with a forged sender address.
  56. # See also https://en.wikipedia.org/wiki/Email_spoofing
  57. # 1 => (recommended) Mail spoofing denied. Each user may only send with his own or his alias addresses.
  58. # Addresses with extension delimiters(http://www.postfix.org/postconf.5.html#recipient_delimiter) are not able to send messages.
  59. SPOOF_PROTECTION=1
  60. # Enables the Sender Rewriting Scheme. SRS is needed if your mail server acts as forwarder. See [postsrsd](https://github.com/roehling/postsrsd/blob/master/README.md#sender-rewriting-scheme-crash-course) for further explanation.
  61. # - **0** => Disabled
  62. # - 1 => Enabled
  63. ENABLE_SRS=0
  64. # 1 => Enables POP3 service
  65. # empty => disables POP3
  66. ENABLE_POP3=
  67. ENABLE_CLAMAV=0
  68. # Amavis content filter (used for ClamAV & SpamAssassin)
  69. # 0 => Disabled
  70. # 1 => Enabled
  71. ENABLE_AMAVIS=1
  72. # -1/-2/-3 => Only show errors
  73. # **0** => Show warnings
  74. # 1/2 => Show default informational output
  75. # 3/4/5 => log debug information (very verbose)
  76. AMAVIS_LOGLEVEL=0
  77. # If you enable Fail2Ban, don't forget to add the following lines to your `docker-compose.yml`:
  78. # cap_add:
  79. # - NET_ADMIN
  80. # Otherwise, `iptables` won't be able to ban IPs.
  81. ENABLE_FAIL2BAN=0
  82. # Fail2Ban blocktype
  83. # drop => drop packet (send NO reply)
  84. # reject => reject packet (send ICMP unreachable)
  85. FAIL2BAN_BLOCKTYPE=drop
  86. # 1 => Enables Managesieve on port 4190
  87. # empty => disables Managesieve
  88. ENABLE_MANAGESIEVE=
  89. # **enforce** => Allow other tests to complete. Reject attempts to deliver mail with a 550 SMTP reply, and log the helo/sender/recipient information. Repeat this test the next time the client connects.
  90. # drop => Drop the connection immediately with a 521 SMTP reply. Repeat this test the next time the client connects.
  91. # ignore => Ignore the failure of this test. Allow other tests to complete. Repeat this test the next time the client connects. This option is useful for testing and collecting statistics without blocking mail.
  92. POSTSCREEN_ACTION=enforce
  93. # empty => all daemons start
  94. # 1 => only launch postfix smtp
  95. SMTP_ONLY=
  96. # Please read [the SSL page in the documentation](https://docker-mailserver.github.io/docker-mailserver/edge/config/security/ssl) for more information.
  97. #
  98. # empty => SSL disabled
  99. # letsencrypt => Enables Let's Encrypt certificates
  100. # custom => Enables custom certificates
  101. # manual => Let's you manually specify locations of your SSL certificates for non-standard cases
  102. # self-signed => Enables self-signed certificates
  103. SSL_TYPE=
  104. # These are only supported with `SSL_TYPE=manual`.
  105. # Provide the path to your cert and key files that you've mounted access to within the container.
  106. SSL_CERT_PATH=
  107. SSL_KEY_PATH=
  108. # Optional: A 2nd certificate can be supported as fallback (dual cert support), eg ECDSA with an RSA fallback.
  109. # Useful for additional compatibility with older MTA and MUA (eg pre-2015).
  110. SSL_ALT_CERT_PATH=
  111. SSL_ALT_KEY_PATH=
  112. # Set how many days a virusmail will stay on the server before being deleted
  113. # empty => 7 days
  114. VIRUSMAILS_DELETE_DELAY=
  115. # This Option is activating the Usage of POSTFIX_DAGENT to specify a lmtp client different from default dovecot socket.
  116. # empty => disabled
  117. # 1 => enabled
  118. ENABLE_POSTFIX_VIRTUAL_TRANSPORT=
  119. # Enabled by ENABLE_POSTFIX_VIRTUAL_TRANSPORT. Specify the final delivery of postfix
  120. #
  121. # empty => fail
  122. # `lmtp:unix:private/dovecot-lmtp` (use socket)
  123. # `lmtps:inet:<host>:<port>` (secure lmtp with starttls, take a look at https://sys4.de/en/blog/2014/11/17/sicheres-lmtp-mit-starttls-in-dovecot/)
  124. # `lmtp:<kopano-host>:2003` (use kopano as mailstore)
  125. # etc.
  126. POSTFIX_DAGENT=
  127. # Set the mailbox size limit for all users. If set to zero, the size will be unlimited (default).
  128. #
  129. # empty => 0
  130. POSTFIX_MAILBOX_SIZE_LIMIT=
  131. # See https://docker-mailserver.github.io/docker-mailserver/edge/config/user-management/accounts/#notes
  132. # 0 => Dovecot quota is disabled
  133. # 1 => Dovecot quota is enabled
  134. ENABLE_QUOTAS=1
  135. # Set the message size limit for all users. If set to zero, the size will be unlimited (not recommended!)
  136. #
  137. # empty => 10240000 (~10 MB)
  138. POSTFIX_MESSAGE_SIZE_LIMIT=
  139. # Enables regular pflogsumm mail reports.
  140. # This is a new option. The old REPORT options are still supported for backwards compatibility. If this is not set and reports are enabled with the old options, logrotate will be used.
  141. #
  142. # not set => No report
  143. # daily_cron => Daily report for the previous day
  144. # logrotate => Full report based on the mail log when it is rotated
  145. PFLOGSUMM_TRIGGER=
  146. # Recipient address for pflogsumm reports.
  147. #
  148. # not set => Use REPORT_RECIPIENT or POSTMASTER_ADDRESS
  149. # => Specify the recipient address(es)
  150. PFLOGSUMM_RECIPIENT=
  151. # From address for pflogsumm reports.
  152. #
  153. # not set => Use REPORT_SENDER or POSTMASTER_ADDRESS
  154. # => Specify the sender address
  155. PFLOGSUMM_SENDER=
  156. # Interval for logwatch report.
  157. #
  158. # none => No report is generated
  159. # daily => Send a daily report
  160. # weekly => Send a report every week
  161. LOGWATCH_INTERVAL=
  162. # Recipient address for logwatch reports if they are enabled.
  163. #
  164. # not set => Use REPORT_RECIPIENT or POSTMASTER_ADDRESS
  165. # => Specify the recipient address(es)
  166. LOGWATCH_RECIPIENT=
  167. # Enables a report being sent (created by pflogsumm) on a regular basis. (deprecated)
  168. # **0** => Report emails are disabled
  169. # 1 => Using POSTMASTER_ADDRESS as the recipient
  170. # => Specify the recipient address
  171. REPORT_RECIPIENT=0
  172. # Change the sending address for mail report (deprecated)
  173. # **empty** => mailserver-report@hostname
  174. # => Specify the report sender (From) address
  175. REPORT_SENDER=
  176. # Changes the interval in which a report is being sent. (deprecated)
  177. # **daily** => Send a daily report
  178. # weekly => Send a report every week
  179. # monthly => Send a report every month
  180. #
  181. # Note: This Variable actually controls logrotate inside the container and rotates the log depending on this setting. The main log output is still available in its entirety via `docker logs mail` (Or your respective container name). If you want to control logrotation for the docker generated logfile see: [Docker Logging Drivers](https://docs.docker.com/config/containers/logging/configure/)
  182. REPORT_INTERVAL=daily
  183. # Choose TCP/IP protocols to use
  184. # **all** => All possible protocols.
  185. # ipv4 => Use only IPv4 traffic. Most likely you want this behind Docker.
  186. # ipv6 => Use only IPv6 traffic.
  187. #
  188. # Note: More details in http://www.postfix.org/postconf.5.html#inet_protocols
  189. POSTFIX_INET_PROTOCOLS=all
  190. # -----------------------------------------------
  191. # --- SpamAssassin Section ----------------------
  192. # -----------------------------------------------
  193. ENABLE_SPAMASSASSIN=0
  194. # deliver spam messages in the inbox (eventually tagged using SA_SPAM_SUBJECT)
  195. SPAMASSASSIN_SPAM_TO_INBOX=1
  196. # spam messages will be moved in the Junk folder (SPAMASSASSIN_SPAM_TO_INBOX=1 required)
  197. MOVE_SPAM_TO_JUNK=1
  198. # add spam info headers if at, or above that level:
  199. SA_TAG=2.0
  200. # add 'spam detected' headers at that level
  201. SA_TAG2=6.31
  202. # triggers spam evasive actions
  203. SA_KILL=6.31
  204. # add tag to subject if spam detected
  205. SA_SPAM_SUBJECT=***SPAM*****
  206. # -----------------------------------------------
  207. # --- Fetchmail Section -------------------------
  208. # -----------------------------------------------
  209. ENABLE_FETCHMAIL=0
  210. # The interval to fetch mail in seconds
  211. FETCHMAIL_POLL=300
  212. # -----------------------------------------------
  213. # --- LDAP Section ------------------------------
  214. # -----------------------------------------------
  215. # A second container for the ldap service is necessary (i.e. https://github.com/osixia/docker-openldap)
  216. # For preparing the ldap server to use in combination with this container this article may be helpful: http://acidx.net/wordpress/2014/06/installing-a-mailserver-with-postfix-dovecot-sasl-ldap-roundcube/
  217. # empty => LDAP authentification is disabled
  218. # 1 => LDAP authentification is enabled
  219. ENABLE_LDAP=
  220. # empty => no
  221. # yes => LDAP over TLS enabled for Postfix
  222. LDAP_START_TLS=
  223. # If you going to use the mailserver in combination with docker-compose you can set the service name here
  224. # empty => mail.domain.com
  225. # Specify the dns-name/ip-address where the ldap-server
  226. LDAP_SERVER_HOST=
  227. # empty => ou=people,dc=domain,dc=com
  228. # => e.g. LDAP_SEARCH_BASE=dc=mydomain,dc=local
  229. LDAP_SEARCH_BASE=
  230. # empty => cn=admin,dc=domain,dc=com
  231. # => take a look at examples of SASL_LDAP_BIND_DN
  232. LDAP_BIND_DN=
  233. # empty** => admin
  234. # => Specify the password to bind against ldap
  235. LDAP_BIND_PW=
  236. # e.g. `"(&(mail=%s)(mailEnabled=TRUE))"`
  237. # => Specify how ldap should be asked for users
  238. LDAP_QUERY_FILTER_USER=
  239. # e.g. `"(&(mailGroupMember=%s)(mailEnabled=TRUE))"`
  240. # => Specify how ldap should be asked for groups
  241. LDAP_QUERY_FILTER_GROUP=
  242. # e.g. `"(&(mailAlias=%s)(mailEnabled=TRUE))"`
  243. # => Specify how ldap should be asked for aliases
  244. LDAP_QUERY_FILTER_ALIAS=
  245. # e.g. `"(&(|(mail=*@%s)(mailalias=*@%s)(mailGroupMember=*@%s))(mailEnabled=TRUE))"`
  246. # => Specify how ldap should be asked for domains
  247. LDAP_QUERY_FILTER_DOMAIN=
  248. # -----------------------------------------------
  249. # --- Dovecot Section ---------------------------
  250. # -----------------------------------------------
  251. # empty => no
  252. # yes => LDAP over TLS enabled for Dovecot
  253. DOVECOT_TLS=
  254. # e.g. `"(&(objectClass=PostfixBookMailAccount)(uniqueIdentifier=%n))"`
  255. DOVECOT_USER_FILTER=
  256. # e.g. `"(&(objectClass=PostfixBookMailAccount)(uniqueIdentifier=%n))"`
  257. DOVECOT_PASS_FILTER=
  258. # Define the mailbox format to be used
  259. # default is maildir, supported values are: sdbox, mdbox, maildir
  260. DOVECOT_MAILBOX_FORMAT=maildir
  261. # empty => no
  262. # yes => Allow bind authentication for LDAP
  263. # https://wiki.dovecot.org/AuthDatabase/LDAP/AuthBinds
  264. DOVECOT_AUTH_BIND=
  265. # -----------------------------------------------
  266. # --- Postgrey Section --------------------------
  267. # -----------------------------------------------
  268. ENABLE_POSTGREY=0
  269. # greylist for N seconds
  270. POSTGREY_DELAY=300
  271. # delete entries older than N days since the last time that they have been seen
  272. POSTGREY_MAX_AGE=35
  273. # response when a mail is greylisted
  274. POSTGREY_TEXT="Delayed by Postgrey"
  275. # whitelist host after N successful deliveries (N=0 to disable whitelisting)
  276. POSTGREY_AUTO_WHITELIST_CLIENTS=5
  277. # -----------------------------------------------
  278. # --- SASL Section ------------------------------
  279. # -----------------------------------------------
  280. ENABLE_SASLAUTHD=0
  281. # empty => pam
  282. # `ldap` => authenticate against ldap server
  283. # `shadow` => authenticate against local user db
  284. # `mysql` => authenticate against mysql db
  285. # `rimap` => authenticate against imap server
  286. # Note: can be a list of mechanisms like pam ldap shadow
  287. SASLAUTHD_MECHANISMS=
  288. # empty => None
  289. # e.g. with SASLAUTHD_MECHANISMS rimap you need to specify the ip-address/servername of the imap server ==> xxx.xxx.xxx.xxx
  290. SASLAUTHD_MECH_OPTIONS=
  291. # empty => Use value of LDAP_SERVER_HOST
  292. # Note: since version 10.0.0, you can specify a protocol here (like ldaps://); this deprecates SASLAUTHD_LDAP_SSL.
  293. SASLAUTHD_LDAP_SERVER=
  294. # empty => Use value of LDAP_BIND_DN
  295. # specify an object with priviliges to search the directory tree
  296. # e.g. active directory: SASLAUTHD_LDAP_BIND_DN=cn=Administrator,cn=Users,dc=mydomain,dc=net
  297. # e.g. openldap: SASLAUTHD_LDAP_BIND_DN=cn=admin,dc=mydomain,dc=net
  298. SASLAUTHD_LDAP_BIND_DN=
  299. # empty => Use value of LDAP_BIND_PW
  300. SASLAUTHD_LDAP_PASSWORD=
  301. # empty => Use value of LDAP_SEARCH_BASE
  302. # specify the search base
  303. SASLAUTHD_LDAP_SEARCH_BASE=
  304. # empty => default filter `(&(uniqueIdentifier=%u)(mailEnabled=TRUE))`
  305. # e.g. for active directory: `(&(sAMAccountName=%U)(objectClass=person))`
  306. # e.g. for openldap: `(&(uid=%U)(objectClass=person))`
  307. SASLAUTHD_LDAP_FILTER=
  308. # empty => no
  309. # yes => LDAP over TLS enabled for SASL
  310. # If set to yes, the protocol in SASLAUTHD_LDAP_SERVER must be ldap:// or missing.
  311. SASLAUTHD_LDAP_START_TLS=
  312. # empty => no
  313. # yes => Require and verify server certificate
  314. # If yes you must/could specify SASLAUTHD_LDAP_TLS_CACERT_FILE or SASLAUTHD_LDAP_TLS_CACERT_DIR.
  315. SASLAUTHD_LDAP_TLS_CHECK_PEER=
  316. # File containing CA (Certificate Authority) certificate(s).
  317. # empty => Nothing is added to the configuration
  318. # Any value => Fills the `ldap_tls_cacert_file` option
  319. SASLAUTHD_LDAP_TLS_CACERT_FILE=
  320. # Path to directory with CA (Certificate Authority) certificates.
  321. # empty => Nothing is added to the configuration
  322. # Any value => Fills the `ldap_tls_cacert_dir` option
  323. SASLAUTHD_LDAP_TLS_CACERT_DIR=
  324. # Specify what password attribute to use for password verification.
  325. # empty => Nothing is added to the configuration but the documentation says it is `userPassword` by default.
  326. # Any value => Fills the `ldap_password_attr` option
  327. SASLAUTHD_LDAP_PASSWORD_ATTR=
  328. # empty => No sasl_passwd will be created
  329. # string => `/etc/postfix/sasl_passwd` will be created with the string as password
  330. SASL_PASSWD=
  331. # empty => `bind` will be used as a default value
  332. # `fastbind` => The fastbind method is used
  333. # `custom` => The custom method uses userPassword attribute to verify the password
  334. SASLAUTHD_LDAP_AUTH_METHOD=
  335. # Specify the authentication mechanism for SASL bind
  336. # empty => Nothing is added to the configuration
  337. # Any value => Fills the `ldap_mech` option
  338. SASLAUTHD_LDAP_MECH=
  339. # -----------------------------------------------
  340. # --- SRS Section -------------------------------
  341. # -----------------------------------------------
  342. # envelope_sender => Rewrite only envelope sender address (default)
  343. # header_sender => Rewrite only header sender (not recommended)
  344. # envelope_sender,header_sender => Rewrite both senders
  345. # An email has an "envelope" sender (indicating the sending server) and a
  346. # "header" sender (indicating who sent it). More strict SPF policies may require
  347. # you to replace both instead of just the envelope sender.
  348. SRS_SENDER_CLASSES=envelope_sender
  349. # empty => Envelope sender will be rewritten for all domains
  350. # provide comma separated list of domains to exclude from rewriting
  351. SRS_EXCLUDE_DOMAINS=
  352. # empty => generated when the image is built
  353. # provide a secret to use in base64
  354. # you may specify multiple keys, comma separated. the first one is used for
  355. # signing and the remaining will be used for verification. this is how you
  356. # rotate and expire keys
  357. SRS_SECRET=
  358. # -----------------------------------------------
  359. # --- Default Relay Host Section ----------------
  360. # -----------------------------------------------
  361. # Setup relaying all mail through a default relay host
  362. #
  363. # empty => don't configure default relay host
  364. # default host and optional port to relay all mail through
  365. DEFAULT_RELAY_HOST=
  366. # -----------------------------------------------
  367. # --- Multi-Domain Relay Section ----------------
  368. # -----------------------------------------------
  369. # Setup relaying for multiple domains based on the domain name of the sender
  370. # optionally uses usernames and passwords in postfix-sasl-password.cf and relay host mappings in postfix-relaymap.cf
  371. #
  372. # empty => don't configure relay host
  373. # default host to relay mail through
  374. RELAY_HOST=
  375. # empty => 25
  376. # default port to relay mail
  377. RELAY_PORT=25
  378. # empty => no default
  379. # default relay username (if no specific entry exists in postfix-sasl-password.cf)
  380. RELAY_USER=
  381. # empty => no default
  382. # password for default relay user
  383. RELAY_PASSWORD=