mail 2.6.4.rc2 → 2.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.rdoc +6 -0
  3. data/MIT-LICENSE +1 -1
  4. data/README.md +1 -1
  5. data/lib/mail.rb +1 -0
  6. data/lib/mail/attachments_list.rb +2 -0
  7. data/lib/mail/body.rb +1 -0
  8. data/lib/mail/check_delivery_params.rb +1 -0
  9. data/lib/mail/configuration.rb +1 -0
  10. data/lib/mail/constants.rb +1 -0
  11. data/lib/mail/core_extensions/smtp.rb +1 -0
  12. data/lib/mail/core_extensions/string.rb +1 -0
  13. data/lib/mail/core_extensions/string/access.rb +1 -0
  14. data/lib/mail/core_extensions/string/multibyte.rb +1 -0
  15. data/lib/mail/elements.rb +1 -0
  16. data/lib/mail/elements/address.rb +2 -2
  17. data/lib/mail/elements/address_list.rb +1 -0
  18. data/lib/mail/elements/content_disposition_element.rb +1 -0
  19. data/lib/mail/elements/content_location_element.rb +6 -5
  20. data/lib/mail/elements/content_transfer_encoding_element.rb +1 -0
  21. data/lib/mail/elements/content_type_element.rb +1 -0
  22. data/lib/mail/elements/date_time_element.rb +1 -0
  23. data/lib/mail/elements/envelope_from_element.rb +1 -0
  24. data/lib/mail/elements/message_ids_element.rb +7 -5
  25. data/lib/mail/elements/mime_version_element.rb +1 -0
  26. data/lib/mail/elements/phrase_list.rb +1 -0
  27. data/lib/mail/elements/received_element.rb +1 -0
  28. data/lib/mail/encodings.rb +1 -0
  29. data/lib/mail/encodings/7bit.rb +1 -0
  30. data/lib/mail/encodings/8bit.rb +1 -0
  31. data/lib/mail/encodings/base64.rb +1 -0
  32. data/lib/mail/encodings/binary.rb +1 -0
  33. data/lib/mail/encodings/quoted_printable.rb +1 -0
  34. data/lib/mail/encodings/transfer_encoding.rb +1 -0
  35. data/lib/mail/encodings/unix_to_unix.rb +1 -0
  36. data/lib/mail/envelope.rb +1 -0
  37. data/lib/mail/field.rb +1 -0
  38. data/lib/mail/field_list.rb +1 -0
  39. data/lib/mail/fields.rb +1 -0
  40. data/lib/mail/fields/bcc_field.rb +1 -0
  41. data/lib/mail/fields/cc_field.rb +1 -0
  42. data/lib/mail/fields/comments_field.rb +1 -0
  43. data/lib/mail/fields/common/address_container.rb +1 -0
  44. data/lib/mail/fields/common/common_address.rb +1 -0
  45. data/lib/mail/fields/common/common_date.rb +1 -0
  46. data/lib/mail/fields/common/common_field.rb +4 -1
  47. data/lib/mail/fields/common/common_message_id.rb +1 -0
  48. data/lib/mail/fields/common/parameter_hash.rb +1 -0
  49. data/lib/mail/fields/content_description_field.rb +1 -0
  50. data/lib/mail/fields/content_disposition_field.rb +2 -1
  51. data/lib/mail/fields/content_id_field.rb +1 -0
  52. data/lib/mail/fields/content_location_field.rb +1 -0
  53. data/lib/mail/fields/content_transfer_encoding_field.rb +1 -0
  54. data/lib/mail/fields/content_type_field.rb +2 -1
  55. data/lib/mail/fields/date_field.rb +1 -0
  56. data/lib/mail/fields/from_field.rb +1 -0
  57. data/lib/mail/fields/in_reply_to_field.rb +1 -0
  58. data/lib/mail/fields/keywords_field.rb +1 -0
  59. data/lib/mail/fields/message_id_field.rb +1 -0
  60. data/lib/mail/fields/mime_version_field.rb +1 -0
  61. data/lib/mail/fields/optional_field.rb +1 -0
  62. data/lib/mail/fields/received_field.rb +1 -0
  63. data/lib/mail/fields/references_field.rb +1 -0
  64. data/lib/mail/fields/reply_to_field.rb +1 -0
  65. data/lib/mail/fields/resent_bcc_field.rb +1 -0
  66. data/lib/mail/fields/resent_cc_field.rb +1 -0
  67. data/lib/mail/fields/resent_date_field.rb +1 -0
  68. data/lib/mail/fields/resent_from_field.rb +1 -0
  69. data/lib/mail/fields/resent_message_id_field.rb +1 -0
  70. data/lib/mail/fields/resent_sender_field.rb +1 -0
  71. data/lib/mail/fields/resent_to_field.rb +1 -0
  72. data/lib/mail/fields/return_path_field.rb +1 -0
  73. data/lib/mail/fields/sender_field.rb +1 -0
  74. data/lib/mail/fields/structured_field.rb +1 -0
  75. data/lib/mail/fields/subject_field.rb +1 -0
  76. data/lib/mail/fields/to_field.rb +1 -0
  77. data/lib/mail/fields/unstructured_field.rb +2 -1
  78. data/lib/mail/header.rb +1 -0
  79. data/lib/mail/indifferent_hash.rb +1 -0
  80. data/lib/mail/mail.rb +1 -0
  81. data/lib/mail/matchers/attachment_matchers.rb +1 -0
  82. data/lib/mail/matchers/has_sent_mail.rb +1 -0
  83. data/lib/mail/message.rb +1 -0
  84. data/lib/mail/multibyte.rb +1 -0
  85. data/lib/mail/multibyte/chars.rb +1 -0
  86. data/lib/mail/multibyte/exceptions.rb +1 -0
  87. data/lib/mail/multibyte/unicode.rb +1 -0
  88. data/lib/mail/multibyte/utils.rb +1 -0
  89. data/lib/mail/network.rb +1 -0
  90. data/lib/mail/network/delivery_methods/exim.rb +1 -0
  91. data/lib/mail/network/delivery_methods/file_delivery.rb +1 -0
  92. data/lib/mail/network/delivery_methods/sendmail.rb +1 -0
  93. data/lib/mail/network/delivery_methods/smtp.rb +1 -0
  94. data/lib/mail/network/delivery_methods/smtp_connection.rb +1 -0
  95. data/lib/mail/network/delivery_methods/test_mailer.rb +1 -0
  96. data/lib/mail/network/retriever_methods/base.rb +1 -0
  97. data/lib/mail/network/retriever_methods/imap.rb +1 -0
  98. data/lib/mail/network/retriever_methods/pop3.rb +1 -0
  99. data/lib/mail/network/retriever_methods/test_retriever.rb +1 -0
  100. data/lib/mail/parsers.rb +1 -0
  101. data/lib/mail/parsers/address_lists_parser.rb +1 -0
  102. data/lib/mail/parsers/content_disposition_parser.rb +1 -0
  103. data/lib/mail/parsers/content_location_parser.rb +1 -0
  104. data/lib/mail/parsers/content_transfer_encoding_parser.rb +1 -0
  105. data/lib/mail/parsers/content_type_parser.rb +1 -0
  106. data/lib/mail/parsers/date_time_parser.rb +3 -0
  107. data/lib/mail/parsers/envelope_from_parser.rb +1 -0
  108. data/lib/mail/parsers/message_ids_parser.rb +1 -0
  109. data/lib/mail/parsers/mime_version_parser.rb +1 -0
  110. data/lib/mail/parsers/phrase_lists_parser.rb +3 -0
  111. data/lib/mail/parsers/ragel.rb +1 -0
  112. data/lib/mail/parsers/received_parser.rb +2 -0
  113. data/lib/mail/part.rb +1 -0
  114. data/lib/mail/parts_list.rb +1 -0
  115. data/lib/mail/utilities.rb +27 -9
  116. data/lib/mail/version.rb +2 -1
  117. data/lib/mail/version_specific/ruby_1_8.rb +1 -0
  118. data/lib/mail/version_specific/ruby_1_9.rb +1 -0
  119. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a4cd6578224b57f03109de0e15e54fc7d0e54079
