-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Grantley Cullar
authored and
Grantley Cullar
committed
Oct 20, 2022
1 parent
b70655d
commit 280df01
Showing
3 changed files
with
17 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# mail-checker | ||
[](https://opensource.org/licenses/mit-license.php) | ||
[](https://pkg.go.dev/github.com/gospacedev/mail-checker) | ||
[](https://goreportcard.com/report/github.com/gospacedev/mail-checker) | ||
|
||
Mail Checker extracts a domain's email DMARC and SPF records. | ||
|
||
|
@@ -14,40 +15,24 @@ Example code: | |
```go | ||
package main | ||
|
||
import ( | ||
"bufio" | ||
"fmt" | ||
"log" | ||
"os" | ||
) | ||
import "github.com/gospacedev/mail-checker" | ||
|
||
func main() { | ||
sci := bufio.NewScanner(os.Stdin) | ||
fmt.Println("domain, hasMX, hasSPF, sprRecord, hasDMARC, dmarcRecord") | ||
|
||
for sci.Scan(){ | ||
fmt.Println(CheckDomainMX(sci.Text())) | ||
} | ||
|
||
|
||
if err := sci.Err(); err != nil { | ||
log.Fatal("Error: Can't read from input: \n", err) | ||
} | ||
mail.CheckDomainMX("google.com", "config", "json", ".") | ||
} | ||
``` | ||
|
||
Run the file and enter a domain name: | ||
|
||
Enter a domain name: | ||
google.com | ||
``` | ||
|
||
Then it should show the email information: | ||
|
||
{ | ||
"Domain": "google.com", | ||
"HasMX": true, | ||
"HasSPF": false, | ||
"HasDMARC": true, | ||
"SPRRecord": "", | ||
"DMARCRecord": "v=DMARC1; p=reject; rua=mailto:[email protected]" | ||
} | ||
The mail information is outputed to the config file, Mail Checker | ||
can write to JSON, TOML, and YAML config files. | ||
|
||
```json | ||
{ | ||
"dmarcrecord": "v=DMARC1; p=reject; rua=mailto:[email protected]", | ||
"domain": "google.com", | ||
"hasdmarc": true, | ||
"hasmx": true, | ||
"hasspf": false, | ||
"sprecord": "" | ||
} | ||
``` |
File renamed without changes.
File renamed without changes.