@@ -110,21 +110,16 @@ EOF
110
110
111
111
echo -n ${ACL_ANYONE} > /etc/dovecot/acl_anyone
112
112
113
- if [[ " ${FLATCURVE_EXPERIMENTAL} " =~ ^([yY][eE][sS]| [yY]) ]]; then
114
- echo -e " \e[33mActivating Flatcurve as FTS Backend...\e[0m"
115
- echo -e " \e[33mDepending on your previous setup a full reindex might be needed... \e[0m"
116
- echo -e " \e[34mVisit https://docs.mailcow.email/manual-guides/Dovecot/u_e-dovecot-fts/#fts-related-dovecot-commands to learn how to reindex\e[0m"
117
- echo -n ' quota acl zlib mail_crypt mail_crypt_acl mail_log notify fts fts_flatcurve listescape replication lazy_expunge' > /etc/dovecot/mail_plugins
118
- echo -n ' quota imap_quota imap_acl acl zlib imap_zlib imap_sieve mail_crypt mail_crypt_acl notify mail_log fts fts_flatcurve listescape replication' > /etc/dovecot/mail_plugins_imap
119
- echo -n ' quota sieve acl zlib mail_crypt mail_crypt_acl fts fts_flatcurve notify listescape replication' > /etc/dovecot/mail_plugins_lmtp
120
- elif [[ " ${SKIP_SOLR} " =~ ^([yY][eE][sS]| [yY])+$ ]]; then
113
+ if [[ " ${SKIP_FTS} " =~ ^([yY][eE][sS]| [yY])+$ ]]; then
114
+ echo -e " \e[33mDetecting SKIP_FTS=y... not enabling Flatcurve (FTS) then...\e[0m"
121
115
echo -n ' quota acl zlib mail_crypt mail_crypt_acl mail_log notify listescape replication lazy_expunge' > /etc/dovecot/mail_plugins
122
116
echo -n ' quota imap_quota imap_acl acl zlib imap_zlib imap_sieve mail_crypt mail_crypt_acl notify listescape replication mail_log' > /etc/dovecot/mail_plugins_imap
123
117
echo -n ' quota sieve acl zlib mail_crypt mail_crypt_acl notify listescape replication' > /etc/dovecot/mail_plugins_lmtp
124
118
else
125
- echo -n ' quota acl zlib mail_crypt mail_crypt_acl mail_log notify fts fts_solr listescape replication lazy_expunge' > /etc/dovecot/mail_plugins
126
- echo -n ' quota imap_quota imap_acl acl zlib imap_zlib imap_sieve mail_crypt mail_crypt_acl notify mail_log fts fts_solr listescape replication' > /etc/dovecot/mail_plugins_imap
127
- echo -n ' quota sieve acl zlib mail_crypt mail_crypt_acl fts fts_solr notify listescape replication' > /etc/dovecot/mail_plugins_lmtp
119
+ echo -e " \e[32mDetecting SKIP_FTS=n... enabling Flatcurve (FTS)\e[0m"
120
+ echo -n ' quota acl zlib mail_crypt mail_crypt_acl mail_log notify fts fts_flatcurve listescape replication lazy_expunge' > /etc/dovecot/mail_plugins
121
+ echo -n ' quota imap_quota imap_acl acl zlib imap_zlib imap_sieve mail_crypt mail_crypt_acl notify mail_log fts fts_flatcurve listescape replication' > /etc/dovecot/mail_plugins_imap
122
+ echo -n ' quota sieve acl zlib mail_crypt mail_crypt_acl fts fts_flatcurve notify listescape replication' > /etc/dovecot/mail_plugins_lmtp
128
123
fi
129
124
chmod 644 /etc/dovecot/mail_plugins /etc/dovecot/mail_plugins_imap /etc/dovecot/mail_plugins_lmtp /templates/quarantine.tpl
130
125
@@ -247,51 +242,6 @@ function script_deinit()
247
242
end
248
243
EOF
249
244
250
- # Temporarily set FTS depending on user choice inside mailcow.conf. Will be removed as soon as Solr is dropped
251
- if [[ " ${FLATCURVE_EXPERIMENTAL} " =~ ^([yY][eE][sS]| [yY])$ ]]; then
252
- cat << EOF > /etc/dovecot/conf.d/fts.conf
253
- # Autogenerated by mailcow
254
- plugin {
255
- fts_autoindex = yes
256
- fts_autoindex_exclude = \Junk
257
- fts_autoindex_exclude2 = \Trash
258
- fts = flatcurve
259
-
260
- # Maximum term length can be set via the 'maxlen' argument (maxlen is
261
- # specified in bytes, not number of UTF-8 characters)
262
- fts_tokenizer_email_address = maxlen=100
263
- fts_tokenizer_generic = algorithm=simple maxlen=30
264
-
265
- # These are not flatcurve settings, but required for Dovecot FTS. See
266
- # Dovecot FTS Configuration link above for further information.
267
- fts_languages = en es de
268
- fts_tokenizers = generic email-address
269
-
270
- # OPTIONAL: Recommended default FTS core configuration
271
- fts_filters = normalizer-icu snowball stopwords
272
- fts_filters_en = lowercase snowball english-possessive stopwords
273
- }
274
- EOF
275
- elif [[ ! " ${SKIP_SOLR} " =~ ^([yY][eE][sS]| [yY])$ ]]; then
276
- cat << EOF > /etc/dovecot/conf.d/fts.conf
277
- # Autogenerated by mailcow
278
- plugin {
279
- fts = solr
280
- fts_autoindex = yes
281
- fts_autoindex_exclude = \Junk
282
- fts_autoindex_exclude2 = \Trash
283
- fts_solr = url=http://solr:8983/solr/dovecot-fts/
284
-
285
- fts_tokenizers = generic email-address
286
- fts_tokenizer_generic = algorithm=simple
287
-
288
- fts_filters = normalizer-icu snowball stopwords
289
- fts_filters_en = lowercase snowball english-possessive stopwords
290
- }
291
- EOF
292
- fi
293
-
294
-
295
245
# Replace patterns in app-passdb.lua
296
246
sed -i " s/__DBUSER__/${DBUSER} /g" /etc/dovecot/lua/passwd-verify.lua
297
247
sed -i " s/__DBPASS__/${DBPASS} /g" /etc/dovecot/lua/passwd-verify.lua
@@ -398,6 +348,15 @@ mail_replica = tcp:${MAILCOW_REPLICA_IP}:${DOVEADM_REPLICA_PORT}
398
348
EOF
399
349
fi
400
350
351
+ # Setting variables for indexer-worker inside fts.conf automatically according to mailcow.conf settings
352
+ if [[ " ${SKIP_FTS} " =~ ^([nN][oO]| [nN])+$ ]]; then
353
+ echo -e " \e[94mConfiguring FTS Settings...\e[0m"
354
+ echo -e " \e[94mSetting FTS Memory Limit (per process) to ${FTS_HEAP} MB\e[0m"
355
+ sed -i " s/vsz_limit\s*=\s*[0-9]*\s*MB*/vsz_limit=${FTS_HEAP} MB/" /etc/dovecot/conf.d/fts.conf
356
+ echo -e " \e[94mSetting FTS Process Limit to ${FTS_PROCS} \e[0m"
357
+ sed -i " s/process_limit\s*=\s*[0-9]*/process_limit=${FTS_PROCS} /" /etc/dovecot/conf.d/fts.conf
358
+ fi
359
+
401
360
# 401 is user dovecot
402
361
if [[ ! -s /mail_crypt/ecprivkey.pem || ! -s /mail_crypt/ecpubkey.pem ]]; then
403
362
openssl ecparam -name prime256v1 -genkey | openssl pkey -out /mail_crypt/ecprivkey.pem
0 commit comments