start dovecot config; generate postfix transport_map; support multiple sender IPs...
[ansible.git] / roles / email / templates / dovecot / quota-warning.sh
diff --git a/roles/email/templates/dovecot/quota-warning.sh b/roles/email/templates/dovecot/quota-warning.sh
new file mode 100644 (file)
index 0000000..00c09f8
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+set -e
+
+PERCENT=$1
+FROM="{{postfix.dovecot.postmaster}}"
+
+msg="From: $FROM
+To: $USER
+CC: $FROM
+Subject: Dein Posteingang ist $PERCENT% voll / Your mailbox is $PERCENT% full
+Content-Type: text/plain; charset=UTF-8
+
+Dein Posteingang ist zu $PERCENT% voll. Bitte räume etwas auf!
+
+Your mailbox is now $PERCENT% full. Please clean it up a bit!"
+
+echo -e "$msg" | /usr/sbin/sendmail -f "$FROM" "$USER" "$FROM"
+
+exit 0