[Mailman-Developers] Bug: Usernames with spaces

Dan Mick Dan Mick <dmick@utopia.West.Sun.COM>
Mon, 4 Feb 2002 14:34:42 -0800 (PST)


Here's a simple fix to prevent people from subscribing through the web
page with addresses including space characters:

Index: Utils.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Utils.py,v
retrieving revision 2.26
diff -u -r2.26 Utils.py
--- Utils.py    2002/01/08 04:43:27     2.26
+++ Utils.py    2002/02/04 22:34:27
@@ -180,7 +180,7 @@
 def ValidateEmail(s):
     """Verify that the an email address isn't grossly evil."""
     # Pretty minimal, cheesy check.  We could do better...
-    if not s:
+    if not s or ' ' in s:
         raise Errors.MMBadEmailError
     if _badchars.search(s) or s[0] == '-':
         raise Errors.MMHostileAddress


> > Somehow I accumulated several users who had either embedded
> > (luser@hot mail.com) or trailing ('luser@hotmail.com ') addresses in
> 
> s/addresses/spaces/
> 
> > Mailman; bounce processing wasn't matching and therefore not working,
> > but outgoing mail still was, so I was still getting bounces.
> > 
> > Someone somewhere isn't (or wasn't) validating by removing spaces or
> > rejecting fields with spaces.  
> 
> I'll try to examine the web-page subscription stuff.
> 
> > 
> > Thank you, clone_member.
> 
> 
> _______________________________________________
> Mailman-Developers mailing list
> Mailman-Developers@python.org
> http://mail.python.org/mailman/listinfo/mailman-developers