cyrus 2.3.14 on opensuse 11.1 x64 and lmtp errors

Dave McMurtrie dave64 at andrew.cmu.edu
Tue Sep 28 17:52:57 EDT 2010


Bron Gondwana wrote:
> On Tue, Sep 28, 2010 at 05:47:35PM +0200, Josef Karliak wrote:
>>  Yes,
>> I see, where did I got that ??? Nor cyrus didn't complain for
>> unknown config options ...
>>   Thanks for kick :)
>>   J.K.
> 
> Yeah, Cyrus doesn't complain about unknown options for a couple
> of reasons:
> 
> a) because you can prefix any option with a service name from
> cyrus.conf and it will override the basic config option.
> 
> b) options that depend on partitions.
> 
> Now - it's probably possible to scan through them and check if
> there's anything unexpected.  Makes it a pain dealing with
> different versions that support different options - but I agree
> a warning would be nice.

Speaking of this, I sent the following to cyrus-devel in April, 2009. 
It's less complete than your suggestion and it wouldn't have helped in 
this particular situation.  I'm not sure if it's worthwhile or not.

Message-ID: <49E633F9.2030105 at andrew.cmu.edu>
Date: Wed, 15 Apr 2009 15:22:33 -0400
From: Dave McMurtrie <dave64 at andrew.cmu.edu>
User-Agent: Thunderbird 2.0.0.12 (X11/20080213)
MIME-Version: 1.0
To: cyrus-devel at lists.andrew.cmu.edu
Subject: Improvement to config file parsing code?
X-Enigmail-Version: 0.95.7
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

I discovered that the code in libconfig.c that parses imapd.conf really
has no way of warning you if you make a typo.  It looks like someone
tried to deal with this at some point, but that code is commented out
because it would die on any service-specific configuration options.

The patch I propose here relies on the fact that a service-specific
option must contain a '_' character in it, so this patch would at least
catch simple typos to real imapd configuration options.  Of course, this
patch is only valid if my assumption that all service-specific options
must contain an underscore is valid.

Thoughts?  If this would be useful, I'll throw it in bugzilla.  If it's
a dumb idea, I'll forget about it.

--- libconfig.c.orig    2009-03-31 08:22:14.000000000 -0400
+++ libconfig.c 2009-04-15 15:04:44.000000000 -0400
@@ -589,18 +589,14 @@
             /* check to make sure it's valid for overflow */
             /* that is, partition names and anything that might be
              * used by SASL */
-/*
-  xxx this would be nice if it wasn't for other services who might be
-      sharing this config file and whose names we cannot predict
-
             if(strncasecmp(key,"sasl_",5)
-           && strncasecmp(key,"partition-",10)) {
+              && strncasecmp(key,"partition-",10)
+              && (!strchr(key,'_'))) {
                 sprintf(errbuf,
                         "option '%s' is unknown on line %d of config file",
                         fullkey, lineno);
                 fatal(errbuf, EC_CONFIG);
             }
-*/

             /* Put it in the overflow hash table */
             newval = xstrdup(p);


More information about the Info-cyrus mailing list