Jump to content
Froxlor Forum
  • 0

Dovecot / Quota Warn E-Mails


rickstinson

Question

Hallo,

so, nachdem ich aus der Dovecot Doku nicht schlau geworden bin, probiere ich es mal hier ?

Froxlor läuft bei uns mit Dovecot wunderbar, auch die Quotas funktionieren entsprechend (werden im Webmail/Thunderbird angezeigt, wenn Mailbox voll werden keine Mails mehr angenommen).
Passt. Was nicht funktioniert ist, dass ein User eine Warn E-Mail ab 80% bzw. 95% bekommt.

In /etc/dovecot/conf.d/90-quota.conf habe ich mal die Quotas festgelegt:

plugin {
  quota_warning = storage=95%% quota-warning 95 %u
  quota_warning2 = storage=80%% quota-warning 80 %u
}

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

Das oben genannte Shellscript funktioniert auch per manuellen aufruf, da bekommt der per Paramenter angegebene User eine Mail


Wenn ich richtig liege, müsste man jetzt noch das Quota Backend festlegen, und genau hier stehe ich an.
Dovecot holt sich die Quota ja aus der SQLDB von Froxlor, wie konfiguriere ich das nun richtig?

plugin {
  #quota = dirsize:User quota
  #quota = maildir:User quota
  #quota = dict:User quota::proxy::quota
  #quota = fs:User quota
}

 

Danke!!
Patrick

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Aus der Config:

Quote

# Quota limits are set using "quota_rule" parameters. To get per-user quota
# limits, you can set/override them by returning "quota_rule" extra field
# from userdb.

Zweiteres machen wir, siehe dovecot-sql.conf.ext:

user_query = "[...] CONCAT('*:storage=', quota,'M') AS quota_rule FROM mail_users WHERE (username = '%u' OR email = '%u')"

Also würde ich intuitiv mal auf folgendes tippen:

quota = maildir:User quota

 

Link to comment
Share on other sites

  • 0

Danke, hat so funktioniert!

Falls jemand noch Warnungsmails bei Quotaüberschreitung benötigt, hier mein Setup:

 vi /etc/dovecot/conf.d/90-quota.conf

plugin {  quota_warning = storage=95%% quota-warning 95 %u }

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

plugin {  quota = maildir:User quota }

Das eigentliche Mail wird über dieses Script versandt (chmod 755):

vi /usr/local/bin/quota-warning.sh

#!/bin/sh
PERCENT=$1
USER=$2
cat << EOF | /usr/lib/dovecot/dovecot-lda -d $USER -o "plugin/quota=maildir:User quota:noenforcing"
From: support@XXXXX
To: $USER
Date: `date +"%a, %d %b %Y %H:%M:%S %z"`
Subject: Ihr Postfach ist fast voll!
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

Ihr Postfach $USER ist aktuell zu $PERCENT% belegt.

Bitte archivieren oder entfernen Sie alte, nicht mehr benötige Nachrichten. Andernfalls
könnte es vorkommen, dass Sie keine neuen Nachrichten mehr empfangen können!
Bei Fragen stehen wir Ihnen unter XXXXX oder unter support@XXXX zur Verfuegung.
Ihr Hosting Team


EOF

 



 

 

 

 

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...