#!/bin/sh PERCENT=$1 USER=$2 DOMAIN=$(echo "$2" | awk -F@ '{print $2}') cat << EOF | /usr/lib/dovecot/dovecot-lda -d "$USER" -o "plugin/quota=maildir:User quota:noenforcing" From: postmaster@$DOMAIN Subject: Quota warning - $PERCENT% reached Your mailbox can only store a limited amount of emails. Currently it is $PERCENT% full. If you reach 100% then new emails cannot be stored. Thanks for your understanding. EOF