Phil Dibowitz schrieb am Thu, May 23, 2002 at 11:48:46AM -0700:
> I found this post:
> 
> http://archives.neohapsis.com/archives/postfix/2001-09/1681.html
> 
> In which the author states he's using Cyrus Imapd's 'altconfig' option to 
> bind seperate imapd processes to seperate interfaces and giving them each a 
> different mail directory.
> 
> This would be perfect for my needs, but I can't find this 'altconfig' 
> option he refers to. Anyone know where/what that is?

Not me.  But BTW: I once wrote a patch that enables master to behave like
the subprocesses when given a "-C" at command line.  See imapd(8) for de-
tails.  I tried several times to get it into some mainstream release, to 
no avail  :-]

Maybe the patch still applies (AFAIK my last working test was with 2.1.2),
its quite small and might be changed easily to fit with 2.1.4.  In case you
use 2.0.16, it applies very neatly.


Regards,

Birger
diff -u cyrus-imapd-2.0.16.orig/master/master.c cyrus-imapd-2.0.16/master/master.c
--- cyrus-imapd-2.0.16.orig/master/master.c     Mon Jul 16 20:23:11 2001
+++ cyrus-imapd-2.0.16/master/master.c  Thu Oct 25 17:21:04 2001
@@ -101,6 +101,7 @@
 
 static int verbose = 0;
 static int listen_queue_backlog = 32;
+char config_filename[255] = "/etc/cyrus.conf";
 
 struct service *Services = NULL;
 int allocservices = 0;
@@ -1002,8 +1003,11 @@
 
     p = getenv("CYRUS_VERBOSE");
     if (p) verbose = atoi(p) + 1;
-    while ((opt = getopt(argc, argv, "l:D")) != EOF) {
+    while ((opt = getopt(argc, argv, "C:l:D")) != EOF) {
        switch (opt) {
+       case 'C': /* user defined cyrus.conf */
+           strncpy(config_filename, optarg, sizeof(config_filename));
+           break;
        case 'l': /* user defined listen queue backlog */
            listen_queue_backlog = atoi(optarg);
            break;
diff -u cyrus-imapd-2.0.16.orig/master/masterconf.c 
cyrus-imapd-2.0.16/master/masterconf.c
--- cyrus-imapd-2.0.16.orig/master/masterconf.c Wed Mar 14 23:39:35 2001
+++ cyrus-imapd-2.0.16/master/masterconf.c      Thu Oct 25 17:25:45 2001
@@ -59,7 +59,7 @@
 
 extern int errno;
 
-#define CONFIG_FILENAME "/etc/cyrus.conf"
+extern char config_filename;
 
 struct configlist {
     char *key;
@@ -102,7 +102,7 @@
            }
            if (*p != '"') {
                sprintf(k, "configuration file %s: missing \" on line %d",
-                       CONFIG_FILENAME, e->lineno);
+                       config_filename, e->lineno);
                fatal(k, EX_CONFIG);
            }
        } else {
@@ -198,9 +198,9 @@
     int lineno = 0;
     char buf[4096];
 
-    infile = fopen(CONFIG_FILENAME, "r");
+    infile = fopen(config_filename, "r");
     if (!infile) {
-       sprintf(buf, "can't open configuration file %s: %s", CONFIG_FILENAME,
+       sprintf(buf, "can't open configuration file %s: %s", config_filename,
                strerror(errno));
        fatal(buf, EX_CONFIG);
     }

Reply via email to