mirror of
https://github.com/github/rails.git
synced 2026-04-04 03:00:58 -04:00
Unquoted @ chars in received email headers are parsed properly in spite of RFC 822 (#1206)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1476 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
*SVN*
|
||||
|
||||
* Unquoted @ characters in headers are now accepted in spite of RFC 822 #1206
|
||||
|
||||
* Helper support (borrowed from ActionPack)
|
||||
|
||||
* Silently ignore Errno::EINVAL errors when converting text.
|
||||
|
||||
@@ -25,8 +25,8 @@ module TMail
|
||||
}
|
||||
|
||||
alnum = 'a-zA-Z0-9'
|
||||
atomsyms = %q[ _#!$%&`'*+-{|}~^/=? ].strip
|
||||
tokensyms = %q[ _#!$%&`'*+-{|}~^. ].strip
|
||||
atomsyms = %q[ _#!$%&`'*+-{|}~^@/=? ].strip
|
||||
tokensyms = %q[ _#!$%&`'*+-{|}~^@. ].strip
|
||||
|
||||
atomchars = alnum + Regexp.quote(atomsyms)
|
||||
tokenchars = alnum + Regexp.quote(tokensyms)
|
||||
|
||||
@@ -36,8 +36,8 @@ module TMail
|
||||
|
||||
module TextUtils
|
||||
|
||||
aspecial = '()<>[]:;.@\\,"'
|
||||
tspecial = '()<>[];:@\\,"/?='
|
||||
aspecial = '()<>[]:;.\\,"'
|
||||
tspecial = '()<>[];:\\,"/?='
|
||||
lwsp = " \t\r\n"
|
||||
control = '\x00-\x1f\x7f-\xff'
|
||||
|
||||
|
||||
34
actionmailer/test/fixtures/raw_email11
vendored
Normal file
34
actionmailer/test/fixtures/raw_email11
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
From xxx@xxxx.com Wed Apr 27 14:15:31 2005
|
||||
Mime-Version: 1.0 (Apple Message framework v619.2)
|
||||
To: xxxxx@xxxxx <matmail>
|
||||
Message-Id: <416eaebec6d333ec6939eaf8a7d80724@xxxxx>
|
||||
Content-Type: multipart/alternative;
|
||||
boundary=Apple-Mail-5-1037861608
|
||||
From: xxxxx@xxxxx <xxxxx@xxxxx>
|
||||
Subject: worse when you use them.
|
||||
Date: Wed, 27 Apr 2005 14:15:31 -0700
|
||||
|
||||
|
||||
|
||||
|
||||
--Apple-Mail-5-1037861608
|
||||
Content-Transfer-Encoding: 7bit
|
||||
Content-Type: text/plain;
|
||||
charset=US-ASCII;
|
||||
format=flowed
|
||||
|
||||
|
||||
XXXXX Xxxxx
|
||||
|
||||
--Apple-Mail-5-1037861608
|
||||
Content-Transfer-Encoding: 7bit
|
||||
Content-Type: text/enriched;
|
||||
charset=US-ASCII
|
||||
|
||||
|
||||
|
||||
<bold>XXXXX Xxxxx</bold>
|
||||
|
||||
|
||||
--Apple-Mail-5-1037861608--
|
||||
|
||||
@@ -521,5 +521,11 @@ EOF
|
||||
mail = TMail::Mail.parse(fixture)
|
||||
assert_nothing_raised { mail.body }
|
||||
end
|
||||
|
||||
def test_decode_message_with_unquoted_atchar_in_header
|
||||
fixture = File.read(File.dirname(__FILE__) + "/fixtures/raw_email11")
|
||||
mail = TMail::Mail.parse(fixture)
|
||||
assert_not_nil mail.from
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user