vars.inc.php 11 KB

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