From 786c71b6629df98db0f0404642068aed8d11b63b Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Mon, 2 Aug 2010 23:11:30 +0000 Subject: [PATCH] GenBSMTP --- ud-generate | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/ud-generate b/ud-generate index 5d46963..eed7698 100755 --- a/ud-generate +++ b/ud-generate @@ -873,17 +873,15 @@ def GenBSMTP(File, HomePrefix): # Fetch all the users global PasswdAttrs - + # Write out the zone file entry for each user for x in PasswdAttrs: - if x[1].has_key("dnsZoneEntry") == 0: - continue - - # If the account has no PGP key, do not write it - if x[1].has_key("keyFingerPrint") == 0: - continue + a = UDLdap.Account(x[0], x[1]) + if not 'dnsZoneEntry' in a: continue + if not a.is_active_user(): continue + try: - for z in x[1]["dnsZoneEntry"]: + for z in a["dnsZoneEntry"]: Split = z.lower().split() if Split[1].lower() == 'in': for y in range(0, len(Split)): @@ -894,7 +892,7 @@ def GenBSMTP(File, HomePrefix): Host = Split[0] + DNSZone if BSMTPCheck.match(Line) != None: F.write("%s: user=%s group=Debian file=%s%s/bsmtp/%s\n"%(Host, - GetAttr(x, "uid"), HomePrefix, GetAttr(x, "uid"), Host)) + a['uid'], HomePrefix, a['uid'], Host)) except: F.write("; Errors\n") -- 2.20.1