User Tools

Site Tools


start:howto:dovecot_plus_database_quota

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
start:howto:dovecot_plus_database_quota [2010/12/20 16:37]
aseques migrated as a howto
start:howto:dovecot_plus_database_quota [2012/01/09 11:51]
aseques
Line 1: Line 1:
-====== ​Replace Courier with Dovecot ​plus Database quota ======+**__ALERT: This is a document being rewritten, only experienced people should use this__** 
 + 
 +====== Dovecot ​modifications from default imscp install ​======
 This is an improved version from the original article in ispcp (http://​isp-control.net/​documentation/​howto:​mail:​replace_courier_with_dovecot) This is an improved version from the original article in ispcp (http://​isp-control.net/​documentation/​howto:​mail:​replace_courier_with_dovecot)
-It describes how to replace ​the courier-pop/​imap/​authdaemon/​maildrop with dovecot taking advantage ​of the features in dovecot ​1.2+All the parts related ​to the default install where removed since imscp already takes care of that, and it's focused to add the functionality that is available only on dovecot ​(instead of courier).
  
-===== The improvements ​from the original document ​===== +===== Changes ​from standard dovecot in imscp ===== 
-  * Quotas are stored on database so they will be shown from the control panel +  * Quotas are stored on database so they can be shown from the control panel 
-  * Required dovecot version is now 1.2 (almost everything could be done in 1.1 but with 1.2 it'​s ​easier and cleaner+  * Required dovecot version is now 1.2 (squeeze'​s ​default
-  * Filtering is enabled by default +  * Filtering is enabled by default ​(to archive spam)
-  * Following the installation is easier now.+
  
-===== Introduction ​=====+===== Reasons to use dovecot ​=====
  
-What do you win by changing from courier to dovecot: 
   * You can do server-side filtering with sieve (for example saving spam to junk folder)   * You can do server-side filtering with sieve (for example saving spam to junk folder)
   * Reading your logs for problems will be easier   * Reading your logs for problems will be easier
Line 20: Line 20:
  
 Please report any bugs/​hints/​whatever in the following board thread: Please report any bugs/​hints/​whatever in the following board thread:
-http://www.isp-control.net/forum/​thread-6088-post-49018.html+http://forum.i-mscp.net/showthread.php?tid=61
  
-**NOTE:​** ​ispCP is already assigning 10MB quota to each mail account created, but currently ​it is not editable by default (ticket #2219). To be able to edit the quota from the control panel you will have to follow this thread, as a bonus you will see the current values. +**NOTE:​** ​There are currently ​no means to configure ​the quota for imscp other than fiddling with the databaseThe functionality from http://​www.isp-control.net/​forum/​thread-8483.html ​should be imported.
-http://​www.isp-control.net/​forum/​thread-8483.html+
  
 **NOTE:** If you want to edit the quota directly; it is stored in bytes in the table "​mail_users"​ in a field named "​quota"​. **NOTE:** If you want to edit the quota directly; it is stored in bytes in the table "​mail_users"​ in a field named "​quota"​.
  
-===== Prerequisites ​===== +===== Replace Courier with Dovecot ​=====
-==== Your system'​s hostname has to be resolvable ==== +
-You can check this by executing +
-  hostname +
-This should print your system'​s hostname.+
  
-==== Script for password verification ==== +You can do it by re-running ​the installer ​and changing the default imap server when asked you can choose between courier or dovecot.
-Somewhere in between rc6 and 1.0.0 password encryption was added and so passwords in clear text are no longer working. Grab the perl script written ​by sci2tech that handles ​the verification of passwords for Dovecot: http://​www.isp-control.net/​forum/​attachment.php?​aid=1185 +
- +
-Copy it to **/​var/​www/​ispcp/​engine/​ispcp-dovecot-mngr** ​and do a +
-   chmod 0755 /​var/​www/​ispcp/​engine/​ispcp-dovecot-mngr +
- +
-===== Replace Courier with Dovecot =====+
  
-**Please replace every appearance of "​PASS_MAILRW"​ with your password!** 
  
 ==== 1. Create a new table in ispcp called quota_dovecot ==== ==== 1. Create a new table in ispcp called quota_dovecot ====
Line 55: Line 43:
     );     );
   ​   ​
-==== 2. Add sql user ==== +==== 2. Granting permissions to the sql user ==== 
-  mysql -u root -p mysql + 
-  mysql> GRANT SELECT ON ispcp.* to '​ispcp_dovecot'​@'​localhost'​ identified by '​PASS_MAILRW';​ +  mysql> GRANT SELECT,​INSERT,​UPDATE ON imscp.quota_dovecot to '​ispcp_dovecot'​@'​localhost'​
-  mysql> GRANT SELECT,​INSERT,​UPDATE ON ispcp.quota_dovecot to '​ispcp_dovecot'​@'​localhost'​+
   mysql> FLUSH PRIVILEGES;   mysql> FLUSH PRIVILEGES;
-  mysql> ​quit; +  mysql> ​QUIT;
- +
-==== 2. Stop Courier services ==== +
- +
-  /​etc/​init.d/​courier-pop stop +
-  /​etc/​init.d/​courier-imap stop +
-  /​etc/​init.d/​courier-authdaemon stop +
-  /​etc/​init.d/​saslauthd stop +
- +
-==== 3. Install Dovecot ==== +
- +
-  apt-get update +
-  apt-get install dovecot-common dovecot-imapd dovecot-pop3d+
  
 ==== 4. Configure Dovecot ==== ==== 4. Configure Dovecot ====
- 
  
 Replace /​etc/​dovecot/​dovecot.conf with the following one (you should backup the original because there are a lot of comments in it explaining all the configuration parameters). Replace /​etc/​dovecot/​dovecot.conf with the following one (you should backup the original because there are a lot of comments in it explaining all the configuration parameters).
Line 299: Line 273:
   flags=DROhu user=vmail:​mail argv=/​usr/​libexec/​dovecot/​deliver -f ${sender} -d ${recipient}   flags=DROhu user=vmail:​mail argv=/​usr/​libexec/​dovecot/​deliver -f ${sender} -d ${recipient}
 </​code>​ </​code>​
- 
-==== 6. Migrate existing maildirs ==== 
- 
-If you are using existing maildirs which were accessed by courier you have to migrate the maildirs. 
-This can be easily done with the courier-dovecot-migrate.pl script from http://​wiki.dovecot.org/​Migration/​Courier Be sure to pick the one that corresponds with your Dovecot version. 
  
 ==== 7. Enable SSL support ==== ==== 7. Enable SSL support ====
Line 409: Line 378:
 You can configure Dovecot to execute an external command if an user's quota exceeds a specified limit. In this example the user receives alert emails if his quota exceeds 80% / 95% percent. You can configure Dovecot to execute an external command if an user's quota exceeds a specified limit. In this example the user receives alert emails if his quota exceeds 80% / 95% percent.
  
-Append the following ​to your plugin section in **/​etc/​dovecot.conf**:​+Append the following ​in your plugin section in **/etc/dovecot/​dovecot.conf**:​
  
   quota_warning = storage=95%% /​usr/​local/​bin/​dovecot-quota-warning.sh 95   quota_warning = storage=95%% /​usr/​local/​bin/​dovecot-quota-warning.sh 95
/var/www/virtual/i-mscp.net/wiki/htdocs/data/pages/start/howto/dovecot_plus_database_quota.txt · Last modified: 2013/06/21 07:36 by aseques