aws-ses-v4 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 32b3c4409c457f05bb089024ae06cba6697176d52cb10b55be68631245ea989e
4
+ data.tar.gz: 3bf7a2e690a780640805b14bf391de196c66c4e50e39acbf80a507e9a1b29275
5
+ SHA512:
6
+ metadata.gz: 4c32564f69563b9676641573b77407b0e8c35ef2c41aa4ca8363466772e3245b8d49496d073097147ed6ba8a8a88af17bd4fdee344323e429e7281f533cb5fc4
7
+ data.tar.gz: 0cf455670a5c6563495265e15ecf8daf0b101d7b8d8a8c8c2467b4731298c4362ca49e284a6ac4b82741bdc122b1c3782fa55eeacb73ac316d0ce5714df1aa8e
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/CHANGELOG ADDED
@@ -0,0 +1,59 @@
1
+ 0.7.1:
2
+ * Bugfix in sig version v4 detection
3
+
4
+ 0.7.0:
5
+ * Implement Authorization Header v4 (add config: `signature_version: 4`)
6
+ * Wrap message ID in `<>` correctly
7
+
8
+ 0.6.0:
9
+ * Various small bug fixes
10
+
11
+ 0.5.0:
12
+ * Check for existence of html or text body when attachments are included
13
+ * Message ids in mail objects should now reflect what is actually sent.
14
+
15
+ 0.4.4:
16
+ * Fixed error in initialized settings if you don't set them manually
17
+
18
+ 0.4.3:
19
+ * No more error from Rails 3.1 about incompatible gem versions
20
+ * Better error message
21
+ * No duplicate dependencies
22
+
23
+ 0.4.2:
24
+ * Added support for ReplyToAddresses, Destinations, and Source (pzb)
25
+ * Added custom User-Agent header (pzb)
26
+ * Widespread doc updates
27
+
28
+ 0.4.1:
29
+ * Removed many unneeded monkeypatch extensions
30
+ * Tests ( and gem ) run in 1.9.2
31
+
32
+ 0.4.0:
33
+ * This version may have some small incompatibilities due to adding support for MessageId. Check that the result still matches what you previously expected.
34
+ * Added MessageId support in responses
35
+ * Improved resulting data from many responses
36
+ * Added tests and documentation for quota and statistics
37
+ * Added Rails 2.3.x support ( I HOPE!!! )
38
+
39
+ 0.3.2:
40
+ * Removed unused extensions that were conflicting with S3
41
+
42
+ 0.3.1:
43
+ * Downgraded mail gem version required to enhance Rails 3.0.0 compatibility
44
+
45
+ 0.3.0:
46
+ * Added send_raw_email support
47
+ * Added support for Rails3
48
+ * Vastly improved error handling and got rid of a bunch of stuff that wasn't used
49
+
50
+ 0.2.0:
51
+ * Added info support
52
+ * Added send_email
53
+
54
+ 0.1.0:
55
+ - Initial creation that supports:
56
+
57
+ * addresses.list
58
+ * addresses.verify(email)
59
+ * addresses.delete(email)
data/Gemfile ADDED
@@ -0,0 +1,21 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
5
+
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+ gem "bundler", ">= 1.17"
10
+ gem 'flexmock', '~> 0.8.11'
11
+ gem "jeweler"
12
+ gem "rake"
13
+ gem "shoulda-context", ">= 0"
14
+ gem 'test-unit'
15
+ gem 'timecop'
16
+ end
17
+
18
+ gem 'builder'
19
+ gem 'mail', '> 2.2.5'
20
+ gem 'mime-types'
21
+ gem 'xml-simple'
data/Gemfile.lock ADDED
@@ -0,0 +1,80 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ addressable (2.4.0)
5
+ builder (3.2.2)
6
+ descendants_tracker (0.0.4)
7
+ thread_safe (~> 0.3, >= 0.3.1)
8
+ faraday (0.9.2)
9
+ multipart-post (>= 1.2, < 3)
10
+ flexmock (0.8.11)
11
+ git (1.7.0)
12
+ rchardet (~> 1.8)
13
+ github_api (0.16.0)
14
+ addressable (~> 2.4.0)
15
+ descendants_tracker (~> 0.0.4)
16
+ faraday (~> 0.8, < 0.10)
17
+ hashie (>= 3.4)
18
+ mime-types (>= 1.16, < 3.0)
19
+ oauth2 (~> 1.0)
20
+ hashie (4.1.0)
21
+ highline (2.0.3)
22
+ jeweler (2.3.9)
23
+ builder
24
+ bundler
25
+ git (>= 1.2.5)
26
+ github_api (~> 0.16.0)
27
+ highline (>= 1.6.15)
28
+ nokogiri (>= 1.5.10)
29
+ psych
30
+ rake
31
+ rdoc
32
+ semver2
33
+ jwt (2.2.2)
34
+ mail (2.6.1)
35
+ mime-types (>= 1.16, < 3)
36
+ mime-types (2.4.1)
37
+ mini_portile2 (2.4.0)
38
+ multi_json (1.15.0)
39
+ multi_xml (0.6.0)
40
+ multipart-post (2.1.1)
41
+ nokogiri (1.10.10)
42
+ mini_portile2 (~> 2.4.0)
43
+ oauth2 (1.4.4)
44
+ faraday (>= 0.8, < 2.0)
45
+ jwt (>= 1.0, < 3.0)
46
+ multi_json (~> 1.3)
47
+ multi_xml (~> 0.5)
48
+ rack (>= 1.2, < 3)
49
+ power_assert (1.2.0)
50
+ psych (3.1.0)
51
+ rack (2.2.3)
52
+ rake (13.0.1)
53
+ rchardet (1.8.0)
54
+ rdoc (6.2.0)
55
+ semver2 (3.4.2)
56
+ shoulda-context (1.2.1)
57
+ test-unit (3.3.6)
58
+ power_assert
59
+ thread_safe (0.3.6)
60
+ timecop (0.9.1)
61
+ xml-simple (1.1.4)
62
+
63
+ PLATFORMS
64
+ ruby
65
+
66
+ DEPENDENCIES
67
+ builder
68
+ bundler (>= 1.17)
69
+ flexmock (~> 0.8.11)
70
+ jeweler
71
+ mail (> 2.2.5)
72
+ mime-types
73
+ rake
74
+ shoulda-context
75
+ test-unit
76
+ timecop
77
+ xml-simple
78
+
79
+ BUNDLED WITH
80
+ 1.17.3
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+
2
+ Copyright (c) 2011 Drew V. Blas <drew.blas@gmail.com>
3
+ Copyright (c) 2006-2009 Marcel Molina Jr. <marcel@vernix.org>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in the
7
+ Software without restriction, including without limitation the rights to use,
8
+ copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
9
+ Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19
+ AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.erb ADDED
@@ -0,0 +1,97 @@
1
+ = AWS::SES
2
+
3
+ {<img src="https://badge.fury.io/rb/aws-ses.svg" alt="http://rubygems.org">}[http://badge.fury.io/rb/aws-ses]
4
+
5
+ <%= docs_for['AWS::SES'] %>
6
+
7
+ == Send E-mail
8
+
9
+ <%= docs_for ['AWS::SES::SendEmail'] %>
10
+
11
+ == Addresses
12
+
13
+ <%= docs_for['AWS::SES::Addresses'] %>
14
+
15
+ == Info
16
+
17
+ <%= docs_for['AWS::SES::Info'] %>
18
+
19
+ == Rails
20
+
21
+ This gem is compatible with Rails >= 3.0.0 and Ruby 2.3.x
22
+
23
+ To use, first add the gem to your Gemfile:
24
+
25
+ gem "aws-ses-v4", "~> 0.8.1", :require => 'aws/ses'
26
+
27
+ == For Rails 3.x
28
+
29
+ Then, add your Amazon credentials and extend ActionMailer in `config/initializers/amazon_ses.rb`:
30
+
31
+ ActionMailer::Base.add_delivery_method :ses, AWS::SES::Base,
32
+ :access_key_id => 'abc',
33
+ :secret_access_key => '123',
34
+ :signature_version => 4
35
+
36
+ Then set the delivery method in `config/environments/*rb` as appropriate:
37
+
38
+ config.action_mailer.delivery_method = :ses
39
+
40
+ == For Rails 2.3.x
41
+
42
+ Then set the delivery method in `config/environments/*rb` as appropriate:
43
+
44
+ config.after_initialize do
45
+ ActionMailer::Base.delivery_method = :amazon_ses
46
+ ActionMailer::Base.custom_amazon_ses_mailer = AWS::SES::Base.new(:secret_access_key => 'abc', :access_key_id => '123')
47
+ end
48
+
49
+ == Issues
50
+
51
+ === HTTP Segmentation fault
52
+
53
+ If you get this error:
54
+ net/http.rb:677: [BUG] Segmentation fault
55
+
56
+ It means that you are not running with SSL enabled in ruby. Re-compile ruby with ssl support or add this option to your environment:
57
+ RUBYOPT="-r openssl"
58
+
59
+ === Rejected sending
60
+
61
+ If you are receiving this message and you HAVE verified the [source] please <b>check to be sure you are not in sandbox mode!</b>
62
+ "Email address is not verified.MessageRejected (AWS::Error)"
63
+ If you have not been granted production access, you will have to <b>verify all recipients</b> as well.
64
+
65
+ http://docs.amazonwebservices.com/ses/2010-12-01/DeveloperGuide/index.html?InitialSetup.Customer.html
66
+
67
+ == Source
68
+
69
+ Available at: https://github.com/drewblas/aws-ses
70
+
71
+ == Contributing to aws-ses
72
+
73
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
74
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
75
+ * Fork the project
76
+ * Start a feature/bugfix branch
77
+ * Commit and push until you are happy with your contribution
78
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
79
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
80
+
81
+ == Copyright
82
+
83
+ Copyright (c) 2020 Drew Blas. See LICENSE for further details.
84
+
85
+ == Thanks
86
+
87
+ Special thanks to Marcel Molina Jr. for his creation of AWS::S3 which I used portions of to get things working.
88
+
89
+ === Other Contributors:
90
+
91
+ * croaky
92
+ * nathanbertram
93
+ * sshaw
94
+ * teeparham (documentation)
95
+ * pzb
96
+ * NicholasHely
97
+ * m33h
data/README.rdoc ADDED
@@ -0,0 +1,220 @@
1
+ = AWS::SES
2
+
3
+ {<img src="https://badge.fury.io/rb/aws-ses-v4.svg" alt="http://rubygems.org">}[http://badge.fury.io/rb/aws-ses-v4]
4
+
5
+ AWS::SES is a Ruby library for Amazon's Simple Email Service's REST API (http://aws.amazon.com/ses).
6
+
7
+ == Getting started
8
+
9
+ To get started you need to require 'aws/ses':
10
+
11
+ % irb -rubygems
12
+ irb(main):001:0> require 'aws/ses'
13
+ # => true
14
+
15
+ Before you can do anything, you must establish a connection using Base.new. A basic connection would look something like this:
16
+
17
+ ses = AWS::SES::Base.new(
18
+ :access_key_id => 'abc',
19
+ :secret_access_key => '123'
20
+ )
21
+
22
+ The minimum connection options that you must specify are your access key id and your secret access key.
23
+
24
+ === Connecting to a server from another region
25
+
26
+ The default server API endpoint is "email.us-east-1.amazonaws.com", corresponding to the US East 1 region.
27
+
28
+ To connect to a different one, just pass it as a parameter to the AWS::SES::Base initializer:
29
+
30
+ ses = AWS::SES::Base.new(
31
+ :access_key_id => 'abc',
32
+ :secret_access_key => '123',
33
+ :server => 'email.eu-west-1.amazonaws.com',
34
+ :message_id_domain => 'eu-west-1.amazonses.com'
35
+ )
36
+
37
+ == Send E-mail
38
+
39
+ Adds functionality for send_email and send_raw_email
40
+ Use the following to send an e-mail:
41
+
42
+ ses = AWS::SES::Base.new( ... connection info ... )
43
+ ses.send_email(
44
+ :to => ['jon@example.com', 'dave@example.com'],
45
+ :source => '"Steve Smith" <steve@example.com>',
46
+ :subject => 'Subject Line',
47
+ :text_body => 'Internal text body'
48
+ )
49
+ By default, the email "from" display address is whatever is before the @.
50
+ To change the display from, use the format:
51
+
52
+ "Steve Smith" <steve@example.com>
53
+
54
+ You can also send Mail objects using send_raw_email:
55
+
56
+ m = Mail.new( :to => ..., :from => ... )
57
+ ses.send_raw_email(m)
58
+
59
+ send_raw_email will also take a hash and pass it through Mail.new automatically as well.
60
+
61
+
62
+
63
+ == Addresses
64
+
65
+ AWS::SES::Addresses provides for:
66
+ * Listing verified e-mail addresses
67
+ * Adding new e-mail addresses to verify
68
+ * Deleting verified e-mail addresses
69
+
70
+ You can access these methods as follows:
71
+
72
+ ses = AWS::SES::Base.new( ... connection info ... )
73
+
74
+ # Get a list of verified addresses
75
+ ses.addresses.list.result
76
+
77
+ # Add a new e-mail address to verify
78
+ ses.addresses.verify('jon@example.com')
79
+
80
+ # Delete an e-mail address
81
+ ses.addresses.delete('jon@example.com')
82
+
83
+
84
+ == Info
85
+
86
+ Adds functionality for the statistics and info send quota data that Amazon SES makes available
87
+
88
+ You can access these methods as follows:
89
+
90
+ ses = AWS::SES::Base.new( ... connection info ... )
91
+
92
+ == Get the quota information
93
+ response = ses.quota
94
+ # How many e-mails you've sent in the last 24 hours
95
+ response.sent_last_24_hours
96
+ # How many e-mails you're allowed to send in 24 hours
97
+ response.max_24_hour_send
98
+ # How many e-mails you can send per second
99
+ response.max_send_rate
100
+
101
+ == Get detailed send statistics
102
+ The result is a list of data points, representing the last two weeks of sending activity.
103
+ Each data point in the list contains statistics for a 15-minute interval.
104
+ GetSendStatisticsResponse#data_points is an array where each element is a hash with give string keys:
105
+
106
+ * +Bounces+
107
+ * +DeliveryAttempts+
108
+ * +Rejects+
109
+ * +Complaints+
110
+ * +Timestamp+
111
+
112
+ For example:
113
+
114
+ response = ses.statistics
115
+ response.data_points
116
+
117
+ will return:
118
+
119
+ [{"Bounces"=>"0",
120
+ "Timestamp"=>"2011-01-26T16:30:00Z",
121
+ "DeliveryAttempts"=>"1",
122
+ "Rejects"=>"0",
123
+ "Complaints"=>"0"},
124
+ {"Bounces"=>"0",
125
+ "Timestamp"=>"2011-02-09T14:45:00Z",
126
+ "DeliveryAttempts"=>"3",
127
+ "Rejects"=>"0",
128
+ "Complaints"=>"0"},
129
+ {"Bounces"=>"0",
130
+ "Timestamp"=>"2011-01-31T15:30:00Z",
131
+ "DeliveryAttempts"=>"3",
132
+ "Rejects"=>"0",
133
+ "Complaints"=>"0"},
134
+ {"Bounces"=>"0",
135
+ "Timestamp"=>"2011-01-31T16:00:00Z",
136
+ "DeliveryAttempts"=>"3",
137
+ "Rejects"=>"0",
138
+ "Complaints"=>"0"}]
139
+
140
+ == Rails
141
+
142
+ This gem is compatible with Rails >= 3.0.0 and Ruby 2.3.x
143
+
144
+ To use, first add the gem to your Gemfile:
145
+
146
+ gem "aws-ses-v4", "~> 0.8.1", :require => 'aws/ses'
147
+
148
+ == For Rails 3.x
149
+
150
+ Then, add your Amazon credentials and extend ActionMailer in `config/initializers/amazon_ses.rb`:
151
+
152
+ ActionMailer::Base.add_delivery_method :ses, AWS::SES::Base,
153
+ :access_key_id => 'abc',
154
+ :secret_access_key => '123',
155
+ :signature_version => 4
156
+
157
+ Then set the delivery method in `config/environments/*.rb` as appropriate:
158
+
159
+ config.action_mailer.delivery_method = :ses
160
+
161
+ == For Rails 2.3.x
162
+
163
+ Then set the delivery method in `config/environments/*rb` as appropriate:
164
+
165
+ config.after_initialize do
166
+ ActionMailer::Base.delivery_method = :amazon_ses
167
+ ActionMailer::Base.custom_amazon_ses_mailer = AWS::SES::Base.new(:secret_access_key => 'abc', :access_key_id => '123')
168
+ end
169
+
170
+ == Issues
171
+
172
+ === HTTP Segmentation fault
173
+
174
+ If you get this error:
175
+ net/http.rb:677: [BUG] Segmentation fault
176
+
177
+ It means that you are not running with SSL enabled in ruby. Re-compile ruby with ssl support or add this option to your environment:
178
+ RUBYOPT="-r openssl"
179
+
180
+ === Rejected sending
181
+
182
+ If you are receiving this message and you HAVE verified the [source] please <b>check to be sure you are not in sandbox mode!</b>
183
+ "Email address is not verified.MessageRejected (AWS::Error)"
184
+ If you have not been granted production access, you will have to <b>verify all recipients</b> as well.
185
+
186
+ To verify email addresses and domains:
187
+ https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-addresses-and-domains.html
188
+
189
+ To request production access:
190
+ https://docs.aws.amazon.com/ses/latest/DeveloperGuide/request-production-access.html
191
+
192
+ == Source
193
+
194
+ Available at: https://github.com/drewblas/aws-ses
195
+
196
+ == Contributing to aws-ses
197
+
198
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
199
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
200
+ * Fork the project
201
+ * Start a feature/bugfix branch
202
+ * Commit and push until you are happy with your contribution
203
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
204
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
205
+
206
+ == Copyright
207
+
208
+ Copyright (c) 2011 Drew Blas. See LICENSE for further details.
209
+
210
+ == Thanks
211
+
212
+ Special thanks to Marcel Molina Jr. for his creation of AWS::S3 which I used portions of to get things working.
213
+
214
+ === Other Contributors:
215
+
216
+ * croaky
217
+ * nathanbertram
218
+ * sshaw
219
+ * teeparham (documentation)
220
+ * pzb