email-authentication 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +12 -2
- data/bin/emailcheck.rb +2 -0
- data/lib/email-authentication/base.rb +6 -2
- data/test/coverage/index.html +1 -1
- data/test/test_address.rb +5 -0
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df9406d305f16cad0177d13e1a2e59b854b23762
|
4
|
+
data.tar.gz: 23012f8bf9bfba8c8a0c96ff26bc898850ba2362
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2be06a5c5c9d7788752a38fd413d635133aae74fb103ebbb76d4eead70809044bc5ebb146ee64793c3e2586a4035593d864ea6e96d525335c358e8df5afc200b
|
7
|
+
data.tar.gz: 9ee13aa11dea0ae5f1a75da5066977dfd7d52e8024633518b79119614804d1bca96844132b3612b909b7f9d48542d0af726be8f8dbe1a524d43b3817ad47aa8c
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -3,12 +3,16 @@
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/email-authentication.png)](http://badge.fury.io/rb/email-authentication)
|
4
4
|
|
5
5
|
NaySayers Read here
|
6
|
-
|
6
|
+
===================
|
7
7
|
|
8
8
|
It is NOT possible to verify an email address unless you send an email to it. And even then you may get a transient bounce. This gem tries its best to check to see if the address is valid. But is DOES NOT guarantee validity. Then why this gem? Because sometimes you receive a list of email addresses and you want to test them before adding to an email service provider list so your account is not blocked due to failing addresses. This gem helps in that process
|
9
9
|
|
10
|
-
|
10
|
+
Alternatives
|
11
11
|
============
|
12
|
+
See validates_email_format_of gem
|
13
|
+
|
14
|
+
email-authentication gem
|
15
|
+
========================
|
12
16
|
|
13
17
|
Given an email address, check to see if it is valid. Check the structure of the address, MX record of the domain and if the domain accpts the SMTP connection
|
14
18
|
|
@@ -16,6 +20,12 @@ Usage case
|
|
16
20
|
=====================
|
17
21
|
Let's say you are using Amazon SES and you want to validate your email addresses before you send via SES (or any other provder). Amazon is quite particular about bounce rates and cchecking prior to sending via SES can prevent your account from being blocked.
|
18
22
|
|
23
|
+
Simplest usage
|
24
|
+
=====================
|
25
|
+
To test an email address via a class call. It returns boolean if success and a list of messages
|
26
|
+
|
27
|
+
success,msgs=EmailAuthentication::Base.check('an email adresss')
|
28
|
+
|
19
29
|
Use gem
|
20
30
|
=====================
|
21
31
|
To test an email address. It returns boolean if success and a list of messages
|
data/bin/emailcheck.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'rubygems'
|
3
3
|
require 'email-authentication'
|
4
|
+
# needs upgrade to thor
|
4
5
|
address=count = ARGV[0]
|
6
|
+
puts "Address is #{[address]}"
|
5
7
|
@f=EmailAuthentication::Base.new
|
6
8
|
success,msg=@f.check(address)
|
7
9
|
puts "Success: #{address}" if success
|
@@ -10,13 +10,17 @@ module EmailAuthentication
|
|
10
10
|
def debug
|
11
11
|
true
|
12
12
|
end
|
13
|
+
def self.check(address)
|
14
|
+
tmp=self.new
|
15
|
+
return tmp.check(address)
|
16
|
+
end
|
13
17
|
def set_address(address)
|
14
18
|
raise "address nil" if address==nil
|
15
19
|
raise "address blank" if address==""
|
16
20
|
self.address=address.to_s
|
17
21
|
@flag=true
|
18
22
|
end
|
19
|
-
# this needs work. Anyone who can improve the regex i would be happy
|
23
|
+
# this needs work. Anyone who can improve the regex i would be happy to put in their changes
|
20
24
|
def check_format
|
21
25
|
@@email_regex = /^(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6}$/i
|
22
26
|
res=(@address =~ @@email_regex)
|
@@ -55,7 +59,7 @@ module EmailAuthentication
|
|
55
59
|
else
|
56
60
|
msg="nil domain"
|
57
61
|
end
|
58
|
-
puts "ret is #{ret.inspect}"
|
62
|
+
# puts "ret is #{ret.inspect}"
|
59
63
|
[flag,msg]
|
60
64
|
end
|
61
65
|
# need to think about this and check the domain via telnet
|
data/test/coverage/index.html
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
<img src="./assets/0.7.1/loading.gif" alt="loading"/>
|
15
15
|
</div>
|
16
16
|
<div id="wrapper" style="display:none;">
|
17
|
-
<div class="timestamp">Generated <abbr class="timeago" title="2013-10-20T15:
|
17
|
+
<div class="timestamp">Generated <abbr class="timeago" title="2013-10-20T15:39:14+08:00">2013-10-20T15:39:14+08:00</abbr></div>
|
18
18
|
<ul class="group_tabs"></ul>
|
19
19
|
|
20
20
|
<div id="content">
|
data/test/test_address.rb
CHANGED
@@ -48,6 +48,11 @@ class EmailAuthenticationTest < Minitest::Test
|
|
48
48
|
assert success,"check did not succeed"
|
49
49
|
|
50
50
|
end
|
51
|
+
def test_class_variable
|
52
|
+
success,msg= EmailAuthentication::Base.check(@success)
|
53
|
+
assert success,"check did not succeed"
|
54
|
+
|
55
|
+
end
|
51
56
|
def test_bademails
|
52
57
|
['test','test#sed', 'test@jack'].each { |e|
|
53
58
|
@f.set_address(e)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: email-authentication
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Sproule
|
@@ -9,21 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2013-10-20 00:00:00.000000000 Z
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: dnsruby
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - '>='
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - '>='
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
12
|
+
dependencies: []
|
27
13
|
description: Try and authenticate email address, check format, lookup mx record and
|
28
14
|
check smtp connectivity
|
29
15
|
email: scott.sproule@ficonab.com
|