<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,5 @@
 #--
-#   Copyright (C) 2001, 2002, 2003 Matt Armstrong.  All rights
+#   Copyright (C) 2001, 2002, 2003, 2008 Matt Armstrong.  All rights
 #   reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -50,7 +50,6 @@ module RMail
     # is parsed for mail addresses and if one is found, it is used to
     # initialize this object.
     def initialize(string = nil)
-
       @local = @domain = @comments = @display_name = nil
 
       if string.kind_of?(String)
@@ -421,7 +420,6 @@ module RMail
         # local-part ':' -&gt; it is a display-name of a group
         # display-name '&lt;' -&gt; it is a mailbox display name
         # display-name ':' -&gt; it is a group display name
-        #
 
 	# set lookahead to '@' '&lt;' or ':' (or another value for
 	# invalid input)
@@ -472,6 +470,20 @@ module RMail
 	  @addresses.last.local = get_text
           expect(SYM_AT_SIGN)
           domain
+
+          if @sym == SYM_LESS_THAN
+            # Workaround for invalid input.  Treat 'foo@bar &lt;foo@bar&gt;' as if it
+            # were '&quot;foo@bar&quot; &lt;foo@bar&gt;'.  The domain parser will eat
+            # 'bar' but stop at '&lt;'.  At this point, we've been
+            # parsing the display name as if it were an address, so we
+            # throw the address into display_name and parse an
+            # angle_addr.
+            @addresses.last.display_name =
+              format(&quot;%s@%s&quot;, @addresses.last.local, @addresses.last.domain)
+            @addresses.last.local = nil
+            @addresses.last.domain = nil
+            angle_addr
+          end
         end
       end
 </diff>
      <filename>lib/rmail/address.rb</filename>
    </modified>
    <modified>
      <diff>@@ -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 @@ class TestRMailAddress &lt; TestBase
           :format =&gt; '&quot;Jason @ Tibbitts&quot; &lt;tibbs@uh.edu&gt;' } ] ]
 
     # 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 ['tibbs@uh.edu Jason Tibbitts', [] ]
     validate_case ['@uh.edu', [] ] # Can't start with @
     validate_case ['J &lt;tibbs&gt;', [] ] # Not FQDN
@@ -644,7 +644,6 @@ class TestRMailAddress &lt; TestBase
   end
 
   def test_rfc_822
-
     validate_case\
     ['&quot;:sysmail&quot;@ Some-Group. Some-Org, Muhammed.(I am the greatest) Ali @(the)Vegas.WBA',
       [ { :name =&gt; nil,
@@ -664,7 +663,6 @@ class TestRMailAddress &lt; TestBase
   end
 
   def test_misc_addresses()
-
     # Make sure that parsing empty stuff works
     assert_equal([], RMail::Address.parse(nil))
     assert_equal([], RMail::Address.parse(&quot;&quot;))
@@ -794,6 +792,20 @@ class TestRMailAddress &lt; TestBase
 	} ] ]
   end
 
+  def test_bug_1754
+    # http://rubyforge.org/tracker/?func=detail&amp;atid=1754&amp;aid=23043&amp;group_id=446
+    validate_case\
+    ['=?iso-8859-1?Q?acme@example.com?= &lt;acme@example.com&gt;',
+      [ { :name =&gt; '=?iso-8859-1?Q?acme@example.com?=',
+          :display_name =&gt; '=?iso-8859-1?Q?acme@example.com?=',
+          :address =&gt; 'acme@example.com',
+          :comments =&gt; nil,
+          :domain =&gt; 'example.com',
+          :local =&gt; 'acme',
+          :format =&gt; '&quot;=?iso-8859-1?Q?acme@example.com?=&quot; &lt;acme@example.com&gt;',
+        } ] ]
+  end
+
   def test_invalid_addresses()
     # The display name isn't encoded -- bad, but we parse it.
     validate_case\</diff>
      <filename>test/testaddress.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>51b8d238bf71a6657d6d43d9b9f571b481df4bf1</id>
    </parent>
  </parents>
  <author>
    <name>Matt Armstrong</name>
    <email>matt@rfc20.org</email>
  </author>
  <url>http://github.com/matta/rubymail/commit/b3a4296ff78d4cf44584c37379a0df51daf859ce</url>
  <id>b3a4296ff78d4cf44584c37379a0df51daf859ce</id>
  <committed-date>2008-11-30T20:27:11-08:00</committed-date>
  <authored-date>2008-11-30T20:27:11-08:00</authored-date>
  <message>Parse the invalid foo@bar &lt;baz@yow&gt; as if it were &quot;foo@bar&quot; &lt;baz@yow&gt;.</message>
  <tree>484ac59bf7460e7ef8a0a547b4ce9ebf069d2fb3</tree>
  <committer>
    <name>Matt Armstrong</name>
    <email>matt@rfc20.org</email>
  </committer>
</commit>
