Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#60 legal email addresses are rejected

closed-fixed
nobody
None
5
2006-08-16
2006-07-19
Steve Vinoski
No

The feedvalidator rejects email addresses containing single quotes,
which are quite common in Irish email addresses. For example,
P.O'Neill@example.ie is a legal email address, but feedvalidator's email
regexp rejects it.

The following patch fixes this, but it's probably not enough, as RFC822
allows far more than the feedvalidator email regexp accepts.

*** src/feedvalidator/validators.py~ Thu Jun 8 18:41:16 2006
--- src/feedvalidator/validators.py Wed Jul 19 11:53:01 2006
***************
*** 266,272 ****
# valid e-mail addr-spec
#
class addr_spec(text):
! email_re = re.compile('''([a-zA-Z0-9_\-\+\.]+)@((\[[0-9]{1,3}\.[0-9]
{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)
$''')
message = InvalidAddrSpec
def validate(self, value=None):
if not value: value=self.value
--- 266,272 ----
# valid e-mail addr-spec
#
class addr_spec(text):
! email_re = re.compile('''([a-zA-Z0-9_\-\+\.\']+)@((\[[0-9]{1,3}\.
[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]
{1,3})(\]?)$''')
message = InvalidAddrSpec
def validate(self, value=None):
if not value: value=self.value

Discussion

  • Joseph Walton
    Joseph Walton
    2006-08-16

    • status: open --> closed-fixed
     
  • Joseph Walton
    Joseph Walton
    2006-08-16

    Logged In: YES
    user_id=847250

    The current check doesn't attempt full RFC syntax, so it
    rules out lots of pathological cases. I've seen this one
    show up with real addresses, though, so I've checked the
    change adding an apostrophe as a valid character in the
    local part.

    Thanks!