<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div>Hi Donald,<br></div>
<div>&nbsp;</div>
<div>I've made a few cleanups and merged your patch.&nbsp; It will be included in the next release.<br></div>
<div>&nbsp;</div>
<div>Thanks!<br></div>
<div>&nbsp;</div>
<div>Ellie<br></div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>On Mon, Jun 22, 2015, at 02:40 PM, ellie timoney wrote:<br></div>
<blockquote type="cite"><div>Hi Donald,<br></div>
<div>&nbsp;</div>
<div>I'm currently maintaining the 2.5 series.&nbsp; Your patch looks okay at a glance, it just had the misfortune of being sent through the day after I'd gone on leave for a few weeks.<br></div>
<div>&nbsp;</div>
<div>But I'm back now, and hope to look this over more closely and get it merged sometime this week.&nbsp; Thanks for the contribution!<br></div>
<div>&nbsp;</div>
<div>Regards,<br></div>
<div>&nbsp;</div>
<div>Ellie<br></div>
<div>&nbsp;</div>
<div>On Mon, Jun 15, 2015, at 10:39 PM, Donald Buczek wrote:<br></div>
<blockquote type="cite"><div>Anything wrong with this?<br></div>
<div>&nbsp;</div>
<div>D.<br></div>
<div><div>&nbsp;</div>
<div>&nbsp;</div>
<div>-------- Forwarded Message --------<br></div>
<table cellpadding="0" cellspacing="0" border="0"><tbody><tr><th nowrap="nowrap">Subject:<br></th><td>[PATCH] make autocreate_quota:0 work as documented<br></td></tr><tr><th nowrap="nowrap">Date:<br></th><td>Wed, 27 May 2015 13:57:59 +0200<br></td></tr><tr><th nowrap="nowrap">From:<br></th><td>Donald Buczek <a href="mailto:buczek@molgen.mpg.de">&lt;buczek@molgen.mpg.de&gt;</a><br></td></tr><tr><th nowrap="nowrap">To:<br></th><td><a href="mailto:cyrus-devel@lists.andrew.cmu.edu">cyrus-devel@lists.andrew.cmu.edu</a><br></td></tr><tr><th nowrap="nowrap">CC:<br></th><td>Donald Buczek <a href="mailto:buczek@molgen.mpg.de">&lt;buczek@molgen.mpg.de&gt;</a><br></td></tr></tbody></table><div>&nbsp;</div>
<div>&nbsp;</div>
<pre>Hello,

with cyrus-imapd-2.5.3 the autocreate_quota parameter doesn't work as documented
by imapd.conf(5) when set to the value 0. This should enable autocreation with
unlimited quota, but it doesn't.

This patch fixed it for me.

Regards
  Donald Buczek


---
 imap/autocreate.c | 4 ++--
 imap/imapd.c      | 2 +-
 imap/lmtpd.c      | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/imap/autocreate.c b/imap/autocreate.c
index f4c78fd..2ddd6d7 100644
--- a/imap/autocreate.c
+++ b/imap/autocreate.c
@@ -698,14 +698,14 @@ int autocreate_user(struct namespace *namespace,
         goto done;
     }
 
-    if (autocreatequota &gt;= 0 || autocreatequotamessage &gt;= 0) {
+    if (autocreatequota &gt; 0 || autocreatequotamessage &gt;= 0) {
         quota_t newquotas[QUOTA_NUMRESOURCES];
         int res;
 
         for (res = 0 ; res &lt; QUOTA_NUMRESOURCES ; res++)
             newquotas[res] = QUOTA_UNLIMITED;
 
-        newquotas[QUOTA_STORAGE] = autocreatequota;
+        newquotas[QUOTA_STORAGE] = autocreatequota !=0 ? autocreatequota : QUOTA_UNLIMITED;
         newquotas[QUOTA_MESSAGE] = autocreatequotamessage;
 
         r = mboxlist_setquotas(inboxname, newquotas, 0);
diff --git a/imap/imapd.c b/imap/imapd.c
index 1a553b4..838eacd 100644
--- a/imap/imapd.c
+++ b/imap/imapd.c
@@ -2277,7 +2277,7 @@ static void autocreate_inbox(void)
     if (imapd_userisadmin) return;
     if (imapd_userisproxyadmin) return;
 
-    if (config_getint(IMAPOPT_AUTOCREATE_QUOTA)) {
+    if (config_getint(IMAPOPT_AUTOCREATE_QUOTA)&gt;=0) {
         char *inboxname = mboxname_user_mbox(imapd_userid, NULL);
         int r = mboxlist_lookup(inboxname, NULL, NULL);
         free(inboxname);
diff --git a/imap/lmtpd.c b/imap/lmtpd.c
index 4d55ae1..f97a052 100644
--- a/imap/lmtpd.c
+++ b/imap/lmtpd.c
@@ -1111,7 +1111,7 @@ int autocreate_inbox(const char *user, const char *domain)
     /*
      * Check for autocreatequota and createonpost
      */
-    if (!config_getint(IMAPOPT_AUTOCREATE_QUOTA)) {
+    if (config_getint(IMAPOPT_AUTOCREATE_QUOTA)&lt;0) {
         free(username);
         return IMAP_MAILBOX_NONEXISTENT;
     }
-- 
2.3.4<br></pre></div>
</blockquote><div>&nbsp;</div>
</blockquote><div>&nbsp;</div>
</body>
</html>