diff --git a/chatmaild/src/chatmaild/config.py b/chatmaild/src/chatmaild/config.py index 38c955c8..38272244 100644 --- a/chatmaild/src/chatmaild/config.py +++ b/chatmaild/src/chatmaild/config.py @@ -56,6 +56,7 @@ class Config: self.privacy_mail = params.get("privacy_mail") self.privacy_pdo = params.get("privacy_pdo") self.privacy_supervisor = params.get("privacy_supervisor") + self.tmpfs_index = params.get("tmpfs_index", "false").lower() == "true" # deprecated option mbdir = params.get("mailboxes_dir", f"/home/vmail/mail/{self.mail_domain}") diff --git a/chatmaild/src/chatmaild/ini/chatmail.ini.f b/chatmaild/src/chatmaild/ini/chatmail.ini.f index 29d7baa9..a5236234 100644 --- a/chatmaild/src/chatmaild/ini/chatmail.ini.f +++ b/chatmaild/src/chatmaild/ini/chatmail.ini.f @@ -48,6 +48,9 @@ passthrough_senders = # (space-separated, item may start with "@" to whitelist whole recipient domains) passthrough_recipients = +# store index files in tmpfs (good for disk size and I/O, bad for ram) +tmpfs_index = false + # path to www directory - documented here: https://chatmail.at/doc/relay/getting_started.html#custom-web-pages #www_folder = www diff --git a/chatmaild/src/chatmaild/ini/override-testrun.ini b/chatmaild/src/chatmaild/ini/override-testrun.ini index af337173..ff3738d0 100644 --- a/chatmaild/src/chatmaild/ini/override-testrun.ini +++ b/chatmaild/src/chatmaild/ini/override-testrun.ini @@ -1,3 +1,6 @@ +[params] + +tmpfs_index = true [privacy] diff --git a/cmdeploy/src/cmdeploy/dovecot/dovecot.conf.j2 b/cmdeploy/src/cmdeploy/dovecot/dovecot.conf.j2 index 8ab2de56..bc15766d 100644 --- a/cmdeploy/src/cmdeploy/dovecot/dovecot.conf.j2 +++ b/cmdeploy/src/cmdeploy/dovecot/dovecot.conf.j2 @@ -68,7 +68,11 @@ userdb { ## # Mailboxes are stored in the "mail" directory of the vmail user home. +{% if config.tmpfs_index %} +mail_location = maildir:{{ config.mailboxes_dir }}/%u:INDEX=/dev/shm/%u +{% else %} mail_location = maildir:{{ config.mailboxes_dir }}/%u +{% endif %} # index/cache files are not very useful for chatmail relay operations # but it's not clear how to disable them completely.