2
0

vars.inc.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  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. 'uk' => 'Українська (Ukrainian)',
  96. 'zh' => '中文 (Chinese)'
  97. );
  98. // Change theme (default: lumen)
  99. // Needs to be one of those: cerulean, cosmo, cyborg, darkly, flatly, journal, lumen, paper, readable, sandstone,
  100. // simplex, slate, spacelab, superhero, united, yeti
  101. // See https://bootswatch.com/
  102. // WARNING: Only lumen is loaded locally. Enabling any other theme, will download external sources.
  103. $DEFAULT_THEME = 'lumen';
  104. // Show DKIM private keys - false by default
  105. $SHOW_DKIM_PRIV_KEYS = false;
  106. // mailcow Apps - buttons on login screen
  107. $MAILCOW_APPS = array(
  108. array(
  109. 'name' => 'Webmail',
  110. 'link' => '/SOGo/',
  111. )
  112. );
  113. // Rows until pagination begins
  114. $PAGINATION_SIZE = 20;
  115. // Default number of rows/lines to display (log table)
  116. $LOG_LINES = 1000;
  117. // Rows until pagination begins (log table)
  118. $LOG_PAGINATION_SIZE = 50;
  119. // Session lifetime in seconds
  120. $SESSION_LIFETIME = 10800;
  121. // Label for OTP devices
  122. $OTP_LABEL = "mailcow UI";
  123. // How long to wait (in s) for cURL Docker requests
  124. $DOCKER_TIMEOUT = 60;
  125. // Split DKIM key notation (bind format)
  126. $SPLIT_DKIM_255 = false;
  127. // OAuth2 settings
  128. $REFRESH_TOKEN_LIFETIME = 2678400;
  129. $ACCESS_TOKEN_LIFETIME = 86400;
  130. // Logout from mailcow after first OAuth2 session profile request
  131. $OAUTH2_FORGET_SESSION_AFTER_LOGIN = false;
  132. // Set a limit for mailbox and domain tagging
  133. $TAGGING_LIMIT = 25;
  134. // MAILBOX_DEFAULT_ATTRIBUTES define default attributes for new mailboxes
  135. // These settings will not change existing mailboxes
  136. // Force incoming TLS for new mailboxes by default
  137. $MAILBOX_DEFAULT_ATTRIBUTES['tls_enforce_in'] = false;
  138. // Force outgoing TLS for new mailboxes by default
  139. $MAILBOX_DEFAULT_ATTRIBUTES['tls_enforce_out'] = false;
  140. // Force password change on next login (only allows login to mailcow UI)
  141. $MAILBOX_DEFAULT_ATTRIBUTES['force_pw_update'] = false;
  142. // Enable SOGo access (set to false to disable access by default)
  143. $MAILBOX_DEFAULT_ATTRIBUTES['sogo_access'] = true;
  144. // Send notification when quarantine is not empty (never, hourly, daily, weekly)
  145. $MAILBOX_DEFAULT_ATTRIBUTES['quarantine_notification'] = 'hourly';
  146. // Mailbox has IMAP access by default
  147. $MAILBOX_DEFAULT_ATTRIBUTES['imap_access'] = true;
  148. // Mailbox has POP3 access by default
  149. $MAILBOX_DEFAULT_ATTRIBUTES['pop3_access'] = true;
  150. // Mailbox has SMTP access by default
  151. $MAILBOX_DEFAULT_ATTRIBUTES['smtp_access'] = true;
  152. // Mailbox has sieve access by default
  153. $MAILBOX_DEFAULT_ATTRIBUTES['sieve_access'] = true;
  154. // Mailbox receives notifications about...
  155. // "add_header" - mail that was put into the Junk folder
  156. // "reject" - mail that was rejected
  157. // "all" - mail that was rejected and put into the Junk folder
  158. $MAILBOX_DEFAULT_ATTRIBUTES['quarantine_category'] = 'reject';
  159. // Default mailbox format, should not be changed unless you know exactly, what you do, keep the trailing ":"
  160. // Check dovecot.conf for further changes (e.g. shared namespace)
  161. $MAILBOX_DEFAULT_ATTRIBUTES['mailbox_format'] = 'maildir:';
  162. // Show last IMAP and POP3 logins
  163. $SHOW_LAST_LOGIN = true;
  164. // UV flag handling in FIDO2/WebAuthn - defaults to false to allow iOS logins
  165. // true = required
  166. // false = preferred
  167. // string 'required' 'preferred' 'discouraged'
  168. $WEBAUTHN_UV_FLAG_REGISTER = false;
  169. $WEBAUTHN_UV_FLAG_LOGIN = false;
  170. $WEBAUTHN_USER_PRESENT_FLAG = true;
  171. $FIDO2_UV_FLAG_REGISTER = 'preferred';
  172. $FIDO2_UV_FLAG_LOGIN = 'preferred'; // iOS ignores the key via NFC if required - known issue
  173. $FIDO2_USER_PRESENT_FLAG = true;
  174. $FIDO2_FORMATS = array('apple', 'android-key', 'android-safetynet', 'fido-u2f', 'none', 'packed', 'tpm');
  175. // Set visible Rspamd maps in mailcow UI, do not change unless you know what you are doing
  176. $RSPAMD_MAPS = array(
  177. 'regex' => array(
  178. 'Header-From: Blacklist' => 'global_mime_from_blacklist.map',
  179. 'Header-From: Whitelist' => 'global_mime_from_whitelist.map',
  180. 'Envelope Sender Blacklist' => 'global_smtp_from_blacklist.map',
  181. 'Envelope Sender Whitelist' => 'global_smtp_from_whitelist.map',
  182. 'Recipient Blacklist' => 'global_rcpt_blacklist.map',
  183. 'Recipient Whitelist' => 'global_rcpt_whitelist.map',
  184. 'Fishy TLDS (only fired in combination with bad words)' => 'fishy_tlds.map',
  185. 'Bad Words (only fired in combination with fishy TLDs)' => 'bad_words.map',
  186. 'Bad Words DE (only fired in combination with fishy TLDs)' => 'bad_words_de.map',
  187. 'Bad Languages' => 'bad_languages.map',
  188. 'Bulk Mail Headers' => 'bulk_header.map',
  189. 'Bad (Junk) Mail Headers' => 'bad_header.map',
  190. 'Monitoring Hosts' => 'monitoring_nolog.map'
  191. )
  192. );
  193. $IMAPSYNC_OPTIONS = array(
  194. 'whitelist' => array(
  195. 'authmech1',
  196. 'authmech2',
  197. 'authuser1',
  198. 'authuser2',
  199. 'debugcontent',
  200. 'disarmreadreceipts',
  201. 'logdir',
  202. 'debugcrossduplicates',
  203. 'maxsize',
  204. 'minsize',
  205. 'minage',
  206. 'search',
  207. 'noabletosearch',
  208. 'pidfile',
  209. 'pidfilelocking',
  210. 'search1',
  211. 'search2',
  212. 'sslargs1',
  213. 'sslargs2',
  214. 'syncduplicates',
  215. 'usecache',
  216. 'synclabels',
  217. 'truncmess',
  218. 'domino2',
  219. 'expunge1',
  220. 'filterbuggyflags',
  221. 'justconnect',
  222. 'justfolders',
  223. 'maxlinelength',
  224. 'useheader',
  225. 'noabletosearch1',
  226. 'nolog',
  227. 'prefix1',
  228. 'prefix2',
  229. 'sep1',
  230. 'sep2',
  231. 'nofoldersizesatend',
  232. 'justfoldersizes',
  233. 'proxyauth1',
  234. 'skipemptyfolders',
  235. 'include',
  236. 'subfolder1',
  237. 'subscribed',
  238. 'subscribe',
  239. 'debug',
  240. 'debugimap2',
  241. 'domino1',
  242. 'exchange1',
  243. 'exchange2',
  244. 'justlogin',
  245. 'keepalive1',
  246. 'keepalive2',
  247. 'noabletosearch2',
  248. 'noexpunge2',
  249. 'noresyncflags',
  250. 'nossl1',
  251. 'nouidexpunge2',
  252. 'syncinternaldates',
  253. 'idatefromheader',
  254. 'useuid',
  255. 'debugflags',
  256. 'debugimap',
  257. 'delete1emptyfolders',
  258. 'delete2folders',
  259. 'gmail2',
  260. 'office1',
  261. 'testslive6',
  262. 'debugimap1',
  263. 'errorsmax',
  264. 'tests',
  265. 'gmail1',
  266. 'maxmessagespersecond',
  267. 'maxbytesafter',
  268. 'maxsleep',
  269. 'abort',
  270. 'resyncflags',
  271. 'resynclabels',
  272. 'syncacls',
  273. 'nosyncacls',
  274. 'nousecache',
  275. 'office2',
  276. 'testslive',
  277. 'debugmemory',
  278. 'exitwhenover',
  279. 'noid',
  280. 'noexpunge1',
  281. 'authmd51',
  282. 'logfile',
  283. 'proxyauth2',
  284. 'domain1',
  285. 'domain2',
  286. 'oauthaccesstoken1',
  287. 'oauthaccesstoken2',
  288. 'oauthdirect1',
  289. 'oauthdirect2',
  290. 'folder',
  291. 'folderrec',
  292. 'folderfirst',
  293. 'folderlast',
  294. 'nomixfolders',
  295. 'authmd52',
  296. 'debugfolders',
  297. 'nossl2',
  298. 'ssl2',
  299. 'tls2',
  300. 'notls2',
  301. 'debugssl',
  302. 'notls1',
  303. 'inet4',
  304. 'inet6',
  305. 'log',
  306. 'showpasswords'
  307. ),
  308. 'blacklist' => array(
  309. 'skipmess',
  310. 'delete2foldersonly',
  311. 'delete2foldersbutnot',
  312. 'regexflag',
  313. 'regexmess',
  314. 'pipemess',
  315. 'regextrans2',
  316. 'maxlinelengthcmd'
  317. )
  318. );