Skip to content

Commit

Permalink
Merge pull request #27 from careyjames/tushar-dkimrecords
Browse files Browse the repository at this point in the history
correct code
  • Loading branch information
careyjames authored Oct 19, 2023
2 parents 8fb83b9 + 2bbc238 commit 9b27c93
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dns_information/dmarc.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func GetDMARCPrompt(input string) {
formattedDMARC := formatLongText(dmarc, 80, " ")
fmt.Printf(color.Blue(" DMARC Record: ") + color.Green(formattedDMARC) + constants.Newline)
} else {
fmt.Printf(color.Blue(" DMARC Record: ") + color.Green(dmarc[8:]) + constants.Newline)
fmt.Printf(color.Blue(" DMARC Record: ") + color.Red(dmarc[8:]) + constants.Newline)
}
} else {
fmt.Printf(color.Blue(" DMARC Record: ") + color.Red("None") + constants.Newline)
Expand Down
12 changes: 8 additions & 4 deletions dns_information/dmki_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,17 @@ func getDKIM(domain string, selector string) (string, error) {
func GetDKIMPrompt(input string) {
flag := false
dkimPrompt := ""
for _, selector := range DKIMSelectors {
for index, selector := range DKIMSelectors {
dkim, _ := getDKIM(input, selector)
if dkim != "" {
flag = true
if isValidDKIM(dkim) {
formattedDMARC := formatLongText(dkim, 80, " ")
dkimPrompt += color.Green(selector+".") + color.Green(formattedDMARC) + constants.Newline
if index > 0 {
dkimPrompt += " " + color.Green(selector+".") + color.Green(formattedDMARC) + constants.Newline
} else {
dkimPrompt += color.Green(selector+".") + color.Green(formattedDMARC) + constants.Newline
}
} else {
dkimPrompt += color.Green(selector+".") + color.Red(dkim[7:]) + constants.Newline
}
Expand All @@ -53,9 +57,9 @@ func GetDKIMPrompt(input string) {
}
}
if flag {
fmt.Printf(color.Blue(" DKIM Record: ") + dkimPrompt)
fmt.Printf(color.Blue(" DKIM Records: ") + dkimPrompt)
} else {
fmt.Printf(color.Blue(" DKIM Record: ") + dkimPrompt)
fmt.Printf(color.Blue(" DKIM Records: ") + dkimPrompt)
}
}

Expand Down

0 comments on commit 9b27c93

Please sign in to comment.