Or you can use a dummy backend. It's a backend which always says « OK
» when you try to write in it, and always says « not in db » when you
read in it. This backend was never committed into cyrus-imapd... Here
is an up-to-date version.

Then add this in imapd.conf :
duplicate_db: dummy

Ken, Bron : do you plan to include this backend into cyrus-imapd ?
It's very handy when we don't want to use a database (here we often
use dummy for annotations).
-- 
Cyril Servant

Le 22 décembre 2009 22:33, Simon Matter <simon.mat...@invoca.ch> a écrit :
>> Hi,
>>
>> I have update my Cyrus installation from 2.3.15 to 2.3.16.
>>
>> I know have this following error :
>>
>>   IOERROR: opening /var/imap/user_deny.db: No such file or directory
>>
>> How can I correct this ?
>
> You could change you syslog to not log debug messages.
>
>> Modify imap configuration file ?
>
> No.
>
>> Create the user_deny.db, if yes how ?
>
> You could simply create an empty file ${configdir}/user_deny.db
> But, then new messages will show up in syslog for every login about
> reading the user_deny db.
>
> Because I can't easily change syslog in my RPMS I decided to do the
> following:
> 1) change the code so it will create the db if it doesn't exist.
> 2) comment out the syslog message which simply tells that the db is being
> read.
>
> I did the same with the statuscache db some time ago and decided to do it
> again here :)
>
> I understand my "solution" has the drawback that it 1) creates the db even
> if it's not used and 2) it may add some extra cycles because it tries to
> read the empty db. Doesn't look perfect but works.
>
> Regards,
> Simon
>
>>
>>
>>
>> Le 21/12/2009 22:39, Ken Murchison a écrit :
>>> Simon Matter wrote:
>>>
>>>>> I am pleased to announce the release of Cyrus IMAPd 2.3.16.  This
>>>>> release should be considered production quality.  Major changes in the
>>>>> release are the following:
>>>>>
>>>>> - Added 'user_deny.db' to be able to selectively deny users access to
>>>>>     Cyrus services.
>>>>>
>>>> While upgrading my rpms I wanted to see where the db is so I can handle
>>>> it
>>>> in the package. But I can't find it and even stracing didn't show that
>>>> the
>>>> file was searched for. Do we have to enable it at compile time or are
>>>> there other options beside userdeny_db to configure it?
>>>> Thanks for any hint.
>>>>
>>> Its in configdir, along with the rest of the dbs.  Its not created by
>>> default, since its not required for normal operation.
>>>
>>> Actually, its not the most efficient implementation right now, since it
>>> does an open/read/close per login.  I need to rework it so that it does
>>> the open at service init time, leaves the db open for reading for the
>>> each process reuse, and closes it at service shutdown time.  This will
>>> take a little work, because we plan on using a remote MySQL database at
>>> CMU, so the actual read function will also have to reconnect if
>>> necessary.
>>>
>>>
>>>
>>
>>
>> --
>> ----------------------------------------------------------------------
>> * E-Mail   : mercier.frede...@iname.com
>> * Site Web : http://lamusiqueceltique.sparfel.net/
>> ----------------------------------------------------------------------
>>
>> ----
>> Cyrus Home Page: http://cyrusimap.web.cmu.edu/
>> Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
>> List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
>>
>
>
> ----
> Cyrus Home Page: http://cyrusimap.web.cmu.edu/
> Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
> List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
diff -ruN cyrus-imapd-2.3.16/configure.in cyrus-imapd-2.3.16.new/configure.in
--- cyrus-imapd-2.3.16/configure.in	2009-12-21 14:09:10.000000000 +0100
+++ cyrus-imapd-2.3.16.new/configure.in	2009-12-23 11:39:10.000000000 +0100
@@ -170,7 +170,7 @@
 dnl function for doing each of the database backends
 dnl parameters: backend name, variable to set, withval
 
-CYRUSDB_OBJS="cyrusdb_flat.o cyrusdb_skiplist.o cyrusdb_quotalegacy.o"
+CYRUSDB_OBJS="cyrusdb_flat.o cyrusdb_skiplist.o cyrusdb_quotalegacy.o cyrusdb_dummy.o"
 
 dnl Berkeley DB Detection
 
