From 7daaa06d53f0f496aa1a87656d16c81ebff37f73 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 22 Feb 2018 12:53:31 +0100 Subject: dashboard/app: restrict patch testing result CC list Currently dashboard sends patch testing result to full bug CC list (which includes kernel mailing lists). This is unnecessary and causes problems with patchwork. Reply only to people in the testing request CC list (adding our mailing list if it was missing). Fixes #526 --- dashboard/app/util_test.go | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) (limited to 'dashboard/app/util_test.go') diff --git a/dashboard/app/util_test.go b/dashboard/app/util_test.go index 8499b610f..17a8b460e 100644 --- a/dashboard/app/util_test.go +++ b/dashboard/app/util_test.go @@ -281,33 +281,37 @@ func (client *apiClient) updateBug(extID string, status dashapi.BugStatus, dup s return reply } -func (c *Ctx) incomingEmail(to, body string) { - c.incomingEmailImpl(0, "", to, body) -} - -func (c *Ctx) incomingEmailFrom(from, to, body string) { - c.incomingEmailImpl(0, from, to, body) -} - -func (c *Ctx) incomingEmailID(id int, to, body string) { - c.incomingEmailImpl(id, "", to, body) -} +type ( + EmailOptMessageID int + EmailOptFrom string + EmailOptCC []string +) -func (c *Ctx) incomingEmailImpl(id int, from, to, body string) { - if from == "" { - from = "default@sender.com" +func (c *Ctx) incomingEmail(to, body string, opts ...interface{}) { + id := 0 + from := "default@sender.com" + cc := []string{"test@syzkaller.com", "bugs@syzkaller.com"} + for _, o := range opts { + switch opt := o.(type) { + case EmailOptMessageID: + id = int(opt) + case EmailOptFrom: + from = string(opt) + case EmailOptCC: + cc = []string(opt) + } } email := fmt.Sprintf(`Sender: %v Date: Tue, 15 Aug 2017 14:59:00 -0700 Message-ID: <%v> Subject: crash1 From: %v -Cc: test@syzkaller.com, bugs@syzkaller.com +Cc: %v To: %v Content-Type: text/plain %v -`, from, id, from, to, body) +`, from, id, from, strings.Join(cc, ","), to, body) c.expectOK(c.POST("/_ah/mail/", email)) } -- cgit mrf-deployment