From ea76acdd3de80664f7e5ac93796de12c34e41e20 Mon Sep 17 00:00:00 2001 From: Stuart Gathman <stuart@gathman.org> Date: Wed, 4 Oct 2006 03:46:01 +0000 Subject: [PATCH] Fix defaults. --- bms.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bms.py b/bms.py index d349ba8..fb392d2 100644 --- a/bms.py +++ b/bms.py @@ -1,6 +1,10 @@ #!/usr/bin/env python # A simple milter that has grown quite a bit. # $Log$ +# Revision 1.67 2006/10/01 01:44:06 customdesigned +# case_sensitive_localpart option, more delayed bounce heuristics, +# optional smart_alias section. +# # Revision 1.66 2006/07/26 16:42:26 customdesigned # Support CBV timeout # @@ -339,8 +343,14 @@ class MilterConfigParser(ConfigParser): ConfigParser.__init__(self) self.defaults = defaults + # The defaults provided by ConfigParser show up in all sections, + # which screws up iterating over all options in a section. + # Worse, passing "defaults" with vars= overrides the config file! + # So we roll our own defaults. def get(self,sect,opt): - return ConfigParser.get(self,sect,opt,vars=self.defaults) + if not self.has_option(sect,opt) and opt in self.defaults: + return self.defaults[opt] + return ConfigParser.get(self,sect,opt) def getlist(self,sect,opt): if self.has_option(sect,opt): -- GitLab