spf 0.0.23 → 0.0.24

Sign up to get free protection for your applications and to get access to all the features.
data/lib/spf/error.rb CHANGED
@@ -16,7 +16,13 @@ module SPF
16
16
  class DNSTimeoutError < DNSError; end # DNS timeout
17
17
  class RecordSelectionError < Error; end # Record selection error
18
18
  class NoAcceptableRecordError < RecordSelectionError; end # No acceptable record found
19
- class RedundantAcceptableRecordsError < RecordSelectionError; end # Redundant acceptable records found
19
+ class RedundantAcceptableRecordsError < RecordSelectionError # Redundant acceptable records found
20
+ attr_accessor :records
21
+ def initialize(message, records=[])
22
+ @records = records
23
+ super(message)
24
+ end
25
+ end
20
26
  class NoUnparsedTextError < Error; end # No unparsed text available
21
27
  class UnexpectedTermObjectError < Error; end # Unexpected term object encountered
22
28
  class ProcessingLimitExceededError < Error; end # Processing limit exceeded
data/lib/spf/eval.rb CHANGED
@@ -229,7 +229,8 @@ class SPF::Server
229
229
  if records.length != 1
230
230
  # RFC 4408, 4.5/6
231
231
  raise SPF::RedundantAcceptableRecordsError.new(
232
- "Redundant applicable '#{preferred_record_class.version_tag}' sender policies found"
232
+ "Redundant applicable '#{preferred_record_class.version_tag}' sender policies found",
233
+ records
233
234
  )
234
235
  end
235
236
 
@@ -263,7 +264,6 @@ class SPF::Server
263
264
  # Record covers requested scope.
264
265
  records << record
265
266
  end
266
- break
267
267
  end
268
268
  end
269
269
  return records
data/lib/spf/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module SPF
2
- VERSION = '0.0.23'
2
+ VERSION = '0.0.24'
3
3
  end
4
4
 
5
5
  # vim:sw=2 sts=2
data/spf.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "spf"
8
- s.version = "0.0.23"
8
+ s.version = "0.0.24"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andrew Flury", "Julian Mehnle"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.23
4
+ version: 0.0.24
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: