Author Topic: enable mail quota and config mail quota limited in 2GB size for each user  (Read 9143 times)

Offline edwardleung

  • Jr. Member
  • **
  • Posts: 10
Hello,

The system is Centos7.3 ( smtp postfix and dovecot imap ) + roundcube 1.2.3.
How to enable mail quota and config mail quota limited in 2GB size for each user

Thanks !

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Re: enable mail quota and config mail quota limited in 2GB size for each user
« Reply #1 on: February 04, 2017, 05:01:26 AM »
You can find information on how to setup quotas in Dovecot in the Dovecot documentation here https://wiki2.dovecot.org/Quota
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline edwardleung

  • Jr. Member
  • **
  • Posts: 10
Re: enable mail quota and config mail quota limited in 2GB size for each user
« Reply #2 on: February 04, 2017, 05:47:24 AM »
Also config or enable in postfix and roundcube ?

Thanks !

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Re: enable mail quota and config mail quota limited in 2GB size for each user
« Reply #3 on: February 04, 2017, 10:09:57 AM »
Roundcube will read the quota information from Dovecot
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline edwardleung

  • Jr. Member
  • **
  • Posts: 10
Re: enable mail quota and config mail quota limited in 2GB size for each user
« Reply #4 on: February 04, 2017, 10:47:20 AM »
Hello,

in dovecont/conf.d/90-quota.conf:

plugin {
  quota = fs:User quota
  quota_rule = *:storage=1M
  quota_exceeded_message = Quota exceeded
}

in dovecont/conf.d/20-imap.conf:

protocol imap {
 mail_plugins = $mail_plugins imap_quota
}

in dovecont/conf.d/10-mail.conf:

mail_plugins = $mail_plugins quota

I tried to send mail within 3MB attachment, BUT there is no nay warning message display ?
would you mind to help ?

Thanks !

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Re: enable mail quota and config mail quota limited in 2GB size for each user
« Reply #5 on: February 04, 2017, 01:30:53 PM »
Well sending email is SMTP not IMAP. So that's different. Was the message successfully saved in you sent folder?

Do you see quota information displayed on the main mail screen of Roundcube?
Quote
Quota display

If your mailbox is limited by a maximum size, the quota display located in the footer of the folder list indicates the current usage of the available disk space. Move the mouse pointer over the percentage display to see the real numbers of your quota usage.

If you don't see any quota information displayed in Roundcube - you could also double check by enabling imap_debug in roundcube and checking the response from the server. Then quotas are not setup properly in Dovecot. I suggest you ask the Dovecot community for help with that.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline edwardleung

  • Jr. Member
  • **
  • Posts: 10
Re: enable mail quota and config mail quota limited in 2GB size for each user
« Reply #6 on: February 05, 2017, 02:07:12 AM »
Hello,

Yes, the message successfully saved in sent folder, but no quota information displayed on the main mail screen of Roundcube...

After enabling imap_debug in roundcube :

