From 698a192c6ddb75832a5bfc8e1b30df43def9b6de Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 28 Mar 2019 19:08:47 +0100 Subject: dashboard/app: don't error on invalid emails Malformed emails constantly appear from spammers. But we have not seen errors parsing legit emails. These errors are annoying. Warn and ignore them. --- dashboard/app/reporting_email.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dashboard/app/reporting_email.go b/dashboard/app/reporting_email.go index ae0e597ca..ee45a759a 100644 --- a/dashboard/app/reporting_email.go +++ b/dashboard/app/reporting_email.go @@ -263,7 +263,11 @@ func handleIncomingMail(w http.ResponseWriter, r *http.Request) { func incomingMail(c context.Context, r *http.Request) error { msg, err := email.Parse(r.Body, ownEmails(c)) if err != nil { - return err + // Malformed emails constantly appear from spammers. + // But we have not seen errors parsing legit emails. + // These errors are annoying. Warn and ignore them. + log.Warningf(c, "failed to parse email: %v", err) + return nil } log.Infof(c, "received email: subject %q, from %q, cc %q, msg %q, bug %q, cmd %q, link %q", msg.Subject, msg.From, msg.Cc, msg.MessageID, msg.BugID, msg.Command, msg.Link) -- cgit mrf-deployment