diff --git a/lib/configfiles/gentoo.inc.php b/lib/configfiles/gentoo.inc.php
index c44a3350..c7858786 100644
--- a/lib/configfiles/gentoo.inc.php
+++ b/lib/configfiles/gentoo.inc.php
@@ -293,7 +293,28 @@ milter_default_action = accept" >> /etc/postfix/main.cf',
)
),
'dovecot' => Array(
- 'label' => 'Dovecot',
+ 'label' => 'Dovecot 1',
+ 'commands_1' => Array(
+ 'emerge -av dovecot',
+ 'mv dovecot.conf dovecot.conf.gentoo',
+ 'mv dovecot-sql.conf dovecot-sql.conf.gentoo',
+ 'touch dovecot.conf',
+ 'touch dovecot-sql.conf',
+ ),
+ 'files' => Array(
+ 'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf',
+ 'etc_dovecot_dovecot-sql.conf' => '/etc/dovecot/dovecot-sql.conf'
+ ),
+ 'commands_2' => Array(
+ 'chmod 0640 /etc/dovecot/dovecot-sql.conf',
+ 'rc-update add dovecot default'
+ ),
+ 'restart' => Array(
+ '/etc/init.d/dovecot restart'
+ )
+ ),
+ 'dovecot2' => Array(
+ 'label' => 'Dovecot 2',
'commands_1' => Array(
'emerge -av dovecot',
'mv dovecot.conf dovecot.conf.gentoo',
diff --git a/templates/admin/templates/templates_edit.tpl b/templates/admin/templates/templates_edit.tpl
index 4fbdc8bb..4b28a05f 100644
--- a/templates/admin/templates/templates_edit.tpl
+++ b/templates/admin/templates/templates_edit.tpl
@@ -98,7 +98,7 @@ $header
{$lng['admin']['templates']['PASSWORD']} |
- | {$lng['admin']['templates']['trafficninetypercent']} |
+ {$lng['admin']['templates']['trafficmaxpercent']} |
| {TRAFFIC}: |
@@ -181,4 +181,4 @@ $header
-$footer
\ No newline at end of file
+$footer
diff --git a/templates/misc/configfiles/gentoo/dovecot2/etc_dovecot_dovecot-sql.conf b/templates/misc/configfiles/gentoo/dovecot2/etc_dovecot_dovecot-sql.conf
new file mode 100644
index 00000000..fef2b19e
--- /dev/null
+++ b/templates/misc/configfiles/gentoo/dovecot2/etc_dovecot_dovecot-sql.conf
@@ -0,0 +1,5 @@
+driver = mysql
+connect = host= dbname= user= password=
+default_pass_scheme = CRYPT
+password_query = "SELECT username AS user, password_enc AS password, CONCAT(homedir, maildir) AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, CONCAT('*:storage=', quota,'M') AS userdb_quota_rule FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3') OR '%Ls' = 'smtp')"
+user_query = "SELECT CONCAT(homedir, maildir) AS home, uid, gid, CONCAT('*:storage=', quota,'M') AS quota_rule FROM mail_users WHERE (username = '%u' OR email = '%u')"
diff --git a/templates/misc/configfiles/gentoo/dovecot2/etc_dovecot_dovecot.conf b/templates/misc/configfiles/gentoo/dovecot2/etc_dovecot_dovecot.conf
new file mode 100644
index 00000000..b7ab0f9d
--- /dev/null
+++ b/templates/misc/configfiles/gentoo/dovecot2/etc_dovecot_dovecot.conf
@@ -0,0 +1,63 @@
+auth_mechanisms = plain login
+## allow Plaintext Logins from foreign IP if the Connection doesn't use TLS
+disable_plaintext_auth = no
+listen = *
+mail_access_groups = vmail
+mail_debug = no
+
+protocols = imap pop3
+
+### SSL Settings
+### After setting this options, set disable_plaintext_auth to yes (see above)
+#ssl_cert = .pem
+#ssl_key = .key
+
+passdb {
+ args = /etc/dovecot/dovecot-sql.conf
+ driver = sql
+}
+
+plugin {
+ quota = maildir:User Quota
+}
+
+service auth {
+ unix_listener /var/spool/postfix/private/auth {
+ group = postfix
+ mode = 0660
+ user = postfix
+ }
+ unix_listener auth-master {
+ group = vmail
+ mode = 0660
+ user = vmail
+ }
+}
+
+userdb {
+ driver = prefetch
+}
+
+userdb {
+ args = /etc/dovecot/dovecot-sql.conf
+ driver = sql
+}
+
+protocol imap {
+ mail_plugins = quota imap_quota
+}
+
+protocol pop3 {
+ mail_plugins = quota
+ pop3_uidl_format = UID%u-%v
+}
+
+lda_mailbox_autocreate = yes
+protocol lda {
+ auth_socket_path = /var/run/dovecot/auth-master
+ mail_plugins = quota
+ # postmaster is the one in charge of the mail system. MUST be set to a valid address!
+ postmaster_address = admin@
+ sendmail_path = /usr/sbin/sendmail
+ lda_mailbox_autocreate = 1
+}
diff --git a/templates/misc/configfiles/gentoo/postfix_dovecot/etc_postfix_main.cf b/templates/misc/configfiles/gentoo/postfix_dovecot/etc_postfix_main.cf
index c355de85..44414c76 100644
--- a/templates/misc/configfiles/gentoo/postfix_dovecot/etc_postfix_main.cf
+++ b/templates/misc/configfiles/gentoo/postfix_dovecot/etc_postfix_main.cf
@@ -52,6 +52,7 @@ smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
## Dovecot Settings for deliver, SASL Auth and virtual transport
mailbox_command = /usr/libexec/dovecot/deliver
+smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1