Giter Club home page Giter Club logo

truemail-rb / truemail-go Goto Github PK

View Code? Open in Web Editor NEW
86.0 2.0 14.0 213 KB

๐Ÿš€ Configurable Golang ๐Ÿ“จ email validator/verifier. Verify email via Regex, DNS, SMTP and even more. Be sure that email address valid and exists.

Home Page: https://truemail-rb.org/truemail-go

License: MIT License

Go 98.89% Shell 1.11%
go golang go-package email email-validation email-verification hacktoberfest mx-validation dns-validation email-validator

truemail-go's People

Contributors

bestwebua avatar richimaulana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

truemail-go's Issues

[BUG] Email Pattern validation causes runtime error

New bug checklist

Bug description

When and email does not have a domain it will throw a panic runtime error: index out of range [1] with length 0.

Complete output when running truemail, including the stack trace and command used
panic: runtime error: index out of range [1] with length 0

goroutine 1 [running]:
github.com/truemail-rb/truemail-go.regexCaptureGroup({0x4000246b70, 0x3}, {0x277365?, 0x400077a240?}, 0x1)
/home/parallels/go/pkg/mod/github.com/truemail-rb/[email protected]/helpers.go:82 +0x74
github.com/truemail-rb/truemail-go.emailDomain(...)
/home/parallels/go/pkg/mod/github.com/truemail-rb/[email protected]/helpers.go:87
github.com/truemail-rb/truemail-go.(*validationDomainListMatch).setValidatorResultDomain(...)
/home/parallels/go/pkg/mod/github.com/truemail-rb/[email protected]/domain_list_match.go:40
github.com/truemail-rb/truemail-go.(*validationDomainListMatch).check(0x4000580110, 0x400059a160)
/home/parallels/go/pkg/mod/github.com/truemail-rb/[email protected]/domain_list_match.go:9 +0x6c
github.com/truemail-rb/truemail-go.(*validator).validateDomainListMatch(...)
/home/parallels/go/pkg/mod/github.com/truemail-rb/[email protected]/validator.go:84
github.com/truemail-rb/truemail-go.(*validator).run(0x40003abd90)
/home/parallels/go/pkg/mod/github.com/truemail-rb/[email protected]/validator.go:158 +0x70
github.com/truemail-rb/truemail-go.Validate({0x4000246b70, 0x3}, 0x40001810a0, {0x40003abec8?, 0x1?, 0x264f7b?})
/home/parallels/go/pkg/mod/github.com/truemail-rb/[email protected]/truemail.go:13 +0x228
main.validateEmails(0x28b2b1?)

[BUG] Email Pattern validation causes runtime error

New bug checklist

Bug description

When and email does not have a domain it will throw a panic runtime error: index out of range [1] with length 0.

Complete output when running truemail, including the stack trace and command used
panic: runtime error: index out of range [1] with length 0

goroutine 1 [running]:
github.com/truemail-rb/truemail-go.regexCaptureGroup({0x4000246b70, 0x3}, {0x277365?, 0x400077a240?}, 0x1)
/home/parallels/go/pkg/mod/github.com/truemail-rb/[email protected]/helpers.go:82 +0x74
github.com/truemail-rb/truemail-go.emailDomain(...)
/home/parallels/go/pkg/mod/github.com/truemail-rb/[email protected]/helpers.go:87
github.com/truemail-rb/truemail-go.(*validationDomainListMatch).setValidatorResultDomain(...)
/home/parallels/go/pkg/mod/github.com/truemail-rb/[email protected]/domain_list_match.go:40
github.com/truemail-rb/truemail-go.(*validationDomainListMatch).check(0x4000580110, 0x400059a160)
/home/parallels/go/pkg/mod/github.com/truemail-rb/[email protected]/domain_list_match.go:9 +0x6c
github.com/truemail-rb/truemail-go.(*validator).validateDomainListMatch(...)
/home/parallels/go/pkg/mod/github.com/truemail-rb/[email protected]/validator.go:84
github.com/truemail-rb/truemail-go.(*validator).run(0x40003abd90)
/home/parallels/go/pkg/mod/github.com/truemail-rb/[email protected]/validator.go:158 +0x70
github.com/truemail-rb/truemail-go.Validate({0x4000246b70, 0x3}, 0x40001810a0, {0x40003abec8?, 0x1?, 0x264f7b?})
/home/parallels/go/pkg/mod/github.com/truemail-rb/[email protected]/truemail.go:13 +0x228
main.validateEmails(0x28b2b1?)