diff -ruN cyrus-imapd-2.3.16/lib/cyrusdb.c cyrus-imapd-2.3.16.new/lib/cyrusdb.c
--- cyrus-imapd-2.3.16/lib/cyrusdb.c	2008-07-30 18:03:38.000000000 +0200
+++ cyrus-imapd-2.3.16.new/lib/cyrusdb.c	2009-12-23 11:36:28.000000000 +0100
@@ -75,6 +75,7 @@
 #if defined HAVE_MYSQL || defined HAVE_PGSQL || defined HAVE_SQLITE
     &cyrusdb_sql,
 #endif
+    &cyrusdb_dummy,
     NULL };
 
 void cyrusdb_init() 
diff -ruN cyrus-imapd-2.3.16/lib/cyrusdb_dummy.c cyrus-imapd-2.3.16.new/lib/cyrusdb_dummy.c
--- cyrus-imapd-2.3.16/lib/cyrusdb_dummy.c	1970-01-01 01:00:00.000000000 +0100
+++ cyrus-imapd-2.3.16.new/lib/cyrusdb_dummy.c	2009-12-23 14:59:05.000000000 +0100
@@ -0,0 +1,221 @@
+/* cyrusdb_dummy.c -- cyrusdb dummy implementation
+ *
+ * Copyright (c) 1994-2008 Carnegie Mellon University.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The name "Carnegie Mellon University" must not be used to
+ *    endorse or promote products derived from this software without
+ *    prior written permission. For permission or any legal
+ *    details, please contact
+ *      Carnegie Mellon University
+ *      Center for Technology Transfer and Enterprise Creation
+ *      4615 Forbes Avenue
+ *      Suite 302
+ *      Pittsburgh, PA  15213
+ *      (412) 268-7393, fax: (412) 268-7395
+ *      innovat...@andrew.cmu.edu
+ *
+ * 4. Redistributions of any form whatsoever must retain the following
+ *    acknowledgment:
+ *    "This product includes software developed by Computing Services
+ *     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
+ *
+ * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
+ * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * $Id: cyrusdb_dummy.c,v 1.1 2008/12/09 17:22:44 fr24522 Exp $
+ */
+
+/* xxx check retry_xxx for failure */
+
+/* xxx all offsets should be bit32s i think */
+
+#include <config.h>
+
+#include <stdlib.h>
+#include <string.h>
+#include <limits.h>
+#include <errno.h>
+#include <syslog.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <netinet/in.h>
+
+#include "assert.h"
+#include "bsearch.h"
+#include "cyrusdb.h"
+#include "libcyr_cfg.h"
+#include "lock.h"
+#include "map.h"
+#include "retry.h"
+#include "util.h"
+
+
+struct txn {
+    int ismalloc;
+    int syncfd;
+
+};
+
+struct db {
+    /* file data */
+    char *fname;
+    int fd;
+
+
+};
+
+
+static int myinit(const char *dbdir, int myflags)
+{
+    return 0;
+}
+
+static int mydone(void)
+{
+    return 0;
+}
+
+static int mysync(void)
+{
+    return 0;
+}
+
+static int myarchive(const char **fnames, const char *dirname)
+{
+    return 0;
+}
+
+static int myunlock(struct db *db)
+{
+    return 0;
+}
+
+static int myopen(const char *fname, int flags, struct db **ret)
+{
+	return 0;
+}
+
+static int myclose(struct db *db)
+{
+    return 0;
+}
+
+static int myfetch(struct db *mydb,
+		 const char *key, int keylen,
+		 const char **data, int *datalen,
+		 struct txn **mytid)
+{
+    return CYRUSDB_NOTFOUND;
+}
+
+static int myfetchlock(struct db *mydb,
+		 const char *key, int keylen,
+		 const char **data, int *datalen,
+		 struct txn **mytid)
+{
+    return CYRUSDB_NOTFOUND;
+}
+
+/* foreach allows for subsidary mailbox operations in 'cb'.
+   if there is a txn, 'cb' must make use of it.
+*/
+static int myforeach(struct db *db,
+	      char *prefix, int prefixlen,
+	      foreach_p *goodp,
+	      foreach_cb *cb, void *rock,
+	      struct txn **tid)
+{
+    return 0;
+}
+
+
+static int mycreate(struct db *db,
+		  const char *key, int keylen,
+		  const char *data, int datalen,
+		  struct txn **tid)
+{
+    return 0;
+}
+
+static int mystore(struct db *db,
+		 const char *key, int keylen,
+		 const char *data, int datalen,
+		 struct txn **tid)
+{
+    return 0;
+}
+
+static int mydelete(struct db *db,
+	     const char *key, int keylen,
+	     struct txn **tid, int force __attribute__((unused)))
+{
+    return 0;
+}
+
+static int mycommit(struct db *db, struct txn *tid)
+{
+   return 0;
+}
+
+static int myabort(struct db *db, struct txn *tid)
+{
+    return 0;
+}
+
+static int mydump(struct db *db, int detail __attribute__((unused)))
+{
+    return 0;
+}
+
+static int myconsistent(struct db *db)
+{
+    return 0;
+}
+
+
+struct cyrusdb_backend cyrusdb_dummy =
+{
+    "dummy",			/* name */
+
+    &myinit,
+    &mydone,
+    &mysync,
+    &myarchive,
+
+    &myopen,
+    &myclose,
+
+    &myfetch,
+    &myfetchlock,
+    &myforeach,
+    &mycreate,
+    &mystore,
+    &mydelete,
+
+    &mycommit,
+    &myabort,
+
+    &mydump,
+    &myconsistent
+};
diff -ruN cyrus-imapd-2.3.16/lib/cyrusdb.h cyrus-imapd-2.3.16.new/lib/cyrusdb.h
--- cyrus-imapd-2.3.16/lib/cyrusdb.h	2008-07-30 18:03:38.000000000 +0200
+++ cyrus-imapd-2.3.16.new/lib/cyrusdb.h	2009-12-23 11:36:51.000000000 +0100
@@ -191,6 +191,7 @@
 extern struct cyrusdb_backend cyrusdb_skiplist;
 extern struct cyrusdb_backend cyrusdb_quotalegacy;
 extern struct cyrusdb_backend cyrusdb_sql;
