summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md33
1 files changed, 24 insertions, 9 deletions
diff --git a/README.md b/README.md
index 1b31200..872fa20 100644
--- a/README.md
+++ b/README.md
@@ -5,31 +5,46 @@ SESSION STORAGE
---------------
This is a quick guide on how to set up the session storage.
-Your options are:
+Your options are Redis/Valkey, MySQL/MariaDB or SQLite.
+They must be reachable by localhost or writable by the current user.
+
+This is an example configuration:
+
+ [JWEBMAIL.READ_MAILS]
+ SESSION_TYPE = 'REDIS'
+ SESSION_STORE_PASSWD = '$PASSWORD'
+
+Make sure the config file can only be read by user/group `jwebmail` when you specify a password.
+
+### SQLite
+
+1. Make sure the db is created at a location where the jwebmail user has
+ read and write permissions. Use the SESSION_STORE_DB_NAME value to set
+ the path.
### Redis
1. Create a user 'jwebmail'
+2. Grant privileges for that user to 'jwm:user:*' for the commands setex and getex.
-That's it.
+ ACL SETUSER jwebmail ~jwm:user:* -@all +setex +getex >$PASSWORD
### MySQL / MariaDB
1. Create a user 'jwebmail' with a password
- CREATE USER jwebmail@localhost IDENTIFIED BY '$PASSWORD';
+ CREATE USER jwebmail@localhost IDENTIFIED BY '$PASSWORD';
2. Create a database 'jwebmaildb1'
- CREATE DATABASE jwebmaildb1;
- USE jwebmaildb1;
+ CREATE DATABASE jwebmaildb1;
+ USE jwebmaildb1;
3. Create a table 'session' with the following schema
- CREATE TABLE session (user char(64) PRIMARY KEY, password varchar(255), timeout timestamp NOT NULL);
- CREATE INDEX timeout_idx ON session (timeout); -- Optional
+ CREATE TABLE session (user char(64) PRIMARY KEY, password varchar(255), timeout timestamp NOT NULL);
+ CREATE INDEX timeout_idx ON session (timeout); -- Optional
4. Grant privileges to the user jwebmail for the above table for at least SELECT, INSERT, UPDATE and DELETE
- GRANT SELECT, INSERT, UPDATE, DELETE PRIVILEGES ON 'jwebmaildb1'.'session' TO 'jwebmail'@'localhost';
-
+ GRANT SELECT, INSERT, UPDATE, DELETE PRIVILEGES ON 'jwebmaildb1'.'session' TO 'jwebmail'@'localhost';