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