mail_box_validator 0.9.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/mail_box_validator/mail_box.rb +7 -2
- data/lib/mail_box_validator/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ae86132c9970aaa61ea82e0126026288e625b72
|
4
|
+
data.tar.gz: de0671e7e99b868f92aa181df9a4e99294650ba6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0952e9fa21bd3b4b50b1baa4dda2a6f3e1c3ed1689da7400e0db2ece387e0c5c8fa1ec54af111b089c74bd0e771bfe09bd2cb77a027a60fe9c00f5e337a0511
|
7
|
+
data.tar.gz: 70bc03d759ded9f943a7cc24dab443584092c222a793781b76abfca0dcd451036055364a73f64727c4979f5c63301e83af6a683920760412d3833c3f6191ff67
|
data/README.md
CHANGED
@@ -7,12 +7,17 @@ module MailBoxValidator
|
|
7
7
|
def valid?(mail_address)
|
8
8
|
domain = mail_address.slice(/@(.*)/, 1)
|
9
9
|
mx = mail_exchanger_record_for(domain)
|
10
|
-
|
11
|
-
mx.all? {|host| response_for(mail_address, host).match(/^2\d{2}/).present? }
|
10
|
+
mx.present? && mx.all?(&return_valid?)
|
12
11
|
end
|
13
12
|
|
14
13
|
private
|
15
14
|
|
15
|
+
def return_valid?
|
16
|
+
Proc.new do |host|
|
17
|
+
response_for(mail_address, host).match(/^2\d{2}/).present?
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
16
21
|
def response_for(mail_address, host)
|
17
22
|
response = ''
|
18
23
|
telnet = Net::Telnet::new(
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mail_box_validator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bidu Developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|