mail 2.2.19 → 2.2.20

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 (4) hide show
  1. data/CHANGELOG.rdoc +4 -0
  2. data/lib/VERSION +1 -1
  3. data/lib/mail/message.rb +27 -7
  4. metadata +183 -215
@@ -1,3 +1,7 @@
1
+ == Tue May 14 14:22:00 +1100 2013 Mikel Lindsaar <mikel@lindsaar.net>
2
+
3
+ * Backport 2.4.2 2.4.4 fixes (fractious)
4
+
1
5
  == Tue Apr 26 09:49:54 UTC 2011 Mikel Lindsaar <mikel@rubyx.com>
2
6
 
3
7
  * Update activesupport require to use inflector - closes #217
@@ -1,4 +1,4 @@
1
1
  major:2
2
2
  minor:2
3
- patch:19
3
+ patch:20
4
4
  build:
@@ -1711,19 +1711,39 @@ module Mail
1711
1711
  buffer
1712
1712
  end
1713
1713
 
1714
- def to_yaml
1715
- ready_to_send!
1714
+ def to_yaml(opts = {})
1716
1715
  hash = {}
1716
+ hash['headers'] = {}
1717
1717
  header.fields.each do |field|
1718
- hash[field.name] = field.value
1718
+ hash['headers'][field.name] = field.value
1719
+ end
1720
+ hash['delivery_handler'] = delivery_handler.to_s if delivery_handler
1721
+ hash['transport_encoding'] = transport_encoding.to_s
1722
+ special_variables = [:@header, :@delivery_handler, :@transport_encoding]
1723
+ (instance_variables.map(&:to_sym) - special_variables).each do |var|
1724
+ hash[var.to_s] = instance_variable_get(var)
1719
1725
  end
1720
- hash['subject'] = subject
1721
- hash['body'] = body.encoded(content_transfer_encoding)
1722
- hash.to_yaml
1726
+ hash.to_yaml(opts)
1723
1727
  end
1724
1728
 
1725
1729
  def self.from_yaml(str)
1726
- from_hash(YAML::load(str))
1730
+ hash = YAML.load(str)
1731
+ m = Mail::Message.new(:headers => hash['headers'])
1732
+ hash.delete('headers')
1733
+ hash.each do |k,v|
1734
+ case
1735
+ when k == 'delivery_handler'
1736
+ begin
1737
+ m.delivery_handler = Object.const_get(v) unless v.blank?
1738
+ rescue NameError
1739
+ end
1740
+ when k == 'transport_encoding'
1741
+ m.transport_encoding(v)
1742
+ when k =~ /^@/
1743
+ m.instance_variable_set(k.to_sym, v)
1744
+ end
1745
+ end
1746
+ m
1727
1747
  end
1728
1748
 
1729
1749
  def self.from_hash(hash)
metadata CHANGED
@@ -1,86 +1,61 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mail
3
3
  version: !ruby/object:Gem::Version
4
- hash: 33
5
4
  prerelease:
6
- segments:
7
- - 2
8
- - 2
9
- - 19
10
- version: 2.2.19
5
+ version: 2.2.20
11
6
  platform: ruby
12
7
  authors:
13
- - Mikel Lindsaar
8
+ - Mikel Lindsaar
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
12
 
18
- date: 2011-04-26 00:00:00 +10:00
19
- default_executable:
13
+ date: 2013-05-14 00:00:00 Z
20
14
  dependencies:
