X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=ud-mailgate;h=cd6b5177c513ea2b9093ebc6eeea5b3df62f2eea;hb=30887642f49a72a319950368542c7d1e7d4d1e74;hp=3c1ad96e9f2511d93bb7d360f196a3009c6155e5;hpb=e9857f007f9521223aa389a71919f4232fd18866;p=mirror%2Fuserdir-ldap.git diff --git a/ud-mailgate b/ud-mailgate index 3c1ad96..cd6b517 100755 --- a/ud-mailgate +++ b/ud-mailgate @@ -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)) @@ -432,7 +433,7 @@ def DoDNS(Str, Attrs, DnRecord): if p == "": if seenEmptypart: return "Invalid IPv6 address (%s): more than one :: (nothing in between colons) is not allowed" % (ipv6address) - seenEmptypart = True + seenEmptypart = True sanitized = "%s IN AAAA %s" % (hostname, ipv6address) else: raise UDFormatError("None of the types I recognize was it. I shouldn't be here. confused.")