1
1
# mail-checker
2
2
[ ![ MIT Licence] ( https://img.shields.io/badge/license-MIT-blue )] ( https://opensource.org/licenses/mit-license.php )
3
3
[ ![ Go Reference] ( https://pkg.go.dev/badge/github.com/gospacedev/mail-checker.svg )] ( https://pkg.go.dev/github.com/gospacedev/mail-checker )
4
+ [ ![ Go Report Card] ( https://goreportcard.com/badge/github.com/gospacedev/mail-checker )] ( https://goreportcard.com/report/github.com/gospacedev/mail-checker )
4
5
5
6
Mail Checker extracts a domain's email DMARC and SPF records.
6
7
@@ -14,40 +15,24 @@ Example code:
14
15
``` go
15
16
package main
16
17
17
- import (
18
- " bufio"
19
- " fmt"
20
- " log"
21
- " os"
22
- )
18
+ import " github.com/gospacedev/mail-checker"
23
19
24
20
func main () {
25
- sci := bufio.NewScanner (os.Stdin )
26
- fmt.Println (" domain, hasMX, hasSPF, sprRecord, hasDMARC, dmarcRecord" )
27
-
28
- for sci.Scan (){
29
- fmt.Println (CheckDomainMX (sci.Text ()))
30
- }
31
-
32
-
33
- if err := sci.Err (); err != nil {
34
- log.Fatal (" Error: Can't read from input: \n " , err)
35
- }
21
+ mail.CheckDomainMX (" google.com" , " config" , " json" , " ." )
36
22
}
37
- ```
38
-
39
- Run the file and enter a domain name:
40
23
41
- Enter a domain name:
42
- google.com
24
+ ```
43
25
44
- Then it should show the email information:
45
-
46
- {
47
- "Domain": "google.com",
48
- "HasMX": true,
49
- "HasSPF": false,
50
- "HasDMARC": true,
51
- "SPRRecord": "",
52
- "DMARCRecord": "v=DMARC1; p=reject; rua=mailto:[email protected] "
53
- }
26
+ The mail information is outputed to the config file, Mail Checker
27
+ can write to JSON, TOML, and YAML config files.
28
+
29
+ ``` json
30
+ {
31
+ "dmarcrecord" :
" v=DMARC1; p=reject; rua=mailto:[email protected] " ,
32
+ "domain" : " google.com" ,
33
+ "hasdmarc" : true ,
34
+ "hasmx" : true ,
35
+ "hasspf" : false ,
36
+ "sprecord" : " "
37
+ }
38
+ ```
0 commit comments