bus...@Fry  committed b48d010

added fix for quote_notification extension from Antoine

  • Participants
  • Parent commits a55a03d
  • Branches default

Comments (0)

Files changed (2)

File sievelib/

             for arg in self.args_definition:
                 if arg["required"]:
                     self.required_args += 1
-        return self.rargs_cnt == self.required_args
+        return (not self.curarg or not "extra_arg" in self.curarg) \
+                           and (self.rargs_cnt == self.required_args)
     def get_type(self):
         """Return the command's type"""
         We make a distinction between required and optional
         arguments. Optional (or tagged) arguments can be provided
-        unordered but the required ones.
+        unordered but not the required ones.
-        A special handling is also for arguments that require an
+        A special handling is also done for arguments that require an
         argument (example: the :comparator argument expects a string
         if self.iscomplete():
             return False
-        if self.curarg is not None:
+        if self.curarg is not None and "extra_arg" in self.curarg:
             if atype == self.curarg["extra_arg"]["type"]:
                 if not self.curarg["extra_arg"].has_key("values") or \
                         avalue in self.curarg["extra_arg"]["values"]:
                         not self.__is_valid_value_for_arg(curarg, avalue):
                     failed = True
+                    self.curarg = curarg
                     self.rargs_cnt += 1
                     self.nextargpos = pos + 1
                     if add:

File sievelib/tests/

     def test_quota_notification(self):
-        self.compilation_ok("""# Filter: Testrule\nquota_notification :subject "subject here" :recipient [""];""")
-        self.sieve_is("""# Filter: Testrule\nquota_notification :subject "subject here" :recipient [""];""")
+        quota_notification_sieve = """# Filter: Testrule\nquota_notification :subject "subject here" :recipient [""];\n"""
+        self.compilation_ok(quota_notification_sieve)
+        self.sieve_is(quota_notification_sieve)
 class ValidEncodings(SieveTest):