mail 1.3.4 → 1.3.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of mail might be problematic. Click here for more details.
- data/CHANGELOG.rdoc +13 -0
- data/README.rdoc +6 -2
- data/Rakefile +1 -1
- data/lib/mail/elements/content_disposition_element.rb +0 -4
- data/lib/mail/elements/content_type_element.rb +0 -4
- data/lib/mail/encodings/encodings.rb +4 -4
- data/lib/mail/fields/common/common_field.rb +1 -1
- data/lib/mail/version.rb +1 -1
- data/lib/mail/version_specific/ruby_1_8.rb +2 -2
- data/lib/mail/version_specific/ruby_1_9.rb +2 -2
- data/lib/vendor/treetop-1.4.3/lib/treetop.rb +2 -3
- data/lib/vendor/treetop.rb +0 -1
- metadata +2 -2
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
== Sun Dec 27 07:30:02 UTC 2009 Mikel Lindsaar <raasdnil@gmail.com>
|
2
|
+
|
3
|
+
* Changed fields to default to :decoded on :to_s, all container objects retain :encoded as the default for :to_s
|
4
|
+
|
5
|
+
== Thu Dec 17 06:35:05 UTC 2009 Mikel Lindsaar <raasdnil@gmail.com>
|
6
|
+
|
7
|
+
* Fixed parsing error 'Subject: =?ISO-8859-1?Q?Re=3A_ol=E1?=' (has a new line embedded)
|
8
|
+
|
9
|
+
== Thu Dec 17 02:14:23 UTC 2009 Mikel Lindsaar <raasdnil@gmail.com>
|
10
|
+
|
11
|
+
* Version 1.3.4
|
12
|
+
* Vendor'd treetop
|
13
|
+
|
1
14
|
== Thu Dec 17 01:32:00 UTC 2009 Mikel Lindsaar <raasdnil@gmail.com>
|
2
15
|
|
3
16
|
* Version 1.3.3
|
data/README.rdoc
CHANGED
@@ -110,8 +110,12 @@ I have tried to simplify it some:
|
|
110
110
|
return the object's "value" only as a string. This means it will not include
|
111
111
|
the header fields (like 'To:' or 'Subject:').
|
112
112
|
|
113
|
-
3. By default, calling :to_s on
|
114
|
-
it
|
113
|
+
3. By default, calling :to_s on a container object will call it's encoded method, while
|
114
|
+
:to_s on a field object will call it's decoded method. So calling :to_s on a Mail
|
115
|
+
object will return the mail, all encoded ready to send, while calling :to_s on the
|
116
|
+
From field will return the decoded value of the field. The body and headers of Mail
|
117
|
+
objects are considered containers. If you are in doubt, call :encoded, or :decoded
|
118
|
+
explicitly, this is safer if you are not sure.
|
115
119
|
|
116
120
|
4. Structured fields that have parameter values that can be encoded (e.g. Content-Type) will
|
117
121
|
provide decoded parameter values when you call the parameter names as methods against
|
data/Rakefile
CHANGED
@@ -91,14 +91,14 @@ module Mail
|
|
91
91
|
# String has to be of the format =?<encoding>?[QB]?<string>?=
|
92
92
|
def Encodings.value_decode(str)
|
93
93
|
str.gsub!(/\?=(\s*)=\?/, '?==?') # Remove whitespaces between 'encoded-word's
|
94
|
-
str.gsub(/(.*?)(=\?.*?\?.\?.*?\?=)|$/) do
|
94
|
+
str.gsub(/(.*?)(=\?.*?\?.\?.*?\?=)|$/m) do
|
95
95
|
before = $1.to_s
|
96
96
|
text = $2.to_s
|
97
97
|
|
98
98
|
case
|
99
|
-
when text =~ /=\?.+\?[Bb]\?/
|
99
|
+
when text =~ /=\?.+\?[Bb]\?/m
|
100
100
|
before + b_value_decode(text)
|
101
|
-
when text =~ /=\?.+\?[Qq]\?/
|
101
|
+
when text =~ /=\?.+\?[Qq]\?/m
|
102
102
|
before + q_value_decode(text)
|
103
103
|
else
|
104
104
|
before + text
|
@@ -181,7 +181,7 @@ module Mail
|
|
181
181
|
end
|
182
182
|
|
183
183
|
def Encodings.split_encoding_from_string( str )
|
184
|
-
match = str.match(/\=\?(.+)?\?[QB]\?(.+)?\?\=/
|
184
|
+
match = str.match(/\=\?(.+)?\?[QB]\?(.+)?\?\=/mi)
|
185
185
|
if match
|
186
186
|
[match[1], match[2]]
|
187
187
|
else
|
data/lib/mail/version.rb
CHANGED
@@ -45,7 +45,7 @@ module Mail
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def Ruby18.b_value_decode(str)
|
48
|
-
match = str.match(/\=\?(.+)?\?[Bb]\?(.+)?\?\=/)
|
48
|
+
match = str.match(/\=\?(.+)?\?[Bb]\?(.+)?\?\=/m)
|
49
49
|
if match
|
50
50
|
encoding = match[1]
|
51
51
|
str = Ruby18.decode_base64(match[2])
|
@@ -61,7 +61,7 @@ module Mail
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def Ruby18.q_value_decode(str)
|
64
|
-
match = str.match(/\=\?(.+)?\?[Qq]\?(.+)?\?\=/)
|
64
|
+
match = str.match(/\=\?(.+)?\?[Qq]\?(.+)?\?\=/m)
|
65
65
|
if match
|
66
66
|
encoding = match[1]
|
67
67
|
str = Encodings::QuotedPrintable.decode(match[2])
|
@@ -37,7 +37,7 @@ module Mail
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def Ruby19.b_value_decode(str)
|
40
|
-
match = str.match(/\=\?(.+)?\?[Bb]\?(.+)?\?\=/)
|
40
|
+
match = str.match(/\=\?(.+)?\?[Bb]\?(.+)?\?\=/m)
|
41
41
|
if match
|
42
42
|
encoding = match[1]
|
43
43
|
str = Ruby19.decode_base64(match[2])
|
@@ -52,7 +52,7 @@ module Mail
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def Ruby19.q_value_decode(str)
|
55
|
-
match = str.match(/\=\?(.+)?\?[Qq]\?(.+)?\?\=/)
|
55
|
+
match = str.match(/\=\?(.+)?\?[Qq]\?(.+)?\?\=/m)
|
56
56
|
if match
|
57
57
|
encoding = match[1]
|
58
58
|
str = Encodings::QuotedPrintable.decode(match[2])
|
@@ -11,7 +11,6 @@ require File.join(TREETOP_ROOT, "ruby_extensions")
|
|
11
11
|
require File.join(TREETOP_ROOT, "runtime")
|
12
12
|
require File.join(TREETOP_ROOT, "compiler")
|
13
13
|
|
14
|
-
|
15
|
-
require 'polyglot'
|
14
|
+
if defined?(Polyglot)
|
16
15
|
Polyglot.register(Treetop::VALID_GRAMMAR_EXT, Treetop)
|
17
|
-
end
|
16
|
+
end
|
data/lib/vendor/treetop.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Lindsaar
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-12-
|
12
|
+
date: 2009-12-27 00:00:00 +11:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|