+extern struct cyrusdb_backend cyrusdb_dummy;
 
 extern int cyrusdb_copyfile(const char *srcname, const char *dstname);
 
diff -ruN cyrus-imapd-2.3.16/lib/imapoptions cyrus-imapd-2.3.16.new/lib/imapoptions
--- cyrus-imapd-2.3.16/lib/imapoptions	2009-12-21 12:25:22.000000000 +0100
+++ cyrus-imapd-2.3.16.new/lib/imapoptions	2009-12-23 11:43:19.000000000 +0100
@@ -165,7 +165,7 @@
    affect LMTP delivery of messages directly to mailboxes via
    plus-addressing. */
 
-{ "annotation_db", "skiplist", STRINGLIST("berkeley", "berkeley-hash", "skiplist")}
+{ "annotation_db", "skiplist", STRINGLIST("berkeley", "berkeley-hash", "skiplist", "dummy")}
 /* The cyrusdb backend to use for mailbox annotations. */
 
 { "anyoneuseracl", 1, SWITCH }
@@ -287,7 +287,7 @@
    session.  Otherwise, the missing mailbox is treated as empty while
    in use by the client.*/
 
-{ "duplicate_db", "berkeley-nosync", STRINGLIST("berkeley", "berkeley-nosync", "berkeley-hash", "berkeley-hash-nosync", "skiplist", "sql")}
+{ "duplicate_db", "berkeley-nosync", STRINGLIST("berkeley", "berkeley-nosync", "berkeley-hash", "berkeley-hash-nosync", "skiplist", "sql", "dummy")}
 /* The cyrusdb backend to use for the duplicate delivery suppression
    and sieve. */
 
@@ -1180,7 +1180,7 @@
 { "umask", "077", STRING }
 /* The umask value used by various Cyrus IMAP programs. */
 
-{ "userdeny_db", "flat", STRINGLIST("flat", "berkeley", "berkeley-hash", "skiplist", "sql")}
+{ "userdeny_db", "flat", STRINGLIST("flat", "berkeley", "berkeley-hash", "skiplist", "sql", "dummy")}
 /* The cyrusdb backend to use for the user access list. */
 
 { "user_folder_limit", 0, INT }
----
Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

Reply via email to