maennchen / email_checker Goto Github PK
View Code? Open in Web Editor NEWThis project forked from kdisneur/email_checker
Elixir library checking email validity based on Regex, MX and SMTP
License: MIT License
This project forked from kdisneur/email_checker
Elixir library checking email validity based on Regex, MX and SMTP
License: MIT License
Hi. i was trying this cool module but most of the domains (gmail, yahoo, outlook) are failing for some reason.
i tried debugging my self but couldn't get to the point of where might be wrong.
one thing i tried is telnetting to gmail
telnet gmail-smtp-in.l.google.com 25
Trying 2404:6800:4008:c07::1a...
Connection failed: Permission denied
Trying 64.233.189.26...
telnet: Unable to connect to remote host: No route to host
Any suggestions? Thanks.
Edit:
Sorry i didn't read correctly the readme page which says
Most email providers nowadays don't support this method. You should only use it if you know what you're doing.
Is there any alternative way to do this?..
I get this error when using EmailChecker.valid?
:
** (FunctionClauseError) no function clause matching in Kernel.=~/2
stacktrace:
(elixir) lib/kernel.ex:1580: Kernel.=~(nil, ~r/^(?<user>[^\s]+)@(?<domain>[^\s]+\.[^\s]+)$/)
lib/email_checker.ex:28: EmailChecker.valid?/2```
Pretty trivial, not worth the hoops of a clone/push/pr.
Warning on compile on lib/email_checker/check/smtp.ex:28
is:
warning: function head for def valid?/2 must come at the top of its direct implementation.
Patch to fix:
diff --git a/lib/email_checker/check/smtp.ex b/lib/email_checker/check/smtp.ex
index 063fb34..914f92f 100644
--- a/lib/email_checker/check/smtp.ex
+++ b/lib/email_checker/check/smtp.ex
@@ -25,7 +25,6 @@ defmodule EmailChecker.Check.SMTP do
"""
@spec valid?(String.t(), non_neg_integer) :: boolean
def valid?(email, retries \\ max_retries())
- def valid?(email, retries)
def valid?(_, 0), do: false
def valid?(email, retries) do
** (UndefinedFunctionError) function Socket.TCP.connect!/3 is undefined (module Socket.TCP is not available)
Socket.TCP.connect!("gmail-smtp-in.l.google.com", 25, [packet: :line, timeout: :infinity])
(email_checker 0.2.4) lib/email_checker/check/smtp.ex:66: EmailChecker.Check.SMTP.smtp_reply/1
(email_checker 0.2.4) lib/email_checker/check/smtp.ex:32: EmailChecker.Check.SMTP.valid?/2
It works properly for some domain names but not all of them. For example, no hotmail.com email addresses are valid.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.