[05-Feb-2017 15:01:09 +0800]: <ae741tce> [DDFF] S: )
[05-Feb-2017 15:01:09 +0800]: <ae741tce> [DDFF] S: A0007 OK Fetch completed.
[05-Feb-2017 15:01:09 +0800]: <ae741tce> [7283] S: A0002 OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS SPECIAL-USE BINARY MOVE QUOTA] Logged in
[05-Feb-2017 15:01:09 +0800]: <ae741tce> [7283] C: A0003 LIST (SUBSCRIBED) "" "*"
[05-Feb-2017 15:01:09 +0800]: <ae741tce> [7283] S: * LIST (\Subscribed \NoInferiors \Marked) "/" Sent
[05-Feb-2017 15:01:09 +0800]: <ae741tce> [7283] S: A0003 OK List completed.
[05-Feb-2017 15:01:09 +0800]: <ae741tce> [7283] C: A0004 STATUS INBOX (MESSAGES UNSEEN)
[05-Feb-2017 15:01:09 +0800]: <ae741tce> [7283] S: * STATUS INBOX (MESSAGES 11 UNSEEN 0)
[05-Feb-2017 15:01:09 +0800]: <ae741tce> [7283] S: A0004 OK Status completed.
[05-Feb-2017 15:01:09 +0800]: <ae741tce> [7283] C: A0005 STATUS Sent (MESSAGES UNSEEN)
[05-Feb-2017 15:01:09 +0800]: <ae741tce> [7283] S: * STATUS Sent (MESSAGES 8 UNSEEN 0)
[05-Feb-2017 15:01:09 +0800]: <ae741tce> [7283] S: A0005 OK Status completed.
[05-Feb-2017 15:01:09 +0800]: <ae741tce> [DDFF] C: A0008 GETQUOTAROOT INBOX
[05-Feb-2017 15:01:09 +0800]: <ae741tce> [DDFF] S: A0008 OK No quota.
[05-Feb-2017 15:01:09 +0800]: <ae741tce> [7283] C: A0006 LOGOUT
[05-Feb-2017 15:01:09 +0800]: <ae741tce> [7283] S: * BYE Logging out
[05-Feb-2017 15:01:09 +0800]: <ae741tce> [7283] S: A0006 OK Logout completed.
[05-Feb-2017 15:01:09 +0800]: <ae741tce> [DDFF] C: A0009 LOGOUT
[05-Feb-2017 15:01:09 +0800]: <ae741tce> [DDFF] S: * BYE Logging out
[05-Feb-2017 15:01:09 +0800]: <ae741tce> [DDFF] S: A0009 OK Logout completed.

Why it still no quota ?

config quota limit 1MB, BUT send test mail within attachment is over 3MB...

Any more help ?

Thanks !

Offline edwardleung

  • Jr. Member
  • **
  • Posts: 10
Re: enable mail quota and config mail quota limited in 2GB size for each user
« Reply #7 on: February 05, 2017, 03:13:19 AM »
Hello,

I just tried to edit :

quota = dirsize:User quota

Now, it seem ok now...

Thanks !

Offline rm13

  • Full Member
  • ***
  • Posts: 129
Re: enable mail quota and config mail quota limited in 2GB size for each user
« Reply #8 on: February 07, 2017, 12:02:47 PM »
You may want to revisit the Dovecot documentation.
https://wiki2.dovecot.org/Quota

That dirsize backend is not well recommended, especially if you're using Maildir to store the email.

Offline edwardleung

  • Jr. Member
  • **
  • Posts: 10
Re: enable mail quota and config mail quota limited in 2GB size for each user
« Reply #9 on: February 08, 2017, 05:11:32 AM »
Hello,

If the linux system is Centos 7.3...
which backend is good for working with ?

in my /etc/dovecot/conf.d/10-mail.conf:
mail_location = mbox:~/mail:INBOX=/var/mail/%u

how to config ? any post share in here ?

Thanks !

Offline rm13

  • Full Member
  • ***
  • Posts: 129
Re: enable mail quota and config mail quota limited in 2GB size for each user
« Reply #10 on: February 08, 2017, 05:59:25 PM »
Hello,

If the linux system is Centos 7.3...
which backend is good for working with ?


Well, if you're using mbox then what I said doesn't really apply.

As for a quota backend, check the Dovecot documents :) What are you familiar with? How are you managing the email users? Maybe look for some email management package for Centos.

For instance I'm using a SQL database for the users and store the quota in SQL as well. I also had a need to specify different quotas for different users and the SQL web front end helped with that.

So I use the Dictionary SQL backend for quotas much the way it is outlined on the wiki https://wiki2.dovecot.org/Quota/Dict But my choices may not apply to you. You could also use the dictionary with simple text files.

Quote
in my /etc/dovecot/conf.d/10-mail.conf:
mail_location = mbox:~/mail:INBOX=/var/mail/%u

how to config ? any post share in here ?

Thanks !

mbox is not the best way to setup a new mail server. Maildir is the simplest and most documented approach.

You might look for the Dovecot book by Peer Heinlein.

Most of this is really straying away from Roundcube.