mail-ses 1.0.2 → 1.0.5

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: fddb2a3546aea105c83d8821c73028dcd48916aef5975b78705eeb0de42ea4be
4
- data.tar.gz: 0a6b2112dfc47c42e79c904f15a2afd0f084d8fd30e8e98a1705199b836ed848
3
+ metadata.gz: f01ada56fdcbda459f4d85745571339e0ab9d63a8f2d7dd1f008a35318546825
4
+ data.tar.gz: fd369c9a8fcccadb8e367db16a9d35f49ecdabec33a24fd6690d8976df24b658
5
5
  SHA512:
6
- metadata.gz: f0efeb27830cdecb58aa115f9c5ff81e3ee1c9cbdda2bbf1ed7e274ed15cee139e3339e43d5d49056553fa0aa9c412f024000757b751ab6a6f9f1cc2f4c6347c
7
- data.tar.gz: 0d1d76a3b7d37cf440438013271a7f177098c120dc019a51fc8c976ff8662d73739860913e842fe665a483c8cb1c5b59f402527237d1bb29a32f2cc0bde31d4d
6
+ metadata.gz: d4e9425b4e22b396b97f172758bfeb1de71512cb5360c4e5372d24da512ca43a0adb787aea556aac8c497f83c10b6abdd457707a022e62897723a10e79ff74e8
7
+ data.tar.gz: 49818a9754ffe39a54e7de1e79f229d17d7db679c52223d84ab562cc74b6e7b28f7b257df29e668af4925b5ac7dd0e8afa8e7e4297a6c0a1bc4847537711aac0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ### 1.0.5
4
+
5
+ - Pass-thru invalid email addresses.
6
+
7
+ ### 1.0.4
8
+
9
+ - Fix missing method error related to message headers.
10
+
11
+ ### 1.0.3
12
+
13
+ - Support UTF-8 chars in from, to, etc addresses.
14
+
3
15
  ### 1.0.2
4
16
 
5
17
  - Fix labels in being stripped from email addresses.
@@ -4,6 +4,14 @@ module Mail
4
4
  class SES
5
5
  # Builds options for Aws::SESV2::Client#send_email
6
6
  class OptionsBuilder
7
+ SES_FIELDS = %i[ from_email_address
8
+ from_email_address_identity_arn
9
+ reply_to_addresses
10
+ feedback_forwarding_email_address
11
+ feedback_forwarding_email_address_identity_arn
12
+ email_tags
13
+ configuration_set_name ].freeze
14
+
7
15
  # message - The Mail::Message object to be sent.
8
16
  # options - The Hash options which override any defaults
9
17
  # from the message.
@@ -20,7 +28,8 @@ module Mail
20
28
  private
21
29
 
22
30
  def ses_options
23
- slice_hash(@options, *RAW_EMAIL_ATTRS)
31
+ # TODO: address fields should be encoded to UTF-8
32
+ slice_hash(@options, *SES_FIELDS)
24
33
  end
25
34
 
26
35
  def message_options
@@ -41,7 +50,20 @@ module Mail
41
50
  end
42
51
 
43
52
  def extract_value(key)
44
- @message.header[key]&.formatted
53
+ value = @message.header[key]
54
+ return unless value
55
+
56
+ if value.respond_to?(:formatted)
57
+ value.formatted
58
+ elsif value.respond_to?(:unparsed_value)
59
+ Array(value.unparsed_value)
60
+ else
61
+ []
62
+ end&.map { |v| encode(v) }
63
+ end
64
+
65
+ def encode(value)
66
+ Mail::Encodings.address_encode(value)
45
67
  end
46
68
  end
47
69
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Mail
4
4
  class SES
5
- VERSION = '1.0.2'
5
+ VERSION = '1.0.5'
6
6
  end
7
7
  end
data/lib/mail/ses.rb CHANGED
@@ -7,14 +7,6 @@ require 'mail/ses/options_builder'
7
7
  module Mail
8
8
  # Mail delivery method handler for AWS SES
9
9
  class SES
10
- RAW_EMAIL_ATTRS = %i[ from_email_address
11
- from_email_address_identity_arn
12
- reply_to_addresses
13
- feedback_forwarding_email_address
14
- feedback_forwarding_email_address_identity_arn
15
- email_tags
16
- configuration_set_name ].freeze
17
-
18
10
  attr_accessor :settings
19
11
  attr_reader :client
20
12
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mail-ses
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johnny Shields
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-29 00:00:00.000000000 Z
11
+ date: 2022-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-sesv2