mail 2.5.3 → 2.5.4

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.

Files changed (66) hide show
  1. data/CHANGELOG.rdoc +65 -0
  2. data/CONTRIBUTING.md +4 -4
  3. data/Gemfile +7 -20
  4. data/MIT-LICENSE +20 -0
  5. data/README.md +10 -9
  6. data/Rakefile +3 -20
  7. data/lib/VERSION +1 -1
  8. data/lib/mail.rb +0 -1
  9. data/lib/mail/attachments_list.rb +2 -2
  10. data/lib/mail/body.rb +4 -4
  11. data/lib/mail/check_delivery_params.rb +12 -22
  12. data/lib/mail/core_extensions/object.rb +8 -8
  13. data/lib/mail/core_extensions/smtp.rb +12 -13
  14. data/lib/mail/core_extensions/string.rb +4 -4
  15. data/lib/mail/elements/address.rb +13 -5
  16. data/lib/mail/elements/envelope_from_element.rb +15 -2
  17. data/lib/mail/encodings.rb +61 -28
  18. data/lib/mail/encodings/quoted_printable.rb +4 -3
  19. data/lib/mail/field.rb +10 -11
  20. data/lib/mail/fields/bcc_field.rb +2 -2
  21. data/lib/mail/fields/cc_field.rb +2 -2
  22. data/lib/mail/fields/comments_field.rb +1 -1
  23. data/lib/mail/fields/common/common_address.rb +13 -3
  24. data/lib/mail/fields/common/common_field.rb +4 -4
  25. data/lib/mail/fields/content_id_field.rb +1 -2
  26. data/lib/mail/fields/content_transfer_encoding_field.rb +2 -2
  27. data/lib/mail/fields/content_type_field.rb +1 -1
  28. data/lib/mail/fields/date_field.rb +1 -1
  29. data/lib/mail/fields/from_field.rb +2 -2
  30. data/lib/mail/fields/in_reply_to_field.rb +2 -1
  31. data/lib/mail/fields/message_id_field.rb +2 -3
  32. data/lib/mail/fields/references_field.rb +2 -1
  33. data/lib/mail/fields/reply_to_field.rb +2 -2
  34. data/lib/mail/fields/resent_bcc_field.rb +2 -2
  35. data/lib/mail/fields/resent_cc_field.rb +2 -2
  36. data/lib/mail/fields/resent_from_field.rb +2 -2
  37. data/lib/mail/fields/resent_sender_field.rb +2 -2
  38. data/lib/mail/fields/resent_to_field.rb +2 -2
  39. data/lib/mail/fields/sender_field.rb +7 -7
  40. data/lib/mail/fields/to_field.rb +2 -2
  41. data/lib/mail/fields/unstructured_field.rb +1 -1
  42. data/lib/mail/header.rb +5 -1
  43. data/lib/mail/message.rb +133 -37
  44. data/lib/mail/multibyte/chars.rb +2 -2
  45. data/lib/mail/multibyte/unicode.rb +5 -3
  46. data/lib/mail/network/delivery_methods/exim.rb +1 -6
  47. data/lib/mail/network/delivery_methods/file_delivery.rb +1 -1
  48. data/lib/mail/network/delivery_methods/sendmail.rb +32 -10
  49. data/lib/mail/network/delivery_methods/smtp.rb +35 -34
  50. data/lib/mail/network/delivery_methods/smtp_connection.rb +6 -6
  51. data/lib/mail/network/delivery_methods/test_mailer.rb +2 -2
  52. data/lib/mail/parsers/content_transfer_encoding.rb +81 -42
  53. data/lib/mail/parsers/content_transfer_encoding.treetop +4 -6
  54. data/lib/mail/parsers/content_type.rb +16 -12
  55. data/lib/mail/parsers/content_type.treetop +2 -2
  56. data/lib/mail/parsers/rfc2045.rb +12 -55
  57. data/lib/mail/parsers/rfc2045.treetop +1 -2
  58. data/lib/mail/parsers/rfc2822.rb +50 -50
  59. data/lib/mail/parsers/rfc2822.treetop +19 -21
  60. data/lib/mail/part.rb +6 -2
  61. data/lib/mail/patterns.rb +1 -0
  62. data/lib/mail/utilities.rb +25 -17
  63. data/lib/mail/version_specific/ruby_1_8.rb +5 -1
  64. data/lib/mail/version_specific/ruby_1_9.rb +46 -21
  65. metadata +57 -8
  66. data/lib/mail/core_extensions/shell_escape.rb +0 -56
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: 2.5.3
4
+ version: 2.5.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-04 00:00:00.000000000 Z
12
+ date: 2013-05-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mime-types
@@ -44,21 +44,69 @@ dependencies:
44
44
  - !ruby/object:Gem::Version
