recoil 0.1.1 → 0.1.2

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
  SHA1:
3
- metadata.gz: 3269c4c5c6231717a8a492750c188db9e1350bff
4
- data.tar.gz: a9d986089b643cb8919e37f8bd1c1b4ba9ea2701
3
+ metadata.gz: a2432586d1aacd6b0549c04ee00e8a18d0704e6c
4
+ data.tar.gz: 4fef427735ad851594f90679807eaf58da639bca
5
5
  SHA512:
6
- metadata.gz: 82262082b4d30016229756467c6677ee1c9ec871afab8ebb7160f033e1d1b624d757e30e9b2bca1acb1c801ca54ca9cb83a310abfb983ac043fdd0a7b924f25d
7
- data.tar.gz: a160355df3843dc90698bb8aadea7ea41bad0f713e0e1614e07705b9d3cc0b233a9c25bc4d8d2c7a6ca96a4c52f8c90126a29febd48ac6f7f938867da503d12c
6
+ metadata.gz: 44051bf74cc7a5ffbc451b306c67016eea6c86793f948547ab6c4df40c8b800d3da9788bb4e89548f65ee16c1600efd0950e609268997dc43528107c253d7835
7
+ data.tar.gz: d476bb0816f7235efcba9853e5eb79cc0c9fa598de28b0b2ba77ab06d484c6d05b6e385c25509af0f380ec6cbfb26efaf392c63e57c080eff9b712e24bbb5e6c
data/README.md CHANGED
@@ -6,8 +6,8 @@
6
6
 
7
7
  Recoil makes sure you're Amazon SES reputation is preserved by blacklisting emails with a bad reputation. Recoil does this with two simple tools:
8
8
 
9
- 1. A HTTP-endpoint to receive bounce notifications and saves them in the database.
10
- 2. A ActionMailer interceptor which is able to filter emails with high-bounce rates.
9
+ 1. An HTTP endpoint to receive bounce notifications and save them to the database.
10
+ 2. An ActionMailer interceptor which is able to filter emails with high bounce rates.
11
11
 
12
12
  ## Getting started
13
13
 
@@ -25,20 +25,27 @@ rake db:migrate
25
25
  ```
26
26
 
27
27
  Add the endpoint to your `routes.rb`:
28
+
28
29
  ```ruby
29
30
  mount Recoil::Engine => '/ses'
30
31
  ```
31
32
 
32
33
  Add an initializer: `config/initializers/recoil.rb` to initialize the interceptor:
34
+
33
35
  ```ruby
34
36
  ActionMailer::Base.register_interceptor(Recoil::Interceptor)
35
37
  ```
36
38
 
37
- You're now ready to subscribe to SNS-notifications. Go to the SES-dashboard > Topics > Create new topic, give it a name and save it. Create a new http/https subscription for this topic with the Recoil-URL as endpoint. Make sure Recoil is mounted to this URL because SNS wil send a verification request as soon as you add the subscription. Lastly, when the subscription is added and verified, you're able to let SES send notifications to the SNS topic. This is configurable in the SES-dashboard.
39
+ You're now ready to subscribe to SNS-notifications:
40
+
41
+ * Go to the SES dashboard and navigate to Topics > Create new topic.
42
+ * Enter a name and save.
43
+ * Create a new http/https subscription for this topic with the Recoil URL as endpoint. Make sure Recoil is mounted to this URL, as SNS will send a verification request as soon as you add the subscription.
44
+ * After the subscription is added and verified, you're able to let SES send notifications to the SNS topic. This is configurable in the SES dashboard.
38
45
 
39
46
  ## Configuration
40
47
 
41
- There is just a single configuration option for recoil: `blacklist_threshold`. This is a lamdba with an ActiveRecord-scope as argument. The default configuration is do blacklist all email with 10+ bounces in the last two weeks. This is a very loose policy, but it's easy to change:
48
+ There is just a single configuration option for recoil: `blacklist_threshold`. This is a lambda with an ActiveRecord scope as argument. The default configuration is to blacklist all email with 10+ bounces in the last two weeks. This is a very loose policy, but it's easy to change:
42
49
 
43
50
  ```ruby
44
51
  # config/initializers/recoil.rb
@@ -51,7 +58,6 @@ You can view the Recoil documentation in RDoc format here:
51
58
 
52
59
  http://rubydoc.info/github/brightin/recoil
53
60
 
54
-
55
61
  ## Contributing
56
62
 
57
63
  1. Fork it ( https://github.com/brightin/recoil/fork )
@@ -1,8 +1,11 @@
1
1
  module Recoil
2
2
  class Interceptor
3
3
  def self.delivering_email(message)
4
- # cannot use reject! because .to is not a plain ruby-array.
5
4
  message.to = message.to.reject { |email| Email.new(email).blacklisted? }
5
+
6
+ if message.to.empty?
7
+ message.perform_deliveries = false
8
+ end
6
9
  end
7
10
  end
8
11
  end
@@ -1,3 +1,3 @@
1
1
  module Recoil
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recoil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brightin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-16 00:00:00.000000000 Z
11
+ date: 2015-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails