truemail 0.1.0 → 0.1.1
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/Gemfile.lock +1 -1
- data/README.md +2 -0
- data/lib/truemail/validate/smtp/request.rb +2 -0
- data/lib/truemail/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5aeb7131d9537a813612ab34168ff4422e088e2835f2106563ae7611fe9d6cc4
|
|
4
|
+
data.tar.gz: 268af7d670caf4917e7a81b3a3315b6b2c475c1287f0e5b0a4f48f1ecedb35c0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f2fef172a1f43f8220f19e3a0fbec240e7ae320aaeaa8598113c6d5eebea2ae579b5b9cc1e6e7460867f5bde04cea1ebda755df72ad1fd8b112f8e14964e5221
|
|
7
|
+
data.tar.gz: fc506f76216573a69baa1f8c8c4fa6b143b13243e134f73ee9a2dcabcb883ba0d97fd223d647071e11eba9ea101ab28365989ba8444b8b5a6ebcedf84a7f825c
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Truemail
|
|
2
2
|
|
|
3
|
+
[](https://badge.fury.io/rb/truemail) [](https://circleci.com/gh/rubygarage/truemail/tree/feature/validator-result-class)
|
|
4
|
+
|
|
3
5
|
The main idea of this gem is to validate emails by regex pattern, presence of domain mx-records, and real existence of email account on a current email server.
|
|
4
6
|
|
|
5
7
|
## Installation
|
|
@@ -4,6 +4,7 @@ module Truemail
|
|
|
4
4
|
SMTP_PORT = 25
|
|
5
5
|
CONNECTION_TIMEOUT_ERROR = 'connection timed out'.freeze
|
|
6
6
|
RESPONSE_TIMEOUT_ERROR = 'server response timeout'.freeze
|
|
7
|
+
CONNECTION_DROPPED = 'server dropped connection after response'.freeze
|
|
7
8
|
|
|
8
9
|
Request = Struct.new(:host, :email, :response, keyword_init: true) do
|
|
9
10
|
require 'net/smtp'
|
|
@@ -47,6 +48,7 @@ module Truemail
|
|
|
47
48
|
case error.class.name
|
|
48
49
|
when 'Net::OpenTimeout' then Truemail::Validate::Smtp::CONNECTION_TIMEOUT_ERROR
|
|
49
50
|
when 'Net::ReadTimeout' then Truemail::Validate::Smtp::RESPONSE_TIMEOUT_ERROR
|
|
51
|
+
when 'EOFError' then Truemail::Validate::Smtp::CONNECTION_DROPPED
|
|
50
52
|
else error.message
|
|
51
53
|
end
|
|
52
54
|
end
|
data/lib/truemail/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: truemail
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vladislav Trotsenko
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-03-
|
|
11
|
+
date: 2019-03-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|