Results 1 to 20 of 20

Thread: Dovecot, RoundCube and Quota display?

  1. #1
    Join Date
    Sep 2007
    Posts
    20

    Dovecot, RoundCube and Quota display?

    I am at my wits end. I am looking to see if anyone can assist me. I am having diffuiculty trying to get roundcube to display individual quota in roundcube. I've edited /etc/dovecot.conf with the following:

    Code:
    protocol imap {
      mail_plugins = quota imap_quota
    }
    Once I restated Dovecot, the following below did appear at the bottom of RoundCube but it's wrong.

    Code:
    Disk usage: unlimited
    Am I trying to do something that can't be done? Or am I just missing a setting?

    Thanks in advance.

    Bryan

  2. #2
    Join Date
    Sep 2007
    Posts
    20
    So after a little more research I discovered that RoundCube is looking for a standard dovecot file in the Maildir root directory for each user called maildirsize.

    http://wiki.dovecot.org/Quota/Maildir

    I've also discovered that dovecot.conf needed one more section besides what I listed above for quotas to work:

    Code:
    plugin {
      quota = maildir
    }

    After I manually created the file, my quota display goes from unlimited to a graph size I arbitrarily entered into the file. So basically it works. It's exactly what my clients need and want.

    Now my questions are why isn't DA creating and updating the maildirsize file for each user? Along with that, why didn't DA added the quota plugin section in dovecot.conf?

    Lastly, how can I get DA to work with the maildirsize file?

  3. #3
    Back when we implemented dovecot, I don't believe the quota plugin for dovecot existed yet.

    As a workaround for now, you can use the post.sh scripts to manage this file for you.

    http://www.directadmin.com/features.php?id=298

    eg, for both files:
    /usr/local/directadmin/scripts/custom/email_create_post.sh
    /usr/local/directadmin/scripts/custom/email_change_pass_post.sh
    Code:
    #!/bin/sh
    if [ "$quota" != "" ] && [ "$username" != "" ]; then
        MDPATH=/home/$username/imap/$domain/$user/Maildir/maildirsize
        if [ "$quota" = "0" ]; then
            echo -n '' > $MDPATH
        else
            VALUE=`echo "$quota * 1024 * 1024" | bc`S
            echo $VALUE > $MDPATH
        fi
        chown -R $username:mail $MDPATH || error "chown"
        chmod 660 $MDPATH || error "chmod"
    fi
    John

  4. #4
    Join Date
    Sep 2007
    Posts
    20
    Thanks John!

    As I indicted in my email. This works great with the addition of two lines that are needed.

    Code:
    chown -R $username:mail $MDPATH || error "chown"
    chmod 660 $MDPATH || error "chmod"

  5. #5
    Join Date
    Apr 2008
    Posts
    7
    there's a way to create the maildirsize file for existing users?

  6. #6
    Join Date
    Oct 2003
    Location
    Switzerland
    Posts
    2,097
    Quote Originally Posted by tafaz View Post
    there's a way to create the maildirsize file for existing users?
    Yes, with a simple shell script that builds a list of all the accounts on the server and that writes that file in all the folders.
    Olivier
    interfaCentre - We design custom hosting solutions

    Custom apps, scripts and configurations for easy and secure access to all hosting services
    Full Personal Information Management suite with mobile synchronisation
    PHP, Ruby, Node.js and Python hosting with 1-click app install

  7. #7
    Join Date
    Apr 2008
    Posts
    7
    thank you ... but if i ask if there's a way to solve this, probably i don't know how to get the list of the accounts ....

  8. #8
    Join Date
    Oct 2003
    Location
    Switzerland
    Posts
    2,097
    A simple way to do find all the folders where you should put the quota file
    Code:
     # find /home/*/imap/*/* -name Maildir
    Olivier
    interfaCentre - We design custom hosting solutions

    Custom apps, scripts and configurations for easy and secure access to all hosting services
    Full Personal Information Management suite with mobile synchronisation
    PHP, Ruby, Node.js and Python hosting with 1-click app install

  9. #9
    Join Date
    Oct 2003
    Location
    Switzerland
    Posts
    2,097
    There are 2 problems with the maildirsize approach:
    1) Quotas are not regularely updated by Dovecot, so information contained in the file may be wrong until the next refresh
    2) Users can manipulate the file and thus get whatever quota they want.
    Olivier
    interfaCentre - We design custom hosting solutions

    Custom apps, scripts and configurations for easy and secure access to all hosting services
    Full Personal Information Management suite with mobile synchronisation
    PHP, Ruby, Node.js and Python hosting with 1-click app install

  10. #10
    Join Date
    Apr 2008
    Posts
    7
    users usually don't have shell access and ftp starts in the root of the domain htdocs, so file modifications are impossible
    i noticed instead the problem of dovecot refresh on quotas ... the question now is, are there other better ways to show quotas in roundcube?

  11. #11
    Join Date
    Oct 2003
    Location
    Switzerland
    Posts
    2,097
    Quote Originally Posted by tafaz View Post
    users usually don't have shell access and ftp starts in the root of the domain htdocs, so file modifications are impossible
    This statement is wrong with the DA version I'm using. My users end up in /home/username

    I have no idea about roundcube or any other webmail for that matter. There is a quota API provided by DA, but it sounds like it would introduce too much overhead for large folder operations.
    Olivier
    interfaCentre - We design custom hosting solutions

    Custom apps, scripts and configurations for easy and secure access to all hosting services
    Full Personal Information Management suite with mobile synchronisation
    PHP, Ruby, Node.js and Python hosting with 1-click app install

  12. #12
    Join Date
    Oct 2003
    Location
    Switzerland
    Posts
    2,097
    Solutions to my 2 previous problems:
    1) Use Dovecot as the LDA
    2) Run a cron that re-applies quotas every x hours
    Olivier
    interfaCentre - We design custom hosting solutions

    Custom apps, scripts and configurations for easy and secure access to all hosting services
    Full Personal Information Management suite with mobile synchronisation
    PHP, Ruby, Node.js and Python hosting with 1-click app install

  13. #13
    Join Date
    Feb 2007
    Posts
    37
    Any chance at making this a standard feature with Roundcube 0.4 now officially released?

    It's great to setup custom scripts and all, but this would be a feature that could potentially benefit all users.
    Matt, just your average guru.

  14. #14
    Join Date
    Jun 2004
    Location
    Raleigh, NC
    Posts
    22
    Is anyone using this in production? How well does it work?
    tranquil hosting - Managed Hosting in Raleigh, North Carolina

  15. #15
    Join Date
    Sep 2011
    Posts
    2

    maildir_use_size_file parameter

    Hi I'm new in the forum and this is my first post ...
    I've try your solution but the maildir file is not updated and the quota occupation still 0%.

    I've read the exim documentation ad I find in this page
    http://www.exim.org/exim-html-curren...html/ch26.html
    this parameter : maildir_use_size_file;
    I've insert in the virtual_localdirectory section with value: true.
    I've insert the previous configuration in /etc/dovecot.conf to enable quota plugin.

    I've restarted exim and dovecot, I sent an email to an user and the file maildirsize was created and in the roundcube the quota level in correctly displayed.

    I've make some test to check that's the email system work correcly.

    You know if there are problems with this configurations?

    Thank's
    Alessandro

  16. #16
    Join Date
    Sep 2011
    Posts
    2
    Quote Originally Posted by a.cirelli View Post
    Hi I'm new in the forum and this is my first post ...
    I've try your solution but the maildir file is not updated and the quota occupation still 0%.

    I've read the exim documentation ad I find in this page
    http://www.exim.org/exim-html-curren...html/ch26.html
    this parameter : maildir_use_size_file;
    I've insert in the virtual_localdirectory section with value: true.
    I've insert the previous configuration in /etc/dovecot.conf to enable quota plugin.

    I've restarted exim and dovecot, I sent an email to an user and the file maildirsize was created and in the roundcube the quota level in correctly displayed.

    I've make some test to check that's the email system work correcly.

    You know if there are problems with this configurations?

    Thank's
    Alessandro
    Hi guys, after few week's system work correctly only one thing, if you use pop3 access you have to enable quota plugin in pop3 protocol:
    protocol pop3 {
    mail_plugins = quota
    }

    If you don't insert this users that can access mail by webmail and mail client with pop3 don't see real mailbox occupation.
    Bye Ale

  17. #17
    Join Date
    Jul 2010
    Posts
    4

    Question We are trying to do the same... but doesn't work yet

    We tried:

    exim.conf -> On virtual_localdelivery section maildir_use_size_file = true

    dovecot.conf ->

    protocol imap {
    mail_plugins = quota imap_quota
    }

    plugin {
    quota = maildir
    }

    Restart both services and the result show on RoudCube is always 0% used of space...

    Any idea?

  18. #18
    Join Date
    May 2012
    Posts
    1
    Quote Originally Posted by Morala View Post
    We tried:

    exim.conf -> On virtual_localdelivery section maildir_use_size_file = true

    dovecot.conf ->

    protocol imap {
    mail_plugins = quota imap_quota
    }

    plugin {
    quota = maildir
    }

    Restart both services and the result show on RoudCube is always 0% used of space...

    Any idea?

    Same problem for me, i do the configuration, but it say that only 0% is occupied.

    Somebody can help me ?

  19. #19
    Join Date
    Nov 2009
    Location
    São Paulo - Brazil
    Posts
    161
    We have build an how-to about displaying quota with Roundcube, please check:
    http://www.directadmin.com/forum/showthread.php?t=43782

  20. #20
    nobaloney's Avatar
    nobaloney is offline NoBaloney Internet Svcs - In Memoriam †
    Join Date
    Jun 2003
    Location
    California
    Posts
    26,123
    Thanks for that. I've moved your thread to our How-Tos section. All links will continue to work.

    Jeff
    +1 951 643-5345
    Third-Party DirectAdmin administration and support
    Dedicated Servers, Dedicated Reseller Accounts
    NoBaloney Internet Services div. Qnito Incorporated
    848 North Rainbow Blvd., Suite #3789
    Las Vegas, NV 89107-1103

Similar Threads

  1. Replies: 70
    Last Post: 03-20-2017, 04:36 AM
  2. How to enable quota display under Roundcube webmail
    By unihostbrasil in forum How-To Guides
    Replies: 38
    Last Post: 11-09-2015, 12:20 AM
  3. Roundcube does not display emails
    By simisimis in forum E-Mail
    Replies: 9
    Last Post: 03-28-2012, 11:13 AM
  4. RoundCube display login page on every page
    By ehsanch in forum DirectAdmin General Discussion
    Replies: 10
    Last Post: 05-24-2010, 11:27 PM
  5. dovecot and quota issue
    By prashantbhushan in forum Dovecot
    Replies: 1
    Last Post: 08-01-2007, 03:33 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •