
Security News
libxml2 Maintainer Ends Embargoed Vulnerability Reports, Citing Unsustainable Burden
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
github.com/adarsh-jaiss/mailify
Mailify is a Go package for validating email addresses by checking their format, verifying the existence of MX records for the domain, and attempting to connect to the mail servers using SMTP.
You can use this as a cli tool on your local machine by installing the mailify cli tool
go install github.com/yourusername/mailify-cli@latest
For more details, checkout CLI DOCS
To install the package, run:
go get github.com/adarsh-jaiss/mailify
To create a new client, use the NewClient function:
client, err := mailify.NewClient("sender@example.com")
if err != nil {
log.Fatalf("Failed to create mailify client: %v", err)
}
To validate an email address, use the ValidateEmail method:
result, err := client.ValidateEmail("recipient@example.com")
if err != nil {
log.Fatalf("Failed to validate email: %v", err)
}
fmt.Println("Validation result:", client.FormatValidationResult("recipient@example.com", result))
To get the mail servers for a domain, use the GetMailServers method:
mailServers, err := client.GetMailServers("example.com")
if err != nil {
log.Fatalf("Failed to get mail servers: %v", err)
}
fmt.Println("Mail servers:", mailServers)
To get the mail servers for a recipient email, use the GetMailServersFromReceipientEmail method:
mailServers, err := client.GetMailServersFromReceipientEmail("recipient@example.com")
if err != nil {
log.Fatalf("Failed to get mail servers: %v", err)
}
fmt.Println("Mail servers:", mailServers)
This section demonstrates how to validate all email addresses in an Excel file using the ProcessAndValidateEmailsViaExcel
method. The method takes the path to the Excel file and the sender's email as parameters. If there is an error during the processing of the file, it will print an error message and terminate the execution.
Example usage:
err = client.ProcessAndValidateEmailsViaExcel("emails.xlsx",client.SenderEmail)
if err!= nil {
fmt.Printf("Error processing file: %v\n", err)
return
}
Here is a complete example demonstrating how to use the package : check examples
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
Research
Security News
Socket investigates hidden protestware in npm packages that blocks user interaction and plays the Ukrainian anthem for Russian-language visitors.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.