Merge remote-tracking branch 'jrtc27/master'
[mirror/userdir-ldap.git] / ud-mailgate
index 3c1ad96..32985d1 100755 (executable)
@@ -189,10 +189,11 @@ def DoArbChange(Str, Attrs):
         if i.lower() == attrName:
             attrName = i
             break
-    if attrName in ArbChanges:
+    if attrName not in ArbChanges:
         return None
 
-    if re.match(ArbChanges[attrName], G[1]) is None:
+    value = G[1]
+    if re.match(ArbChanges[attrName], value) is None:
         raise UDFormatError("Item does not match the required format" + ArbChanges[attrName])
 
     Attrs.append((ldap.MOD_REPLACE, attrName, value))