~ubuntu-branches/ubuntu/karmic/cyrus-imapd-2.2/karmic

« back to all changes in this revision

Viewing changes to debian/patches/23-configurable_idled.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2006-12-07 17:31:51 UTC
  • Revision ID: james.westby@ubuntu.com-20061207173151-u34z5dafs5nh9sat
Tags: 2.2.13-9ubuntu1
* Merge with Debian unstable; remaining changes:
  - Build using DB4.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## 23-configurable_idled.dpatch by Ondřej Surý <ondrej@sury.org>
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
## DP: Adds imapd.conf option to select IDLE method at runtime
 
6
 
 
7
@DPATCH@
 
8
diff -urNad cyrus-imapd-2.2.13/configure.in /tmp/dpep.7DrWs1/cyrus-imapd-2.2.13/configure.in
 
9
--- cyrus-imapd-2.2.13/configure.in     2006-08-23 18:13:47.000000000 +0200
 
10
+++ /tmp/dpep.7DrWs1/cyrus-imapd-2.2.13/configure.in    2006-08-23 18:13:56.178920138 +0200
 
11
@@ -760,9 +760,6 @@
 
12
                           METHOD is [poll], idled or no],
 
13
        WITH_IDLE="${withval}",WITH_IDLE="poll")
 
14
 AC_SUBST(WITH_IDLE)
 
15
-if test "$WITH_IDLE" = "idled"; then
 
16
-  IMAP_PROGS="$IMAP_PROGS idled"
 
17
-fi
 
18
 
 
19
 dnl
 
20
 dnl see if we're compiling with NNTP support
 
21
diff -urNad cyrus-imapd-2.2.13/imap/Makefile.in /tmp/dpep.7DrWs1/cyrus-imapd-2.2.13/imap/Makefile.in
 
22
--- cyrus-imapd-2.2.13/imap/Makefile.in 2006-08-23 18:13:47.000000000 +0200
 
23
+++ /tmp/dpep.7DrWs1/cyrus-imapd-2.2.13/imap/Makefile.in        2006-08-23 18:13:56.178920138 +0200
 
24
@@ -47,9 +47,6 @@
 
25
 # 'local' (legacy flat file).
 
26
 SEEN=seen_db.o
 
27
 
 
28
-# IMAP IDLE mechanism
 
29
-IDLE=idle_@WITH_IDLE@.o
 
30
-
 
31
 srcdir = @srcdir@
 
32
 top_srcdir = @top_srcdir@
 
33
 VPATH = @srcdir@
 
34
@@ -104,7 +101,8 @@
 
35
        convert_code.o duplicate.o saslclient.o saslserver.o signals.o \
 
36
        annotate.o search_engines.o squat.o squat_internal.o mbdump.o \
 
37
        imapparse.o telemetry.o user.o notify.o protocol.o quota_db.o \
 
38
-       $(SEEN) $(IDLE)
 
39
+       idle.o idle_no.o idle_poll.o idle_idled.o \
 
40
+       $(SEEN)
 
41
 
 
42
 IMAPDOBJS=pushstats.o backend.o imapd.o index.o tls.o version.o
 
43
 
 
44
@@ -118,7 +116,7 @@
 
45
 SERVICE=../master/service.o
 
46
 SERVICETHREAD=../master/service-thread.o
 
47
 
 
48
-PROGS = imapd lmtpd pop3d \
 
49
+PROGS = imapd lmtpd pop3d idled \
 
50
        fud smmapd reconstruct quota mbpath ipurge \
 
51
        cyrdump chk_cyrus cvt_cyrusdb deliver ctl_mboxlist \
 
52
        ctl_deliver ctl_cyrusdb squatter mbexamine cyr_expire arbitron \
 
53
diff -urNad cyrus-imapd-2.2.13/imap/global.c /tmp/dpep.7DrWs1/cyrus-imapd-2.2.13/imap/global.c
 
54
--- cyrus-imapd-2.2.13/imap/global.c    2006-08-23 18:13:47.000000000 +0200
 
55
+++ /tmp/dpep.7DrWs1/cyrus-imapd-2.2.13/imap/global.c   2006-08-23 18:28:28.243411698 +0200
 
56
@@ -72,6 +72,7 @@
 
57
 #include "prot.h" /* for PROT_BUFSIZE */
 
58
 #include "util.h"
 
