aboutsummaryrefslogtreecommitdiff
path: root/files/usr/local/libexec
diff options
context:
space:
mode:
authorCullum Smith <cullum@sacredheartsc.com>2024-10-04 21:59:59 -0400
committerCullum Smith <cullum@sacredheartsc.com>2024-10-04 21:59:59 -0400
commit1e088983f6a80b6fd47543d0b4989e9ddb3234d5 (patch)
tree16af4205d84c9194257887e5e54653f79e96f987 /files/usr/local/libexec
parenta1bddcb1de1053994fb445267ca5d1ffaecb0fb5 (diff)
downloadinfrastructure-1e088983f6a80b6fd47543d0b4989e9ddb3234d5.tar.gz
add imap stuff
Diffstat (limited to 'files/usr/local/libexec')
-rw-r--r--files/usr/local/libexec/dovecot/quota-warning.sh.imap_server20
-rw-r--r--files/usr/local/libexec/dovecot/sieve-pipe/report-ham.sh.imap_server7
-rw-r--r--files/usr/local/libexec/dovecot/sieve-pipe/report-spam.sh.imap_server7
3 files changed, 34 insertions, 0 deletions
diff --git a/files/usr/local/libexec/dovecot/quota-warning.sh.imap_server b/files/usr/local/libexec/dovecot/quota-warning.sh.imap_server
new file mode 100644
index 0000000..96419f5
--- /dev/null
+++ b/files/usr/local/libexec/dovecot/quota-warning.sh.imap_server
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -eu -o pipefail
+
+PERCENT=$1
+USER=$2
+FROM=$3
+
+cat << EOF | /usr/libexec/dovecot/dovecot-lda -d "$USER" -o "plugin/quota=count:User quota:noenforcing"
+From: ${FROM}
+Subject: Mailbox quota warning
+
+This is an automatically generated message.
+
+Your mailbox is now ${PERCENT}% full.
+
+When your mailbox exceeds its quota, you will no longer receive new mail.
+
+Please delete some messages to free up space.
+EOF
diff --git a/files/usr/local/libexec/dovecot/sieve-pipe/report-ham.sh.imap_server b/files/usr/local/libexec/dovecot/sieve-pipe/report-ham.sh.imap_server
new file mode 100644
index 0000000..e09674a
--- /dev/null
+++ b/files/usr/local/libexec/dovecot/sieve-pipe/report-ham.sh.imap_server
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+exec /usr/local/bin/rspamc \\
+ --connect="${rspamd_host}.${domain}" \\
+ --password="${rspamd_rw_password}" \\
+ --key="${rspamd_pubkey}" \\
+ learn_ham
diff --git a/files/usr/local/libexec/dovecot/sieve-pipe/report-spam.sh.imap_server b/files/usr/local/libexec/dovecot/sieve-pipe/report-spam.sh.imap_server
new file mode 100644
index 0000000..825113f
--- /dev/null
+++ b/files/usr/local/libexec/dovecot/sieve-pipe/report-spam.sh.imap_server
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+exec /usr/local/bin/rspamc \\
+ --connect="${rspamd_host}.${domain}" \\
+ --password="${rspamd_rw_password}" \\
+ --key="${rspamd_pubkey}" \\
+ learn_spam