email_verifier 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/README.md +2 -0
- data/email_verifier.gemspec +1 -0
- data/lib/email_verifier/checker.rb +7 -5
- data/lib/email_verifier/version.rb +1 -1
- metadata +20 -4
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -5,6 +5,8 @@ Many times as developers we've put in our models statements for checking email a
|
|
5
5
|
*format*. This gem will complete your existing setups with validator that actually
|
6
6
|
connects with given mail server and asks if given email address exists for real.
|
7
7
|
|
8
|
+
**New**: Now it supports Heroku!
|
9
|
+
|
8
10
|
## Installation
|
9
11
|
|
10
12
|
Add this line to your application's Gemfile:
|
data/email_verifier.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'net/smtp'
|
2
|
+
require 'dnsruby'
|
2
3
|
|
3
4
|
class EmailVerifier::Checker
|
4
5
|
|
@@ -21,11 +22,12 @@ class EmailVerifier::Checker
|
|
21
22
|
|
22
23
|
def list_mxs(domain)
|
23
24
|
return [] unless domain
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
{ priority:
|
28
|
-
end
|
25
|
+
res = Dnsruby::DNS.new
|
26
|
+
mxs = []
|
27
|
+
res.each_resource(domain, 'MX') do |rr|
|
28
|
+
mxs << { priority: rr.preference, address: rr.exchange.to_s }
|
29
|
+
end
|
30
|
+
mxs.sort_by { |mx| mx[:priority] }
|
29
31
|
end
|
30
32
|
|
31
33
|
def is_connected
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: email_verifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-09-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -27,6 +27,22 @@ dependencies:
|
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: 3.0.0
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: dnsruby
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '1.5'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '1.5'
|
30
46
|
description: Helper utility checking if given email address exists or not
|
31
47
|
email:
|
32
48
|
- kamil@endpoint.com
|
@@ -61,7 +77,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
61
77
|
version: '0'
|
62
78
|
segments:
|
63
79
|
- 0
|
64
|
-
hash:
|
80
|
+
hash: 382711456140948445
|
65
81
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
66
82
|
none: false
|
67
83
|
requirements:
|
@@ -70,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
70
86
|
version: '0'
|
71
87
|
segments:
|
72
88
|
- 0
|
73
|
-
hash:
|
89
|
+
hash: 382711456140948445
|
74
90
|
requirements: []
|
75
91
|
rubyforge_project:
|
76
92
|
rubygems_version: 1.8.23
|