59
 #include "xmalloc.h"
 
60
+#include "idle.h"
 
61
 
 
62
 static enum {
 
63
     NOT_RUNNING = 0,
 
64
@@ -94,6 +95,8 @@
 
65
 /* syslog prefix tag */
 
66
 static char syslog_prefix[20];
 
67
 
 
68
+struct idle_backend *config_idle=NULL;
 
69
+
 
70
 /* Called before a cyrus application starts (but after command line parameters
 
71
  * are read) */
 
72
 int cyrus_init(const char *alt_config, const char *ident, unsigned flags)
 
73
@@ -185,6 +188,10 @@
 
74
        config_ptscache_db =
 
75
            cyrusdb_fromname(config_getstring(IMAPOPT_PTSCACHE_DB));
 
76
 
 
77
+        /* lookup idle backend */
 
78
+        config_idle =
 
79
+            idle_fromname(config_getstring(IMAPOPT_IDLEMETHOD));
 
80
+
 
81
        /* configure libcyrus as needed */
 
82
        libcyrus_config_setstring(CYRUSOPT_CONFIG_DIR, config_dir);
 
83
        libcyrus_config_setswitch(CYRUSOPT_AUTH_UNIX_GROUP_ENABLE,
 
84
diff -urNad cyrus-imapd-2.2.13/imap/global.h /tmp/dpep.7DrWs1/cyrus-imapd-2.2.13/imap/global.h
 
85
--- cyrus-imapd-2.2.13/imap/global.h    2006-08-21 23:32:39.000000000 +0200
 
86
+++ /tmp/dpep.7DrWs1/cyrus-imapd-2.2.13/imap/global.h   2006-08-23 18:13:56.179920040 +0200
 
87
@@ -152,4 +152,6 @@
 
88
 extern struct cyrusdb_backend *config_tlscache_db;
 
89
 extern struct cyrusdb_backend *config_ptscache_db;
 
90
 
 
91
+extern struct idle_backend *config_idle;
 
92
+
 
93
 #endif /* INCLUDED_GLOBAL_H */
 
94
diff -urNad cyrus-imapd-2.2.13/imap/idle.c /tmp/dpep.7DrWs1/cyrus-imapd-2.2.13/imap/idle.c
 
95
--- cyrus-imapd-2.2.13/imap/idle.c      1970-01-01 01:00:00.000000000 +0100
 
96
+++ /tmp/dpep.7DrWs1/cyrus-imapd-2.2.13/imap/idle.c     2006-08-23 18:13:56.179920040 +0200
 
97
@@ -0,0 +1,87 @@
 
98
+/* 
 
99
+ * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
 
100
+ *
 
101
+ * Redistribution and use in source and binary forms, with or without
 
102
+ * modification, are permitted provided that the following conditions
 
103
+ * are met:
 
104
+ *
 
105
+ * 1. Redistributions of source code must retain the above copyright
 
106
+ *    notice, this list of conditions and the following disclaimer. 
 
107
+ *
 
108
+ * 2. Redistributions in binary form must reproduce the above copyright
 
109
+ *    notice, this list of conditions and the following disclaimer in
 
110
+ *    the documentation and/or other materials provided with the
 
111
+ *    distribution.
 
112
+ *
 
113
+ * 3. The name "Carnegie Mellon University" must not be used to
 
114
+ *    endorse or promote products derived from this software without
 
115
+ *    prior written permission. For permission or any other legal
 
116
+ *    details, please contact  
 
117
+ *      Office of Technology Transfer
 
118
+ *      Carnegie Mellon University
 
119
+ *      5000 Forbes Avenue
 
120
+ *      Pittsburgh, PA  15213-3890
 
121
+ *      (412) 268-4387, fax: (412) 268-7395
 
122
+ *      tech-transfer@andrew.cmu.edu
 
123
+ *
 
124
+ * 4. Redistributions of any form whatsoever must retain the following
 
125
+ *    acknowledgment:
 
126
+ *    "This product includes software developed by Computing Services
 
127
+ *     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
 
128
+ *
 
129
+ * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
 
130
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
 
131
+ * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
 
132
+ * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 
133
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
 
134
+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
 
135
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
136
+ */
 
137
+
 
138
+/* $Id: idle.c,v 1.10 2006/01/04 02:06:23 ondrej Exp $ */
 
139
+
 
140
+#include <config.h>
 
141
+#include <stdlib.h>
 
142
+#include <string.h>
 
143
+#include <stdio.h>
 
144
+#include <netdb.h>
 
145
+#include <sys/socket.h>
 
146
+#include <netinet/in.h>
 
147
+#include <arpa/inet.h>
 
148
+#include <errno.h>
 
149
+#include <syslog.h>
 
150
+#include <sys/types.h>
 
151
+#include <sys/stat.h>
 
152
+#include <unistd.h>
 
153
+#include <fcntl.h>
 
154
+#include "makedepend/def.h"
 
155
+
 
156
+#include "idle.h"
 
157
+#include "exitcodes.h"
 
158
+
 
159
+struct idle_backend *idle_backends[] = {
 
160
+    &id_bk_no,
 
161
+    &id_bk_poll,
 
162
+    &id_bk_idled,
 
163
+    NULL };
 
164
+
 
165
+struct idle_backend *idle_fromname(const char *name)
 
166
+{
 
167
+    int i;
 
168
+    struct idle_backend *idle = NULL;
 
169
+
 
170
+    for (i = 0; idle_backends[i]; i++) {
 
171
+        if (!strcmp(idle_backends[i]->name, name)) {
 
172
+            idle = idle_backends[i];
 
173
+           break;
 
174
+        }
 
175
+    }
 
176
+    if (!idle) {
 
177
+        char errbuf[1024];
 
178
+        snprintf(errbuf, sizeof(errbuf),
 
179
+                 "idle backend %s not supported", name);
 
180
+        fatal(errbuf, EC_CONFIG);
 
181
+    }
 
182
+
 
183
+    return idle;
 
184
+}
 
185
diff -urNad cyrus-imapd-2.2.13/imap/idle.h /tmp/dpep.7DrWs1/cyrus-imapd-2.2.13/imap/idle.h
 
186
--- cyrus-imapd-2.2.13/imap/idle.h      2006-08-21 23:32:39.000000000 +0200
 
187
+++ /tmp/dpep.7DrWs1/cyrus-imapd-2.2.13/imap/idle.h     2006-08-23 18:13:56.180919942 +0200
 
188
@@ -44,8 +44,7 @@
 
189
 #define IDLE_H
 
190
 
 
191
 #include "mailbox.h"
 
192
-
 
193
-extern const char *idle_method_desc;
 
194
+#include "global.h"
 
195
 
 
196
 typedef enum {
 
197
     IDLE_MAILBOX =     0x1,
 
198
@@ -54,20 +53,43 @@
 
199
 
 
200
 typedef void idle_updateproc_t(idle_flags_t flags);
 
201
 
 
202
+struct idle_backend {
 
203
+    const char *name;
 
204
 
 
205
-/* Is IDLE enabled?  Can also do initial setup, if necessary */
 
206
-int idle_enabled(void);
 
207
+    /* Is IDLE enabled?  Can also do initial setup, if necessary */
 
208
+    int (*enabled)(void);
 
209
 
 
210
-/* Setup for IDLE.
 
211
- * 'proc' is a pointer to a function which reports mailbox updates and/or
 
212
- * ALERTs to the client.
 
213
- */
 
214
-int idle_init(idle_updateproc_t *proc);
 
215
+    /* Setup for IDLE.
 
216
+     * 'proc' is a pointer to a function which reports mailbox updates and/or
 
217
+     * ALERTs to the client.
 
218
+     */
 
219
+    int (*init)(idle_updateproc_t *proc);
 
220
 
 
221
-/* Start IDLEing on 'mailbox'. */
 
222
-void idle_start(struct mailbox *mailbox);
 
223
+    /* Start IDLEing on 'mailbox'. */
 
224
+    void (*start)(struct mailbox *mailbox);
 
225
 
 
226
-/* Cleanup when IDLE is completed. */
 
227
-void idle_done(struct mailbox *mailbox);
 
228
+    /* Cleanup when IDLE is completed. */
 
229
+    void (*done)(struct mailbox *mailbox);
 
230
+};
 
231
+
 
232
+/* Defines to simulate old behaviour */
 
233
+/* see struct definition above to see what they do */
 
234
+
 
235
+#define idle_enabled()                 (config_idle?config_idle->enabled():0)
 
236
+#define idle_init(proc)                (config_idle?config_idle->init(proc):0)
 
237
+#define idle_start(mbox)       (config_idle?config_idle->start(mbox):0)
 
238
+#define idle_done(mbox)                (config_idle?config_idle->done(mbox):0)
 
239
+#define idle_method_desc       (config_idle?config_idle->name:NULL)
 
240
+
 
241
+extern struct idle_backend *idle_backends[];
 
242
+
 
243
+/* Note that some of these may be undefined symbols
 
244
+ * if imapd was not built with support for them */
 
245
+extern struct idle_backend id_bk_no;
 
246
+extern struct idle_backend id_bk_poll;
 
247
+extern struct idle_backend id_bk_idled;
 
248
+
 
249
+/* Configuration */
 
250
+struct idle_backend *idle_fromname(const char *name);
 
251
 
 
252
 #endif
 
253
diff -urNad cyrus-imapd-2.2.13/imap/idle_idled.c /tmp/dpep.7DrWs1/cyrus-imapd-2.2.13/imap/idle_idled.c
 
254
--- cyrus-imapd-2.2.13/imap/idle_idled.c        2006-08-23 18:13:47.000000000 +0200
 
255
+++ /tmp/dpep.7DrWs1/cyrus-imapd-2.2.13/imap/idle_idled.c       2006-08-23 18:13:56.180919942 +0200
 
256
@@ -58,8 +58,6 @@
 
257
 #include "idled.h"
 
258
 #include "global.h"
 
259
 
 
260
-const char *idle_method_desc = "idled";
 
261
-
 
262
 /* function to report mailbox updates to the client */
 
263
 static idle_updateproc_t *idle_update = NULL;
 
264
 
 
265
@@ -73,14 +71,14 @@
 
266
 static int idle_remote_len = 0;
 
267
 
 
268
 /* Forward declarations */
 
269
-int idle_send_msg(int msg, struct mailbox *mailbox);
 
270
-void idle_notify(struct mailbox *mailbox);
 
271
+static int idle_send_msg(int msg, struct mailbox *mailbox);
 
272
+static void idle_notify(struct mailbox *mailbox);
 
273
 
 
274
 
 
275
 /*
 
276
  * Create connection to idled for sending notifications
 
277
  */
 
278
-int idle_enabled(void)
 
279
+static int idle_idled_enabled(void)
 
280
 {
 
281
     int s;
 
282
     int fdflags;
 
283
@@ -154,7 +152,10 @@
 
284
     }
 
285
 }
 
286
 
 
287
-int idle_init(idle_updateproc_t *proc)
 
288
+/* forward declaration */
 
289
+static void idle_idled_done(struct mailbox *mailbox);
 
290
+
 
291
+static int idle_idled_init(idle_updateproc_t *proc)
 
292
 {
 
293
     struct sigaction action;
 
294
 
 
295
@@ -177,14 +178,14 @@
 
296
        syslog(LOG_ERR, "sigaction: %m");
 
297
 
 
298
        /* Cancel receiving signals */
 
299
-       idle_done(NULL);
 
300
+       idle_idled_done(NULL);
 
301
        return 0;
 
302
     }
 
303
 
 
304
     return 1;
 
305
 }
 
306
 
 
307
-void idle_start(struct mailbox *mailbox)
 
308
+static void idle_idled_start(struct mailbox *mailbox)
 
309
 {
 
310
     idle_started = 1;
 
311
 
 
312
@@ -195,7 +196,7 @@
 
313
     }
 
314
 }
 
