wlvalidate 0.3.8 → 0.3.10

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 (2) hide show
  1. data/lib/wlvalidate.rb +9 -5
  2. metadata +4 -20
@@ -289,7 +289,9 @@ module WLValidate
289
289
  hashReturn = Hash.new
290
290
  boolFoundMatch = false
291
291
  strHost = "smtpapi._domainkey." + strDomain
292
- strDKIM = "k=rsa; t=s; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPtW5iwpXVPiH5FzJ7Nrl8USzuY9zqqzjE0D1r04xDN6qwziDnmgcFNNfMewVKN2D1O+2J9N14hRprzByFwfQW76yojh54Xu3uSbQ3JP0A7k8o8GutRF8zbFUA8n0ZH2y0cIEjMliXY4W4LwPA7m4q0ObmvSjhd63O9d8z1XkUBwIDAQAB"
292
+ strDKIM_k = "k=rsa"
293
+ strDKIM_t = "t=s"
294
+ strDKIM_p = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPtW5iwpXVPiH5FzJ7Nrl8USzuY9zqqzjE0D1r04xDN6qwziDnmgcFNNfMewVKN2D1O+2J9N14hRprzByFwfQW76yojh54Xu3uSbQ3JP0A7k8o8GutRF8zbFUA8n0ZH2y0cIEjMliXY4W4LwPA7m4q0ObmvSjhd63O9d8z1XkUBwIDAQAB"
293
295
 
294
296
  if ((strWL == "") || (strDomain == ""))
295
297
  hashReturn = { "type" => "DKIM1", "result" => "ERROR", "data" => "Missing parameters", "ext_data" => "One or more expected paramters are missing!" }
@@ -309,7 +311,7 @@ module WLValidate
309
311
  hashReturn = { "type" => "DKIM1", "result" => "PASS", "data" => r.name.to_s, "ext_data" => "CNAME", "rdata" => "(cname)" }
310
312
  boolFoundMatch = true
311
313
  end
312
- if ((r.name.to_s == strHost) && (r.data == strDKIM))
314
+ if ((r.name.to_s == strHost) && (r.data.split(" ")[0].match %r{#{Regexp.escape(strDKIM_k)}}) && (r.data.split(" ")[1].match %r{#{Regexp.escape(strDKIM_t)}}) && (r.data.split(" ")[2].match %r{#{Regexp.escape(strDKIM_p)}}))
313
315
  hashReturn = { "type" => "DKIM1", "result" => "PASS", "data" => r.name.to_s, "ext_data" => "TXT", "rdata" => r.data }
314
316
  boolFoundMatch = true
315
317
  end
@@ -340,7 +342,9 @@ module WLValidate
340
342
  hashReturn = Hash.new
341
343
  boolFoundMatch = false
342
344
  strHost = "smtpapi._domainkey." + strWL + "." + strDomain
343
- strDKIM = "k=rsa; t=s; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPtW5iwpXVPiH5FzJ7Nrl8USzuY9zqqzjE0D1r04xDN6qwziDnmgcFNNfMewVKN2D1O+2J9N14hRprzByFwfQW76yojh54Xu3uSbQ3JP0A7k8o8GutRF8zbFUA8n0ZH2y0cIEjMliXY4W4LwPA7m4q0ObmvSjhd63O9d8z1XkUBwIDAQAB"
345
+ strDKIM_k = "k=rsa"
346
+ strDKIM_t = "t=s"
347
+ strDKIM_p = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPtW5iwpXVPiH5FzJ7Nrl8USzuY9zqqzjE0D1r04xDN6qwziDnmgcFNNfMewVKN2D1O+2J9N14hRprzByFwfQW76yojh54Xu3uSbQ3JP0A7k8o8GutRF8zbFUA8n0ZH2y0cIEjMliXY4W4LwPA7m4q0ObmvSjhd63O9d8z1XkUBwIDAQAB"
344
348
 
345
349
  if ((strWL == "") || (strDomain == ""))
346
350
  hashReturn = { "type" => "DKIM2", "result" => "ERROR", "data" => "Missing parameters", "ext_data" => "One or more expected paramters are missing!" }
@@ -360,7 +364,7 @@ module WLValidate
360
364
  hashReturn = { "type" => "DKIM2", "result" => "PASS", "data" => r.name.to_s, "ext_data" => "CNAME", "rdata" => "(cname)" }
361
365
  boolFoundMatch = true
362
366
  end
363
- if ((r.name.to_s == strHost) && (r.data == strDKIM))
367
+ if ((r.name.to_s == strHost) && (r.data.split(" ")[0].match %r{#{Regexp.escape(strDKIM_k)}}) && (r.data.split(" ")[1].match %r{#{Regexp.escape(strDKIM_t)}}) && (r.data.split(" ")[2].match %r{#{Regexp.escape(strDKIM_p)}}))
364
368
  hashReturn = { "type" => "DKIM2", "result" => "PASS", "data" => r.name.to_s, "ext_data" => "TXT", "rdata" => r.data }
365
369
  boolFoundMatch = true
366
370
  end
@@ -419,7 +423,7 @@ module WLValidate
419
423
  elsif rTXT.match %r{\?al}
420
424
  hashReturn = { "type" => "SPF", "result" => "PASS", "data" => rTXT, "ext_data" => "neutral" }
421
425
  else
422
- hashReturn = { "type" => "SPF", "result" => "PASS", "data" => rTXT, "ext_data" => "" }
426
+ hashReturn = { "type" => "SPF", "result" => "PASS", "data" => rTXT, "ext_data" => "no qualifier" }
423
427
  end
424
428
  boolFoundMatch = true
425
429
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wlvalidate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,24 +9,8 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-27 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: dnsruby
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
12
+ date: 2013-07-09 00:00:00.000000000 Z
13
+ dependencies: []
30
14
  description: SendGrid Rails Gem to validate White Label settings
31
15
  email: jayson.sperling@sendgrid.com
32
16
  executables: []
@@ -54,7 +38,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
38
  version: '0'
55
39
  requirements: []
56
40
  rubyforge_project:
57
- rubygems_version: 1.8.24
41
+ rubygems_version: 1.8.23
58
42
  signing_key:
59
43
  specification_version: 3
60
44
  summary: SendGrid White Label Validator