[QUESTION] I am experiencing difficulties validating emails using the TrueMail API on my Local Ubuntu System

Hello Team,

I'm a PHP Laravel developer with no prior experience in Go. I've installed Go version go1.21.6 on Linux/amd64. I am looking to validate emails with domain and MX records using Go.

I've attempted to run go build, go run ., and go run [specific files], but encountered various errors each time.

Could you please guide me through the necessary steps to run this validation process so that I can effectively validate emails?

Thank you.

[ISSUE] Typographical error on line 49 in domain_list_match.go file

New issue checklist

[ISSUE] Typographical error on line 49 in domain_list_match.go file

Issue description

// Returns true if whitelist validation enebled, otherwise returns false
func (validation *validationDomainListMatch) isWhitelistValidation() bool {
validatorResult := validation.result
return validatorResult.Configuration.WhitelistValidation
}

As seen above, the comment reads Returns true if whitelist validation "enabled"
This is a typo, as the word should be "enabled"

[QUESTION] Is it possible to do validation after the RCPT TO section in the SMTP session?

New question checklist

Question

When using Truemail as my main engine for validating emails I found that every time I validate Yahoo emails the results are always valid/true. After I try to debug the problems, turn out that Yahoo accepts all email addresses in the RCPT TO section, so even if the email doesn't exist the return from the Yahoo MX server will always be OK (250). After I continued to the DATA section in the SMTP session the Yahoo MX server just returned the mailbox not exist message.

Here is the detail:

$ swaks -s mta5.am0.yahoodns.net:25 -f [email protected] -t [email protected]
=== Trying mta5.am0.yahoodns.net:25...
=== Connected to mta5.am0.yahoodns.net.
<-  220 mtaproxy511.free.mail.bf1.yahoo.com ESMTP ready
 -> EHLO vpndev.aktiva.co.id
<-  250-mtaproxy511.free.mail.bf1.yahoo.com
<-  250-PIPELINING
<-  250-SIZE 41943040
<-  250-8BITMIME
<-  250 STARTTLS
 -> MAIL FROM:<[email protected]>
<-  250 sender <[email protected]> ok
 -> RCPT TO:<[email protected]>
<-  250 recipient <[email protected]> ok
 -> DATA
<-  354 go ahead
 -> Date: Tue, 30 Apr 2024 04:24:03 +0000
 -> To: [email protected]
 -> From: [email protected]
 -> Subject: test Tue, 30 Apr 2024 04:24:03 +0000
 -> Message-Id: <[email protected]>
 -> X-Mailer: swaks v20190914.0 jetmore.org/john/code/swaks/
 ->
 -> This is a test mailing
 ->
 ->
 -> .
<** 552 1 Requested mail action aborted, mailbox not found
 -> QUIT
*** Remote host closed connection unexpectedly.

So is there any workaround for this problem? I tried various validators that are available online and the result is valid.

Is the only way is just to do/continue the SMTP session until the DATA section? If it is, doesn't it will send the message to the target email if the email is valid?

[QUESTION] Why smtpRequest is private ?

New question checklist

Question

It is not possible to easily access the content of truemail.validatorResult.SmtpDebug because the fields of smtpRequest are private. How to access easily to these fields ?

I would like to know why smtp check fail by look at SmtpDebug[i].response. Is that a choice to put those structs private ?

Thanks for your work

[BUG] There is an issue in the Validate function where it panics, root cause is in the runSession function

The bug is in the runSession function when creating smtp client we ignore the error, however calling either Send or Close in case there is an error causes panic

New bug checklist

Bug description

The bug is in the runSession function when creating smtp client we ignore the error on line 105, however calling either Send or Close in case there is an error causes panic:
Screenshot 2023-10-12 at 4 52 50 PM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.