mail 2.6.4 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.md +208 -156
- data/lib/mail/attachments_list.rb +13 -10
- data/lib/mail/body.rb +96 -107
- data/lib/mail/configuration.rb +2 -0
- data/lib/mail/constants.rb +27 -5
- data/lib/mail/elements/address.rb +61 -50
- data/lib/mail/elements/address_list.rb +11 -19
- data/lib/mail/elements/content_disposition_element.rb +9 -16
- data/lib/mail/elements/content_location_element.rb +6 -11
- data/lib/mail/elements/content_transfer_encoding_element.rb +6 -11
- data/lib/mail/elements/content_type_element.rb +16 -23
- data/lib/mail/elements/date_time_element.rb +7 -15
- data/lib/mail/elements/envelope_from_element.rb +22 -23
- data/lib/mail/elements/message_ids_element.rb +18 -13
- data/lib/mail/elements/mime_version_element.rb +7 -15
- data/lib/mail/elements/phrase_list.rb +12 -10
- data/lib/mail/elements/received_element.rb +27 -19
- data/lib/mail/encodings/7bit.rb +9 -14
- data/lib/mail/encodings/8bit.rb +2 -21
- data/lib/mail/encodings/base64.rb +11 -12
- data/lib/mail/encodings/binary.rb +3 -22
- data/lib/mail/encodings/identity.rb +24 -0
- data/lib/mail/encodings/quoted_printable.rb +6 -6
- data/lib/mail/encodings/transfer_encoding.rb +38 -29
- data/lib/mail/encodings/unix_to_unix.rb +4 -2
- data/lib/mail/encodings.rb +83 -56
- data/lib/mail/envelope.rb +11 -14
- data/lib/mail/field.rb +181 -130
- data/lib/mail/field_list.rb +61 -8
- data/lib/mail/fields/bcc_field.rb +33 -52
- data/lib/mail/fields/cc_field.rb +27 -49
- data/lib/mail/fields/comments_field.rb +26 -37
- data/lib/mail/fields/common_address_field.rb +162 -0
- data/lib/mail/fields/common_date_field.rb +56 -0
- data/lib/mail/fields/common_field.rb +77 -0
- data/lib/mail/fields/common_message_id_field.rb +41 -0
- data/lib/mail/fields/content_description_field.rb +6 -14
- data/lib/mail/fields/content_disposition_field.rb +11 -38
- data/lib/mail/fields/content_id_field.rb +23 -51
- data/lib/mail/fields/content_location_field.rb +10 -25
- data/lib/mail/fields/content_transfer_encoding_field.rb +30 -31
- data/lib/mail/fields/content_type_field.rb +53 -84
- data/lib/mail/fields/date_field.rb +22 -52
- data/lib/mail/fields/from_field.rb +27 -49
- data/lib/mail/fields/in_reply_to_field.rb +37 -49
- data/lib/mail/fields/keywords_field.rb +17 -31
- data/lib/mail/fields/message_id_field.rb +24 -71
- data/lib/mail/fields/mime_version_field.rb +18 -30
- data/lib/mail/fields/named_structured_field.rb +10 -0
- data/lib/mail/fields/named_unstructured_field.rb +10 -0
- data/lib/mail/fields/optional_field.rb +9 -8
- data/lib/mail/fields/{common/parameter_hash.rb → parameter_hash.rb} +13 -11
- data/lib/mail/fields/received_field.rb +42 -57
- data/lib/mail/fields/references_field.rb +34 -49
- data/lib/mail/fields/reply_to_field.rb +27 -49
- data/lib/mail/fields/resent_bcc_field.rb +27 -49
- data/lib/mail/fields/resent_cc_field.rb +27 -49
- data/lib/mail/fields/resent_date_field.rb +4 -30
- data/lib/mail/fields/resent_from_field.rb +27 -49
- data/lib/mail/fields/resent_message_id_field.rb +4 -29
- data/lib/mail/fields/resent_sender_field.rb +26 -56
- data/lib/mail/fields/resent_to_field.rb +27 -49
- data/lib/mail/fields/return_path_field.rb +49 -54
- data/lib/mail/fields/sender_field.rb +33 -55
- data/lib/mail/fields/structured_field.rb +2 -30
- data/lib/mail/fields/subject_field.rb +8 -11
- data/lib/mail/fields/to_field.rb +27 -49
- data/lib/mail/fields/unstructured_field.rb +31 -47
- data/lib/mail/fields.rb +9 -0
- data/lib/mail/header.rb +71 -110
- data/lib/mail/mail.rb +34 -37
- data/lib/mail/matchers/attachment_matchers.rb +15 -0
- data/lib/mail/matchers/has_sent_mail.rb +21 -1
- data/lib/mail/message.rb +126 -127
- data/lib/mail/multibyte/chars.rb +24 -181
- data/lib/mail/multibyte/unicode.rb +11 -11
- data/lib/mail/multibyte/utils.rb +26 -43
- data/lib/mail/multibyte.rb +55 -16
- data/lib/mail/network/delivery_methods/exim.rb +8 -11
- data/lib/mail/network/delivery_methods/file_delivery.rb +15 -18
- data/lib/mail/network/delivery_methods/logger_delivery.rb +34 -0
- data/lib/mail/network/delivery_methods/sendmail.rb +32 -35
- data/lib/mail/network/delivery_methods/smtp.rb +125 -68
- data/lib/mail/network/delivery_methods/smtp_connection.rb +11 -16
- data/lib/mail/network/delivery_methods/test_mailer.rb +12 -13
- data/lib/mail/network/retriever_methods/base.rb +13 -13
- data/lib/mail/network/retriever_methods/imap.rb +25 -9
- data/lib/mail/network/retriever_methods/pop3.rb +25 -23
- data/lib/mail/network/retriever_methods/test_retriever.rb +3 -2
- data/lib/mail/network.rb +1 -0
- data/lib/mail/parser_tools.rb +15 -0
- data/lib/mail/parsers/address_lists_parser.rb +33228 -116
- data/lib/mail/parsers/address_lists_parser.rl +183 -0
- data/lib/mail/parsers/content_disposition_parser.rb +885 -49
- data/lib/mail/parsers/content_disposition_parser.rl +93 -0
- data/lib/mail/parsers/content_location_parser.rb +812 -23
- data/lib/mail/parsers/content_location_parser.rl +82 -0
- data/lib/mail/parsers/content_transfer_encoding_parser.rb +512 -21
- data/lib/mail/parsers/content_transfer_encoding_parser.rl +75 -0
- data/lib/mail/parsers/content_type_parser.rb +1039 -55
- data/lib/mail/parsers/content_type_parser.rl +94 -0
- data/lib/mail/parsers/date_time_parser.rb +880 -25
- data/lib/mail/parsers/date_time_parser.rl +73 -0
- data/lib/mail/parsers/envelope_from_parser.rb +3672 -40
- data/lib/mail/parsers/envelope_from_parser.rl +93 -0
- data/lib/mail/parsers/message_ids_parser.rb +5149 -25
- data/lib/mail/parsers/message_ids_parser.rl +97 -0
- data/lib/mail/parsers/mime_version_parser.rb +500 -26
- data/lib/mail/parsers/mime_version_parser.rl +72 -0
- data/lib/mail/parsers/phrase_lists_parser.rb +873 -22
- data/lib/mail/parsers/phrase_lists_parser.rl +94 -0
- data/lib/mail/parsers/received_parser.rb +8779 -43
- data/lib/mail/parsers/received_parser.rl +95 -0
- data/lib/mail/parsers/rfc2045_content_transfer_encoding.rl +13 -0
- data/lib/mail/parsers/rfc2045_content_type.rl +25 -0
- data/lib/mail/parsers/rfc2045_mime.rl +16 -0
- data/lib/mail/parsers/rfc2183_content_disposition.rl +15 -0
- data/lib/mail/parsers/rfc3629_utf8.rl +19 -0
- data/lib/mail/parsers/rfc5234_abnf_core_rules.rl +22 -0
- data/lib/mail/parsers/rfc5322.rl +74 -0
- data/lib/mail/parsers/rfc5322_address.rl +72 -0
- data/lib/mail/parsers/{ragel/date_time.rl → rfc5322_date_time.rl} +8 -1
- data/lib/mail/parsers/rfc5322_lexical_tokens.rl +60 -0
- data/lib/mail/parsers.rb +11 -25
- data/lib/mail/part.rb +25 -29
- data/lib/mail/parts_list.rb +62 -6
- data/lib/mail/smtp_envelope.rb +57 -0
- data/lib/mail/utilities.rb +361 -74
- data/lib/mail/version.rb +2 -2
- data/lib/mail/yaml.rb +30 -0
- data/lib/mail.rb +4 -37
- metadata +125 -67
- data/CHANGELOG.rdoc +0 -787
- data/CONTRIBUTING.md +0 -60
- data/Dependencies.txt +0 -2
- data/Gemfile +0 -11
- data/Rakefile +0 -29
- data/TODO.rdoc +0 -9
- data/lib/mail/check_delivery_params.rb +0 -21
- data/lib/mail/core_extensions/smtp.rb +0 -25
- data/lib/mail/core_extensions/string/access.rb +0 -146
- data/lib/mail/core_extensions/string/multibyte.rb +0 -79
- data/lib/mail/core_extensions/string.rb +0 -21
- data/lib/mail/fields/common/address_container.rb +0 -17
- data/lib/mail/fields/common/common_address.rb +0 -136
- data/lib/mail/fields/common/common_date.rb +0 -36
- data/lib/mail/fields/common/common_field.rb +0 -61
- data/lib/mail/fields/common/common_message_id.rb +0 -49
- data/lib/mail/multibyte/exceptions.rb +0 -9
- data/lib/mail/parsers/ragel/common.rl +0 -185
- data/lib/mail/parsers/ragel/parser_info.rb +0 -61
- data/lib/mail/parsers/ragel/ruby/machines/address_lists_machine.rb +0 -14864
- data/lib/mail/parsers/ragel/ruby/machines/address_lists_machine.rb.rl +0 -37
- data/lib/mail/parsers/ragel/ruby/machines/content_disposition_machine.rb +0 -751
- data/lib/mail/parsers/ragel/ruby/machines/content_disposition_machine.rb.rl +0 -37
- data/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb +0 -614
- data/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb.rl +0 -37
- data/lib/mail/parsers/ragel/ruby/machines/content_transfer_encoding_machine.rb +0 -447
- data/lib/mail/parsers/ragel/ruby/machines/content_transfer_encoding_machine.rb.rl +0 -37
- data/lib/mail/parsers/ragel/ruby/machines/content_type_machine.rb +0 -825
- data/lib/mail/parsers/ragel/ruby/machines/content_type_machine.rb.rl +0 -37
- data/lib/mail/parsers/ragel/ruby/machines/date_time_machine.rb +0 -817
- data/lib/mail/parsers/ragel/ruby/machines/date_time_machine.rb.rl +0 -37
- data/lib/mail/parsers/ragel/ruby/machines/envelope_from_machine.rb +0 -2149
- data/lib/mail/parsers/ragel/ruby/machines/envelope_from_machine.rb.rl +0 -37
- data/lib/mail/parsers/ragel/ruby/machines/message_ids_machine.rb +0 -1570
- data/lib/mail/parsers/ragel/ruby/machines/message_ids_machine.rb.rl +0 -37
- data/lib/mail/parsers/ragel/ruby/machines/mime_version_machine.rb +0 -440
- data/lib/mail/parsers/ragel/ruby/machines/mime_version_machine.rb.rl +0 -37
- data/lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb +0 -564
- data/lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb.rl +0 -37
- data/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl +0 -51
- data/lib/mail/parsers/ragel/ruby/machines/received_machine.rb +0 -5144
- data/lib/mail/parsers/ragel/ruby/machines/received_machine.rb.rl +0 -37
- data/lib/mail/parsers/ragel/ruby/parser.rb.rl.erb +0 -37
- data/lib/mail/parsers/ragel/ruby.rb +0 -40
- data/lib/mail/parsers/ragel.rb +0 -18
- data/lib/mail/version_specific/ruby_1_8.rb +0 -126
- data/lib/mail/version_specific/ruby_1_9.rb +0 -223
data/lib/mail/mail.rb
CHANGED
|
@@ -3,45 +3,45 @@
|
|
|
3
3
|
module Mail
|
|
4
4
|
|
|
5
5
|
# Allows you to create a new Mail::Message object.
|
|
6
|
-
#
|
|
6
|
+
#
|
|
7
7
|
# You can make an email via passing a string or passing a block.
|
|
8
|
-
#
|
|
8
|
+
#
|
|
9
9
|
# For example, the following two examples will create the same email
|
|
10
10
|
# message:
|
|
11
|
-
#
|
|
11
|
+
#
|
|
12
12
|
# Creating via a string:
|
|
13
|
-
#
|
|
13
|
+
#
|
|
14
14
|
# string = "To: mikel@test.lindsaar.net\r\n"
|
|
15
15
|
# string << "From: bob@test.lindsaar.net\r\n"
|
|
16
16
|
# string << "Subject: This is an email\r\n"
|
|
17
17
|
# string << "\r\n"
|
|
18
18
|
# string << "This is the body"
|
|
19
19
|
# Mail.new(string)
|
|
20
|
-
#
|
|
20
|
+
#
|
|
21
21
|
# Or creating via a block:
|
|
22
|
-
#
|
|
22
|
+
#
|
|
23
23
|
# message = Mail.new do
|
|
24
24
|
# to 'mikel@test.lindsaar.net'
|
|
25
25
|
# from 'bob@test.lindsaar.net'
|
|
26
26
|
# subject 'This is an email'
|
|
27
27
|
# body 'This is the body'
|
|
28
28
|
# end
|
|
29
|
-
#
|
|
29
|
+
#
|
|
30
30
|
# Or creating via a hash (or hash like object):
|
|
31
|
-
#
|
|
31
|
+
#
|
|
32
32
|
# message = Mail.new({:to => 'mikel@test.lindsaar.net',
|
|
33
33
|
# 'from' => 'bob@test.lindsaar.net',
|
|
34
34
|
# :subject => 'This is an email',
|
|
35
35
|
# :body => 'This is the body' })
|
|
36
|
-
#
|
|
36
|
+
#
|
|
37
37
|
# Note, the hash keys can be strings or symbols, the passed in object
|
|
38
38
|
# does not need to be a hash, it just needs to respond to :each_pair
|
|
39
39
|
# and yield each key value pair.
|
|
40
|
-
#
|
|
40
|
+
#
|
|
41
41
|
# As a side note, you can also create a new email through creating
|
|
42
42
|
# a Mail::Message object directly and then passing in values via string,
|
|
43
43
|
# symbol or direct method calls. See Mail::Message for more information.
|
|
44
|
-
#
|
|
44
|
+
#
|
|
45
45
|
# mail = Mail.new
|
|
46
46
|
# mail.to = 'mikel@test.lindsaar.net'
|
|
47
47
|
# mail[:from] = 'bob@test.lindsaar.net'
|
|
@@ -54,20 +54,20 @@ module Mail
|
|
|
54
54
|
# Sets the default delivery method and retriever method for all new Mail objects.
|
|
55
55
|
# The delivery_method and retriever_method default to :smtp and :pop3, with defaults
|
|
56
56
|
# set.
|
|
57
|
-
#
|
|
57
|
+
#
|
|
58
58
|
# So sending a new email, if you have an SMTP server running on localhost is
|
|
59
59
|
# as easy as:
|
|
60
|
-
#
|
|
60
|
+
#
|
|
61
61
|
# Mail.deliver do
|
|
62
62
|
# to 'mikel@test.lindsaar.net'
|
|
63
63
|
# from 'bob@test.lindsaar.net'
|
|
64
64
|
# subject 'hi there!'
|
|
65
65
|
# body 'this is a body'
|
|
66
66
|
# end
|
|
67
|
-
#
|
|
67
|
+
#
|
|
68
68
|
# If you do not specify anything, you will get the following equivalent code set in
|
|
69
69
|
# every new mail object:
|
|
70
|
-
#
|
|
70
|
+
#
|
|
71
71
|
# Mail.defaults do
|
|
72
72
|
# delivery_method :smtp, { :address => "localhost",
|
|
73
73
|
# :port => 25,
|
|
@@ -76,33 +76,25 @@ module Mail
|
|
|
76
76
|
# :password => nil,
|
|
77
77
|
# :authentication => nil,
|
|
78
78
|
# :enable_starttls_auto => true }
|
|
79
|
-
#
|
|
79
|
+
#
|
|
80
80
|
# retriever_method :pop3, { :address => "localhost",
|
|
81
81
|
# :port => 995,
|
|
82
82
|
# :user_name => nil,
|
|
83
83
|
# :password => nil,
|
|
84
84
|
# :enable_ssl => true }
|
|
85
85
|
# end
|
|
86
|
-
#
|
|
86
|
+
#
|
|
87
87
|
# Mail.delivery_method.new #=> Mail::SMTP instance
|
|
88
88
|
# Mail.retriever_method.new #=> Mail::POP3 instance
|
|
89
89
|
#
|
|
90
90
|
# Each mail object inherits the default set in Mail.delivery_method, however, on
|
|
91
91
|
# a per email basis, you can override the method:
|
|
92
92
|
#
|
|
93
|
-
# mail.delivery_method :
|
|
94
|
-
#
|
|
93
|
+
# mail.delivery_method :smtp
|
|
94
|
+
#
|
|
95
95
|
# Or you can override the method and pass in settings:
|
|
96
|
-
#
|
|
97
|
-
# mail.delivery_method :
|
|
98
|
-
#
|
|
99
|
-
# You can also just modify the settings:
|
|
100
|
-
#
|
|
101
|
-
# mail.delivery_settings = { :address => 'some.host' }
|
|
102
|
-
#
|
|
103
|
-
# The passed in hash is just merged against the defaults with +merge!+ and the result
|
|
104
|
-
# assigned the mail object. So the above example will change only the :address value
|
|
105
|
-
# of the global smtp_settings to be 'some.host', keeping all other values
|
|
96
|
+
#
|
|
97
|
+
# mail.delivery_method :smtp, :address => 'some.host'
|
|
106
98
|
def self.defaults(&block)
|
|
107
99
|
Configuration.instance.instance_eval(&block)
|
|
108
100
|
end
|
|
@@ -120,21 +112,21 @@ module Mail
|
|
|
120
112
|
# Send an email using the default configuration. You do need to set a default
|
|
121
113
|
# configuration first before you use self.deliver, if you don't, an appropriate
|
|
122
114
|
# error will be raised telling you to.
|
|
123
|
-
#
|
|
115
|
+
#
|
|
124
116
|
# If you do not specify a delivery type, SMTP will be used.
|
|
125
|
-
#
|
|
117
|
+
#
|
|
126
118
|
# Mail.deliver do
|
|
127
119
|
# to 'mikel@test.lindsaar.net'
|
|
128
120
|
# from 'ada@test.lindsaar.net'
|
|
129
121
|
# subject 'This is a test email'
|
|
130
122
|
# body 'Not much to say here'
|
|
131
123
|
# end
|
|
132
|
-
#
|
|
124
|
+
#
|
|
133
125
|
# You can also do:
|
|
134
|
-
#
|
|
126
|
+
#
|
|
135
127
|
# mail = Mail.read('email.eml')
|
|
136
128
|
# mail.deliver!
|
|
137
|
-
#
|
|
129
|
+
#
|
|
138
130
|
# And your email object will be created and sent.
|
|
139
131
|
def self.deliver(*args, &block)
|
|
140
132
|
mail = self.new(args, &block)
|
|
@@ -160,7 +152,7 @@ module Mail
|
|
|
160
152
|
retriever_method.first(*args, &block)
|
|
161
153
|
end
|
|
162
154
|
|
|
163
|
-
# Receive the
|
|
155
|
+
# Receive the last email(s) from the default retriever
|
|
164
156
|
# See Mail::Retriever for a complete documentation.
|
|
165
157
|
def self.last(*args, &block)
|
|
166
158
|
retriever_method.last(*args, &block)
|
|
@@ -198,7 +190,7 @@ module Mail
|
|
|
198
190
|
|
|
199
191
|
# You can register an object to be informed of every email that is sent through
|
|
200
192
|
# this method.
|
|
201
|
-
#
|
|
193
|
+
#
|
|
202
194
|
# Your object needs to respond to a single method #delivered_email(mail)
|
|
203
195
|
# which receives the email that is sent.
|
|
204
196
|
def self.register_observer(observer)
|
|
@@ -216,7 +208,7 @@ module Mail
|
|
|
216
208
|
# You can register an object to be given every mail object that will be sent,
|
|
217
209
|
# before it is sent. So if you want to add special headers or modify any
|
|
218
210
|
# email that gets sent through the Mail library, you can do so.
|
|
219
|
-
#
|
|
211
|
+
#
|
|
220
212
|
# Your object needs to respond to a single method #delivering_email(mail)
|
|
221
213
|
# which receives the email that is about to be sent. Make your modifications
|
|
222
214
|
# directly to this object.
|
|
@@ -244,6 +236,11 @@ module Mail
|
|
|
244
236
|
end
|
|
245
237
|
end
|
|
246
238
|
|
|
239
|
+
# Returns a list of registered delivery interceptors.
|
|
240
|
+
def self.delivery_interceptors
|
|
241
|
+
@@delivery_interceptors
|
|
242
|
+
end
|
|
243
|
+
|
|
247
244
|
protected
|
|
248
245
|
|
|
249
246
|
RANDOM_TAG='%x%x_%x%x%d%x'
|
|
@@ -9,6 +9,10 @@ module Mail
|
|
|
9
9
|
AttachmentFilenameMatcher.new(filename)
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
+
def an_attachment_with_mime_type(filename)
|
|
13
|
+
AttachmentMimeTypeMatcher.new(filename)
|
|
14
|
+
end
|
|
15
|
+
|
|
12
16
|
class AnyAttachmentMatcher
|
|
13
17
|
def ===(other)
|
|
14
18
|
other.attachment?
|
|
@@ -25,5 +29,16 @@ module Mail
|
|
|
25
29
|
other.attachment? && other.filename == filename
|
|
26
30
|
end
|
|
27
31
|
end
|
|
32
|
+
|
|
33
|
+
class AttachmentMimeTypeMatcher
|
|
34
|
+
attr_reader :mime_type
|
|
35
|
+
def initialize(mime_type)
|
|
36
|
+
@mime_type = mime_type
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def ===(other)
|
|
40
|
+
other.attachment? && other.mime_type == mime_type
|
|
41
|
+
end
|
|
42
|
+
end
|
|
28
43
|
end
|
|
29
44
|
end
|
|
@@ -83,6 +83,16 @@ module Mail
|
|
|
83
83
|
self
|
|
84
84
|
end
|
|
85
85
|
|
|
86
|
+
def with_html(body)
|
|
87
|
+
@html_part_body = body
|
|
88
|
+
self
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def with_text(body)
|
|
92
|
+
@text_part_body = body
|
|
93
|
+
self
|
|
94
|
+
end
|
|
95
|
+
|
|
86
96
|
def description
|
|
87
97
|
result = "send a matching email"
|
|
88
98
|
result
|
|
@@ -108,7 +118,7 @@ module Mail
|
|
|
108
118
|
candidate_deliveries = deliveries
|
|
109
119
|
modifiers =
|
|
110
120
|
%w(sender recipients copy_recipients blind_copy_recipients subject
|
|
111
|
-
subject_matcher body body_matcher having_attachments attachments)
|
|
121
|
+
subject_matcher body body_matcher html_part_body text_part_body having_attachments attachments)
|
|
112
122
|
modifiers.each do |modifier_name|
|
|
113
123
|
next unless instance_variable_defined?("@#{modifier_name}")
|
|
114
124
|
candidate_deliveries = candidate_deliveries.select{|matching_delivery| self.send("matches_on_#{modifier_name}?", matching_delivery)}
|
|
@@ -160,6 +170,14 @@ module Mail
|
|
|
160
170
|
@body_matcher.match delivery.body.raw_source
|
|
161
171
|
end
|
|
162
172
|
|
|
173
|
+
def matches_on_html_part_body?(delivery)
|
|
174
|
+
delivery.html_part.body == @html_part_body
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
def matches_on_text_part_body?(delivery)
|
|
178
|
+
delivery.text_part.body == @text_part_body
|
|
179
|
+
end
|
|
180
|
+
|
|
163
181
|
def explain_expectations
|
|
164
182
|
result = ''
|
|
165
183
|
result += "from #{@sender} " if instance_variable_defined?('@sender')
|
|
@@ -170,6 +188,8 @@ module Mail
|
|
|
170
188
|
result += "with subject matching \"#{@subject_matcher}\" " if instance_variable_defined?('@subject_matcher')
|
|
171
189
|
result += "with body \"#{@body}\" " if instance_variable_defined?('@body')
|
|
172
190
|
result += "with body matching \"#{@body_matcher}\" " if instance_variable_defined?('@body_matcher')
|
|
191
|
+
result += "with a text part matching \"#{@text_part_body}\" " if instance_variable_defined?('@text_part_body')
|
|
192
|
+
result += "with an HTML part matching \"#{@html_part_body}\" " if instance_variable_defined?('@html_part_body')
|
|
173
193
|
result
|
|
174
194
|
end
|
|
175
195
|
|