email_verifier 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.README.md.swp +0 -0
- data/.gitignore +3 -0
- data/README.md +15 -2
- data/email_verifier.gemspec +1 -0
- data/lib/email_verifier/checker.rb +2 -1
- data/lib/email_verifier/version.rb +1 -1
- metadata +21 -8
- data/lib/.verifier.rb.swp +0 -0
- data/lib/email_verifier/.server.rb.swp +0 -0
- data/lib/email_verifier/.validates_email_realness.rb.swp +0 -0
data/.README.md.swp
CHANGED
Binary file
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -17,11 +17,22 @@ And then execute:
|
|
17
17
|
|
18
18
|
Or install it yourself as:
|
19
19
|
|
20
|
-
$ gem install
|
20
|
+
$ gem install email_verifier
|
21
21
|
|
22
22
|
## Usage
|
23
23
|
|
24
|
-
|
24
|
+
To get info about realness of given email address, email_verifier connects
|
25
|
+
with mail server that email's domain points to and pretends to send an email.
|
26
|
+
|
27
|
+
Some stmp servers will not allow you to do this if you will not present
|
28
|
+
yourself as some real user. So first thing you'd need to set up is to
|
29
|
+
put something like this either in initializer or in application.rb file:
|
30
|
+
|
31
|
+
EmailVerifier.config do |config|
|
32
|
+
config.verifier_email = "realname@realdomain.com"
|
33
|
+
end
|
34
|
+
|
35
|
+
Then just put this in your model e. g:
|
25
36
|
|
26
37
|
validates_email_realness_of :email
|
27
38
|
|
@@ -32,6 +43,8 @@ Or - if you'd like to use it outside of your models:
|
|
32
43
|
This method will return true or false, or - will throw exception
|
33
44
|
with nicely detailed info about what's wrong.
|
34
45
|
|
46
|
+
**Still Rails 3+ only** but compatibility with anything in tghe pipeline.
|
47
|
+
|
35
48
|
## Credits
|
36
49
|
![End Point Corporation](http://www.endpoint.com/images/end_point.png)
|
37
50
|
|
data/email_verifier.gemspec
CHANGED
@@ -8,7 +8,7 @@ class EmailVerifier::Checker
|
|
8
8
|
# real mail servers got from MX dns lookup
|
9
9
|
def initialize(address)
|
10
10
|
@email = address
|
11
|
-
@domain = address.split("@")
|
11
|
+
_, @domain = address.split("@")
|
12
12
|
@servers = list_mxs @domain
|
13
13
|
raise EmailVerifier::NoMailServerException.new("No mail server for #{address}") if @servers.empty?
|
14
14
|
@smtp = nil
|
@@ -19,6 +19,7 @@ class EmailVerifier::Checker
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def list_mxs(domain)
|
22
|
+
return [] unless domain
|
22
23
|
`host -t MX #{domain}`.scan(/(?<=by ).+/).map do |mx|
|
23
24
|
res = mx.split(" ")
|
24
25
|
next if res.last[0..-2].strip.empty?
|
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.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,8 +9,24 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
13
|
-
dependencies:
|
12
|
+
date: 2012-12-14 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rails
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.0.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: 3.0.0
|
14
30
|
description: Helper utility checking if given email address exists or not
|
15
31
|
email:
|
16
32
|
- kamil@endpoint.com
|
@@ -25,10 +41,7 @@ files:
|
|
25
41
|
- README.md
|
26
42
|
- Rakefile
|
27
43
|
- email_verifier.gemspec
|
28
|
-
- lib/.verifier.rb.swp
|
29
44
|
- lib/email_verifier.rb
|
30
|
-
- lib/email_verifier/.server.rb.swp
|
31
|
-
- lib/email_verifier/.validates_email_realness.rb.swp
|
32
45
|
- lib/email_verifier/checker.rb
|
33
46
|
- lib/email_verifier/config.rb
|
34
47
|
- lib/email_verifier/exceptions.rb
|
@@ -49,7 +62,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
49
62
|
version: '0'
|
50
63
|
segments:
|
51
64
|
- 0
|
52
|
-
hash:
|
65
|
+
hash: 4285945759283300825
|
53
66
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
67
|
none: false
|
55
68
|
requirements:
|
@@ -58,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
71
|
version: '0'
|
59
72
|
segments:
|
60
73
|
- 0
|
61
|
-
hash:
|
74
|
+
hash: 4285945759283300825
|
62
75
|
requirements: []
|
63
76
|
rubyforge_project:
|
64
77
|
rubygems_version: 1.8.23
|
data/lib/.verifier.rb.swp
DELETED
Binary file
|
Binary file
|
Binary file
|