summaryrefslogtreecommitdiff
path: root/files/expire
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2009-12-06 23:02:23 +0100
committermh <mh@immerda.ch>2009-12-06 23:02:23 +0100
commit0d1a1fdb690cd88496776f1571416e468a51ce71 (patch)
tree9aa1baa428492f67afcf4a02d018fc3d466f961e /files/expire
parentc2b7e2af0438975e8b8b4c8d2532c383a8125e3f (diff)
initial release of the new dovecot module
Diffstat (limited to 'files/expire')
-rwxr-xr-xfiles/expire/expire-tool.sh5
-rw-r--r--files/expire/expire.sqlite.sql13
2 files changed, 18 insertions, 0 deletions
diff --git a/files/expire/expire-tool.sh b/files/expire/expire-tool.sh
new file mode 100755
index 0000000..1089663
--- /dev/null
+++ b/files/expire/expire-tool.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+MAIL_PLUGINS=${MAIL_PLUGINS//imap_quota/}
+MAIL_PLUGINS=${MAIL_PLUGINS//mail_log/}
+
+exec ${0%.sh} "$@"
diff --git a/files/expire/expire.sqlite.sql b/files/expire/expire.sqlite.sql
new file mode 100644
index 0000000..4545689
--- /dev/null
+++ b/files/expire/expire.sqlite.sql
@@ -0,0 +1,13 @@
+CREATE TABLE expires (
+ username varchar(100) not null,
+ mailbox varchar(255) not null,
+ expire_stamp integer not null,
+ primary key (username, mailbox)
+);
+CREATE TRIGGER mergeexpires BEFORE INSERT ON expires FOR EACH ROW
+BEGIN
+ UPDATE expires SET expire_stamp=NEW.expire_stamp
+ WHERE username = NEW.username AND mailbox = NEW.mailbox;
+ SELECT raise(ignore)
+ WHERE (SELECT 1 FROM expires WHERE username = NEW.username AND mailbox = NEW.mailbox) IS NOT NULL;
+END;