DirectAdmin Knowledge Base and Support

DirectAdmin is a web panel for a simple administration of both virtual and dedicated servers. DirectAdmin is faster, safe and more powerful than any other CP. And we know how to customize and support it.

Exim or Dovecot quotas with Pigeonhole

| 18:03:23 01.05.2013

 As soon as you enable Pigeonhole with Exim and Dovecot you get email quotas not working any longer. And here is a way how to enable them back with Dovecot. 

Enabling quota plugins in Dovecot

Update configuration file /etc/dovecot/dovecot.conf:

Add lines

    quota = maildir:User quota
    quota_rule = *:storage=10M

to plugin {...} section

plugin {
    sieve = ~/.dovecot.sieve
    sieve_global_path = /var/lib/dovecot/sieve/default.sieve
    sieve_dir = ~/sieve
    sieve_global_dir = /var/lib/dovecot/sieve/global/

    quota = maildir:User quota
    quota_rule = *:storage=10M
}

Update mail_plugins line in protocol lda {...} and protocol lmtp {...} section to the following:

mail_plugins = $mail_plugins sieve quota

Add line

mail_plugins = quota

into protocol pop3 {...} and protocol imap {...} sections:

protocol pop3 {
    mail_plugins = quota
    pop3_uidl_format = %08Xu%08Xv
}
protocol imap {
    mail_plugins = quota
}

See http://wiki2.dovecot.org/Quota and http://wiki2.dovecot.org/Quota/Configuration for more information.


Converting passwd-files to contain quotas data (since Directadmin 1.43.1)

To enable DA to add the quota options, add:

add_userdb_quota=1

to your directadmin.conf, and restart DA. The internal default is 0.

After turning on the option, to convert all existing files to use the extra format, use one of these new task.queue command:

echo "action=rewrite&value=email_passwd" >> /usr/local/directadmin/data/task.queue

If you need to convert the file only for one user, use this command (replace fred with your real username):

echo "action=rewrite&value=email_passwd&user=fred" >> /usr/local/directadmin/data/task.queue

Converting passwd-files to contain quotas data (prior to Directadmin 1.43.1)

Download a script (no more needed since Directadmin 1.43.1 is released):

# cd /usr/local/directadmin/scripts/custom
# wget -O poralix_transform_passwd.sh http://plugins-da.net/_public_files/poralix_transform_passwd.sh.txt
# chmod 700 poralix_transform_passwd.sh
# chown diradmin:diradmin poralix_transform_passwd.sh

And update (or create):

  • /usr/local/directadmin/scripts/custom/email_change_pass_post.sh
  • /usr/local/directadmin/scripts/custom/email_create_post.sh
# cd /usr/local/directadmin/scripts/custom
# touch email_change_pass_post.sh email_create_post.sh
# chmod 700 email_change_pass_post.sh email_create_post.sh
# chown diradmin:diradmin email_change_pass_post.sh email_create_post.sh

so both of them contain the following lines:  

#!/bin/bash
/usr/local/directadmin/scripts/custom/poralix_transform_passwd.sh ${domain} >/dev/null 2>&1;
exit 0;

To update the existing files, you should run the following command:

# for domain in `cat /etc/virtual/domains`; do /usr/local/directadmin/scripts/custom/poralix_transform_passwd.sh $domain; done; 

Have a nice day!

UPDATE:

Since a recently released version of Directadmin 1.43.1, you no more need to use any custom scripts (posted above) to have quotas in dovecot password files. It's a new built-in directadmin feature.

Please check this for more information: http://www.directadmin.com/features.php?id=1461

About Us
We are a team of professionals, and specialize in installation, configuring and managing of remote virtual and dedicated servers powered by Linux/Unix-like OS with DirectAdmin. We support various sets of software, including web-servers Apache, Nginx; internet domain name servers Bind, PowerDNS; mail-servers with POP3, IMAP and SMTP, FTP-servers, etc. After years of working through the most complex server challenges our team has gathered valuable experience and universal solutions suitable for everyday tasks. We are here to lend you a helping hand and take care of your servers in order to let you have enough time to do more of what you love.




All of the information and data on this site is for informational purposes only and is provided for the convenience of the user.
Powered by: Amiro.CMS - Free edition