default anti-spam options
[mirror/userdir-ldap.git] / ud-useradd
index 2f24201..c183dca 100755 (executable)
@@ -155,7 +155,9 @@ Res = raw_input("First name [" + cn + "]? ");
 if Res != "":
    cn = Res;
 Res = raw_input("Middle name [" + mn + "]? ");
-if Res != "":
+if Res == " ":
+   mn = ""
+elif Res != "":
    mn = Res;
 Res = raw_input("Last name [" + sn + "]? ");
 if Res != "":
@@ -239,14 +241,14 @@ encto = ''
 try:
   encto = FullName.decode('us-ascii')
 except UnicodeError:
-  encto = email.Header.Header(FullName, 'utf-8', 200) + " " + emailaddr
+  encto = str(email.Header.Header(FullName, 'utf-8', 200)) + " " + emailaddr
 
 subjstring = "New Debian Maintainer " + FullName
 encsubj = ''
 try:
   encsubj = subjstring.decode('us-ascii')
 except UnicodeError:
-  encsubj = email.Header.Header(subjstring, 'utf-8', 200)
+  encsubj = str(email.Header.Header(subjstring, 'utf-8', 200))
 
 Subst["__HEADER_SUBJ__"] = encsubj
 Subst["__HEADER_EMAIL"] = encto
@@ -324,7 +326,7 @@ if Update == 1 and ForceMail == 0:
 
 # Send the Welcome message
 print "Sending Welcome Email"
-Reply = TemplateSubst(Subst,open(TemplatesDir + "/welcome-message-%d" % gidNumber, "r").read())
+Reply = TemplateSubst(Subst,open(TemplatesDir + "/welcome-message-%d" % int(gidNumber), "r").read())
 Child = os.popen("/usr/sbin/sendmail -t","w");
 #Child = os.popen("cat","w");
 Child.write(Reply);