45
45
  version: 1.4.8
46
46
  - !ruby/object:Gem::Dependency
47
- name: i18n
47
+ name: bundler
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  none: false
50
50
  requirements:
51
51
  - - ! '>='
52
52
  - !ruby/object:Gem::Version
53
- version: 0.4.0
54
- type: :runtime
53
+ version: 1.0.3
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 1.0.3
62
+ - !ruby/object:Gem::Dependency
63
+ name: rake
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>'
68
+ - !ruby/object:Gem::Version
69
+ version: 0.8.7
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>'
76
+ - !ruby/object:Gem::Version
77
+ version: 0.8.7
78
+ - !ruby/object:Gem::Dependency
79
+ name: rspec
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: 2.12.0
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: 2.12.0
94
+ - !ruby/object:Gem::Dependency
95
+ name: rdoc
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
55
103
  prerelease: false
56
104
  version_requirements: !ruby/object:Gem::Requirement
57
105
  none: false
58
106
  requirements:
59
107
  - - ! '>='
60
108
  - !ruby/object:Gem::Version
61
- version: 0.4.0
109
+ version: '0'
62
110
  description: A really Ruby Mail handler.
63
111
  email: raasdnil@gmail.com
64
112
  executables: []
@@ -70,6 +118,7 @@ extra_rdoc_files:
70
118
  - TODO.rdoc
71
119
  files:
72
120
  - README.md
121
+ - MIT-LICENSE
73
122
  - CONTRIBUTING.md
74
123
  - CHANGELOG.rdoc
75
124
  - Dependencies.txt
@@ -83,7 +132,6 @@ files:
83
132
  - lib/mail/configuration.rb
84
133
  - lib/mail/core_extensions/nil.rb
85
134
  - lib/mail/core_extensions/object.rb
86
- - lib/mail/core_extensions/shell_escape.rb
87
135
  - lib/mail/core_extensions/smtp.rb
88
136
  - lib/mail/core_extensions/string/access.rb
89
137
  - lib/mail/core_extensions/string/multibyte.rb
@@ -212,7 +260,8 @@ files:
212
260
  - lib/tasks/treetop.rake
213
261
  - lib/VERSION
214
262
  homepage: http://github.com/mikel/mail
215
- licenses: []
263
+ licenses:
264
+ - MIT
216
265
  post_install_message:
217
266
  rdoc_options: []
218
267
  require_paths:
@@ -1,56 +0,0 @@
1
- # encoding: utf-8
2
-
3
- # The following is an adaptation of ruby 1.9.2's shellwords.rb file,
4
- # it is modified to include '+' in the allowed list to allow for
5
- # sendmail to accept email addresses as the sender with a + in them
6
- #
7
- module Mail
8
- module ShellEscape
9
- # Escapes a string so that it can be safely used in a Bourne shell
10
- # command line.
11
- #
12
- # Note that a resulted string should be used unquoted and is not
13
- # intended for use in double quotes nor in single quotes.
14
- #
15
- # open("| grep #{Shellwords.escape(pattern)} file") { |pipe|
16
- # # ...
17
- # }
18
- #
19
- # +String#shellescape+ is a shorthand for this function.
20
- #
21
- # open("| grep #{pattern.shellescape} file") { |pipe|
22
- # # ...
23
- # }
24
- #
25
- def escape_for_shell(str)
26
- # An empty argument will be skipped, so return empty quotes.
27
- return "''" if str.empty?
28
-
29
- str = str.dup
30
-
31
- # Process as a single byte sequence because not all shell
32
- # implementations are multibyte aware.
33
- str.gsub!(/([^A-Za-z0-9_\s\+\-.,:\/@])/n, "\\\\\\1")
34
-
35
- # A LF cannot be escaped with a backslash because a backslash + LF
36
- # combo is regarded as line continuation and simply ignored.
37
- str.gsub!(/\n/, "'\n'")
38
-
39
- return str
40
- end
41
-
42
- module_function :escape_for_shell
43
- end
44
- end
45
-
46
- class String
47
- # call-seq:
48
- # str.shellescape => string
49
- #
50
- # Escapes +str+ so that it can be safely used in a Bourne shell
51
- # command line. See +Shellwords::shellescape+ for details.
52
- #
53
- def escape_for_shell
54
- Mail::ShellEscape.escape_for_shell(self)
55
- end
56
- end