aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2019-03-28 19:08:47 +0100
committerDmitry Vyukov <dvyukov@google.com>2019-03-29 08:56:02 +0100
commit698a192c6ddb75832a5bfc8e1b30df43def9b6de (patch)
tree611dd423dbea20ff5cedf3fc52fa9d950457746b
parentc84501fe70ad8b8ca637daebb75eed7fcc707f6a (diff)
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.
-rw-r--r--dashboard/app/reporting_email.go6
1 files changed, 5 insertions, 1 deletions
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)