Hi,

I'm sending warnings to accounts when their quota gets up to 80% and again on 
95%.

Relevant parts from "doveconf -n":

...
service quota-warning {
  executable = script /usr/local/bin/quota-warning.sh
  unix_listener quota-warning {
    user = mailstore
  }
  user = mailstore
}


plugin {
...
  quota = count:User quota
  quota_rule2 = Trash:storage=+100M
  quota_status_nouser = DUNNO
  quota_status_overquota = 552 5.2.2 Mailbox is full
  quota_status_success = DUNNO
  quota_vsizes = yes
  quota_warning = storage=95%% quota-warning 95 %u
  quota_warning2 = storage=80%% quota-warning 80 %u
...
}

Bash script:
...
#!/bin/sh
PERCENT=$1
USER=$2
DATE=`date`
MSGID_P1=`date '+%Y%m%d%H%M%S'`
MSGID_P2=`hostname`
MSGID=$MSGID_P1@$MSGID_P2
logger -p mail.info -t dovecot "$PERCENT% Quota-warning sent to $USER"
cat << EOF | /usr/lib/dovecot/dovecot-lda -d $USER -o "plugin/quota=count:User 
quota:noenforcing"
From: <postmas...@mydomain.com>
To: <$USER>
Subject: $PERCENT% Mail quota warning
Message-ID: <$MSGID>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Date: $DATE

Your text....
...


Best
Urban




Am 15.03.24 um 12:58 schrieb N V:
Hello!
I'm trying to allow a system email address to send notifications to over-quota
accounts.
Is there a way to do it?

Thanks inĀ advance!


_______________________________________________
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org
_______________________________________________
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org

Reply via email to