1

Topic: Email alert to admin When users mailbox quota exceeds the limit.

==== Provide required information ====
- iRedMail version and backend (LDAP/MySQL/PGSQL):
- Linux/BSD distribution name and version:
- Any related log? Log is helpful for troubleshooting.
====

Hi Zhang,
How to get Email alert to admin and users when users mailbox quota exceeds the limit for dovecot ldap backend.

please advise.

Regards,
PineMail11

2

Re: Email alert to admin When users mailbox quota exceeds the limit.

iRedMail enables Dovecot plugin and service "quota_warning" by default, you can find settings in dovecot.conf like below:

plugins {
    ...
    # Quota warning.                                                               
    # If user suddenly receives a huge mail and the quota jumps from               
    # 85% to 95%, only the 95% script is executed.                                 
    quota_warning = storage=85%% quota-warning 85 %u                                                                          
    quota_warning2 = storage=90%% quota-warning 90 %u                              
    quota_warning3 = storage=95%% quota-warning 95 %u     
    ...
}

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

Please edit /usr/local/bin/dovecot-quota-warning.sh, insert a BCC header above "Subject:" line like below:

From: no-reply@demo.iredmail.org
BCC: postmaster@your_domain.com
Subject: Mailbox Quota Warning: ${PERCENT}% Full.

Your mailbox is now ${PERCENT}% full, please clean up some mails for
further incoming mails.

Let me know whether it works for you or not. If it doesn't work, you can also add similar command in dovecot-quota-warning.sh to send an email to admin.

3

Re: Email alert to admin When users mailbox quota exceeds the limit.

Hi Zhang,

I have set BCC to admin@mydomain.com in dovecot-quota-warning.sh file.

Only perticular user is getting email alert not to admin@mydomain.com.

Kindly advise me how it can be achieved.

Thanks & regards,

PineMail11


ZhangHuangbin wrote:

iRedMail enables Dovecot plugin and service "quota_warning" by default, you can find settings in dovecot.conf like below:

plugins {
    ...
    # Quota warning.                                                               
    # If user suddenly receives a huge mail and the quota jumps from               
    # 85% to 95%, only the 95% script is executed.                                 
    quota_warning = storage=85%% quota-warning 85 %u                                                                          
    quota_warning2 = storage=90%% quota-warning 90 %u                              
    quota_warning3 = storage=95%% quota-warning 95 %u     
    ...
}

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

Please edit /usr/local/bin/dovecot-quota-warning.sh, insert a BCC header above "Subject:" line like below:

From: no-reply@demo.iredmail.org
BCC: postmaster@your_domain.com
Subject: Mailbox Quota Warning: ${PERCENT}% Full.

Your mailbox is now ${PERCENT}% full, please clean up some mails for
further incoming mails.

Let me know whether it works for you or not. If it doesn't work, you can also add similar command in dovecot-quota-warning.sh to send an email to admin.

4

Re: Email alert to admin When users mailbox quota exceeds the limit.

Why not simply copy the code in the script to send to admin?

5

Re: Email alert to admin When users mailbox quota exceeds the limit.

i have the same problem with pro version.
If i lanch the script all works, so i suppose that the script is ok
What i've to do for work?

6

Re: Email alert to admin When users mailbox quota exceeds the limit.

cedbiella wrote:

i have the same problem with pro version.
If i lanch the script all works, so i suppose that the script is ok
What i've to do for work?


Still not function, any idea.

dovecot.conf is different, because i've dovecot 2.x installed

7

Re: Email alert to admin When users mailbox quota exceeds the limit.

this not working for me either, and without changes the script is not even sending warnings to the users, when is the script being executed?

8

Re: Email alert to admin When users mailbox quota exceeds the limit.

- Please paste output of command "dovecot -n", your script, and related dovecot/sieve log (/var/log/dovecot.log, /var/log/sieve.log) here to help troubleshoot.
- We set Dovecot to execute quota warning script when mailbox is 85%, 90% or 95% full. Check your dovecot config file please.