From 1315e02cbacbec9049ec64b9bfc65a028ccc0202 Mon Sep 17 00:00:00 2001 From: "github@kiekerjan.isdronken.nl" Date: Mon, 19 Jul 2021 21:41:50 +0200 Subject: [PATCH] mail homes and correct use of STORAGE PATH --- setup/dovecot-fts-xapian.sh | 6 +++--- setup/mail-dovecot.sh | 2 ++ setup/mail-users.sh | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/setup/dovecot-fts-xapian.sh b/setup/dovecot-fts-xapian.sh index 4ba84096..e985bf8d 100755 --- a/setup/dovecot-fts-xapian.sh +++ b/setup/dovecot-fts-xapian.sh @@ -25,7 +25,7 @@ apt_install libxapian30 # the IMAP specification expects. tools/editconf.py /etc/dovecot/conf.d/10-mail.conf \ mail_plugins="fts fts_xapian" \ - mail_home="/home/user-data/mail/homes/%d/%n" + mail_home="$STORAGE_ROOT/mail/homes/%d/%n" # Install cronjobs to keep FTS up to date. hide_output install -m 755 conf/cron/miab_dovecot /etc/cron.daily/ @@ -74,9 +74,9 @@ restart_service dovecot # Per doveadm-fts manpage: Scan what mails exist in the full text search index # and compare those to what actually exist in mailboxes. -# This removes mails from the index that have already been expunged and makes +# This removes mails from the index that have already been expunged and makes # sure that the next doveadm index will index all the missing mails (if any). -# doveadm fts rescan -A +doveadm fts rescan -A # Adds unindexed files to the fts database # * `-q`: Queues the indexing to be run by indexer process. (will background the indexing) diff --git a/setup/mail-dovecot.sh b/setup/mail-dovecot.sh index 26d32895..b50e28d5 100755 --- a/setup/mail-dovecot.sh +++ b/setup/mail-dovecot.sh @@ -201,7 +201,9 @@ chmod -R o-rwx /etc/dovecot # Ensure mailbox files have a directory that exists and are owned by the mail user. mkdir -p $STORAGE_ROOT/mail/mailboxes +mkdir -p $STORAGE_ROOT/mail/homes chown -R mail.mail $STORAGE_ROOT/mail/mailboxes +chown -R mail.mail $STORAGE_ROOT/mail/homes # Same for the sieve scripts. mkdir -p $STORAGE_ROOT/mail/sieve diff --git a/setup/mail-users.sh b/setup/mail-users.sh index 48b3ef32..2d051afb 100755 --- a/setup/mail-users.sh +++ b/setup/mail-users.sh @@ -50,7 +50,7 @@ driver = sqlite connect = $db_path default_pass_scheme = SHA512-CRYPT password_query = SELECT email as user, password FROM users WHERE email='%u'; -user_query = SELECT email AS user, "mail" as uid, "mail" as gid, "$STORAGE_ROOT/mail/mailboxes/%d/%n" as home FROM users WHERE email='%u'; +user_query = SELECT email AS user, "mail" as uid, "mail" as gid, "$STORAGE_ROOT/mail/homes/%d/%n" as home FROM users WHERE email='%u'; iterate_query = SELECT email AS user FROM users; EOF chmod 0600 /etc/dovecot/dovecot-sql.conf.ext # per Dovecot instructions