vars.inc.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  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-gb';
  73. // Available languages
  74. // https://www.iso.org/obp/ui/#search
  75. // https://en.wikipedia.org/wiki/IETF_language_tag
  76. $AVAILABLE_LANGUAGES = array(
  77. // 'ca-es' => 'Català (Catalan)',
  78. 'cs-cz' => 'Čeština (Czech)',
  79. 'da-dk' => 'Danish (Dansk)',
  80. 'de-de' => 'Deutsch (German)',
  81. 'en-gb' => 'English',
  82. 'es-es' => 'Español (Spanish)',
  83. 'fi-fi' => 'Suomi (Finish)',
  84. 'fr-fr' => 'Français (French)',
  85. 'gr-gr' => 'Ελληνικά (Greek)',
  86. 'hu-hu' => 'Magyar (Hungarian)',
  87. 'it-it' => 'Italiano (Italian)',
  88. 'ja-jp' => '日本語 (Japanese)',
  89. 'ko-kr' => '한국어 (Korean)',
  90. 'lv-lv' => 'latviešu (Latvian)',
  91. 'lt-lt' => 'Lietuvių (Lithuanian)',
  92. 'nb-no' => 'Norsk (Norwegian)',
  93. 'nl-nl' => 'Nederlands (Dutch)',
  94. 'pl-pl' => 'Język Polski (Polish)',
  95. 'pt-br' => 'Português brasileiro (Brazilian Portuguese)',
  96. 'pt-pt' => 'Português (Portuguese)',
  97. 'ro-ro' => 'Română (Romanian)',
  98. 'ru-ru' => 'Pусский (Russian)',
  99. 'si-si' => 'Slovenščina (Slovenian)',
  100. 'sk-sk' => 'Slovenčina (Slovak)',
  101. 'sv-se' => 'Svenska (Swedish)',
  102. 'tr-tr' => 'Türkçe (Turkish)',
  103. 'uk-ua' => 'Українська (Ukrainian)',
  104. 'zh-cn' => '简体中文 (Simplified Chinese)',
  105. 'zh-tw' => '繁體中文 (Traditional Chinese)',
  106. );
  107. // default theme is lumen
  108. // additional themes can be found here: https://bootswatch.com/
  109. // copy them to data/web/css/themes/{THEME-NAME}-bootstrap.css
  110. $UI_THEME = "lumen";
  111. // Show DKIM private keys - false by default
  112. $SHOW_DKIM_PRIV_KEYS = false;
  113. // mailcow Apps - buttons on login screen
  114. $MAILCOW_APPS = array(
  115. array(
  116. 'name' => 'Webmail',
  117. 'link' => '/SOGo/so',
  118. 'user_link' => '/SOGo/so',
  119. 'hide' => true
  120. )
  121. );
  122. // Logo max file size in bytes
  123. $LOGO_LIMITS['max_size'] = 15 * 1024 * 1024; // 15MB
  124. // Logo max width in pixels
  125. $LOGO_LIMITS['max_width'] = 1920;
  126. // Logo max height in pixels
  127. $LOGO_LIMITS['max_height'] = 1920;
  128. // Rows until pagination begins
  129. $PAGINATION_SIZE = 25;
  130. // Default number of rows/lines to display (log table)
  131. $LOG_LINES = 1000;
  132. // Rows until pagination begins (log table)
  133. $LOG_PAGINATION_SIZE = 50;
  134. // Session lifetime in seconds
  135. $SESSION_LIFETIME = 10800;
  136. // Label for OTP devices
  137. $OTP_LABEL = "mailcow UI";
  138. // How long to wait (in s) for cURL Docker requests
  139. $DOCKER_TIMEOUT = 60;
  140. // Split DKIM key notation (bind format)
  141. $SPLIT_DKIM_255 = false;
  142. // OAuth2 settings
  143. $REFRESH_TOKEN_LIFETIME = 2678400;
  144. $ACCESS_TOKEN_LIFETIME = 86400;
  145. // Logout from mailcow after first OAuth2 session profile request
  146. $OAUTH2_FORGET_SESSION_AFTER_LOGIN = false;
  147. // Set a limit for mailbox and domain tagging
  148. $TAGGING_LIMIT = 25;
  149. // MAILBOX_DEFAULT_ATTRIBUTES define default attributes for new mailboxes
  150. // These settings will not change existing mailboxes
  151. // Force incoming TLS for new mailboxes by default
  152. $MAILBOX_DEFAULT_ATTRIBUTES['tls_enforce_in'] = false;
  153. // Force outgoing TLS for new mailboxes by default
  154. $MAILBOX_DEFAULT_ATTRIBUTES['tls_enforce_out'] = false;
  155. // Force password change on next login (only allows login to mailcow UI)
  156. $MAILBOX_DEFAULT_ATTRIBUTES['force_pw_update'] = false;
  157. // Enable SOGo access - Users will be redirected to SOGo after login (set to false to disable redirect by default)
  158. $MAILBOX_DEFAULT_ATTRIBUTES['sogo_access'] = true;
  159. // How to handle tagged emails
  160. // none - No special handling
  161. // subfolder - Create subfolder under INBOX (e.g. "INBOX/Facebook")
  162. // subject - Add tag to subject (e.g. "[Facebook] Subject")
  163. $MAILBOX_DEFAULT_ATTRIBUTES['tagged_mail_handler'] = "none";
  164. // Send notification when quarantine is not empty (never, hourly, daily, weekly)
  165. $MAILBOX_DEFAULT_ATTRIBUTES['quarantine_notification'] = 'hourly';
  166. // Mailbox has IMAP access by default
  167. $MAILBOX_DEFAULT_ATTRIBUTES['imap_access'] = true;
  168. // Mailbox has POP3 access by default
  169. $MAILBOX_DEFAULT_ATTRIBUTES['pop3_access'] = true;
  170. // Mailbox has SMTP access by default
  171. $MAILBOX_DEFAULT_ATTRIBUTES['smtp_access'] = true;
  172. // Mailbox has sieve access by default
  173. $MAILBOX_DEFAULT_ATTRIBUTES['sieve_access'] = true;
  174. // Mailbox receives notifications about...
  175. // "add_header" - mail that was put into the Junk folder
  176. // "reject" - mail that was rejected
  177. // "all" - mail that was rejected and put into the Junk folder
  178. $MAILBOX_DEFAULT_ATTRIBUTES['quarantine_category'] = 'reject';
  179. // Default mailbox format, should not be changed unless you know exactly, what you do, keep the trailing ":"
  180. // Check dovecot.conf for further changes (e.g. shared namespace)
  181. $MAILBOX_DEFAULT_ATTRIBUTES['mailbox_format'] = 'maildir:';
  182. // Show last IMAP and POP3 logins
  183. $SHOW_LAST_LOGIN = true;
  184. // Maximum number of password reset tokens that can be generated at once per user
  185. $PW_RESET_TOKEN_LIMIT = 3;
  186. // Maximum time in minutes a password reset token is valid
  187. $PW_RESET_TOKEN_LIFETIME = 15;
  188. // UV flag handling in FIDO2/WebAuthn - defaults to false to allow iOS logins
  189. // true = required
  190. // false = preferred
  191. // string 'required' 'preferred' 'discouraged'
  192. $WEBAUTHN_UV_FLAG_REGISTER = false;
  193. $WEBAUTHN_UV_FLAG_LOGIN = false;
  194. $WEBAUTHN_USER_PRESENT_FLAG = true;
  195. $FIDO2_UV_FLAG_REGISTER = 'preferred';
  196. $FIDO2_UV_FLAG_LOGIN = 'preferred'; // iOS ignores the key via NFC if required - known issue
  197. $FIDO2_USER_PRESENT_FLAG = true;
  198. $FIDO2_FORMATS = array('apple', 'android-key', 'android-safetynet', 'fido-u2f', 'none', 'packed', 'tpm');
  199. // Set visible Rspamd maps in mailcow UI, do not change unless you know what you are doing
  200. $RSPAMD_MAPS = array(
  201. 'regex' => array(
  202. 'Header-From: Blacklist' => 'global_mime_from_blacklist.map',
  203. 'Header-From: Whitelist' => 'global_mime_from_whitelist.map',
  204. 'Envelope Sender Blacklist' => 'global_smtp_from_blacklist.map',
  205. 'Envelope Sender Whitelist' => 'global_smtp_from_whitelist.map',
  206. 'Recipient Blacklist' => 'global_rcpt_blacklist.map',
  207. 'Recipient Whitelist' => 'global_rcpt_whitelist.map',
  208. 'Fishy TLDS (only fired in combination with bad words)' => 'fishy_tlds.map',
  209. 'Bad Words (only fired in combination with fishy TLDs)' => 'bad_words.map',
  210. 'Bad Words DE (only fired in combination with fishy TLDs)' => 'bad_words_de.map',
  211. 'Bad Languages' => 'bad_languages.map',
  212. 'Bulk Mail Headers' => 'bulk_header.map',
  213. 'Bad (Junk) Mail Headers' => 'bad_header.map',
  214. 'Monitoring Hosts' => 'monitoring_nolog.map'
  215. )
  216. );
  217. $IMAPSYNC_OPTIONS = array(
  218. 'whitelist' => array(
  219. 'abort',
  220. 'authmd51',
  221. 'authmd52',
  222. 'authmech1',
  223. 'authmech2',
  224. 'authuser1',
  225. 'authuser2',
  226. 'debug',
  227. 'debugcontent',
  228. 'debugcrossduplicates',
  229. 'debugflags',
  230. 'debugfolders',
  231. 'debugimap',
  232. 'debugimap1',
  233. 'debugimap2',
  234. 'debugmemory',
  235. 'debugssl',
  236. 'delete1emptyfolders',
  237. 'delete2folders',
  238. 'disarmreadreceipts',
  239. 'domain1',
  240. 'domain2',
  241. 'domino1',
  242. 'domino2',
  243. 'dry',
  244. 'errorsmax',
  245. 'exchange1',
  246. 'exchange2',
  247. 'exitwhenover',
  248. 'expunge1',
  249. 'f1f2',
  250. 'filterbuggyflags',
  251. 'folder',
  252. 'folderfirst',
  253. 'folderlast',
  254. 'folderrec',
  255. 'gmail1',
  256. 'gmail2',
  257. 'idatefromheader',
  258. 'include',
  259. 'inet4',
  260. 'inet6',
  261. 'justconnect',
  262. 'justfolders',
  263. 'justfoldersizes',
  264. 'justlogin',
  265. 'keepalive1',
  266. 'keepalive2',
  267. 'log',
  268. 'logdir',
  269. 'logfile',
  270. 'maxbytesafter',
  271. 'maxlinelength',
  272. 'maxmessagespersecond',
  273. 'maxsize',
  274. 'maxsleep',
  275. 'minage',
  276. 'minsize',
  277. 'noabletosearch',
  278. 'noabletosearch1',
  279. 'noabletosearch2',
  280. 'noexpunge1',
  281. 'noexpunge2',
  282. 'nofoldersizesatend',
  283. 'noid',
  284. 'nolog',
  285. 'nomixfolders',
  286. 'noresyncflags',
  287. 'nossl1',
  288. 'nossl2',
  289. 'nosyncacls',
  290. 'notls1',
  291. 'notls2',
  292. 'nouidexpunge2',
  293. 'nousecache',
  294. 'oauthaccesstoken1',
  295. 'oauthaccesstoken2',
  296. 'oauthdirect1',
  297. 'oauthdirect2',
  298. 'office1',
  299. 'office2',
  300. 'pidfile',
  301. 'pidfilelocking',
  302. 'prefix1',
  303. 'prefix2',
  304. 'proxyauth1',
  305. 'proxyauth2',
  306. 'resyncflags',
  307. 'resynclabels',
  308. 'search',
  309. 'search1',
  310. 'search2',
  311. 'sep1',
  312. 'sep2',
  313. 'showpasswords',
  314. 'skipemptyfolders',
  315. 'ssl2',
  316. 'sslargs1',
  317. 'sslargs2',
  318. 'subfolder1',
  319. 'subscribe',
  320. 'subscribed',
  321. 'syncacls',
  322. 'syncduplicates',
  323. 'syncinternaldates',
  324. 'synclabels',
  325. 'tests',
  326. 'testslive',
  327. 'testslive6',
  328. 'tls2',
  329. 'truncmess',
  330. 'usecache',
  331. 'useheader',
  332. 'useuid'
  333. ),
  334. 'blacklist' => array(
  335. 'skipmess',
  336. 'delete2foldersonly',
  337. 'delete2foldersbutnot',
  338. 'regexflag',
  339. 'regexmess',
  340. 'pipemess',
  341. 'regextrans2',
  342. 'maxlinelengthcmd'
  343. )
  344. );