21
- - !ruby/object:Gem::Dependency
22
- name: activesupport
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 15
30
- segments:
31
- - 2
32
- - 3
33
- - 6
34
- version: 2.3.6
35
- type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: mime-types
39
- prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ~>
44
- - !ruby/object:Gem::Version
45
- hash: 47
46
- segments:
47
- - 1
48
- - 16
49
- version: "1.16"
50
- type: :runtime
51
- version_requirements: *id002
52
- - !ruby/object:Gem::Dependency
53
- name: treetop
54
- prerelease: false
55
- requirement: &id003 !ruby/object:Gem::Requirement
56
- none: false
57
- requirements:
58
- - - ~>
59
- - !ruby/object:Gem::Version
60
- hash: 23
61
- segments:
62
- - 1
63
- - 4
64
- - 8
65
- version: 1.4.8
66
- type: :runtime
67
- version_requirements: *id003
68
- - !ruby/object:Gem::Dependency
69
- name: i18n
70
- prerelease: false
71
- requirement: &id004 !ruby/object:Gem::Requirement
72
- none: false
73
- requirements:
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- hash: 15
77
- segments:
78
- - 0
79
- - 4
80
- - 0
81
- version: 0.4.0
82
- type: :runtime
83
- version_requirements: *id004
15
+ - !ruby/object:Gem::Dependency
16
+ name: activesupport
17
+ prerelease: false
18
+ requirement: &id001 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 2.3.6
24
+ type: :runtime
25
+ version_requirements: *id001
26
+ - !ruby/object:Gem::Dependency
27
+ name: mime-types
28
+ prerelease: false
29
+ requirement: &id002 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ~>
33
+ - !ruby/object:Gem::Version
34
+ version: "1.16"
35
+ type: :runtime
36
+ version_requirements: *id002
37
+ - !ruby/object:Gem::Dependency
38
+ name: treetop
39
+ prerelease: false
40
+ requirement: &id003 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 1.4.8
46
+ type: :runtime
47
+ version_requirements: *id003
48
+ - !ruby/object:Gem::Dependency
49
+ name: i18n
50
+ prerelease: false
51
+ requirement: &id004 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 0.4.0
57
+ type: :runtime
58
+ version_requirements: *id004
84
59
  description: A really Ruby Mail handler.
85
60
  email: raasdnil@gmail.com
86
61
  executables: []
@@ -88,136 +63,135 @@ executables: []
88
63
  extensions: []
89
64
 
90
65
  extra_rdoc_files:
91
- - README.rdoc
92
- - CHANGELOG.rdoc
93
- - TODO.rdoc
66
+ - README.rdoc
67
+ - CHANGELOG.rdoc
68
+ - TODO.rdoc
94
69
  files:
