ud-useradd: Properly encode realname in subjects and to header lines regardless of...
authorPeter Palfrader <peter@palfrader.org>
Sat, 9 Jan 2010 11:01:38 +0000 (12:01 +0100)
committerPeter Palfrader <peter@palfrader.org>
Sat, 9 Jan 2010 11:01:38 +0000 (12:01 +0100)
debian/changelog
templates/welcome-message
templates/welcome-message-60000
templates/welcome-message-800
ud-useradd

index a73095c..d08eb5a 100644 (file)
@@ -13,8 +13,10 @@ userdir-ldap (0.3.76xXx) unstable; urgency=low
     by ud-ldap.  (defaults to true.)
   * Fix welcome-message to be like welcome-message-800 and 60000 wrt
     email headers
+  * ud-useradd: Properly encode realname in subjects and to header lines
+    regardless of which template is being used.
 
- -- Peter Palfrader <weasel@debian.org>  Sat, 09 Jan 2010 02:10:02 +0100
+ -- Peter Palfrader <weasel@debian.org>  Sat, 09 Jan 2010 11:58:30 +0100
 
 userdir-ldap (0.3.75) unstable; urgency=low
 
index 017528e..fbf25aa 100644 (file)
@@ -1,9 +1,9 @@
-To: "__REALNAME__" <__EMAIL__>
+To: "__ENCODED_REALNAME__" <__EMAIL__>
 From: __WHOAMI__
 MIME-Version: 1.0
 Content-Type: text/plain; charset="utf-8"
 Content-Transfer-Encoding: 8bit
-Subject:  __HEADER_SUBJ__
+Subject: New ud-ldap account for __ENCODED_REALNAME__
 Cc: new-maintainer@debian.org
 Reply-To: new-maintainer@debian.org
 Date: __DATE__
index dbc377f..e056189 100644 (file)
@@ -1,8 +1,8 @@
-To: "__REALNAME__" <__EMAIL__>
+To: "__ENCODED_REALNAME__" <__EMAIL__>
 MIME-Version: 1.0
 Content-Type: text/plain; charset="utf-8"
 Content-Transfer-Encoding: 8bit
-Subject: Debian Guest Account for __REALNAME__
+Subject: Debian Guest Account for __ENCODED_REALNAME__
 Cc: debian-admin@lists.debian.org
 Reply-To: debian-admin@lists.debian.org
 Date: __DATE__
index d9e7f2d..347ad5f 100644 (file)
@@ -1,9 +1,9 @@
-To: "__REALNAME__" <__EMAIL__>
+To: "__ENCODED_REALNAME__" <__EMAIL__>
 From: __WHOAMI__
 MIME-Version: 1.0
 Content-Type: text/plain; charset="utf-8"
 Content-Transfer-Encoding: 8bit
-Subject: New Debian developer __REALNAME__
+Subject: New Debian developer __ENCODED_REALNAME__
 Cc: da-manager@debian.org, debian-admin@debian.org
 Reply-To: da-manager@debian.org
 Date: __DATE__
index 243443f..3b3e3a8 100755 (executable)
@@ -243,21 +243,13 @@ if Res != "yes":
 # Initialize the substitution Map
 Subst = {}
 
-encto = ''
+encrealname = ''
 try:
-  encto = FullName.decode('us-ascii')
+  encrealname = FullName.decode('us-ascii')
 except UnicodeError:
-  encto = str(email.Header.Header(FullName, 'utf-8', 200)) + " " + emailaddr
+  encrealname = str(email.Header.Header(FullName, 'utf-8', 200))
 
-subjstring = "New Debian Maintainer " + FullName
-encsubj = ''
-try:
-  encsubj = subjstring.decode('us-ascii')
-except UnicodeError:
-  encsubj = str(email.Header.Header(subjstring, 'utf-8', 200))
-
-Subst["__HEADER_SUBJ__"] = encsubj
-Subst["__HEADER_EMAIL"] = encto
+Subst["__ENCODED_REALNAME__"] = encrealname
 Subst["__REALNAME__"] = FullName;
 Subst["__WHOAMI__"] = pwd.getpwuid(os.getuid())[0];
 Subst["__DATE__"] = time.strftime("%a, %d %b %Y %H:%M:%S +0000",time.gmtime(time.time()));