mail 2.6.4.rc1 → 2.6.4.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/lib/mail.rb +0 -1
- data/lib/mail/constants.rb +1 -1
- data/lib/mail/core_extensions/string.rb +0 -20
- data/lib/mail/encodings/8bit.rb +2 -2
- data/lib/mail/encodings/base64.rb +1 -1
- data/lib/mail/encodings/quoted_printable.rb +2 -2
- data/lib/mail/fields/unstructured_field.rb +1 -1
- data/lib/mail/header.rb +2 -2
- data/lib/mail/message.rb +1 -1
- data/lib/mail/network/delivery_methods/exim.rb +1 -1
- data/lib/mail/network/delivery_methods/sendmail.rb +1 -1
- data/lib/mail/utilities.rb +21 -0
- data/lib/mail/version.rb +1 -1
- metadata +4 -5
- data/lib/mail/core_extensions/nil.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4cd6578224b57f03109de0e15e54fc7d0e54079
|
4
|
+
data.tar.gz: 7f7b2116022f18740b56ba559038332d40476dbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a93b7505e4b1dc57444a7779005de12c4cc4db846d9e0ec86981f26c13abdac2cffde6be282b03ef6cc7f24317822434cdb34be99dd213a585b4eb34589ece4
|
7
|
+
data.tar.gz: c5abba187c988de228cd9d808b5e85d26a1d59a48ae8c702a1ebb25a96b98ad1c48e16364ff1970ba5302c08112f78c45e82b475c724574cd9664b7847423f42
|
data/Gemfile
CHANGED
data/lib/mail.rb
CHANGED
data/lib/mail/constants.rb
CHANGED
@@ -1,26 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
class String #:nodoc:
|
3
3
|
|
4
|
-
CRLF = "\r\n"
|
5
|
-
LF = "\n"
|
6
|
-
|
7
|
-
if RUBY_VERSION >= '1.9'
|
8
|
-
# This 1.9 only regex can save a reasonable amount of time (~20%)
|
9
|
-
# by not matching "\r\n" so the string is returned unchanged in
|
10
|
-
# the common case.
|
11
|
-
CRLF_REGEX = Regexp.new("(?<!\r)\n|\r(?!\n)")
|
12
|
-
else
|
13
|
-
CRLF_REGEX = /\n|\r\n|\r/
|
14
|
-
end
|
15
|
-
|
16
|
-
def to_crlf
|
17
|
-
to_str.gsub(CRLF_REGEX, CRLF)
|
18
|
-
end
|
19
|
-
|
20
|
-
def to_lf
|
21
|
-
to_str.gsub(/\r\n|\r/, LF)
|
22
|
-
end
|
23
|
-
|
24
4
|
unless method_defined?(:ascii_only?)
|
25
5
|
# Backport from Ruby 1.9 checks for non-us-ascii characters.
|
26
6
|
def ascii_only?
|
data/lib/mail/encodings/8bit.rb
CHANGED
@@ -12,12 +12,12 @@ module Mail
|
|
12
12
|
|
13
13
|
# Decode the string
|
14
14
|
def self.decode(str)
|
15
|
-
|
15
|
+
::Mail::Utilities.to_lf str
|
16
16
|
end
|
17
17
|
|
18
18
|
# Encode the string
|
19
19
|
def self.encode(str)
|
20
|
-
|
20
|
+
::Mail::Utilities.to_crlf str
|
21
21
|
end
|
22
22
|
|
23
23
|
# Idenity encodings have a fixed cost, 1 byte out per 1 byte in
|
@@ -15,11 +15,11 @@ module Mail
|
|
15
15
|
# Decode the string from Quoted-Printable. Cope with hard line breaks
|
16
16
|
# that were incorrectly encoded as hex instead of literal CRLF.
|
17
17
|
def self.decode(str)
|
18
|
-
str.gsub(/(?:=0D=0A|=0D|=0A)\r\n/, "\r\n").unpack("M*").first
|
18
|
+
::Mail::Utilities.to_lf str.gsub(/(?:=0D=0A|=0D|=0A)\r\n/, "\r\n").unpack("M*").first
|
19
19
|
end
|
20
20
|
|
21
21
|
def self.encode(str)
|
22
|
-
[
|
22
|
+
::Mail::Utilities.to_crlf([::Mail::Utilities.to_lf(str)].pack("M"))
|
23
23
|
end
|
24
24
|
|
25
25
|
def self.cost(str)
|
data/lib/mail/header.rb
CHANGED
@@ -49,7 +49,7 @@ module Mail
|
|
49
49
|
# me the example so we can fix it.
|
50
50
|
def initialize(header_text = nil, charset = nil)
|
51
51
|
@charset = charset
|
52
|
-
self.raw_source =
|
52
|
+
self.raw_source = ::Mail::Utilities.to_crlf(header_text).lstrip
|
53
53
|
split_header if header_text
|
54
54
|
end
|
55
55
|
|
@@ -204,7 +204,7 @@ module Mail
|
|
204
204
|
content-id content-disposition content-location]
|
205
205
|
|
206
206
|
def encoded
|
207
|
-
buffer =
|
207
|
+
buffer = String.new
|
208
208
|
buffer.force_encoding('us-ascii') if buffer.respond_to?(:force_encoding)
|
209
209
|
fields.each do |field|
|
210
210
|
buffer << field.encoded
|
data/lib/mail/message.rb
CHANGED
@@ -1994,7 +1994,7 @@ module Mail
|
|
1994
1994
|
|
1995
1995
|
def raw_source=(value)
|
1996
1996
|
value = value.dup.force_encoding(Encoding::BINARY) if RUBY_VERSION >= "1.9.1"
|
1997
|
-
@raw_source =
|
1997
|
+
@raw_source = ::Mail::Utilities.to_crlf(value)
|
1998
1998
|
end
|
1999
1999
|
|
2000
2000
|
# see comments to body=. We take data and process it lazily
|
data/lib/mail/utilities.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
module Mail
|
3
3
|
module Utilities
|
4
|
+
|
5
|
+
LF = "\n"
|
6
|
+
CRLF = "\r\n"
|
7
|
+
|
4
8
|
include Constants
|
5
9
|
|
6
10
|
# Returns true if the string supplied is free from characters not allowed as an ATOM
|
@@ -219,6 +223,23 @@ module Mail
|
|
219
223
|
enum.each_with_index.map(&block)
|
220
224
|
end
|
221
225
|
|
226
|
+
def self.to_lf input
|
227
|
+
input.kind_of?(String) ? input.to_str.gsub(/\r\n|\r/, LF) : ''
|
228
|
+
end
|
229
|
+
|
230
|
+
if RUBY_VERSION >= '1.9'
|
231
|
+
# This 1.9 only regex can save a reasonable amount of time (~20%)
|
232
|
+
# by not matching "\r\n" so the string is returned unchanged in
|
233
|
+
# the common case.
|
234
|
+
CRLF_REGEX = Regexp.new("(?<!\r)\n|\r(?!\n)")
|
235
|
+
else
|
236
|
+
CRLF_REGEX = /\n|\r\n|\r/
|
237
|
+
end
|
238
|
+
|
239
|
+
def self.to_crlf input
|
240
|
+
input.kind_of?(String) ? input.to_str.gsub(CRLF_REGEX, CRLF) : ''
|
241
|
+
end
|
242
|
+
|
222
243
|
end
|
223
244
|
|
224
245
|
# Returns true if the object is considered blank.
|
data/lib/mail/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.4.
|
4
|
+
version: 2.6.4.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikel Lindsaar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mime-types
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '1.16'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '4'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '1.16'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '4'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: bundler
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -110,7 +110,6 @@ files:
|
|
110
110
|
- lib/mail/check_delivery_params.rb
|
111
111
|
- lib/mail/configuration.rb
|
112
112
|
- lib/mail/constants.rb
|
113
|
-
- lib/mail/core_extensions/nil.rb
|
114
113
|
- lib/mail/core_extensions/smtp.rb
|
115
114
|
- lib/mail/core_extensions/string.rb
|
116
115
|
- lib/mail/core_extensions/string/access.rb
|