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 +4 -4
- data/README.md +11 -5
- data/lib/recoil/interceptor.rb +4 -1
- data/lib/recoil/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2432586d1aacd6b0549c04ee00e8a18d0704e6c
|
4
|
+
data.tar.gz: 4fef427735ad851594f90679807eaf58da639bca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
10
|
-
2.
|
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
|
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
|
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 )
|
data/lib/recoil/interceptor.rb
CHANGED
@@ -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
|
data/lib/recoil/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|