whitelist_mail_proxy 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/Rakefile +1 -1
  2. data/lib/whitelist_mail_proxy.rb +9 -1
  3. metadata +3 -3
data/Rakefile CHANGED
@@ -45,7 +45,7 @@ spec = Gem::Specification.new do |s|
45
45
 
46
46
  # Change these as appropriate
47
47
  s.name = "whitelist_mail_proxy"
48
- s.version = "0.4.0"
48
+ s.version = "0.4.1"
49
49
  s.summary = "A thin proxy for Mail and ActionMailer to enable whitelisting"
50
50
  s.author = "Matthew Rudy Jacobs"
51
51
  s.email = "MatthewRudyJacobs@gmail.com"
@@ -19,7 +19,7 @@ class WhitelistMailProxy
19
19
  end
20
20
 
21
21
  if blocked.any?
22
- raise BlockedDelivery.new("cannot send to #{blocked.inspect}, whitelist is #{regexp.inspect}")
22
+ raise BlockedDelivery.new("cannot send to #{blocked.inspect}, whitelist is #{whitelist_description}")
23
23
  else
24
24
  real_delivery_method.deliver!(mail)
25
25
  end
@@ -40,6 +40,14 @@ class WhitelistMailProxy
40
40
  block_by_regexp?(string) || block_by_domain?(string)
41
41
  end
42
42
 
43
+ def whitelist_description
44
+ bits = []
45
+ bits << "addresses LIKE #{regexp.inspect}" if self.regexp
46
+ bits << "domains IN #{domains.inspect}" if self.domains
47
+
48
+ bits.join(" OR ")
49
+ end
50
+
43
51
  protected
44
52
 
45
53
  def block_by_regexp?(string)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whitelist_mail_proxy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 0
10
- version: 0.4.0
9
+ - 1
10
+ version: 0.4.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matthew Rudy Jacobs