Skip to content

Commit

Permalink
Log only one time per failed filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Xpl0itU committed Sep 10, 2023
1 parent 5c8f4d3 commit 6725150
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,12 @@ func checkEmailsWithFilters(filters []MailFilter, server, email, password, mailO
continue
}

if filter.FailIfFound {
log.Printf("Error: %+v\n", filter)
}

for _, msg := range messages {
if filter.FailIfFound {
log.Printf("Error: %+v\n", filter)
failedSet.AddNum(msg.SeqNum)
anyErrors = true
} else {
Expand Down Expand Up @@ -138,7 +141,7 @@ func searchEmails(c *client.Client, filter MailFilter) ([]*imap.Message, error)

go func() {
if err := c.Fetch(seqset, []imap.FetchItem{imap.FetchEnvelope}, messagesChan); err != nil {
log.Println("Error fetching messages:", err)
log.Printf("Error fetching messages: %s\n", err.Error())
}
}()

Expand Down

0 comments on commit 6725150

Please sign in to comment.