summaryrefslogtreecommitdiffstats
path: root/doc/wiki/Plugins.LastLogin.txt
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:51:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:51:24 +0000
commitf7548d6d28c313cf80e6f3ef89aed16a19815df1 (patch)
treea3f6f2a3f247293bee59ecd28e8cd8ceb6ca064a /doc/wiki/Plugins.LastLogin.txt
parentInitial commit. (diff)
downloaddovecot-upstream.tar.xz
dovecot-upstream.zip
Adding upstream version 1:2.3.19.1+dfsg1.upstream/1%2.3.19.1+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--doc/wiki/Plugins.LastLogin.txt54
1 files changed, 54 insertions, 0 deletions
diff --git a/doc/wiki/Plugins.LastLogin.txt b/doc/wiki/Plugins.LastLogin.txt
new file mode 100644
index 0000000..65ae6a8
--- /dev/null
+++ b/doc/wiki/Plugins.LastLogin.txt
@@ -0,0 +1,54 @@
+Last Login Plugin
+=================
+
+Requires v2.2.14+. This plugin can be used to easily update user's last-login
+timestamp in the configured <dictionary> [Dictionary.txt]. Configuration:
+
+---%<-------------------------------------------------------------------------
+protocol imap {
+ mail_plugins = $mail_plugins last_login
+}
+protocol pop3 {
+ mail_plugins = $mail_plugins last_login
+}
+
+plugin {
+ last_login_dict = redis:host=127.0.0.1:port=6379
+ #last_login_key = last-login/%u # default
+}
+---%<-------------------------------------------------------------------------
+
+Note that we enable last_login plugin explicitly only for imap & pop3
+protocols. If enabled globally, it'll also update the timestamp whenever new
+mails are delivered via lda/lmtp or when doveadm is run for the user. This can
+also be thought of as a feature, so if you want to update a different timestamp
+for user when new mails are delivered, you can do that by enabling the
+last_login plugin also for lda/lmtp and changing the last_login_key setting.
+
+Example dict config with schema
+
+---%<-------------------------------------------------------------------------
+CREATE TABLE `users` (
+ `userid` varchar(255) NOT NULL,
+
+...
+
+ `last_login` int(11) DEFAULT NULL,
+ PRIMARY KEY (`userid`)
+)
+---%<-------------------------------------------------------------------------
+
+---%<-------------------------------------------------------------------------
+map {
+ pattern = shared/last-login/$user
+ table = users
+ value_field = last_login
+ value_type = uint
+
+ fields {
+ userid = $user
+ }
+}
+---%<-------------------------------------------------------------------------
+
+(This file was created from the wiki on 2019-06-19 12:42)