BSMTP
authorjgg <>
Fri, 16 Feb 2001 06:07:38 +0000 (06:07 +0000)
committerjgg <>
Fri, 16 Feb 2001 06:07:38 +0000 (06:07 +0000)
debian/changelog
ud-generate
ud-mailgate

index 2e26af4..85c272f 100644 (file)
@@ -1,9 +1,15 @@
+userdir-ldap (0.2) unstable; urgency=low
+
+  * What the hey, a new version number.
+
+ -- Jason Gunthrope <jgg@debian.org>  Sun, 11 Feb 2001 18:37:27 -0800 
+
 userdir-ldap (0.1) unstable; urgency=low
 
   * Initial Packaging
 
  -- Jason Gunthrope <jgg@debian.org>  Fri, 30 Apr 1999 00:39:31 -0600
 userdir-ldap (0.1) unstable; urgency=low
 
   * Initial Packaging
 
  -- Jason Gunthrope <jgg@debian.org>  Fri, 30 Apr 1999 00:39:31 -0600
+
 Local variables:
 mode: debian-changelog
 add-log-mailing-address: "jgg@debian.org"
 Local variables:
 mode: debian-changelog
 add-log-mailing-address: "jgg@debian.org"
index b20e6bb..674cc60 100755 (executable)
@@ -11,6 +11,8 @@ Allowed = None;
 CurrentHost = "";
 
 EmailCheck = re.compile("^([^ <>@]+@[^ ,<>@]+)?$");
 CurrentHost = "";
 
 EmailCheck = re.compile("^([^ <>@]+@[^ ,<>@]+)?$");
+BSMTPCheck = re.compile(".*mx 0 klecker\.debian\.org\..*",re.DOTALL);
+DNSZone = ".debian.net"
 
 def Sanitize(Str):
   return string.translate(Str,string.maketrans("\n\r\t","$$$"));
 
 def Sanitize(Str):
   return string.translate(Str,string.maketrans("\n\r\t","$$$"));
@@ -379,13 +381,13 @@ def GenPrivate(l,File):
   Done(File,F,Fdb);
 
 # Generate the DNS Zone file
   Done(File,F,Fdb);
 
 # Generate the DNS Zone file
-def GenDNS(l,File):
+def GenDNS(l,File,BSMTPFile,HomePrefix):
   F = None;
   F = None;
-  Fdb = None;
+  FB = None;
   try:
    F = open(File + ".tmp","w");
   try:
    F = open(File + ".tmp","w");
-   Fdb = None;
-
+   FB = open(BSMTPFile + ".tmp","w");
+   
    # Fetch all the users
    global PasswdAttrs;
    if PasswdAttrs == None:
    # Fetch all the users
    global PasswdAttrs;
    if PasswdAttrs == None:
@@ -406,7 +408,13 @@ def GenDNS(l,File):
                Line = string.join(Split," ") + "\n";
                F.write(Line);
               
                Line = string.join(Split," ") + "\n";
                F.write(Line);
               
-              # Write some identication information
+              Host = Split[0] + DNSZone;
+              if BSMTPCheck.match(Line) != None:
+                  F.write("; Has BSMTP\n");
+                  FB.write("%s: user=%s group=Debian file=%s%s/bsmtp/%s\n"%(Host,
+                              GetAttr(x,"uid"),HomePrefix,GetAttr(x,"uid"),Host));
+                              
+              # Write some identification information
                if string.lower(Split[2]) == "a":
                  Line = "%s IN TXT \"%s\"\n"%(Split[0],EmailAddress(x));
                   for y in x[1]["keyfingerprint"]:
                if string.lower(Split[2]) == "a":
                  Line = "%s IN TXT \"%s\"\n"%(Split[0],EmailAddress(x));
                   for y in x[1]["keyfingerprint"]:
@@ -418,13 +426,16 @@ def GenDNS(l,File):
 
          F.write("\n");
       except:
 
          F.write("\n");
       except:
+        F.write("; Errors\n");
          pass;
       
   # Oops, something unspeakable happened.
   except:
          pass;
       
   # Oops, something unspeakable happened.
   except:
-   Die(File,F,Fdb);
+   Die(File,F,None);
+   Die(BSMTPFile,FB,None);
    raise;
    raise;
-  Done(File,F,Fdb);
+  Done(File,F,None);
+  Done(BSMTPFile,FB,None);
 
 # Connect to the ldap server
 l = ldap.open(LDAPServer);
 
 # Connect to the ldap server
 l = ldap.open(LDAPServer);
@@ -464,7 +475,6 @@ GlobalDir = GenerateDir+"/";
 GenSSHShadow(l,GlobalDir+"ssh-rsa-shadow");
 GenAllForward(l,GlobalDir+"mail-forward.cdb");
 GenMarkers(l,GlobalDir+"markers");
 GenSSHShadow(l,GlobalDir+"ssh-rsa-shadow");
 GenAllForward(l,GlobalDir+"mail-forward.cdb");
 GenMarkers(l,GlobalDir+"markers");
-GenDNS(l,GlobalDir+"dns-zone");
 GenPrivate(l,GlobalDir+"debian-private");
 
 # Compatibility.
 GenPrivate(l,GlobalDir+"debian-private");
 
 # Compatibility.
@@ -516,7 +526,7 @@ while(1):
    DoLink(GlobalDir,OutDir,"forward-alias");
 
    if ExtraList.has_key("[DNS]"):
    DoLink(GlobalDir,OutDir,"forward-alias");
 
    if ExtraList.has_key("[DNS]"):
-      DoLink(GlobalDir,OutDir,"dns-zone");
+      GenDNS(l,OutDir+"dns-zone",OutDir+"bsmtp",Split[1]);
       
    if ExtraList.has_key("[PRIVATE]"):
       DoLink(GlobalDir,OutDir,"debian-private");
       
    if ExtraList.has_key("[PRIVATE]"):
       DoLink(GlobalDir,OutDir,"debian-private");
index 4e3b39d..7a70f66 100755 (executable)
@@ -178,7 +178,8 @@ def DoSSH(Str,Attrs):
 def DoDNS(Str,Attrs,DnRecord):
    if re.match('^[\w-]+\s+in\s+a\s+\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$',\
         Str,re.IGNORECASE) == None and \
 def DoDNS(Str,Attrs,DnRecord):
    if re.match('^[\w-]+\s+in\s+a\s+\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$',\
         Str,re.IGNORECASE) == None and \
-      re.match("^[\w-]+\s+in\s+cname\s+[\w.\-]+\.$",Str,re.IGNORECASE) == None:
+      re.match("^[\w-]+\s+in\s+cname\s+[\w.\-]+\.$",Str,re.IGNORECASE) == None and \
+      re.match("^[\w-]+\s+in\s+mx\s+\d{1,3}\s+[\w.\-]+\.$",Str,re.IGNORECASE) == None:
      return None;     
 
    # Check if the name is already taken
      return None;     
 
    # Check if the name is already taken