4
- data.tar.gz: 7f7b2116022f18740b56ba559038332d40476dbf
3
+ metadata.gz: f91f133d2e44832ecef1cb4bfe9cc57391aedf84
4
+ data.tar.gz: 23d0cdbc09cdbaafee76b01d7c3820a6c0dfb6d1
5
5
  SHA512:
6
- metadata.gz: 5a93b7505e4b1dc57444a7779005de12c4cc4db846d9e0ec86981f26c13abdac2cffde6be282b03ef6cc7f24317822434cdb34be99dd213a585b4eb34589ece4
7
- data.tar.gz: c5abba187c988de228cd9d808b5e85d26a1d59a48ae8c702a1ebb25a96b98ad1c48e16364ff1970ba5302c08112f78c45e82b475c724574cd9664b7847423f42
6
+ metadata.gz: c788407da309561bee6a59ec746efeea7c0cc8633206eb2085f08ad6b161df92475109a988de748e554248d2ca47e6cd31c3fd0394d0eddac5950e7bb28783a8
7
+ data.tar.gz: 55b70f9d539420d254373c7abfccf6bc85228f34c38696086be363a36fb4f966415238aaa8e9ec9e6eed02207af2a3940b9f85c5f3076e735cd19e095764abc2
@@ -1,5 +1,7 @@
1
1
  == HEAD
