Skip to content

Commit f7f2c96

Browse files
committed
dovecot: add tmpfs_index chatmail.ini parameter for storing index files in /dev/shm
1 parent dfcaf41 commit f7f2c96

4 files changed

Lines changed: 11 additions & 0 deletions

File tree

chatmaild/src/chatmaild/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def __init__(self, inipath, params):
5656
self.privacy_mail = params.get("privacy_mail")
5757
self.privacy_pdo = params.get("privacy_pdo")
5858
self.privacy_supervisor = params.get("privacy_supervisor")
59+
self.tmpfs_index = params.get("tmpfs_index", "false").lower() == "true"
5960

6061
# deprecated option
6162
mbdir = params.get("mailboxes_dir", f"/home/vmail/mail/{self.mail_domain}")

chatmaild/src/chatmaild/ini/chatmail.ini.f

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@
4848
# (space-separated, item may start with "@" to whitelist whole recipient domains)
4949
passthrough_recipients =
5050

51+
# store index files in tmpfs (good for disk size and I/O, bad for ram)
52+
tmpfs_index = false
53+
5154
# path to www directory - documented here: https://chatmail.at/doc/relay/getting_started.html#custom-web-pages
5255
#www_folder = www
5356

chatmaild/src/chatmaild/ini/override-testrun.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[params]
2+
3+
tmpfs_index = true
14

25
[privacy]
36

cmdeploy/src/cmdeploy/dovecot/dovecot.conf.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ userdb {
6868
##
6969

7070
# Mailboxes are stored in the "mail" directory of the vmail user home.
71+
{% if config.tmpfs_index %}
72+
mail_location = maildir:{{ config.mailboxes_dir }}/%u:INDEX=/dev/shm/%u
73+
{% else %}
7174
mail_location = maildir:{{ config.mailboxes_dir }}/%u
75+
{% endif %}
7276

7377
# index/cache files are not very useful for chatmail relay operations
7478
# but it's not clear how to disable them completely.

0 commit comments

Comments
 (0)