*** cyrus-imapd-1.6.20/imap/arbitron.c	Tue Aug 31 14:39:19 1999
--- cyrus-imapd-1.6.20/imap/arbitron.c	Sat Jan 15 00:24:25 2000
***************
*** 48,51 ****
--- 48,52 ----
  extern int optind;
  extern char *optarg;
+ extern int opterr;
  
  int code = 0;
***************
*** 68,73 ****
      int prune_months = 0;
      char pattern[MAX_MAILBOX_NAME+1];
! 
!     config_init("arbitron");
  
      strcpy(pattern, "*");
--- 69,73 ----
      int prune_months = 0;
      char pattern[MAX_MAILBOX_NAME+1];
!     char *configfile = 0;
  
      strcpy(pattern, "*");
***************
*** 75,80 ****
      if (geteuid() == 0) fatal("must run as the Cyrus user", EC_USAGE);
  
!     while ((opt = getopt(argc, argv, "d:p:")) != EOF) {
  	switch (opt) {
  	case 'd':
  	    report_days = atoi(optarg);
--- 75,84 ----
      if (geteuid() == 0) fatal("must run as the Cyrus user", EC_USAGE);
  
!     opterr = 0;
!     while ((opt = getopt(argc, argv, "c:d:p:")) != EOF) {
  	switch (opt) {
+ 	case 'c':
+ 	    if (*optarg) configfile = optarg;
+ 	    break;
  	case 'd':
  	    report_days = atoi(optarg);
***************
*** 91,94 ****
--- 95,99 ----
  	}
      }
+     config_init("arbitron",configfile);
  
      if (optind != argc) strncpy(pattern, argv[optind], MAX_MAILBOX_NAME);
***************
*** 106,110 ****
  usage()
  {
!     fprintf(stderr, "usage: arbitron [-d days] [-p months] [mboxpattern]\n");
      exit(EC_USAGE);
  }    
--- 111,115 ----
  usage()
  {
!     fprintf(stderr, "usage: arbitron [-c configfile] [-d days] [-p months] [mboxpattern]\n");
      exit(EC_USAGE);
  }    
*** cyrus-imapd-1.6.20/imap/collectnews.c	Fri Oct  1 20:43:03 1999
--- cyrus-imapd-1.6.20/imap/collectnews.c	Sat Jan 15 00:08:00 2000
***************
*** 43,46 ****
--- 43,48 ----
  
  extern int errno;
+ extern char *optarg;
+ extern int opterr;
  
  struct newsgroup {
***************
*** 63,71 ****
  {
      char buf[4096], *group, *nextgroup, *uid, *p;
      int c;
! 
!     config_init("collectnews");
  
      if (geteuid() == 0) fatal("must run as the Cyrus user", EC_USAGE);
  
      newsprefix = config_getstring("newsprefix", 0);
--- 65,86 ----
  {
      char buf[4096], *group, *nextgroup, *uid, *p;
+     char *configfile = 0;
      int c;
!     int opt;
  
      if (geteuid() == 0) fatal("must run as the Cyrus user", EC_USAGE);
+ 
+     opterr = 0;
+     while ((opt = getopt(argc, argv, "c:")) != EOF) {
+       switch(opt) {
+         case 'c':
+           if (*optarg) configfile = optarg;
+           break;
+         default:
+           break;
+       }
+     }
+ 
+     config_init("collectnews",configfile);
  
      newsprefix = config_getstring("newsprefix", 0);
*** cyrus-imapd-1.6.20/imap/config.c	Fri Oct  1 20:43:03 1999
--- cyrus-imapd-1.6.20/imap/config.c	Sat Jan 15 00:23:16 2000
***************
*** 56,63 ****
  int config_hashimapspool;
  
! static void config_read P((void));
  
! int config_init(ident)
  const char *ident;
  {
      char buf[100];
--- 56,65 ----
  int config_hashimapspool;
  
! /*static void config_read P((void));*/
! static void config_read P((const char *));
  
! int config_init(ident,configfile)
  const char *ident;
+ const char *configfile;
  {
      char buf[100];
***************
*** 70,74 ****
      openlog(ident, LOG_PID, LOG_LOCAL6);
  
!     config_read();
  
      /* Look up configdirectory config option */
--- 72,79 ----
      openlog(ident, LOG_PID, LOG_LOCAL6);
  
!     if (configfile)
!       config_read(configfile);
!     else
!       config_read(CONFIG_FILENAME);
  
      /* Look up configdirectory config option */
***************
*** 170,174 ****
  #define CONFIGLISTGROWSIZE 10 /* 100 */
  static void
! config_read()
  {
      FILE *infile;
--- 175,180 ----
  #define CONFIGLISTGROWSIZE 10 /* 100 */
  static void
! config_read(configfile)
! const char *configfile;
  {
      FILE *infile;
***************
*** 178,184 ****
      char *p, *key;
  
!     infile = fopen(CONFIG_FILENAME, "r");
      if (!infile) {
! 	sprintf(buf, "can't open configuration file %s: %s", CONFIG_FILENAME,
  		error_message(errno));
  	fatal(buf, EC_CONFIG);
--- 184,190 ----
      char *p, *key;
  
!     infile = fopen(configfile, "r");
      if (!infile) {
! 	sprintf(buf, "can't open configuration file %s: %s", configfile,
  		error_message(errno));
  	fatal(buf, EC_CONFIG);
*** cyrus-imapd-1.6.20/imap/config.h	Mon Aug  9 17:43:35 1999
--- cyrus-imapd-1.6.20/imap/config.h	Fri Jan 14 23:55:26 2000
***************
*** 39,43 ****
  #endif
  
! extern int config_init P((const char *ident));
  extern const char *config_getstring P((const char *key, const char *def));
  extern int config_getint P((const char *key, int def));
--- 39,43 ----
  #endif
  
! extern int config_init P((const char *ident, const char *configfilename));
  extern const char *config_getstring P((const char *key, const char *def));
  extern int config_getint P((const char *key, int def));
*** cyrus-imapd-1.6.20/imap/deliver.c	Wed Nov 17 15:02:23 1999
--- cyrus-imapd-1.6.20/imap/deliver.c	Sat Jan 15 00:00:32 2000
***************
*** 328,331 ****
--- 328,332 ----
      char *mailboxname = 0;
      char **flag = 0;
+     char *configfile = 0;
      int nflags = 0;
      char *authuser = 0;
***************
*** 339,353 ****
      prot_settimeout(deliver_in, 300);
  
-     config_init("deliver");
- 
- #ifdef USE_SIEVE
-     sieve_usehomedir = config_getswitch("sieveusehomedir", 0);
-     if (!sieve_usehomedir) {
- 	sieve_dir = config_getstring("sievedir", "/usr/sieve");
-     } else {
- 	sieve_dir = NULL;
-     }
- #endif USE_SIEVE
- 
      msg_new(&msgdata);
      memset((void *) delopts, 0, sizeof(deliver_opts_t));
--- 340,343 ----
***************
*** 360,365 ****
      }
  
!     while ((opt = getopt(argc, argv, "df:r:m:a:F:eE:lqD")) != EOF) {
  	switch(opt) {
  	case 'd':
  	    /* Ignore -- /bin/mail compatibility flags */
--- 350,358 ----
      }
  
!     while ((opt = getopt(argc, argv, "c:df:r:m:a:F:eE:lqD")) != EOF) {
  	switch(opt) {
+         case 'c':
+ 	    if (*optarg) configfile = optarg;
+ 	    break;
  	case 'd':
  	    /* Ignore -- /bin/mail compatibility flags */
***************
*** 419,423 ****
--- 412,424 ----
      }
  
+     config_init("deliver",configfile);
+ 
  #ifdef USE_SIEVE
+     sieve_usehomedir = config_getswitch("sieveusehomedir", 0);
+     if (!sieve_usehomedir) {
+ 	sieve_dir = config_getstring("sievedir", "/usr/sieve");
+     } else {
+ 	sieve_dir = NULL;
+     }
      /* setup sieve support */
      setup_sieve(delopts, lmtpflag);
***************
*** 1258,1262 ****
  {
      fprintf(stderr, 
! "421-4.3.0 usage: deliver [-m mailbox] [-a auth] [-i] [-F flag]... [user]...\r\n");
      fprintf(stderr, "421 4.3.0        deliver -E age\n");
      fprintf(stderr, "421 4.3.0 %s\n", CYRUS_VERSION);
--- 1259,1263 ----
  {
      fprintf(stderr, 
! "421-4.3.0 usage: deliver [-c configfile] [-m mailbox] [-a auth] [-i] [-F flag]... [user]...\r\n");
      fprintf(stderr, "421 4.3.0        deliver -E age\n");
      fprintf(stderr, "421 4.3.0 %s\n", CYRUS_VERSION);
*** cyrus-imapd-1.6.20/imap/dump_deliver.c	Thu Nov  4 20:26:52 1999
--- cyrus-imapd-1.6.20/imap/dump_deliver.c	Sat Jan 15 00:14:40 2000
***************
*** 119,132 ****
    int opt;
    char *alt_file = NULL;
  
!   while ((opt = getopt(argc, argv, "f:")) != EOF) {
      switch (opt) {
      case 'f':
        alt_file = optarg;
        break;
      case '?':
!       fprintf(stderr,"usage: -f"
  	      "\n\t-f <dbfile>\tAlternate location for deliver.db file."
! 	      "\n");
        exit(-1);
        break;
--- 119,136 ----
    int opt;
    char *alt_file = NULL;
+   char *configfile = 0;
  
!   while ((opt = getopt(argc, argv, "c:f:")) != EOF) {
      switch (opt) {
+     case 'c':
+       if (*optarg) configfile = optarg;
+       break;
      case 'f':
        alt_file = optarg;
        break;
      case '?':
!       fprintf(stderr,"usage: [-c configfile] -f"
  	      "\n\t-f <dbfile>\tAlternate location for deliver.db file."
! 	      "\n\t-c <configfile>\tOptional config file\n");
        exit(-1);
        break;
***************
*** 137,141 ****
    }
  
!   config_init("dump_deliverdb");
    
    printf("it is NOW: %d\n", time(NULL));
--- 141,145 ----
    }
  
!   config_init("dump_deliverdb",configfile);
    
    printf("it is NOW: %d\n", time(NULL));
*** cyrus-imapd-1.6.20/imap/feedcyrus	Wed Dec 31 19:00:00 1969
--- cyrus-imapd-1.6.20/imap/feedcyrus	Fri Jan 14 15:06:01 2000
***************
*** 0 ****
--- 1,75 ----
+ #! /bin/sh
+ # $Id: feedcyrus.in,v 1.8 1998/05/12 22:27:47 wcw Exp $
+ # Generated automatically from feedcyrus.in by configure.
+ ##
+ ##  Send news to Cyrus IMAPD
+ ##  =()<. @<_PATH_SHELLVARS>@>()=
+ . no
+ 
+ CYRUS_DIR=/usr/cyrus/bin
+ 
+ PROGNAME=`basename $0`
+ LOCK=${LOCKS}/LOCK.${PROGNAME}
+ LOG=${MOST_LOGS}/${PROGNAME}.log
+ 
+ ##  Go to where the action is.
+ test ! -d ${BATCH} && {
+     echo "${PROGNAME}: directory ${BATCH} not found" 1>&2
+     exit 1
+ }
+ cd ${BATCH}
+ 
+ ##  Set up log file.
+ umask 002
+ test -z "${D_FLAG}" && {
+     test ! -f ${LOG} && touch ${LOG}
+     chmod 0660 ${LOG}
+     exec >>${LOG} 2>&1
+ }
+ PARENTPID=$$
+ echo "${PROGNAME}: [${PARENTPID}] start"
+ 
+ ##  Set up environment.
+ export BATCH PROGNAME PARENTPID CYRUS_DIR
+ 
+ ##  Loop over all sites.
+ for PROG in collectnews; do
+ 
+     ##  Start sending this site in the background.
+     export PROG LOCKS BATCHFILE PROGNAME PARENTPID TMPDIR
+     sh -c '
+ 	BATCHFILE=${PROG}.input
+ 	LOCK=${LOCKS}/LOCK.${PROG}
+ 	trap "rm -f ${LOCK} ; exit 1" 1 2 3 15
+ 	shlock -p $$ -f ${LOCK} || {
+ 	    WHY="`cat ${LOCK}`"
+ 	    echo "${PROGNAME}: [${PARENTPID}:$$] ${PROG} locked ${WHY} `date`"
+ 	    exit
+ 	}
+ 	if [ -f ${PROG}.work ] ; then
+ 	    cat ${PROG}.work >>${BATCHFILE}
+ 	    rm -f ${PROG}.work
+ 	fi
+ 	mv ${PROG} ${PROG}.work
+ 	if ctlinnd -s -t30 flush ${PROG}"!" ; then
+ 	    if [ -f ${BATCHFILE} ] ; then
+ 		cat ${PROG}.work >>${BATCHFILE}
+ 		rm -f ${PROG}.work
+ 	    else
+ 		mv ${PROG}.work ${BATCHFILE}
+ 	    fi
+ 	    if [ -s ${BATCHFILE} ] ; then
+ 		echo "${PROGNAME}: [${PARENTPID}:$$] begin ${PROG} `date`"
+ 		${CYRUS_DIR}/${PROG} < ${BATCH}/${BATCHFILE} && rm -f ${BATCHFILE} 
+ 		echo "${PROGNAME}: [${PARENTPID}:$$] end ${PROG} `date`"
+ 	    else
+ 		rm -f ${BATCHFILE}
+ 	    fi
+ 	fi
+ 	rm -f ${LOCK}
+     ' &
+     sleep 5
+ done
+ 
+ wait
+ echo "${PROGNAME}: [${PARENTPID}] stop"
*** cyrus-imapd-1.6.20/imap/fud.c	Thu Apr  8 17:04:22 1999
--- cyrus-imapd-1.6.20/imap/fud.c	Sat Jan 15 00:11:53 2000
***************
*** 60,63 ****
--- 60,64 ----
  extern int optind;
  extern char *optarg;
+ extern int opterr;
  
  void send_reply P((struct sockaddr_in sfrom, int status,
***************
*** 76,87 ****
  {
      int port, r;
     
  
      r = 0; /* to shut up lint/gcc */
  
-     config_init("fud");
  
      if(geteuid() == 0)
          fatal("must run as the Cyrus user", EC_USAGE);
      r = init_network(port);
      signal(SIGHUP,SIG_IGN);
--- 77,102 ----
  {
      int port, r;
+     char *configfile;
+     int opt;
     
  
      r = 0; /* to shut up lint/gcc */
  
  
      if(geteuid() == 0)
          fatal("must run as the Cyrus user", EC_USAGE);
+ 
+     opterr = 0;
+     while ((opt = getopt(argc, argv, "c:")) != EOF) {
+       switch(opt) {
+         case 'c':
+           if (*optarg) configfile = optarg;
+           break;
+         default:
+           break;
+       }
+     }
+ 
+     config_init("fud",configfile);
      r = init_network(port);
      signal(SIGHUP,SIG_IGN);
*** cyrus-imapd-1.6.20/imap/imapd.c	Thu Dec  2 00:22:39 1999
--- cyrus-imapd-1.6.20/imap/imapd.c	Sat Jan 15 00:01:11 2000
***************
*** 71,74 ****
--- 71,75 ----
  extern int optind;
  extern char *optarg;
+ extern int opterr;
  
  extern int errno;
***************
*** 410,414 ****
--- 411,417 ----
      struct hostent *hp;
      int timeout;
+     int opt;
      char hostname[MAXHOSTNAMELEN+1];
+     char *configfile = 0;
      sasl_security_properties_t *secprops = NULL;
  
***************
*** 420,424 ****
  
      setproctitle_init(argc, argv, envp);
!     config_init("imapd");
  
      signal(SIGPIPE, SIG_IGN);
--- 423,439 ----
  
      setproctitle_init(argc, argv, envp);
!     
!     opterr = 0;
!     while ((opt = getopt(argc, argv, "c:")) != EOF) {
!       switch(opt) {
!         case 'c':
! 	  if (*optarg) configfile = optarg;
!           break;
! 	default:
! 	  break;
!       }
!     }
! 
!     config_init("imapd",configfile);
  
      signal(SIGPIPE, SIG_IGN);
*** cyrus-imapd-1.6.20/imap/mbpath.c	Sat Aug 14 14:56:49 1999
--- cyrus-imapd-1.6.20/imap/mbpath.c	Sat Jan 15 00:13:38 2000
***************
*** 68,73 ****
  static int 
  usage(void) {
!   fprintf(stderr,"usage: cdmb [-q] <mailbox name>...\n");
    fprintf(stderr,"\t-q\tquietly drop any error messages\n");
    fatal(NULL, -1);
  }
--- 68,74 ----
  static int 
  usage(void) {
!   fprintf(stderr,"usage: cdmb [-c configfile] [-q] <mailbox name>...\n");
    fprintf(stderr,"\t-q\tquietly drop any error messages\n");
+   fprintf(stderr,"\t-c\toptionally specifiy a different config file\n");
    fatal(NULL, -1);
  }
***************
*** 79,88 ****
    int rc, i, quiet = 0, stop_on_error=0;
    char opt;
  
  
-   config_init("mbpath");
  
!   while ((opt = getopt(argc, argv, "qs")) != EOF) {
      switch(opt) {
      case 'q':
        quiet = 1;
--- 80,92 ----
    int rc, i, quiet = 0, stop_on_error=0;
    char opt;
+   char *configfile = 0;
  
  
  
!   while ((opt = getopt(argc, argv, "c:qs")) != EOF) {
      switch(opt) {
+     case 'c':
+       if (*optarg) configfile = optarg;
+       break;
      case 'q':
        quiet = 1;
***************
*** 91,95 ****
        stop_on_error = 1;
        break;
- 
      default:
        usage();
--- 95,98 ----
***************
*** 97,100 ****
--- 100,104 ----
    }
  
+   config_init("mbpath",configfile);
    for (i = optind; i < argc; i++) {
      (void)memset(&path, 0, sizeof(path));
*** cyrus-imapd-1.6.20/imap/pop3d.c	Thu Dec  2 15:42:13 1999
--- cyrus-imapd-1.6.20/imap/pop3d.c	Sat Jan 15 00:16:05 2000
***************
*** 179,182 ****
--- 179,183 ----
      int opt;
      char hostname[MAXHOSTNAMELEN+1];
+     char *configfile = 0;
      int salen;
      struct hostent *hp;
***************
*** 191,196 ****
  
      opterr = 0;
!     while ((opt = getopt(argc, argv, "k")) != EOF) {
  	switch(opt) {
  #ifdef HAVE_KRB
  	case 'k':
--- 192,200 ----
  
      opterr = 0;
!     while ((opt = getopt(argc, argv, "c:k")) != EOF) {
  	switch(opt) {
+         case 'c':
+           if (*optarg) configfile = optarg;
+           break;
  #ifdef HAVE_KRB
  	case 'k':
***************
*** 205,209 ****
  
      setproctitle_init(argc, argv, envp);
!     config_init("pop3d");
  
      signal(SIGPIPE, SIG_IGN);
--- 209,213 ----
  
      setproctitle_init(argc, argv, envp);
!     config_init("pop3d",configfile);
  
      signal(SIGPIPE, SIG_IGN);
***************
*** 277,281 ****
  		" [-k]"
  #else
! 		""
  #endif
  		);
--- 281,285 ----
  		" [-k]"
  #else
! 		"[-c configfile]"
  #endif
  		);
*** cyrus-imapd-1.6.20/imap/quota.c	Fri Aug 20 16:08:30 1999
--- cyrus-imapd-1.6.20/imap/quota.c	Sat Jan 15 00:17:04 2000
***************
*** 91,101 ****
      int fflag = 0;
      int r, code = 0;
! 
!     config_init("quota");
  
      if (geteuid() == 0) fatal("must run as the Cyrus user", EC_USAGE);
  
!     while ((opt = getopt(argc, argv, "f")) != EOF) {
  	switch (opt) {
  	case 'f':
  	    fflag = 1;
--- 91,103 ----
      int fflag = 0;
      int r, code = 0;
!     char *configfile = 0;
  
      if (geteuid() == 0) fatal("must run as the Cyrus user", EC_USAGE);
  
!     while ((opt = getopt(argc, argv, "c:f")) != EOF) {
  	switch (opt) {
+         case 'c':
+           if (*optarg) configfile = optarg;
+           break;
  	case 'f':
  	    fflag = 1;
***************
*** 107,110 ****
--- 109,114 ----
      }
  
+     config_init("quota",configfile);
+ 
      r = buildquotalist(argv+optind, argc-optind);
  
***************
*** 123,127 ****
  usage()
  {
!     fprintf(stderr, "usage: quota [-f] [prefix]...\n");
      exit(EC_USAGE);
  }    
--- 127,131 ----
  usage()
  {
!     fprintf(stderr, "usage: quota [-c configfile] [-f] [prefix]...\n");
      exit(EC_USAGE);
  }    
*** cyrus-imapd-1.6.20/imap/reconstruct.c	Fri Aug 20 15:05:30 1999
--- cyrus-imapd-1.6.20/imap/reconstruct.c	Sat Jan 15 00:18:02 2000
***************
*** 85,90 ****
      int mflag = 0;
      char buf[MAX_MAILBOX_PATH];
! 
!     config_init("reconstruct");
  
      if (geteuid() == 0) fatal("must run as the Cyrus user", EC_USAGE);
--- 85,89 ----
      int mflag = 0;
      char buf[MAX_MAILBOX_PATH];
!     char *configfile = 0;
  
      if (geteuid() == 0) fatal("must run as the Cyrus user", EC_USAGE);
***************
*** 94,99 ****
      assert(INDEX_RECORD_SIZE == (OFFSET_USER_FLAGS+MAX_USER_FLAGS/8));
  
!     while ((opt = getopt(argc, argv, "rm")) != EOF) {
  	switch (opt) {
  	case 'r':
  	    rflag = 1;
--- 93,101 ----
      assert(INDEX_RECORD_SIZE == (OFFSET_USER_FLAGS+MAX_USER_FLAGS/8));
  
!     while ((opt = getopt(argc, argv, "c:rm")) != EOF) {
  	switch (opt) {
+         case 'c':
+           if (*optarg) configfile = optarg;
+           break;
  	case 'r':
  	    rflag = 1;
***************
*** 109,112 ****
--- 111,116 ----
      }
  
+     config_init("reconstruct",configfile);
+ 
      if (mflag) {
  	if (rflag || optind != argc) usage();
***************
*** 139,144 ****
  usage()
  {
!     fprintf(stderr, "usage: reconstruct [-r] mailbox...\n");
!     fprintf(stderr, "       reconstruct -m\n");
      exit(EC_USAGE);
  }    
--- 143,148 ----
  usage()
  {
!     fprintf(stderr, "usage: reconstruct [-c configfile] [-r] mailbox...\n");
!     fprintf(stderr, "       reconstruct [-c configfile] -m\n");
      exit(EC_USAGE);
  }    
*** cyrus-imapd-1.6.20/imap/rmnews.c	Thu Apr  8 17:04:27 1999
--- cyrus-imapd-1.6.20/imap/rmnews.c	Sat Jan 15 00:19:28 2000
***************
*** 44,47 ****
--- 44,50 ----
  
  extern int errno;
+ extern char *optarg;
+ extern int opterr;
+ 
  
  const char *newsprefix;
***************
*** 67,72 ****
      static struct uidlist uidlist;
      int c;
  
!     config_init("rmnews");
  
      if (geteuid() == 0) fatal("must run as the Cyrus user", EC_USAGE);
--- 70,88 ----
      static struct uidlist uidlist;
      int c;
+     int opt;
+     char *configfile = 0;
+ 
+     opterr = 0;
+     while ((opt = getopt(argc, argv, "c:")) != EOF) {
+       switch(opt) {
+         case 'c':
+           if (*optarg) configfile = optarg;
+           break;
+         default:
+           break;
+       }
+     }
  
!     config_init("rmnews",configfile);
  
      if (geteuid() == 0) fatal("must run as the Cyrus user", EC_USAGE);
*** cyrus-imapd-1.6.20/imap/syncnews.c	Fri Oct  1 20:43:07 1999
--- cyrus-imapd-1.6.20/imap/syncnews.c	Sat Jan 15 00:22:58 2000
***************
*** 50,53 ****
--- 50,54 ----
  extern int optind;
  extern char *optarg;
+ extern int opterr;
  
  int code = 0;
***************
*** 63,73 ****
  {
      int opt;
! 
!     config_init("syncnews");
! 
      if (geteuid() == 0) fatal("must run as the Cyrus user", EC_USAGE);
  
!     while ((opt = getopt(argc, argv, "")) != EOF) {
  	switch (opt) {
  	default:
  	    usage();
--- 64,75 ----
  {
      int opt;
!     char *configfile = 0;
      if (geteuid() == 0) fatal("must run as the Cyrus user", EC_USAGE);
  
!     while ((opt = getopt(argc, argv, "c:")) != EOF) {
  	switch (opt) {
+         case 'c':
+           if (*optarg) configfile = optarg;
+           break;
  	default:
  	    usage();
***************
*** 75,78 ****
--- 77,82 ----
      }
  
+     config_init("syncnews",configfile);
+ 
      if (!argv[optind] || argv[optind+1]) usage();
  
***************
*** 85,89 ****
  usage()
  {
!     fprintf(stderr, "usage: syncnews active\n");
      exit(EC_USAGE);
  }    
--- 89,93 ----
  usage()
  {
!     fprintf(stderr, "usage: syncnews [-c configfile] active\n");
      exit(EC_USAGE);
  }    
*** cyrus-imapd-1.6.20/imap/updateimsp.c	Thu Apr  8 17:04:28 1999
--- cyrus-imapd-1.6.20/imap/updateimsp.c	Sat Jan 15 00:22:28 2000
***************
*** 60,63 ****
--- 60,66 ----
  };
  
+ extern char *optarg;
+ extern int opterr;
+ 
  FILE *failedfp;
  int commands_pending;
***************
*** 69,74 ****
  {
      const char *val;
  
!     config_init("updateimsp");
  
      if (geteuid() == 0) fatal("must run as the Cyrus user", EC_USAGE);
--- 72,90 ----
  {
      const char *val;
+     int opt;
+     char *configfile = 0;
+ 
+     opterr = 0;
+     while ((opt = getopt(argc, argv, "c:")) != EOF) {
+       switch(opt) {
+         case 'c':
+           if (*optarg) configfile = optarg;
+           break;
+         default:
+           break;
+       }
+     }
  
!     config_init("updateimsp",configfile);
  
      if (geteuid() == 0) fatal("must run as the Cyrus user", EC_USAGE);
*** cyrus-imapd-1.6.20/imap/version.h	Wed Dec  8 00:05:39 1999
--- cyrus-imapd-1.6.20/imap/version.h	Sat Jan 15 00:23:49 2000
***************
*** 4,8 ****
   */
  
! #define _CYRUS_VERSION "v1.6.20"
  
  /* EXTRA_IDENT is a hack to add some version information for which compile
--- 4,8 ----
   */
  
! #define _CYRUS_VERSION "v1.6.20-dmzb2"
  
  /* EXTRA_IDENT is a hack to add some version information for which compile