2
2
 
3
+ == Version 2.6.4 - Wed Mar 23 08:16 -0700 2016 Jeremy Daer <jeremydaer@gmail.com>
4
+
3
5
  Features:
4
6
  * #772 - Normalize encoding matchers (grosser)
5
7
  * #775 - Avoid failed encodings / stop bad charsets early (grosser)
@@ -11,6 +13,10 @@ Features:
11
13
  * #901 - Allow mail.text_part = '…' and mail.html_part = '<p>…</p>' (taavo)
12
14
  * #924 - Matcher for having attachments (schepedw)
13
15
 
16
+ Performance:
17
+ * #956 - Use native String#encode for CR/LF conversion (carsonreinke)
18
+ * #970 - Support Ruby 2.3+ frozen string literals (twalpole)
19
+
14
20
  Bugs:
15
21
  * #719 - Fix to not extract header content that looks like its field name (kjg)
16
22
  * #789 - Fix encoding collapsing not dealing with multiple encodings in 1 line (grosser)
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009-2015 Mikel Lindsaar
1
+ Copyright (c) 2009-2016 Mikel Lindsaar
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -697,7 +697,7 @@ License
697
697
 
698
698
  (The MIT License)
699
699
 
700
- Copyright (c) 2009-2015 Mikel Lindsaar
700
+ Copyright (c) 2009-2016 Mikel Lindsaar
701
701
 
702
702
  Permission is hereby granted, free of charge, to any person obtaining
