Fixed zone generation
[mirror/userdir-ldap.git] / ud-generate
index 201f0e2..b20e6bb 100755 (executable)
@@ -10,7 +10,7 @@ GroupIDMap = {};
 Allowed = None;
 CurrentHost = "";
 
-EmailCheck = re.compile("^([^<>@]+@.+)?$");
+EmailCheck = re.compile("^([^ <>@]+@[^ ,<>@]+)?$");
 
 def Sanitize(Str):
   return string.translate(Str,string.maketrans("\n\r\t","$$$"));
@@ -407,7 +407,7 @@ def GenDNS(l,File):
                F.write(Line);
               
               # Write some identication information
-               if string.lower(Split[2]) != "cname":
+               if string.lower(Split[2]) == "a":
                  Line = "%s IN TXT \"%s\"\n"%(Split[0],EmailAddress(x));
                   for y in x[1]["keyfingerprint"]:
                     Line = Line + "%s IN TXT \"PGP %s\"\n"%(Split[0],FormatPGPKey(y));