95
- - README.rdoc
96
- - Rakefile
97
- - TODO.rdoc
98
- - lib/mail/attachments_list.rb
99
- - lib/mail/body.rb
100
- - lib/mail/configuration.rb
101
- - lib/mail/core_extensions/nil.rb
102
- - lib/mail/core_extensions/shellwords.rb
103
- - lib/mail/core_extensions/smtp.rb
104
- - lib/mail/core_extensions/string.rb
105
- - lib/mail/elements/address.rb
106
- - lib/mail/elements/address_list.rb
107
- - lib/mail/elements/content_disposition_element.rb
108
- - lib/mail/elements/content_location_element.rb
109
- - lib/mail/elements/content_transfer_encoding_element.rb
110
- - lib/mail/elements/content_type_element.rb
111
- - lib/mail/elements/date_time_element.rb
112
- - lib/mail/elements/envelope_from_element.rb
113
- - lib/mail/elements/message_ids_element.rb
114
- - lib/mail/elements/mime_version_element.rb
115
- - lib/mail/elements/phrase_list.rb
116
- - lib/mail/elements/received_element.rb
117
- - lib/mail/elements.rb
118
- - lib/mail/encodings/7bit.rb
119
- - lib/mail/encodings/8bit.rb
120
- - lib/mail/encodings/base64.rb
121
- - lib/mail/encodings/binary.rb
122
- - lib/mail/encodings/quoted_printable.rb
123
- - lib/mail/encodings/transfer_encoding.rb
124
- - lib/mail/encodings.rb
125
- - lib/mail/envelope.rb
126
- - lib/mail/field.rb
127
- - lib/mail/field_list.rb
128
- - lib/mail/fields/bcc_field.rb
129
- - lib/mail/fields/cc_field.rb
130
- - lib/mail/fields/comments_field.rb
131
- - lib/mail/fields/common/address_container.rb
132
- - lib/mail/fields/common/common_address.rb
133
- - lib/mail/fields/common/common_date.rb
134
- - lib/mail/fields/common/common_field.rb
135
- - lib/mail/fields/common/common_message_id.rb
136
- - lib/mail/fields/common/parameter_hash.rb
137
- - lib/mail/fields/content_description_field.rb
138
- - lib/mail/fields/content_disposition_field.rb
139
- - lib/mail/fields/content_id_field.rb
140
- - lib/mail/fields/content_location_field.rb
141
- - lib/mail/fields/content_transfer_encoding_field.rb
142
- - lib/mail/fields/content_type_field.rb
143
- - lib/mail/fields/date_field.rb
144
- - lib/mail/fields/from_field.rb
145
- - lib/mail/fields/in_reply_to_field.rb
146
- - lib/mail/fields/keywords_field.rb
147
- - lib/mail/fields/message_id_field.rb
148
- - lib/mail/fields/mime_version_field.rb
149
- - lib/mail/fields/optional_field.rb
150
- - lib/mail/fields/received_field.rb
151
- - lib/mail/fields/references_field.rb
152
- - lib/mail/fields/reply_to_field.rb
153
- - lib/mail/fields/resent_bcc_field.rb
154
- - lib/mail/fields/resent_cc_field.rb
155
- - lib/mail/fields/resent_date_field.rb
156
- - lib/mail/fields/resent_from_field.rb
157
- - lib/mail/fields/resent_message_id_field.rb
158
- - lib/mail/fields/resent_sender_field.rb
159
- - lib/mail/fields/resent_to_field.rb
160
- - lib/mail/fields/return_path_field.rb
161
- - lib/mail/fields/sender_field.rb
162
- - lib/mail/fields/structured_field.rb
163
- - lib/mail/fields/subject_field.rb
164
- - lib/mail/fields/to_field.rb
165
- - lib/mail/fields/unstructured_field.rb
166
- - lib/mail/fields.rb
167
- - lib/mail/header.rb
168
- - lib/mail/mail.rb
169
- - lib/mail/message.rb
170
- - lib/mail/network/delivery_methods/file_delivery.rb
171
- - lib/mail/network/delivery_methods/sendmail.rb
172
- - lib/mail/network/delivery_methods/smtp.rb
173
- - lib/mail/network/delivery_methods/smtp_connection.rb
174
- - lib/mail/network/delivery_methods/test_mailer.rb
175
- - lib/mail/network/retriever_methods/base.rb
176
- - lib/mail/network/retriever_methods/imap.rb
177
- - lib/mail/network/retriever_methods/pop3.rb
178
- - lib/mail/network/retriever_methods/test_retriever.rb
179
- - lib/mail/network.rb
180
- - lib/mail/parsers/address_lists.rb
181
- - lib/mail/parsers/address_lists.treetop
182
- - lib/mail/parsers/content_disposition.rb
183
- - lib/mail/parsers/content_disposition.treetop
184
- - lib/mail/parsers/content_location.rb
185
- - lib/mail/parsers/content_location.treetop
186
- - lib/mail/parsers/content_transfer_encoding.rb
187
- - lib/mail/parsers/content_transfer_encoding.treetop
188
- - lib/mail/parsers/content_type.rb
189
- - lib/mail/parsers/content_type.treetop
190
- - lib/mail/parsers/date_time.rb
191
- - lib/mail/parsers/date_time.treetop
192
- - lib/mail/parsers/envelope_from.rb
193
- - lib/mail/parsers/envelope_from.treetop
194
- - lib/mail/parsers/message_ids.rb
195
- - lib/mail/parsers/message_ids.treetop
196
- - lib/mail/parsers/mime_version.rb
197
- - lib/mail/parsers/mime_version.treetop
198
- - lib/mail/parsers/phrase_lists.rb
199
- - lib/mail/parsers/phrase_lists.treetop
200
- - lib/mail/parsers/received.rb
201
- - lib/mail/parsers/received.treetop
202
- - lib/mail/parsers/rfc2045.rb
203
- - lib/mail/parsers/rfc2045.treetop
204
- - lib/mail/parsers/rfc2822.rb
205
- - lib/mail/parsers/rfc2822.treetop
206
- - lib/mail/parsers/rfc2822_obsolete.rb
207
- - lib/mail/parsers/rfc2822_obsolete.treetop
208
- - lib/mail/part.rb
209
- - lib/mail/parts_list.rb
210
- - lib/mail/patterns.rb
211
- - lib/mail/utilities.rb
212
- - lib/mail/version.rb
213
- - lib/mail/version_specific/ruby_1_8.rb
214
- - lib/mail/version_specific/ruby_1_9.rb
215
- - lib/mail.rb
216
- - lib/tasks/corpus.rake
217
- - lib/tasks/treetop.rake
218
- - lib/VERSION
219
- - CHANGELOG.rdoc
220
- has_rdoc: true
70
+ - README.rdoc
71
+ - Rakefile
72
+ - TODO.rdoc
73
+ - lib/mail.rb
74
+ - lib/VERSION
75
+ - lib/mail/attachments_list.rb
76
+ - lib/mail/body.rb
77
+ - lib/mail/configuration.rb
78
+ - lib/mail/elements.rb
79
+ - lib/mail/encodings.rb
80
+ - lib/mail/envelope.rb
81
+ - lib/mail/field.rb
82
+ - lib/mail/field_list.rb
83
+ - lib/mail/fields.rb
84
+ - lib/mail/header.rb
85
+ - lib/mail/mail.rb
86
+ - lib/mail/message.rb
87
+ - lib/mail/network.rb
88
+ - lib/mail/part.rb
89
+ - lib/mail/parts_list.rb
90
+ - lib/mail/patterns.rb
91
+ - lib/mail/utilities.rb
92
+ - lib/mail/version.rb
93
+ - lib/mail/core_extensions/nil.rb
94
+ - lib/mail/core_extensions/shellwords.rb
95
+ - lib/mail/core_extensions/smtp.rb
96
+ - lib/mail/core_extensions/string.rb
97
+ - lib/mail/elements/address.rb
98
+ - lib/mail/elements/address_list.rb
99
+ - lib/mail/elements/content_disposition_element.rb
100
+ - lib/mail/elements/content_location_element.rb
101
+ - lib/mail/elements/content_transfer_encoding_element.rb
102
+ - lib/mail/elements/content_type_element.rb
103
+ - lib/mail/elements/date_time_element.rb
104
+ - lib/mail/elements/envelope_from_element.rb
105
+ - lib/mail/elements/message_ids_element.rb
106
+ - lib/mail/elements/mime_version_element.rb
107
+ - lib/mail/elements/phrase_list.rb
108
+ - lib/mail/elements/received_element.rb
109
+ - lib/mail/encodings/7bit.rb
110
+ - lib/mail/encodings/8bit.rb
111
+ - lib/mail/encodings/base64.rb
112
+ - lib/mail/encodings/binary.rb
113
+ - lib/mail/encodings/quoted_printable.rb
114
+ - lib/mail/encodings/transfer_encoding.rb
115
+ - lib/mail/fields/bcc_field.rb
116
+ - lib/mail/fields/cc_field.rb
117
+ - lib/mail/fields/comments_field.rb
118
+ - lib/mail/fields/content_description_field.rb
119
+ - lib/mail/fields/content_disposition_field.rb
120
+ - lib/mail/fields/content_id_field.rb
121
+ - lib/mail/fields/content_location_field.rb
122
+ - lib/mail/fields/content_transfer_encoding_field.rb
123
+ - lib/mail/fields/content_type_field.rb
124
+ - lib/mail/fields/date_field.rb
125
+ - lib/mail/fields/from_field.rb
126
+ - lib/mail/fields/in_reply_to_field.rb
127
+ - lib/mail/fields/keywords_field.rb
128
+ - lib/mail/fields/message_id_field.rb
129
+ - lib/mail/fields/mime_version_field.rb
130
+ - lib/mail/fields/optional_field.rb
131
+ - lib/mail/fields/received_field.rb
132
+ - lib/mail/fields/references_field.rb
133
+ - lib/mail/fields/reply_to_field.rb
134
+ - lib/mail/fields/resent_bcc_field.rb
135
+ - lib/mail/fields/resent_cc_field.rb
136
+ - lib/mail/fields/resent_date_field.rb
137
+ - lib/mail/fields/resent_from_field.rb
138
+ - lib/mail/fields/resent_message_id_field.rb
139
+ - lib/mail/fields/resent_sender_field.rb
140
+ - lib/mail/fields/resent_to_field.rb
141
+ - lib/mail/fields/return_path_field.rb
142
+ - lib/mail/fields/sender_field.rb
143
+ - lib/mail/fields/structured_field.rb
144
+ - lib/mail/fields/subject_field.rb
145
+ - lib/mail/fields/to_field.rb
146
+ - lib/mail/fields/unstructured_field.rb
147
+ - lib/mail/fields/common/address_container.rb
148
+ - lib/mail/fields/common/common_address.rb
149
+ - lib/mail/fields/common/common_date.rb
150
+ - lib/mail/fields/common/common_field.rb
151
+ - lib/mail/fields/common/common_message_id.rb
152
+ - lib/mail/fields/common/parameter_hash.rb
153
+ - lib/mail/network/delivery_methods/file_delivery.rb
154
+ - lib/mail/network/delivery_methods/sendmail.rb
155
+ - lib/mail/network/delivery_methods/smtp.rb
156
+ - lib/mail/network/delivery_methods/smtp_connection.rb
157
+ - lib/mail/network/delivery_methods/test_mailer.rb
158
+ - lib/mail/network/retriever_methods/base.rb
159
+ - lib/mail/network/retriever_methods/imap.rb
160
+ - lib/mail/network/retriever_methods/pop3.rb
161
+ - lib/mail/network/retriever_methods/test_retriever.rb
162
+ - lib/mail/parsers/address_lists.rb
163
+ - lib/mail/parsers/address_lists.treetop
164
+ - lib/mail/parsers/content_disposition.rb
165
+ - lib/mail/parsers/content_disposition.treetop
166
+ - lib/mail/parsers/content_location.rb
167
+ - lib/mail/parsers/content_location.treetop
168
+ - lib/mail/parsers/content_transfer_encoding.rb
169
+ - lib/mail/parsers/content_transfer_encoding.treetop
170
+ - lib/mail/parsers/content_type.rb
171
+ - lib/mail/parsers/content_type.treetop
172
+ - lib/mail/parsers/date_time.rb
173
+ - lib/mail/parsers/date_time.treetop
174
+ - lib/mail/parsers/envelope_from.rb
175
+ - lib/mail/parsers/envelope_from.treetop
176
+ - lib/mail/parsers/message_ids.rb
177
+ - lib/mail/parsers/message_ids.treetop
178
+ - lib/mail/parsers/mime_version.rb
179
+ - lib/mail/parsers/mime_version.treetop
180
+ - lib/mail/parsers/phrase_lists.rb
181
+ - lib/mail/parsers/phrase_lists.treetop
182
+ - lib/mail/parsers/received.rb
183
+ - lib/mail/parsers/received.treetop
184
+ - lib/mail/parsers/rfc2045.rb
185
+ - lib/mail/parsers/rfc2045.treetop
186
+ - lib/mail/parsers/rfc2822.rb
187
+ - lib/mail/parsers/rfc2822.treetop
188
+ - lib/mail/parsers/rfc2822_obsolete.rb
189
+ - lib/mail/parsers/rfc2822_obsolete.treetop
190
+ - lib/mail/version_specific/ruby_1_8.rb
191
+ - lib/mail/version_specific/ruby_1_9.rb
192
+ - lib/tasks/corpus.rake
193
+ - lib/tasks/treetop.rake
194
+ - CHANGELOG.rdoc
221
195
  homepage: http://github.com/mikel/mail
222
196
  licenses: []
223
197
 
@@ -225,29 +199,23 @@ post_install_message:
225
199
  rdoc_options: []
226
200
 
227
201
  require_paths:
228
- - lib
202
+ - lib
229
203
  required_ruby_version: !ruby/object:Gem::Requirement
230
204
  none: false
231
205
  requirements:
232
- - - ">="
233
- - !ruby/object:Gem::Version
234
- hash: 3
235
- segments:
236
- - 0
237
- version: "0"
206
+ - - ">="
207
+ - !ruby/object:Gem::Version
208
+ version: "0"
238
209
  required_rubygems_version: !ruby/object:Gem::Requirement
239
210
  none: false
240
211
  requirements:
241
- - - ">="
242
- - !ruby/object:Gem::Version
243
- hash: 3
244
- segments:
245
- - 0
246
- version: "0"
212
+ - - ">="
213
+ - !ruby/object:Gem::Version
214
+ version: "0"
247
215
  requirements: []
248
216
 
249
217
  rubyforge_project:
250
- rubygems_version: 1.6.2
218
+ rubygems_version: 1.8.24
251
219
  signing_key:
252
220
  specification_version: 3
253
221
  summary: Mail provides a nice Ruby DSL for making, sending and reading emails.