Skip to content

Commit faf8635

Browse files
committed
skip sending email when no mailer is configured
1 parent 16c8799 commit faf8635

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmd/root.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func initMailer() {
122122
case "amazonses":
123123
mailSender = &mailer.AmazonSESMailer{}
124124
default:
125-
log.Println("no mailer configured")
125+
log.Println("no mailer configured, email report will not be sent")
126126
return
127127
}
128128

@@ -162,6 +162,9 @@ func getDomainConfigName(domain string) string {
162162
}
163163

164164
func sendMail(domain string, issuances []api.Issuance) error {
165+
if mailSender == nil {
166+
return nil
167+
}
165168
subject := fmt.Sprintf("Certificate Transparency Notification for %s", domain)
166169
body := fmt.Sprintf("ct-monitor has observed the issuance of the following certificate(s) for the %s domain:\n", domain)
167170
for _, i := range issuances {

0 commit comments

Comments
 (0)