From d355ef6e793853db50849d19a5c53bbb2b7c5871 Mon Sep 17 00:00:00 2001 From: Stephen Gran Date: Sun, 14 Mar 2010 13:33:15 +0000 Subject: [PATCH] write one identifying txt entry per host, if it has an a or aaaa record Signed-off-by: Stephen Gran --- ud-generate | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ud-generate b/ud-generate index 91d95a7..1617821 100755 --- a/ud-generate +++ b/ud-generate @@ -780,6 +780,7 @@ def GenDNS(File): # Fetch all the users global PasswdAttrs + RRs = {} # Write out the zone file entry for each user for x in PasswdAttrs: @@ -805,11 +806,13 @@ def GenDNS(File): F.write("; Has BSMTP\n") # Write some identification information - if Split[2].lower() == "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)) - F.write(Line) + if not RRs.has_key(Host): + if Split[2].lower() in ["a", "aaaa"]: + 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)) + F.write(Line) + RRs[Host] = 1 else: Line = "; Err %s"%(str(Split)) F.write(Line) -- 2.20.1