email-authentication 0.1.5 → 0.1.6
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.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/bin/check_and_addvtiger.rb +34 -0
- data/bin/emailcheck.rb +2 -2
- data/lib/email-authentication/base.rb +2 -1
- data/test/coverage/index.html +1 -1
- data/test/test_address.rb +7 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 024bd04e010a3ae6d3465eb9cfcf2fa4b3e5813a
|
4
|
+
data.tar.gz: cae36b01df2234c75d1912427737c1ed34ed247e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b7718a5205428594c38f37dd6dea03485d845c60723e01a3d5ed3227cce5b33a53472e9903ae128751c7f33cd4e5e686dbb6aef59b03e35f7fff5b63efdb9a4
|
7
|
+
data.tar.gz: 93d356cab1d44b59077a7b53a566a5acf0ed21e9650e66cfdc173143eeacf8e3e80ff0b1d0d1eafaba400d2cf45d77e0cb48de0647f28a778dfb4c24b237dd13
|
data/README.md
CHANGED
@@ -14,11 +14,11 @@ See validates_email_format_of gem
|
|
14
14
|
email-authentication gem
|
15
15
|
========================
|
16
16
|
|
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
|
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 accepts the SMTP connection and the recipient address. Checking the smtp connection is unique to this gem that I am aware of.
|
18
18
|
|
19
19
|
Usage case
|
20
20
|
=====================
|
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
|
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 checking prior to sending via SES can prevent your account from being blocked.
|
22
22
|
|
23
23
|
Simplest usage
|
24
24
|
=====================
|
@@ -0,0 +1,34 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'rubygems'
|
3
|
+
require 'email-authentication'
|
4
|
+
require 'vtiger'
|
5
|
+
# needs upgrade to thor
|
6
|
+
puts "Check check_and_addvtiger.rb <address> <from> <url> <username> <key>"
|
7
|
+
address = ARGV[0]
|
8
|
+
from=ARGV[1]
|
9
|
+
@url=ARGV[2]
|
10
|
+
@username=ARGV[3]
|
11
|
+
@key=ARGV[4]
|
12
|
+
def setup_vtiger_internal
|
13
|
+
api = {
|
14
|
+
:username => @username,
|
15
|
+
:key => @key,
|
16
|
+
:url => @url,
|
17
|
+
}
|
18
|
+
@vtiger_cmd =Vtiger::Commands.vtiger_factory(api)
|
19
|
+
end
|
20
|
+
def addleademail(ln,co,email)
|
21
|
+
options={'description' => "indonesia list"}
|
22
|
+
hashv={}
|
23
|
+
@vtiger_cmd.addleademail(options,ln,co,email,hashv)
|
24
|
+
end
|
25
|
+
puts "Address is #{[address]} From address [#{from}]"
|
26
|
+
setup_vtiger_internal
|
27
|
+
@f=EmailAuthentication::Base.new
|
28
|
+
success,msg=@f.check(address)
|
29
|
+
if success
|
30
|
+
addleademail(@f.name,@f.domain,address)
|
31
|
+
puts "Success: #{address} messages #{msg}" if success
|
32
|
+
end
|
33
|
+
|
34
|
+
puts "Failure: #{address} messages: #{msg}" if !success
|
data/bin/emailcheck.rb
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
require 'rubygems'
|
3
3
|
require 'email-authentication'
|
4
4
|
# needs upgrade to thor
|
5
|
+
puts "Check emailcheck.rb <address> <from>"
|
5
6
|
address = ARGV[0]
|
6
7
|
from=ARGV[1]
|
7
|
-
puts "Address is #{[address]}"
|
8
|
-
puts "From address #{from}"
|
8
|
+
puts "Address is #{[address]} From address [#{from}]"
|
9
9
|
@f=EmailAuthentication::Base.new
|
10
10
|
success,msg=@f.check(address)
|
11
11
|
puts "Success: #{address} messages #{msg}" if success
|
@@ -7,7 +7,7 @@ require 'net/telnet'
|
|
7
7
|
|
8
8
|
module EmailAuthentication
|
9
9
|
class Base
|
10
|
-
attr_accessor :address, :mx, :message, :domain, :from
|
10
|
+
attr_accessor :address, :mx, :message, :domain, :from, :fromdomain, :name
|
11
11
|
def debug
|
12
12
|
true
|
13
13
|
end
|
@@ -44,6 +44,7 @@ module EmailAuthentication
|
|
44
44
|
def check_mx
|
45
45
|
domain=self.address.split('@')
|
46
46
|
@domain = domain[1]
|
47
|
+
@name=domain[0]
|
47
48
|
#puts "domain is #{domain}"
|
48
49
|
flag=false
|
49
50
|
if @domain!=nil
|
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-
|
17
|
+
<div class="timestamp">Generated <abbr class="timeago" title="2013-10-26T18:05:21+08:00">2013-10-26T18:05:21+08:00</abbr></div>
|
18
18
|
<ul class="group_tabs"></ul>
|
19
19
|
|
20
20
|
<div id="content">
|
data/test/test_address.rb
CHANGED
@@ -55,6 +55,13 @@ class EmailAuthenticationTest < Minitest::Test
|
|
55
55
|
assert success,"check did not succeed"
|
56
56
|
|
57
57
|
end
|
58
|
+
def test_name
|
59
|
+
@f.set_address(@success,@from)
|
60
|
+
success,msg= @f.check_format
|
61
|
+
assert @f.name='scott.sproule'
|
62
|
+
assert success,"check did not succeed"
|
63
|
+
|
64
|
+
end
|
58
65
|
def test_class_variable
|
59
66
|
success,msg= EmailAuthentication::Base.check(@success,@from)
|
60
67
|
assert success,"check did not succeed"
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Sproule
|
@@ -29,6 +29,7 @@ description: Try and authenticate email address, check format, lookup mx record
|
|
29
29
|
email: scott.sproule@ficonab.com
|
30
30
|
executables:
|
31
31
|
- emailcheck.rb
|
32
|
+
- check_and_addvtiger.rb
|
32
33
|
extensions: []
|
33
34
|
extra_rdoc_files: []
|
34
35
|
files:
|
@@ -79,6 +80,7 @@ files:
|
|
79
80
|
- test/test_helper.rb
|
80
81
|
- test/test_mx_records.rb
|
81
82
|
- test/test_smtp.rb
|
83
|
+
- bin/check_and_addvtiger.rb
|
82
84
|
- bin/emailcheck.rb
|
83
85
|
- Gemfile
|
84
86
|
- Gemfile.lock
|