ud-mailgate: remove exception for münchen.debian.net
[mirror/userdir-ldap.git] / ud-info
diff --git a/ud-info b/ud-info
index c5a45ea..3db0648 100755 (executable)
--- a/ud-info
+++ b/ud-info
@@ -20,7 +20,7 @@
 #   Copyright (c) 1999-2001  Jason Gunthorpe <jgg@debian.org>
 #   Copyright (c) 2004-2005,7,8  Joey Schulze <joey@infodrom.org>
 #   Copyright (c) 2001-2006  Ryan Murray <rmurray@debian.org>
-#   Copyright (c) 2008 Peter Palfrader <peter@palfrader.org>
+#   Copyright (c) 2008,2009 Peter Palfrader <peter@palfrader.org>
 #   Copyright (c) 2008 Martin Zobel-Helas <zobel@debian.org>
 #   Copyright (c) 2008 Marc 'HE' Brockschmidt <he@debian.org>
 #   Copyright (c) 2008 Mark Hymers <mhy@debian.org>
@@ -68,7 +68,6 @@ AttrInfo = {"cn": ["First Name", 101],
            "icqUin": ["ICQ UIN",14],
            "jabberJID": ["Jabber ID",15],
            "privateSub": ["Debian-Private",16],
-           "gender": ["Gender",17],
            "birthDate": ["Date of Birth",18],
            "mailDisableMessage": ["Mail Disabled",19],
            "mailGreylisting": ["Mail Greylisting",20],
@@ -76,7 +75,7 @@ AttrInfo = {"cn": ["First Name", 101],
             "mailRBL": ["Mail RBLs",22],
             "mailRHSBL": ["Mail RHSBLs",23],
             "mailWhitelist": ["Mail Whitelist",24],
-           "mailSpamOptOut": ["Mail Spam Filtering",25],
+           "mailContentInspectionAction": ["mail C-I Action",25],
            "VoIP": ["VoIP Address",26],
            "comment": ["Comment",116],
            "userPassword": ["Crypted Password",117],
@@ -103,7 +102,6 @@ AttrPrompt = {"cn": ["Common name or first name"],
               "supplementaryGid": ["Groups the user is in"],
              "allowedHost": ["Grant access to certain hosts"],
               "privateSub": ["Debian-Private mailing list subscription"],
-             "gender": ["ISO5218 Gender code (1=male,2=female,9=unspecified)"],
              "birthDate": ["Date of Birth (YYYYMMDD)"],
              "mailDisableMessage": ["Error message to return via SMTP"],
              "mailGreylisting": ["SMTP Greylisting (TRUE/FALSE)"],
@@ -111,7 +109,7 @@ AttrPrompt = {"cn": ["Common name or first name"],
               "mailRBL": ["SMTP time RBL lists"],
               "mailRHSBL": ["SMTP time RHSBL lists"],
               "mailWhitelist": ["SMTP time whitelist from other checks"],
-              "mailSpamOptOut": ["Mail Spam Filtering"],
+              "mailContentInspectionAction": ["Content Inspection Action (reject, blackhole, markup)"],
               "member": ["LDAP Group Member for slapd ACLs"],
              "latitude": ["XEarth latitude in ISO 6709 format - see /usr/share/zoneinfo/zone.tab or etak.com"],
              "longitude": ["XEarth latitude in ISO 6709 format - see /usr/share/zoneinfo/zone.tab or etak.com"],
@@ -219,7 +217,7 @@ def ShowAttrs(Attrs):
    Keys.sort();
    for at in Keys:
       if at < 100 or RootMode != 0:
-         print " %3u) %-18s: " % (at,OrderedIndex[at][0]),
+         print " %3u) %-19s: " % (at,OrderedIndex[at][0]),
          for x in OrderedIndex[at][1]:
             print "'%s'" % (re.sub('[\n\r]','?',x)),
          print;
@@ -252,13 +250,15 @@ def ChangeAttr(Attrs,Attr):
       Attrs[1][Attr] = [""];
       return;
 
-   if (Attr == "mailSpamOptOut" and NewValue != "true" and NewValue != "false"):
-      if (NewValue == "1"): NewValue = "true"
-      else:
-         if (NewValue == "0"): NewValue = "false"
+   if (Attr == "mailGreylisting" or Attr == "mailCallout"):
+      if (NewValue.lower() != "true" and NewValue.lower() != "false"):
+         if (NewValue == "1"): NewValue = "true"
          else:
-            print "Need a boolean value"
-            return
+            if (NewValue == "0"): NewValue = "false"
+            else:
+               print "Need a boolean value"
+               return
+      NewValue = NewValue.upper()
 
    # Set a new value
    print "Setting.",;
@@ -349,14 +349,15 @@ else:
 
 # Connect to the ldap server
 l = connectLDAP()
+UserDn = "uid=" + User + "," + BaseDn
 if (BindUser != ""):
    Password = getpass.getpass(BindUser + "'s password: ")
-   UserDn = "uid=" + BindUser + "," + BaseDn
+   BindUserDn = "uid=" + BindUser + "," + BaseDn
 else:
    Password = ""
-   UserDn = ""
+   BindUserDn = ""
 try:
-   l.simple_bind_s(UserDn,Password)
+   l.simple_bind_s(BindUserDn,Password)
 except ldap.LDAPError,e:
    print >> sys.stderr, "LDAP error:", e.args[0]['desc']
    print >> sys.stderr, "           ", e.args[0]['info']