This repository has been archived by the owner on Jan 29, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parse the invalid foo@bar <baz@yow> as if it were "foo@bar" <baz@yow>.
- Loading branch information
Showing
2 changed files
with
31 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/usr/bin/env ruby | ||
#-- | ||
# Copyright (C) 2001, 2002, 2003, 2007 Matt Armstrong. All rights reserved. | ||
# Copyright (C) 2001, 2002, 2003, 2007, 2008 Matt Armstrong. All rights reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions are met: | ||
|
@@ -419,7 +419,7 @@ def test_majordomoII | |
:format => '"Jason @ Tibbitts" <[email protected]>' } ] ] | ||
|
||
# Majordomo II parses all of these with an error. We have deleted | ||
# some of the tests since when they are actually legal. | ||
# some of the tests when they are actually legal. | ||
validate_case ['[email protected] Jason Tibbitts', [] ] | ||
validate_case ['@uh.edu', [] ] # Can't start with @ | ||
validate_case ['J <tibbs>', [] ] # Not FQDN | ||
|
@@ -644,7 +644,6 @@ def test_mailtools_suite() | |
end | ||
|
||
def test_rfc_822 | ||
|
||
validate_case\ | ||
['":sysmail"@ Some-Group. Some-Org, Muhammed.(I am the greatest) Ali @(the)Vegas.WBA', | ||
[ { :name => nil, | ||
|
@@ -664,7 +663,6 @@ def test_rfc_822 | |
end | ||
|
||
def test_misc_addresses() | ||
|
||
# Make sure that parsing empty stuff works | ||
assert_equal([], RMail::Address.parse(nil)) | ||
assert_equal([], RMail::Address.parse("")) | ||
|
@@ -794,6 +792,20 @@ def test_misc_addresses() | |
} ] ] | ||
end | ||
|
||
def test_bug_1754 | ||
# http://rubyforge.org/tracker/?func=detail&atid=1754&aid=23043&group_id=446 | ||
validate_case\ | ||
['[email protected]?= <[email protected]>', | ||
[ { :name => '[email protected]?=', | ||
:display_name => '[email protected]?=', | ||
:address => '[email protected]', | ||
:comments => nil, | ||
:domain => 'example.com', | ||
:local => 'acme', | ||
:format => '"[email protected]?=" <[email protected]>', | ||
} ] ] | ||
end | ||
|
||
def test_invalid_addresses() | ||
# The display name isn't encoded -- bad, but we parse it. | ||
validate_case\ | ||
|