Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Grantley Cullar authored and Grantley Cullar committed Oct 20, 2022
1 parent b70655d commit 280df01
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 32 deletions.
49 changes: 17 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# mail-checker
[![MIT Licence](https://img.shields.io/badge/license-MIT-blue)](https://opensource.org/licenses/mit-license.php)
[![Go Reference](https://pkg.go.dev/badge/github.com/gospacedev/mail-checker.svg)](https://pkg.go.dev/github.com/gospacedev/mail-checker)
[![Go Report Card](https://goreportcard.com/badge/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.

Expand All @@ -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.

0 comments on commit 280df01

Please sign in to comment.