ud-generate: generate mail-default-options globally
[mirror/userdir-ldap.git] / ud-generate
index cf49f0f..97d003e 100755 (executable)
@@ -966,29 +966,6 @@ def GenZoneRecords(host_attrs, File):
          for Line in ExtractDNSInfo(x):
             F.write(Line + "\n")
 
-        # this would write sshfp lines for services on machines
-        # but we can't yet, since some are cnames and we'll make
-        # an invalid zonefile
-        #
-        # for i in x[1].get("purpose", []):
-        #    m = PurposeHostField.match(i)
-        #    if m:
-        #       m = m.group(1)
-        #       # we ignore [[*..]] entries
-        #       if m.startswith('*'):
-        #          continue
-        #       if m.startswith('-'):
-        #          m = m[1:]
-        #       if m:
-        #          if not m.endswith(HostDomain):
-        #             continue
-        #          if not m.endswith('.'):
-        #             m = m + "."
-        #          for Line in DNSInfo:
-        #             if isSSHFP.match(Line):
-        #                Line = "%s\t%s" % (m, Line)
-        #                F.write(Line + "\n")
-
    # Oops, something unspeakable happened.
    except:
       Die(File, F, None)
@@ -1153,7 +1130,7 @@ def get_accounts(ldap_conn):
                     "mailGreylisting", "mailCallout", "mailRBL", "mailRHSBL",\
                     "mailWhitelist", "sudoPassword", "objectClass", "accountStatus",\
                     "mailContentInspectionAction", "webPassword", "rtcPassword",\
-                    "bATVToken", "totpSeed"])
+                    "bATVToken", "totpSeed", "mailDefaultOptions"])
 
    if passwd_attrs is None:
       raise UDEmptyList, "No Users"
@@ -1233,6 +1210,8 @@ def generate_all(global_dir, ldap_conn):
    GenDBM(accounts, global_dir + "mail-forward.db", 'emailForward')
    GenCDB(accounts, global_dir + "mail-contentinspectionaction.cdb", 'mailContentInspectionAction')
    GenDBM(accounts, global_dir + "mail-contentinspectionaction.db", 'mailContentInspectionAction')
+   GenCDB(accounts, global_dir + "default-mail-options.cdb", 'mailDefaultOptions')
+   GenDBM(accounts, global_dir + "default-mail-options.db", 'mailDefaultOptions')
    GenPrivate(accounts, global_dir + "debian-private")
    GenSSHKnown(host_attrs, global_dir+"authorized_keys", 'authorized_keys', global_dir+'ud-generate.lock')
    GenMailBool(accounts, global_dir + "mail-greylist", "mailGreylisting")
@@ -1325,12 +1304,12 @@ def generate_host(host, global_dir, all_accounts, all_hosts, ssh_userkeys):
    DoLink(global_dir, OutDir, "mail-rhsbl")
    DoLink(global_dir, OutDir, "mail-whitelist")
    DoLink(global_dir, OutDir, "all-accounts.json")
+   DoLink(global_dir, Outdir, "default-mail-options.cdb")
+   DoLink(global_dir, Outdir, "default-mail-options.db")
    GenCDB(accounts, OutDir + "user-forward.cdb", 'emailForward')
    GenDBM(accounts, OutDir + "user-forward.db", 'emailForward')
    GenCDB(accounts, OutDir + "batv-tokens.cdb", 'bATVToken')
    GenDBM(accounts, OutDir + "batv-tokens.db", 'bATVToken')
-   GenCDB(accounts, OutDir + "default-mail-options.cdb", 'mailDefaultOptions')
-   GenDBM(accounts, OutDir + "default-mail-options.db", 'mailDefaultOptions')
 
    # Compatibility.
    DoLink(global_dir, OutDir, "forward-alias")