mail 2.8.0.rc2 → 2.8.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2e6dac6546c3b4aabe60abc09fbb055bb2318d2ad65733d8d5fe317146c51de
4
- data.tar.gz: 83055f59c22ea5ec023f855d74c22d68031df05b4dc453c9da2e937e255c7bec
3
+ metadata.gz: ac99b70fae085914a2fbc153a38f199ddda35671f0e488b6ae6b578c16ef868e
4
+ data.tar.gz: 031535fbd036e814e7619a7f4a0e353cfdd64460ed8904525da349d691f92bfe
5
5
  SHA512:
6
- metadata.gz: a7fbca6e0c4d75d5fb7292312e70046a65a2d18a5790bab76c5d9dced2550d6379d5b5de4afc1cf5fbe0b16687b339fe895f935696480427362efb05d7055ba8
7
- data.tar.gz: 18d2df0deabee8d6797194b96cdf0116057b5ea1d76d2ec64f748c2cc2c38dfe4ff8292995fce390412e16865ccd6cdd7a24c5a1a6b60401b1a695884b480b96
6
+ metadata.gz: 4beae958c4b21822b7739401118b515d4b02d9dbdb5b37135a60da5aa647eb8b905937a0c45e093c6deca134355e53340208cd321816bde3cdec12cb6197b96b
7
+ data.tar.gz: 5155f9bb2fa57c864b4c42faaf0c2981724c7db2664eebe41c6c09139c8f23f02a3409bcea202676dd783fb660659f6a7ff839d320a9ffa3fe4c19b289f77aeb
data/lib/mail/message.rb CHANGED
@@ -1496,7 +1496,7 @@ module Mail
1496
1496
  # Returns the character set defined in the content type field
1497
1497
  def charset
1498
1498
  if @header
1499
- has_content_type? ? content_type_parameters['charset'] : @charset
1499
+ has_content_type? && !multipart? ? content_type_parameters['charset'] : @charset
1500
1500
  else
1501
1501
  @charset
1502
1502
  end
@@ -111,17 +111,33 @@ module Mail
111
111
 
112
112
  def build_smtp_session
113
113
  Net::SMTP.new(settings[:address], settings[:port]).tap do |smtp|
114
- if settings[:tls] || settings[:ssl]
115
- if smtp.respond_to?(:enable_tls)
114
+ tls = settings[:tls] || settings[:ssl]
115
+ if !tls.nil?
116
+ case tls
117
+ when true
116
118
  smtp.enable_tls(ssl_context)
119
+ when false
120
+ smtp.disable_tls
121
+ else
122
+ raise ArgumentError, "Unrecognized :tls value #{settings[:tls].inspect}; expected true, false, or nil"
117
123
  end
118
- elsif settings[:enable_starttls]
119
- if smtp.respond_to?(:enable_starttls)
124
+ elsif settings.include?(:enable_starttls) && !settings[:enable_starttls].nil?
125
+ case settings[:enable_starttls]
126
+ when true
120
127
  smtp.enable_starttls(ssl_context)
128
+ when false
129
+ smtp.disable_starttls
130
+ else
131
+ raise ArgumentError, "Unrecognized :enable_starttls value #{settings[:enable_starttls].inspect}; expected true, false, or nil"
121
132
  end
122
- elsif settings[:enable_starttls_auto]
123
- if smtp.respond_to?(:enable_starttls_auto)
133
+ elsif settings.include?(:enable_starttls_auto) && !settings[:enable_starttls_auto].nil?
134
+ case settings[:enable_starttls_auto]
135
+ when true
124
136
  smtp.enable_starttls_auto(ssl_context)
137
+ when false
138
+ smtp.disable_starttls_auto
139
+ else
140
+ raise ArgumentError, "Unrecognized :enable_starttls_auto value #{settings[:enable_starttls_auto].inspect}; expected true, false, or nil"
125
141
  end
126
142
  end
127
143
 
data/lib/mail/version.rb CHANGED
@@ -5,7 +5,7 @@ module Mail
5
5
  MAJOR = 2
6
6
  MINOR = 8
7
7
  PATCH = 0
8
- BUILD = 'rc2'
8
+ BUILD = 'rc3'
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
11
11
 
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.8.0.rc2
4
+ version: 2.8.0.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikel Lindsaar