703
703
  a copy of this software and associated documentation files (the
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail # :doc:
3
4
 
4
5
  require 'date'
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Mail
2
3
  class AttachmentsList < Array
3
4
 
@@ -71,6 +72,7 @@ module Mail
71
72
 
72
73
  if hash[:body].respond_to? :force_encoding and hash[:body].respond_to? :valid_encoding?
73
74
  if not hash[:body].valid_encoding? and default_values[:content_transfer_encoding].downcase == "binary"
75
+ hash[:body] = hash[:body].dup if hash[:body].frozen?
74
76
  hash[:body].force_encoding("BINARY")
75
77
  end
76
78
  end
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail
3
4
 
4
5
  # = Body
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Mail
2
3
  module CheckDeliveryParams
3
4
  def check_delivery_params(mail)
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # Thanks to Nicolas Fouché for this wrapper
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # encoding: us-ascii
2
+ # frozen_string_literal: true
2
3
  module Mail
3
4
  module Constants
4
5
  white_space = %Q|\x9\x20|
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Net
3
4
  class SMTP
4
5
  # This is a backport of r30294 from ruby trunk because of a bug in net/smtp.
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  class String #:nodoc:
3
4
 
4
5
  unless method_defined?(:ascii_only?)
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  # This is not loaded if ActiveSupport is already loaded
4
5
 
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  # This is not loaded if ActiveSupport is already loaded
4
5
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Mail
2
3
  register_autoload :Address, 'mail/elements/address'
3
4
  register_autoload :AddressList, 'mail/elements/address_list'
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail
3
4
  class Address
4
5
 
@@ -92,7 +93,7 @@ module Mail
92
93
  # a.display_name = 'Mikel Lindsaar'
93
94
  # a.format #=> 'Mikel Lindsaar <mikel@test.lindsaar.net>'
94
95
  def display_name=( str )
95
- @display_name = str
96
+ @display_name = str.dup # in case frozen
96
97
  end
97
98
 
98
99
  # Returns the local part (the left hand side of the @ sign in the email address) of
@@ -209,7 +210,6 @@ module Mail
209
210
  elsif @data.comments && @data.domain
210
211
  str = strip_domain_comments(format_comments)
211
212
  end
212
-
213
213
  str unless Utilities.blank?(str)
214
214
  end
215
215
 
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail
3
4
  class AddressList # :nodoc:
4
5
 
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail
3
4
  class ContentDispositionElement # :nodoc:
4
5
 
@@ -1,21 +1,22 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail
3
4
  class ContentLocationElement # :nodoc:
4
-
5
+
5
6
  include Mail::Utilities
6
-
7
+
7
8
  def initialize( string )
8
9
  content_location = Mail::Parsers::ContentLocationParser.new.parse(string)
9
10
  @location = content_location.location
10
11
  end
11
-
12
+
12
13
  def location
13
14
  @location
14
15
  end
15
-
16
+
16
17
  def to_s(*args)
17
18
  location.to_s
18
19
  end
19
-
20
+
20
21
  end
21
22
  end
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail
3
4
  class ContentTransferEncodingElement
4
5
 
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail
3
4
  class ContentTypeElement # :nodoc:
4
5
 
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail
3
4
  class DateTimeElement # :nodoc:
4
5
 
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail
3
4
  class EnvelopeFromElement
4
5
 
@@ -1,21 +1,23 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail
3
4
  class MessageIdsElement
4
-
5
+
5
6
  include Mail::Utilities
6
-
7
+
7
8
  def initialize(string)
9
+ raise Mail::Field::ParseError.new(Mail::MessageIdsElement, string, 'nil is invalid') if string.nil?
8
10
  @message_ids = Mail::Parsers::MessageIdsParser.new.parse(string).message_ids.map { |msg_id| clean_msg_id(msg_id) }
9
11
  end
10
-
12
+
11
13
  def message_ids
12
14
  @message_ids
13
15
  end
14
-
16
+
15
17
  def message_id
16
18
  @message_ids.first
17
19
  end
18
-
20
+
19
21
  def clean_msg_id( val )
20
22
  val =~ /.*<(.*)>.*/ ; $1
21
23
  end
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail
3
4
  class MimeVersionElement
4
5
 
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail
3
4
  class PhraseList
4
5
 
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail
3
4
  class ReceivedElement
4
5
 
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Mail
4
5
  # Raised when attempting to decode an unknown encoding type
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  require 'mail/encodings/8bit'
3
4
 
4
5
  module Mail
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  require 'mail/encodings/binary'
3
4
 
4
5
  module Mail
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  require 'mail/encodings/7bit'
3
4
 
4
5
  module Mail
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  require 'mail/encodings/transfer_encoding'
3
4
 
4
5
  module Mail
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  require 'mail/encodings/7bit'
3
4
 
4
5
  module Mail
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail
3
4
  module Encodings
4
5
  class TransferEncoding
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Mail
2
3
  module Encodings
3
4
  module UnixToUnix
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # = Mail Envelope
4
5
  #
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'mail/fields'
2
3
 
3
4
  # encoding: utf-8
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail
3
4
 
4
5
  # Field List class provides an enhanced array that keeps a list of
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Mail
2
3
  register_autoload :UnstructuredField, 'mail/fields/unstructured_field'
3
4
  register_autoload :StructuredField, 'mail/fields/structured_field'
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # = Blind Carbon Copy Field
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # = Carbon Copy Field
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # = Comments Field
4
5
  #
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Mail
2
3
 
3
4
  class AddressContainer < Array
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  require 'mail/fields/common/address_container'
3
4
 
4
5
  module Mail
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail
3
4
  module CommonDate # :nodoc:
4
5
  # Returns a date time object of the parsed date
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail
3
4
  module CommonField # :nodoc:
4
5
  include Mail::Constants
@@ -51,7 +52,9 @@ module Mail
51
52
  FILENAME_RE = /\b(filename|name)=([^;"\r\n]+\s[^;"\r\n]+)/
52
53
  def ensure_filename_quoted(value)
53
54
  if value.is_a?(String)
54
- value.sub! FILENAME_RE, '\1="\2"'
55
+ value.sub FILENAME_RE, '\1="\2"'
56
+ else
57
+ value
55
58
  end
56
59
  end
57
60
  end
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail
3
4
  module CommonMessageId # :nodoc:
4
5
  def element
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail
3
4
 
4
5
  # ParameterHash is an intelligent Hash that allows you to add
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  #
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  require 'mail/fields/common/parameter_hash'
3
4
 
4
5
  module Mail
@@ -9,7 +10,7 @@ module Mail
9
10
 
10
11
  def initialize(value = nil, charset = 'utf-8')
11
12
  self.charset = charset
12
- ensure_filename_quoted(value)
13
+ value = ensure_filename_quoted(value)
13
14
  super(CAPITALIZED_FIELD, strip_field(FIELD_NAME, value), charset)
14
15
  self.parse
15
16
  self
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  #
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  #
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  #
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  require 'mail/fields/common/parameter_hash'
3
4
 
4
5
  module Mail
@@ -19,7 +20,7 @@ module Mail
19
20
  @parameters = nil
20
21
  value = strip_field(FIELD_NAME, value)
21
22
  end
22
- ensure_filename_quoted(value)
23
+ value = ensure_filename_quoted(value)
23
24
  super(CAPITALIZED_FIELD, value, charset)
24
25
  self.parse
25
26
  self
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # = Date Field
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # = From Field
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # = In-Reply-To Field
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # keywords = "Keywords:" phrase *("," phrase) CRLF
4
5
  module Mail
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # = Message-ID Field
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  #
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # The field names of any optional-field MUST NOT be identical to any
4
5
  # field name specified elsewhere in this standard.
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # trace = [return]
4
5
  # 1*received
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # = References Field
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # = Reply-To Field
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # = Resent-Bcc Field
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # = Resent-Cc Field
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # resent-date = "Resent-Date:" date-time CRLF
4
5
  require 'mail/fields/common/common_date'
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # = Resent-From Field
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # resent-msg-id = "Resent-Message-ID:" msg-id CRLF
4
5
  require 'mail/fields/common/common_message_id'
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # = Resent-Sender Field
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # = Resent-To Field
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # 4.4.3. REPLY-TO / RESENT-REPLY-TO
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # = Sender Field
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  require 'mail/fields/common/common_field'
3
4
 
4
5
  module Mail
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # subject = "Subject:" unstructured CRLF
4
5
  module Mail
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # = To Field
4
5
  #
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  require 'mail/fields/common/common_field'
3
4
 
4
5
  module Mail
@@ -127,7 +128,7 @@ module Mail
127
128
  if first
128
129
  first = !first
129
130
  else
130
- word = " " << word
131
+ word = " #{word}"
131
132
  end
132
133
  if word.not_ascii_only?
133
134
  word
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail
3
4
 
4
5
  # Provides access to a header object.
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  # This is an almost cut and paste from ActiveSupport v3.0.6, copied in here so that Mail
4
5
  # itself does not depend on ActiveSupport to avoid versioning conflicts
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail
3
4
 
4
5
  # Allows you to create a new Mail::Message object.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Mail
2
3
  module Matchers
3
4
  def any_attachment
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Mail
2
3
  module Matchers
3
4
  def have_sent_email
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  require "yaml"
3
4
 
4
5
  module Mail
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail #:nodoc:
3
4
  module Multibyte
4
5
  require 'mail/multibyte/exceptions'
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Mail #:nodoc:
4
5
  module Multibyte #:nodoc:
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Mail #:nodoc:
4
5
  module Multibyte #:nodoc:
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Mail
2
3
  module Multibyte
3
4
  module Unicode
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Mail #:nodoc:
4
5
  module Multibyte #:nodoc:
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'mail/network/retriever_methods/base'
2
3
 
3
4
  module Mail
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Mail
2
3
 
3
4
  # A delivery method implementation which sends via exim.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'mail/check_delivery_params'
2
3
 
3
4
  module Mail
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'mail/check_delivery_params'
2
3
 
3
4
  module Mail
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'mail/check_delivery_params'
2
3
 
3
4
  module Mail
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'mail/check_delivery_params'
2
3
 
3
4
  module Mail
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'mail/check_delivery_params'
2
3
 
3
4
  module Mail
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Mail
4
5
 
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Mail
4
5
  # The IMAP retriever allows to get the last, first or all emails from a IMAP server.
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Mail
4
5
  # The Pop3 retriever allows to get the last, first or all emails from a POP3 server.
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Mail
4
5
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Mail
2
3
  module Parsers
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Mail::Parsers
2
3
  class AddressListsParser
3
4
  include Mail::Utilities
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Mail::Parsers
2
3
  class ContentDispositionParser
3
4
  include Mail::Utilities
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Mail::Parsers
2
3
  class ContentLocationParser
3
4
  def parse(s)
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Mail::Parsers
2
3
  class ContentTransferEncodingParser
3
4
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Mail::Parsers
2
3
  class ContentTypeParser
3
4
  include Mail::Utilities
@@ -1,8 +1,11 @@
1
+ # frozen_string_literal: true
1
2
  module Mail::Parsers
2
3
  class DateTimeParser
3
4
  include Mail::Utilities
4
5
 
5
6
  def parse(s)
7
+ raise Mail::Field::ParseError.new(Mail::DateTimeElement, s, "nil is an invalid DateTime") if s.nil?
8
+
6
9
  date_time = DateTimeStruct.new([])
7
10
 
8
11
  actions, error = Ragel.parse(:date_time, s)
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Mail::Parsers
2
3
  class EnvelopeFromParser
3
4
  def parse(s)
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Mail::Parsers
2
3
  class MessageIdsParser
3
4
  def parse(s)
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Mail::Parsers
2
3
  class MimeVersionParser
3
4
  include Mail::Utilities
@@ -1,7 +1,10 @@
1
+ # frozen_string_literal: true
1
2
  module Mail::Parsers
2
3
  class PhraseListsParser
3
4
 
4
5
  def parse(s)
6
+ raise Mail::Field::ParseError.new(Mail::PhraseList, s, 'nil is invalid') if s.nil?
7
+
5
8
  actions, error = Ragel.parse(:phrase_lists, s)
6
9
  if error
7
10
  raise Mail::Field::ParseError.new(Mail::PhraseList, s, error)
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Mail
2
3
  module Parsers
3
4
  module Ragel
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
1
2
  module Mail::Parsers
2
3
  class ReceivedParser
3
4
 
4
5
  def parse(s)
6
+ raise Mail::Field::ParseError.new(Mail::ReceivedElement, s, 'nil is invalid') if s.nil?
5
7
  actions, error = Ragel.parse(:received, s)
6
8
  if error
7
9
  raise Mail::Field::ParseError.new(Mail::ReceivedElement, s, error)
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail
3
4
  class Part < Message
4
5
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'delegate'
2
3
 
3
4
  module Mail
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
  module Mail
3
4
  module Utilities
4
5
 
@@ -23,13 +24,11 @@ module Mail
23
24
  def quote_phrase( str )
24
25
  if RUBY_VERSION >= '1.9'
25
26
  original_encoding = str.encoding
26
- str.force_encoding('ASCII-8BIT')
27
- if (PHRASE_UNSAFE === str)
28
- quoted_str = dquote(str).force_encoding(original_encoding)
29
- str.force_encoding(original_encoding)
30
- quoted_str
27
+ ascii_str = str.dup.force_encoding('ASCII-8BIT')
28
+ if (PHRASE_UNSAFE === ascii_str)
29
+ dquote(ascii_str).force_encoding(original_encoding)
31
30
  else
32
- str.force_encoding(original_encoding)
31
+ str
33
32
  end
34
33
  else
35
34
  (PHRASE_UNSAFE === str) ? dquote(str) : str
@@ -223,7 +222,26 @@ module Mail
223
222
  enum.each_with_index.map(&block)
224
223
  end
225
224
 
226
- def self.to_lf input
225
+ end
226
+
227
+ # Test String#encode works correctly with line endings.
228
+ # Some versions of Ruby (e.g. MRI <1.9, JRuby, Rubinius) line ending
229
+ # normalization does not work correctly or did not have #encode.
230
+ if ("\r".encode(:universal_newline => true) rescue nil) == LF &&
231
+ (LF.encode(:crlf_newline => true) rescue nil) == CRLF
232
+ # Using String#encode is better performing than Regexp
233
+
234
+ def self.to_lf(input)
235
+ input.kind_of?(String) ? input.to_str.encode(input.encoding, :universal_newline => true) : ''
236
+ end
237
+
238
+ def self.to_crlf(input)
239
+ input.kind_of?(String) ? input.to_str.encode(input.encoding, :universal_newline => true).encode!(input.encoding, :crlf_newline => true) : ''
240
+ end
241
+
242
+ else
243
+
244
+ def self.to_lf(input)
227
245
  input.kind_of?(String) ? input.to_str.gsub(/\r\n|\r/, LF) : ''
228
246
  end
229
247
 
@@ -236,7 +254,7 @@ module Mail
236
254
  CRLF_REGEX = /\n|\r\n|\r/
237
255
  end
238
256
 
239
- def self.to_crlf input
257
+ def self.to_crlf(input)
240
258
  input.kind_of?(String) ? input.to_str.gsub(CRLF_REGEX, CRLF) : ''
241
259
  end
242
260
 
@@ -245,7 +263,7 @@ module Mail
245
263
  # Returns true if the object is considered blank.
246
264
  # A blank includes things like '', ' ', nil,
247
265
  # and arrays and hashes that have nothing in them.
248
- #
266
+ #
249
267
  # This logic is mostly shared with ActiveSupport's blank?
250
268
  def self.blank?(value)
251
269
  if value.kind_of?(NilClass)
@@ -1,10 +1,11 @@
1
+ # frozen_string_literal: true
1
2
  module Mail
2
3
  module VERSION
3
4
 
4
5
  MAJOR = 2
5
6
  MINOR = 6
6
7
  PATCH = 4
7
- BUILD = 'rc2'
8
+ BUILD = nil
8
9
 
9
10
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
10
11
 
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Mail
4
5
  class Ruby18
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Mail
4
5
  class Ruby19
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.rc2
4
+ version: 2.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikel Lindsaar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-14 00:00:00.000000000 Z
11
+ date: 2016-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types
@@ -264,9 +264,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
264
264
  version: '0'
265
265
  required_rubygems_version: !ruby/object:Gem::Requirement
266
266
  requirements:
267
- - - ">"
267
+ - - ">="
268
268
  - !ruby/object:Gem::Version
269
- version: 1.3.1
269
+ version: '0'
270
270
  requirements: []
271
271
  rubyforge_project:
272
272
  rubygems_version: 2.5.1