vars.inc.php 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <?php
  2. error_reporting(E_ERROR);
  3. //error_reporting(E_ALL);
  4. /*
  5. PLEASE USE THE FILE "vars.local.inc.php" TO OVERWRITE SETTINGS AND MAKE THEM PERSISTENT!
  6. This file will be reset on upgrades.
  7. */
  8. // SQL database connection variables
  9. $database_type = 'mysql';
  10. $database_sock = '/var/run/mysqld/mysqld.sock';
  11. $database_host = 'mysql';
  12. $database_user = getenv('DBUSER');
  13. $database_pass = getenv('DBPASS');
  14. $database_name = getenv('DBNAME');
  15. // Other variables
  16. $mailcow_hostname = getenv('MAILCOW_HOSTNAME');
  17. $default_pass_scheme = getenv('MAILCOW_PASS_SCHEME');
  18. // Autodiscover settings
  19. // ===
  20. // Auto-detect HTTPS port =>
  21. $https_port = strpos($_SERVER['HTTP_HOST'], ':');
  22. if ($https_port === FALSE) {
  23. $https_port = 443;
  24. } else {
  25. $https_port = substr($_SERVER['HTTP_HOST'], $https_port+1);
  26. }
  27. // Alternatively select port here =>
  28. //$https_port = 1234;
  29. // Other settings =>
  30. $autodiscover_config = array(
  31. // General autodiscover service type: "activesync" or "imap"
  32. // emClient uses autodiscover, but does not support ActiveSync. mailcow excludes emClient from ActiveSync.
  33. // With SOGo disabled, the type will always fallback to imap. CalDAV and CardDAV will be excluded, too.
  34. 'autodiscoverType' => 'activesync',
  35. // If autodiscoverType => activesync, also use ActiveSync (EAS) for Outlook desktop clients (>= Outlook 2013 on Windows)
  36. // Outlook for Mac does not support ActiveSync
  37. 'useEASforOutlook' => 'no',
  38. // Please don't use STARTTLS-enabled service ports in the "port" variable.
  39. // The autodiscover service will always point to SMTPS and IMAPS (TLS-wrapped services).
  40. // The autoconfig service will additionally announce the STARTTLS-enabled ports, specified in the "tlsport" variable.
  41. 'imap' => array(
  42. 'server' => $mailcow_hostname,
  43. 'port' => (int)filter_var(substr(getenv('IMAPS_PORT'), strrpos(getenv('IMAPS_PORT'), ':')), FILTER_SANITIZE_NUMBER_INT),
  44. 'tlsport' => (int)filter_var(substr(getenv('IMAP_PORT'), strrpos(getenv('IMAP_PORT'), ':')), FILTER_SANITIZE_NUMBER_INT)
  45. ),
  46. 'pop3' => array(
  47. 'server' => $mailcow_hostname,
  48. 'port' => (int)filter_var(substr(getenv('POPS_PORT'), strrpos(getenv('POPS_PORT'), ':')), FILTER_SANITIZE_NUMBER_INT),
  49. 'tlsport' => (int)filter_var(substr(getenv('POP_PORT'), strrpos(getenv('POP_PORT'), ':')), FILTER_SANITIZE_NUMBER_INT)
  50. ),
  51. 'smtp' => array(
  52. 'server' => $mailcow_hostname,
  53. 'port' => (int)filter_var(substr(getenv('SMTPS_PORT'), strrpos(getenv('SMTPS_PORT'), ':')), FILTER_SANITIZE_NUMBER_INT),
  54. 'tlsport' => (int)filter_var(substr(getenv('SUBMISSION_PORT'), strrpos(getenv('SUBMISSION_PORT'), ':')), FILTER_SANITIZE_NUMBER_INT)
  55. ),
  56. 'activesync' => array(
  57. 'url' => 'https://' . $mailcow_hostname . ($https_port == 443 ? '' : ':' . $https_port) . '/Microsoft-Server-ActiveSync',
  58. ),
  59. 'caldav' => array(
  60. 'server' => $mailcow_hostname,
  61. 'port' => $https_port,
  62. ),
  63. 'carddav' => array(
  64. 'server' => $mailcow_hostname,
  65. 'port' => $https_port,
  66. ),
  67. );
  68. // If false, we will use DEFAULT_LANG
  69. // Uses HTTP_ACCEPT_LANGUAGE header
  70. $DETECT_LANGUAGE = true;
  71. // Change default language
  72. $DEFAULT_LANG = 'en';
  73. // Available languages
  74. // https://www.iso.org/obp/ui/#search
  75. // https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
  76. $AVAILABLE_LANGUAGES = array(
  77. 'cs' => 'Čeština (Czech)',
  78. 'da' => 'Danish (Dansk)',
  79. 'de' => 'Deutsch (German)',
  80. 'en' => 'English',
  81. 'es' => 'Español (Spanish)',
  82. 'fi' => 'Suomi (Finish)',
  83. 'fr' => 'Français (French)',
  84. 'hu' => 'Magyar (Hungarian)',
  85. 'it' => 'Italiano (Italian)',
  86. 'ko' => '한국어 (Korean)',
  87. 'lv' => 'latviešu (Latvian)',
  88. 'nl' => 'Nederlands (Dutch)',
  89. 'pl' => 'Język Polski (Polish)',
  90. 'pt' => 'Português (Portuguese)',
  91. 'ro' => 'Română (Romanian)',
  92. 'ru' => 'Pусский (Russian)',
  93. 'sk' => 'Slovenčina (Slovak)',
  94. 'sv' => 'Svenska (Swedish)',
  95. 'zh' => '中文 (Chinese)'
  96. );
  97. // Show DKIM private keys - false by default
  98. $SHOW_DKIM_PRIV_KEYS = false;
  99. // mailcow Apps - buttons on login screen
  100. $MAILCOW_APPS = array(
  101. array(
  102. 'name' => 'Webmail',
  103. 'link' => '/SOGo/',
  104. )
  105. );
  106. // Rows until pagination begins
  107. $PAGINATION_SIZE = 20;
  108. // Default number of rows/lines to display (log table)
  109. $LOG_LINES = 1000;
  110. // Rows until pagination begins (log table)
  111. $LOG_PAGINATION_SIZE = 50;
  112. // Session lifetime in seconds
  113. $SESSION_LIFETIME = 10800;
  114. // Label for OTP devices
  115. $OTP_LABEL = "mailcow UI";
  116. // How long to wait (in s) for cURL Docker requests
  117. $DOCKER_TIMEOUT = 60;
  118. // Split DKIM key notation (bind format)
  119. $SPLIT_DKIM_255 = false;
  120. // OAuth2 settings
  121. $REFRESH_TOKEN_LIFETIME = 2678400;
  122. $ACCESS_TOKEN_LIFETIME = 86400;
  123. // Logout from mailcow after first OAuth2 session profile request
  124. $OAUTH2_FORGET_SESSION_AFTER_LOGIN = false;
  125. // MAILBOX_DEFAULT_ATTRIBUTES define default attributes for new mailboxes
  126. // These settings will not change existing mailboxes
  127. // Force incoming TLS for new mailboxes by default
  128. $MAILBOX_DEFAULT_ATTRIBUTES['tls_enforce_in'] = false;
  129. // Force outgoing TLS for new mailboxes by default
  130. $MAILBOX_DEFAULT_ATTRIBUTES['tls_enforce_out'] = false;
  131. // Force password change on next login (only allows login to mailcow UI)
  132. $MAILBOX_DEFAULT_ATTRIBUTES['force_pw_update'] = false;
  133. // Enable SOGo access (set to false to disable access by default)
  134. $MAILBOX_DEFAULT_ATTRIBUTES['sogo_access'] = true;
  135. // Send notification when quarantine is not empty (never, hourly, daily, weekly)
  136. $MAILBOX_DEFAULT_ATTRIBUTES['quarantine_notification'] = 'hourly';
  137. // Mailbox has IMAP access by default
  138. $MAILBOX_DEFAULT_ATTRIBUTES['imap_access'] = true;
  139. // Mailbox has POP3 access by default
  140. $MAILBOX_DEFAULT_ATTRIBUTES['pop3_access'] = true;
  141. // Mailbox has SMTP access by default
  142. $MAILBOX_DEFAULT_ATTRIBUTES['smtp_access'] = true;
  143. // Mailbox has sieve access by default
  144. $MAILBOX_DEFAULT_ATTRIBUTES['sieve_access'] = true;
  145. // Mailbox receives notifications about...
  146. // "add_header" - mail that was put into the Junk folder
  147. // "reject" - mail that was rejected
  148. // "all" - mail that was rejected and put into the Junk folder
  149. $MAILBOX_DEFAULT_ATTRIBUTES['quarantine_category'] = 'reject';
  150. // Default mailbox format, should not be changed unless you know exactly, what you do, keep the trailing ":"
  151. // Check dovecot.conf for further changes (e.g. shared namespace)
  152. $MAILBOX_DEFAULT_ATTRIBUTES['mailbox_format'] = 'maildir:';
  153. // Show last IMAP and POP3 logins
  154. $SHOW_LAST_LOGIN = true;
  155. // UV flag handling in FIDO2/WebAuthn - defaults to false to allow iOS logins
  156. // true = required
  157. // false = preferred
  158. // string 'required' 'preferred' 'discouraged'
  159. $WEBAUTHN_UV_FLAG_REGISTER = false;
  160. $WEBAUTHN_UV_FLAG_LOGIN = false;
  161. $WEBAUTHN_USER_PRESENT_FLAG = true;
  162. $FIDO2_UV_FLAG_REGISTER = 'preferred';
  163. $FIDO2_UV_FLAG_LOGIN = 'preferred'; // iOS ignores the key via NFC if required - known issue
  164. $FIDO2_USER_PRESENT_FLAG = true;
  165. $FIDO2_FORMATS = array('apple', 'android-key', 'android-safetynet', 'fido-u2f', 'none', 'packed', 'tpm');
  166. // Set visible Rspamd maps in mailcow UI, do not change unless you know what you are doing
  167. $RSPAMD_MAPS = array(
  168. 'regex' => array(
  169. 'Header-From: Blacklist' => 'global_mime_from_blacklist.map',
  170. 'Header-From: Whitelist' => 'global_mime_from_whitelist.map',
  171. 'Envelope Sender Blacklist' => 'global_smtp_from_blacklist.map',
  172. 'Envelope Sender Whitelist' => 'global_smtp_from_whitelist.map',
  173. 'Recipient Blacklist' => 'global_rcpt_blacklist.map',
  174. 'Recipient Whitelist' => 'global_rcpt_whitelist.map',
  175. 'Fishy TLDS (only fired in combination with bad words)' => 'fishy_tlds.map',
  176. 'Bad Words (only fired in combination with fishy TLDs)' => 'bad_words.map',
  177. 'Bad Words DE (only fired in combination with fishy TLDs)' => 'bad_words_de.map',
  178. 'Bad Languages' => 'bad_languages.map',
  179. 'Bulk Mail Headers' => 'bulk_header.map',
  180. 'Bad (Junk) Mail Headers' => 'bad_header.map',
  181. 'Monitoring Hosts' => 'monitoring_nolog.map'
  182. )
  183. );