[Mailman-Developers] Quoting problem in 2.0

Barry A. Warsaw barry@digicool.com
Wed, 3 Jan 2001 11:04:10 -0500


>>>>> "DC" == David Champion <dgc@uchicago.edu> writes:

    DC> There's a problem triggered when list admins enter addresses
    DC> with double quotes: "foo@bar.biz" instead of foo@bar.biz

    DC> These addresses are added - the quotes aren't stripped off -
    DC> but they cannot be removed via the web interface, because then
    DC> the quotes ARE stripped off.  This is true for my 2.0 release
    DC> installation.

    DC> In my 1.0 rc2 installation, there's a further complication: it
    DC> appears from the HTML output that mailman tried to subscribe
    DC> all addresses in the current chunk.

    DC> The quoted addresses can be removed via remove_members.

    DC> I'll see about a patch for 2.0, but since Barry's talking
    DC> about 2.0.1 I wanted to mention the problem quickly in case
    DC> the solution is easy enough to throw in the pot.  Seems that
    DC> it would be.

You're right it is a simple fix, see below.

-Barry

Index: admin.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Cgi/admin.py,v
retrieving revision 1.82
diff -u -r1.82 admin.py
--- admin.py	2000/09/29 00:05:04	1.82
+++ admin.py	2001/01/03 16:02:26
@@ -22,6 +22,7 @@
 import cgi
 import string
 import types
+import rfc822
 
 from Mailman import Utils
 from Mailman import MailList
@@ -835,10 +836,13 @@
     #
     # mass subscription processing for members category
     #
+    def clean_names(name):
+        return rfc822.unquote(string.strip(name))
+
     if cgi_info.has_key('subscribees'):
 	name_text = cgi_info['subscribees'].value
         name_text = string.replace(name_text, '\r', '')
-	names = filter(None, map(string.strip, string.split(name_text, '\n')))
+	names = filter(None, map(clean_names, string.split(name_text, '\n')))
         send_welcome_msg = string.atoi(
             cgi_info["send_welcome_msg_to_this_batch"].value)
         digest = 0