safety_mailer 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +7 -0
- data/lib/safety_mailer/safety_mailer.rb +9 -9
- data/lib/safety_mailer/version.rb +1 -1
- metadata +12 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69e8be8ab3ca951f1e657fc3c35a76e361df35b2
|
4
|
+
data.tar.gz: 58def558830485c7a746b692aa38be37ab9cd67a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ced894bcfbcbd623ee3259675c239e8b2b791afa55a0a34cb2fa512e00cc8ab007d5f0b08716eee6bd6ba5fb6ea066af61bb4adee514856d23af3a549e22609
|
7
|
+
data.tar.gz: 1d8764ed50b0a072348a8e1bbcdb45d13a0f1f859ebad87df03b27c626721eb3b3fd581ef1658bc9f29c2132d6c398ad67eeb29d7f2b15884508df161abe5a81
|
data/README.rdoc
CHANGED
@@ -46,6 +46,13 @@ Any user of the Mail gem can configure safety_mailer:
|
|
46
46
|
}
|
47
47
|
end
|
48
48
|
|
49
|
+
== Non-Mail
|
50
|
+
|
51
|
+
If you're not using the Mail gem (or use it sometimes but want to use the same logic / configuration in other contexts),
|
52
|
+
you can filter directly:
|
53
|
+
|
54
|
+
filtered_array = SafetyMailer::Carrier.new(ActionMailer::Base.safety_mailer_settings).filter(unfiltered_email_addresses)
|
55
|
+
|
49
56
|
== License
|
50
57
|
|
51
58
|
safety_mailer is released under the MIT license:
|
@@ -29,6 +29,15 @@ module SafetyMailer
|
|
29
29
|
matchers.any? { |m| recipient =~ m }
|
30
30
|
end
|
31
31
|
|
32
|
+
def filter(addresses)
|
33
|
+
allowed, rejected = addresses.partition { |r| whitelisted?(r) }
|
34
|
+
|
35
|
+
rejected.each { |addr| log "*** safety_mailer delivery suppressed for #{addr}" }
|
36
|
+
allowed.each { |addr| log "*** safety_mailer delivery allowed for #{addr}" }
|
37
|
+
|
38
|
+
allowed
|
39
|
+
end
|
40
|
+
|
32
41
|
private
|
33
42
|
|
34
43
|
def recipients
|
@@ -45,15 +54,6 @@ module SafetyMailer
|
|
45
54
|
log "*** safety_mailer was unable to parse the X-SMTPAPI header"
|
46
55
|
end
|
47
56
|
|
48
|
-
def filter(addresses)
|
49
|
-
allowed, rejected = addresses.partition { |r| whitelisted?(r) }
|
50
|
-
|
51
|
-
rejected.each { |addr| log "*** safety_mailer delivery suppressed for #{addr}" }
|
52
|
-
allowed.each { |addr| log "*** safety_mailer delivery allowed for #{addr}" }
|
53
|
-
|
54
|
-
allowed
|
55
|
-
end
|
56
|
-
|
57
57
|
# Handles clean-up for additional SendGrid features that may be required
|
58
58
|
# by changes to the recipient list. Expects the passed-in Array of
|
59
59
|
# addresses to have been whitelist-filtered already.
|
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: safety_mailer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bill Kirtley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mail
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: actionmailer
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description: Specify a domain (or set of domains, or magic word in email address)
|
@@ -82,7 +82,8 @@ files:
|
|
82
82
|
- lib/safety_mailer/safety_mailer.rb
|
83
83
|
- lib/safety_mailer/version.rb
|
84
84
|
homepage: http://github.com/cluesque/safety_mailer
|
85
|
-
licenses:
|
85
|
+
licenses:
|
86
|
+
- MIT
|
86
87
|
metadata: {}
|
87
88
|
post_install_message:
|
88
89
|
rdoc_options: []
|