heycarsten-email-veracity 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +9 -1
- data/lib/email_veracity/config.rb +1 -2
- data/test/unit/config_test.rb +5 -2
- metadata +4 -3
data/README.markdown
CHANGED
@@ -20,6 +20,14 @@ addresses.
|
|
20
20
|
specification.
|
21
21
|
|
22
22
|
|
23
|
+
A Note About The ActiveRecord Plugin
|
24
|
+
------------------------------------
|
25
|
+
|
26
|
+
**It's dead!** Why? Determining the validity of an email address based on a lookup of its domain is a good idea, but basing it off of one single test done inline with a request is not. A name server might be down, shit happens, and you might be snubbing a totally legitimate person from using your product — not good.
|
27
|
+
|
28
|
+
I feel a better solution is to check the pattern of the email address and perhaps check it against the blacklist on creation. The other tests should be done in the background over the period of many days and be added to a log. A report can then be performed and you can statistically determine the addresses that are most likely false and take appropriate action from that point.
|
29
|
+
|
30
|
+
|
23
31
|
Using The Gem
|
24
32
|
-------------
|
25
33
|
|
@@ -37,7 +45,7 @@ out, consider the following examples:
|
|
37
45
|
address.domain.to_s
|
38
46
|
# => 'gmail.com'
|
39
47
|
|
40
|
-
address.domain.address_servers.
|
48
|
+
address.domain.address_servers.map { |s| s.to_s }
|
41
49
|
# => ["64.233.171.83", "64.233.161.83", "209.85.171.83"]
|
42
50
|
|
43
51
|
address = EmailVeracity::Address.new('fakey@crazy-z3d9df-domain.com')
|
@@ -6,8 +6,7 @@ module EmailVeracity
|
|
6
6
|
rogers.com sympatico.ca yahoo.com telus.com sprint.com sprint.ca ],
|
7
7
|
:blacklist => %w[ dodgeit.com mintemail.com mintemail.uni.cc
|
8
8
|
1mintemail.mooo.com spammotel.com trashmail.net ],
|
9
|
-
:valid_pattern =>
|
10
|
-
/\A(([\w]+[\w\+_\-\.]+[\+_\-\.]{0})@((?:[-a-z0-9]+\.)+[a-z]{2,})){1}\Z/i,
|
9
|
+
:valid_pattern => /\A(([a-z0-1]{1}|[\w]+[\w\+_\-\.]+[\+_\-\.]{0})@((?:[-a-z0-9]+\.)+[a-z]{2,})){1}\Z/i,
|
11
10
|
:timeout => 2,
|
12
11
|
:lookup => [:a],
|
13
12
|
:enforce_blacklist => false,
|
data/test/unit/config_test.rb
CHANGED
@@ -58,10 +58,10 @@ class DefaultValidAddressPatternTest < Test::Unit::TestCase
|
|
58
58
|
def test_valid_email_addresses
|
59
59
|
%w[
|
60
60
|
goto@rubyfringe.ca
|
61
|
-
stuff
|
61
|
+
heyd00d+stuff@gmail.com
|
62
62
|
carsten_nielsen@gmail.com
|
63
63
|
carsten-nielsen@gmail.com
|
64
|
-
|
64
|
+
goodoldemail@address.ca
|
65
65
|
old-skool@mail.mysite.on.ca
|
66
66
|
heycarsten@del.icio.us
|
67
67
|
nex3@haml.town
|
@@ -70,6 +70,8 @@ class DefaultValidAddressPatternTest < Test::Unit::TestCase
|
|
70
70
|
sweetCandy4@me-and-you.ca
|
71
71
|
jesus@god.com
|
72
72
|
neat@b.eat
|
73
|
+
i@shouldwork.com
|
74
|
+
1@shouldworktoo.com
|
73
75
|
].each do |address|
|
74
76
|
assert_match EmailVeracity::Config[:valid_pattern],
|
75
77
|
address,
|
@@ -95,6 +97,7 @@ class DefaultValidAddressPatternTest < Test::Unit::TestCase
|
|
95
97
|
ungültige@adresse.de
|
96
98
|
failure@10.0.0.1
|
97
99
|
douche@@bag.net
|
100
|
+
.@fail.net
|
98
101
|
-@fail.org
|
99
102
|
_@fail.org
|
100
103
|
+_-@fail.die
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heycarsten-email-veracity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carsten Nielsen
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-05-16 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -36,6 +36,7 @@ files:
|
|
36
36
|
- init.rb
|
37
37
|
has_rdoc: false
|
38
38
|
homepage: http://github.com/heycarsten/email-veracity
|
39
|
+
licenses:
|
39
40
|
post_install_message:
|
40
41
|
rdoc_options: []
|
41
42
|
|
@@ -56,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
57
|
requirements: []
|
57
58
|
|
58
59
|
rubyforge_project: email-veracity
|
59
|
-
rubygems_version: 1.
|
60
|
+
rubygems_version: 1.3.5
|
60
61
|
signing_key:
|
61
62
|
specification_version: 2
|
62
63
|
summary: A simple library for checking the real-world validity of email addresses.
|