email-verification 0.2.1 → 0.2.2
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/lib/email/verification/errors.rb +1 -0
- data/lib/email/verification/verifier.rb +19 -13
- data/lib/email/verification/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: 5a2ca2ec0c71fd1e8c9fe8b6a36ae069194c4a6236a5881476727c25bfe493a2
|
4
|
+
data.tar.gz: 55c3024fdeb7431747d79a7bbae9107136fc27a0b9bb7a58c48042f1063a783c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d25a42c1af2d6a26cc686ed11b5158d00d4653ff20e5e83739ca0c3dc32a034df31a94e4ee33597a37ba92f6c917549eba7b8ebcd8fe60d0c7518382f5721c3c
|
7
|
+
data.tar.gz: 1496fbeb77c1e864a767110230fd1b12d34aff61cb5756e1772ece1931bafd08a415681a4a457c79adac06819ec9aff68a19a3c9598e186bc04f394e55f93de8
|
@@ -5,6 +5,7 @@ module Email
|
|
5
5
|
class Error < StandardError; end
|
6
6
|
class InvalidCredentialsError < Email::Verification::Errors::Error; end
|
7
7
|
class ImapNotSupportedError < Email::Verification::Errors::Error; end
|
8
|
+
class InvalidProxyError < Email::Verification::Errors::Error; end
|
8
9
|
|
9
10
|
end
|
10
11
|
end
|
@@ -20,21 +20,27 @@ module Email
|
|
20
20
|
|
21
21
|
def retrieve_verification_code(email:, password:, mailboxes: %w(Inbox), count: :all, settings: {}, proxy: nil, wait: 3, retries: 3)
|
22
22
|
service = determine_email_service(email)
|
23
|
+
result = nil
|
23
24
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
25
|
+
begin
|
26
|
+
result = case service
|
27
|
+
when :gmail
|
28
|
+
perform_retrieval(::Email::Verification::Gmail.new, email: email, password: password, mailboxes: mailboxes, count: count, settings: settings, proxy: proxy, wait: wait, retries: retries)
|
29
|
+
when :hotmail
|
30
|
+
perform_retrieval(::Email::Verification::Hotmail.new, email: email, password: password, mailboxes: mailboxes, count: count, settings: settings, proxy: proxy, wait: wait, retries: retries)
|
31
|
+
when :protonmail, :tutanota
|
32
|
+
if self.mode.eql?(:interactive)
|
33
|
+
puts "[Email::Verification::Verifier] - #{Time.now}: You're using an email account that doesn't have support for POP3 or IMAP. You have to manually retrieve the code or URL from the account and post it below."
|
34
|
+
capture_cli_input(email)
|
35
|
+
else
|
36
|
+
raise ::Email::Verification::Errors::ImapNotSupportedError.new("#{service} doesn't have support for IMAP or POP3 retrieval! Please switch to interactive mode or use another provider!")
|
37
|
+
end
|
33
38
|
else
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
39
|
+
nil
|
40
|
+
end
|
41
|
+
|
42
|
+
rescue Net::HTTPServerException => e
|
43
|
+
raise ::Email::Verification::Errors::InvalidProxyError.new("Proxy isn't working, please retry with a new proxy!")
|
38
44
|
end
|
39
45
|
|
40
46
|
return result
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: email-verification
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Johnsson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gmail
|