315
 
 
316
-void idle_done(struct mailbox *mailbox)
 
317
+static void idle_idled_done(struct mailbox *mailbox)
 
318
 {
 
319
     /* Tell idled that we're done idling */
 
320
     idle_send_msg(IDLE_DONE, mailbox);
 
321
@@ -212,7 +213,7 @@
 
322
 /*
 
323
  * Send a message to idled
 
324
  */
 
325
-int idle_send_msg(int msg, struct mailbox *mailbox)
 
326
+static int idle_send_msg(int msg, struct mailbox *mailbox)
 
327
 {
 
328
     idle_data_t idledata;
 
329
 
 
330
@@ -235,10 +236,21 @@
 
331
 /*
 
332
  * Notify imapidled of a mailbox change
 
333
  */
 
334
-void idle_notify(struct mailbox *mailbox)
 
335
+static void idle_notify(struct mailbox *mailbox)
 
336
 {
 
337
     /* We should try to determine if we need to send this
 
338
      * (ie, is an imapd is IDLE on 'mailbox'?).
 
339
      */
 
340
     idle_send_msg(IDLE_NOTIFY, mailbox);
 
341
 }
 
342
+
 
343
+struct idle_backend id_bk_idled =
 
344
+{
 
345
+    "idled", /* name */
 
346
+
 
347
+    &idle_idled_enabled,
 
348
+    &idle_idled_init,
 
349
+
 
350
+    &idle_idled_start,
 
351
+    &idle_idled_done
 
352
+};
 
353
diff -urNad cyrus-imapd-2.2.13/imap/idle_no.c /tmp/dpep.7DrWs1/cyrus-imapd-2.2.13/imap/idle_no.c
 
354
--- cyrus-imapd-2.2.13/imap/idle_no.c   2006-08-21 23:32:39.000000000 +0200
 
355
+++ /tmp/dpep.7DrWs1/cyrus-imapd-2.2.13/imap/idle_no.c  2006-08-23 18:13:56.181919844 +0200
 
356
@@ -42,23 +42,31 @@
 
357
 
 
358
 #include "idle.h"
 
359
 
 
360
-
 
361
-const char *idle_method_desc = (char *)0;
 
362
-
 
363
-int idle_enabled(void)
 
364
+static int idle_no_enabled(void)
 
365
 {
 
366
     return 0;
 
367
 }
 
368
 
 
369
-int idle_init(idle_updateproc_t *proc)
 
370
+static int idle_no_init(idle_updateproc_t *proc)
 
371
 {
 
372
     return 0;
 
373
 }
 
374
 
 
375
-void idle_start(struct mailbox *mailbox)
 
376
+static void idle_no_start(struct mailbox *mailbox __attribute__((unused)))
 
377
 {
 
378
 }
 
379
 
 
380
-void idle_done(struct mailbox *mailbox)
 
381
+static void idle_no_done(struct mailbox *mailbox __attribute__((unused)))
 
382
 {
 
383
 }
 
384
+
 
385
+struct idle_backend id_bk_no =
 
386
+{
 
387
+    "no", /* name */
 
388
+
 
389
+    &idle_no_enabled,
 
390
+    &idle_no_init,
 
391
+
 
392
+    &idle_no_start,
 
393
+    &idle_no_done
 
394
+};
 
395
diff -urNad cyrus-imapd-2.2.13/imap/idle_poll.c /tmp/dpep.7DrWs1/cyrus-imapd-2.2.13/imap/idle_poll.c
 
396
--- cyrus-imapd-2.2.13/imap/idle_poll.c 2006-08-21 23:32:39.000000000 +0200
 
397
+++ /tmp/dpep.7DrWs1/cyrus-imapd-2.2.13/imap/idle_poll.c        2006-08-23 18:13:56.181919844 +0200
 
398
@@ -51,15 +51,13 @@
 
399
 #include "idle.h"
 
400
 #include "global.h"
 
401
 
 
402
-const char *idle_method_desc = "poll";
 
403
-
 
404
 /* function to report mailbox updates to the client */
 
405
 static idle_updateproc_t *idle_update = NULL;
 
406
 
 
407
 /* how often to poll the mailbox */
 
408
 static time_t idle_period = -1;
 
409
 
 
410
-int idle_enabled(void)
 
411
+static int idle_poll_enabled(void)
 
412
 {
 
413
     /* get polling period */
 
414
     if (idle_period == -1) {
 
415
@@ -78,7 +76,10 @@
 
416
     alarm(idle_period);
 
417
 }
 
418
 
 
419
-int idle_init(idle_updateproc_t *proc)
 
420
+/* forward declaration */
 
421
+static void idle_poll_done(struct mailbox *mailbox __attribute__((unused)));
 
422
+
 
423
+static int idle_poll_init(idle_updateproc_t *proc)
 
424
 {
 
425
     struct sigaction action;
 
426
 
 
427
@@ -96,22 +97,33 @@
 
428
        syslog(LOG_ERR, "sigaction: %m");
 
429
 
 
430
        /* Cancel receiving signals */
 
431
-       idle_done(NULL);
 
432
+       idle_poll_done(NULL);
 
433
        return 0;
 
434
     }
 
435
 
 
436
     return 1;
 
437
 }
 
438
 
 
439
-void idle_start(struct mailbox *mailbox __attribute__((unused)))
 
440
+static void idle_poll_start(struct mailbox *mailbox __attribute__((unused)))
 
441
 {
 
442
     alarm(idle_period);
 
443
 }
 
444
 
 
445
-void idle_done(struct mailbox *mailbox __attribute__((unused)))
 
446
+static void idle_poll_done(struct mailbox *mailbox __attribute__((unused)))
 
447
 {
 
448
     /* Remove the polling function */
 
449
     signal(SIGALRM, SIG_IGN);
 
450
 
 
451
     idle_update = NULL;
 
452
 }
 
453
+
 
454
+struct idle_backend id_bk_poll = 
 
455
+{
 
456
+    "poll", /* name */
 
457
+
 
458
+    &idle_poll_enabled,
 
459
+    &idle_poll_init,
 
460
+
 
461
+    &idle_poll_start,
 
462
+    &idle_poll_done
 
463
+};
 
464
diff -urNad cyrus-imapd-2.2.13/imap/version.c /tmp/dpep.7DrWs1/cyrus-imapd-2.2.13/imap/version.c
 
465
--- cyrus-imapd-2.2.13/imap/version.c   2006-08-21 23:32:39.000000000 +0200
 
466
+++ /tmp/dpep.7DrWs1/cyrus-imapd-2.2.13/imap/version.c  2006-08-23 18:13:56.181919844 +0200
 
467
@@ -62,6 +62,7 @@
 
468
 #include "map.h"
 
469
 #include "lock.h"
 
470
 #include "nonblock.h"
 
471
+#include "global.h"
 
472
 #include "idle.h"
 
473
 
 
474
 #ifdef USE_SIEVE
 
475
diff -urNad cyrus-imapd-2.2.13/lib/Makefile.in /tmp/dpep.7DrWs1/cyrus-imapd-2.2.13/lib/Makefile.in
 
476
--- cyrus-imapd-2.2.13/lib/Makefile.in  2006-08-23 18:13:47.000000000 +0200
 
477
+++ /tmp/dpep.7DrWs1/cyrus-imapd-2.2.13/lib/Makefile.in 2006-08-23 18:13:56.182919747 +0200
 
478
@@ -74,6 +74,8 @@
 
479
 
 
480
 libdir = @libdir@
 
481
 
 
482
+IDLE = @WITH_IDLE@
 
483
+
 
484
 BUILTSOURCES = imapopts.h imapopts.c
 
485
 
 
486
 LIBCYR_HDRS = $(srcdir)/acl.h $(srcdir)/assert.h $(srcdir)/auth.h \
 
487
@@ -132,7 +134,7 @@
 
488
        $(RANLIB) libcyrus_min.a
 
489
 
 
490
 imapopts.c: imapoptions $(srcdir)/../tools/config2header
 
491
-       $(srcdir)/../tools/config2header CC=$(CC) $(srcdir)/imapopts.c $(srcdir)/imapopts.h < $(srcdir)/imapoptions
 
492
+       sed -e "s/%IDLE%/$(IDLE)/g" < $(srcdir)/imapoptions | $(srcdir)/../tools/config2header CC=$(CC) $(srcdir)/imapopts.c $(srcdir)/imapopts.h
 
493
 
 
494
 imapopts.h: imapopts.c
 
495
 
 
496
diff -urNad cyrus-imapd-2.2.13/lib/imapoptions /tmp/dpep.7DrWs1/cyrus-imapd-2.2.13/lib/imapoptions
 
497
--- cyrus-imapd-2.2.13/lib/imapoptions  2006-08-23 18:13:47.000000000 +0200
 
498
+++ /tmp/dpep.7DrWs1/cyrus-imapd-2.2.13/lib/imapoptions 2006-08-23 18:13:56.182919747 +0200
 
499
@@ -248,6 +248,9 @@
 
500
 /* The password to use for authentication to the backend server hostname
 
501
    (where hostname is the short hostname of the server) - Cyrus Murder */
 
502
 
 
503
+{ "idlemethod", "%IDLE%", STRINGLIST("no", "poll", "idled") }
 
504
+/* The idle backend to use for IDLE command. */
 
505
+
 
506
 { "idlesocket", "{configdirectory}/socket/idle", STRING }
 
507
 /* Unix domain socket that idled listens on. */
 
508