From nobody Fri Mar 29 15:05:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1555496154; cv=none; d=zoho.com; s=zohoarc; b=JOLGoqnff2pEh2bLVltZ+JXunUgnHjr+IjdXL79HUJGfje5GC0d/V6eujk+xAyIWnE1/xUVLVY7+NL/LpviB2LYn57sAwaLJdWHtZQKE2Kk+0Cn2AtDgx9djfaSYx3vBBuqgY/qhFjChIakA7DL9AcjUyRd6Zc9AlK5mcEDkzh4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555496154; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=XXTdITvVLMvQSIax+mFy+64ZUaSankyUwlu8VUXa5Ys=; b=NAjfWnKLH/brqtbiIdu3fUwIxbdIUcY0OCSRwEtUWKk79bb1ICJQxLzy8HvfqoET5X9ZvFRxsY/muhcXNJiOVS75K1jdf6IiPOnBaM6pCt0oLqm04qPCkzeQMslHU8P2knQ5/s6k3QnRu8F5sWkD/gGf83lsODmqXdA3zvsEJOA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15554961546991005.353656455163; Wed, 17 Apr 2019 03:15:54 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7826D30821E2; Wed, 17 Apr 2019 10:15:53 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6C410608C1; Wed, 17 Apr 2019 10:15:53 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5CB3E181AC45; Wed, 17 Apr 2019 10:15:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3HAFqnk013859 for ; Wed, 17 Apr 2019 06:15:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 03C6360143; Wed, 17 Apr 2019 10:15:52 +0000 (UTC) Received: from mx1.redhat.com (ext-mx16.extmail.prod.ext.phx2.redhat.com [10.5.110.45]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F070D600CC for ; Wed, 17 Apr 2019 10:15:49 +0000 (UTC) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6F8573082A2A for ; Wed, 17 Apr 2019 10:15:48 +0000 (UTC) Received: by mail-wr1-f46.google.com with SMTP id t17so31123225wrw.13 for ; Wed, 17 Apr 2019 03:15:48 -0700 (PDT) Received: from donizetti.redhat.com ([2001:b07:6468:f312:ac27:aac4:c65c:6eb]) by smtp.gmail.com with ESMTPSA id z13sm79677756wrw.36.2019.04.17.03.15.46 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Apr 2019 03:15:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=uwv72tUMbBkNkIqpQ/9sGg9pRf3uYHWVd8r8BooCnRM=; b=gK7zGdSjae9gkjbk8Wp8knZhmeXwDIEzDAIGWchf/6YFaXBwcAgRsBMT+uijTcBwBH Rl/XpEndOXffG4F/jxkcWJeGrReBkg3m+oVbuEbTaRcMvQpYU+uRObMtWlScVj2+csBF bSDKsyomPACLlOcy2ZlArlH1Zjr1EbBy7wcId9Rm0fQWoeGQH2TwoYNVE9DBqTIQr3O6 NH4T9oehZCj9nOy05SY+pCBCOfT9IRDOfPPldCZPyFAJ0Cchy4EE1eD7Y5PYQRZ3VEEu /kuUpF+K39VXK84OoSWv4iKoLILQGFlhTXQpbKRNlHAJClzkPadVPeKrx0Gj7N33lJZK lXeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version:content-transfer-encoding; bh=uwv72tUMbBkNkIqpQ/9sGg9pRf3uYHWVd8r8BooCnRM=; b=bxmWONCzXkVOYT0UBzqJCfcwUfCThJUlO12+0UjM4TsD1T2rqpOj69cXFtu4midvBd frQSee0gTrLSuCtmrttgsHFsfEXnZP2kTmrtsH4zuqmSqcfp9RlMeZZtJZDwzqcXcbct 6Hmp4M7ZVlrKOSjwG2M5TKHDlXXGtSd2tHUk6H3tuJVV2O9ET5rp8u4n8xQPUttYZj8X 9apqR1eDkecXnTKOgV/wpYWyh1toyWPwQpYN19PrBllrYsyWbyGidBOPWu+mP62aX93+ j119E0MDgUIchforOf8jGk3NLtUpY+RKE1LBPgXXKe/Q/w7kwuoqA357ccjCQP1tPQv7 jJ/A== X-Gm-Message-State: APjAAAVVffjIGbGakHxBWluQ6rJkq23AyUXXLJ/AWc6G0uQ3jhM0x8ti Oe0QF317ZuELVdzTBRO/wkFGgM51 X-Google-Smtp-Source: APXvYqx9Bdc/lTRXUfOWvIirCkxfRJKszuDvX+dD0/y3crKIgnbhs9+s38jEuGqpIQdj4lDf+YIviQ== X-Received: by 2002:a5d:52ce:: with SMTP id r14mr2175015wrv.224.1555496146850; Wed, 17 Apr 2019 03:15:46 -0700 (PDT) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Wed, 17 Apr 2019 12:15:45 +0200 Message-Id: <20190417101545.9258-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 17 Apr 2019 10:15:48 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 17 Apr 2019 10:15:48 +0000 (UTC) for IP:'209.85.221.46' DOMAIN:'mail-wr1-f46.google.com' HELO:'mail-wr1-f46.google.com' FROM:'paolo.bonzini@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.24 (DKIM_SIGNED, DKIM_VALID, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS) 209.85.221.46 mail-wr1-f46.google.com 209.85.221.46 mail-wr1-f46.google.com X-RedHat-Possible-Forgery: Paolo Bonzini X-Scanned-By: MIMEDefang 2.84 on 10.5.110.45 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH] email: add to_user configuration X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Wed, 17 Apr 2019 10:15:53 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This could be used to send email when a patch is added to the "watched" que= ue. Signed-off-by: Paolo Bonzini --- mods/email.py | 5 +++++ mods/maintainer.py | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mods/email.py b/mods/email.py index 91c7d28..411bc4b 100644 --- a/mods/email.py +++ b/mods/email.py @@ -74,6 +74,9 @@ Email information is configured in "INI" style: BooleanSchema("reply_subject", "Set replying subje= ct", desc=3D'Whether to set Subject to "R= e: xxx", if the event has an associated email message', default=3DTrue), + BooleanSchema("to_user", "Send to user", + desc=3D'Whether to set To to a user = email, if the event has an associated user', + default=3DFalse), StringSchema("to", "To", desc=3D"Send email to"), StringSchema("cc", "Cc", desc=3D"Cc list"), StringSchema("subject_template", "Subject template= ", @@ -246,6 +249,8 @@ Email information is configured in "INI" style: headers["Reply-To"] =3D "<%s>" % mo.project.mailing_list if nt["reply_subject"] and mo: subject =3D "Re: " + mo.subject if not mo.subject.startswi= th("Re:") else mo.subject + if nt["to_user"] and 'user' in params and params['user'].email: + to +=3D params['user'].email if not (subject and body and (to or cc)): continue headers["Subject"] =3D subject diff --git a/mods/maintainer.py b/mods/maintainer.py index 7093760..00b1586 100644 --- a/mods/maintainer.py +++ b/mods/maintainer.py @@ -38,13 +38,13 @@ class MaintainerModule(PatchewModule): for x in [m] + list(m.get_patches()): q, created =3D QueuedSeries.objects.get_or_create(user=3Duser,= message=3Dx, name=3Dqueue) if created: - emit_event("MessageQueued", message=3Dx, queue=3Dq) + emit_event("MessageQueued", user=3Duser, message=3Dx, queu= e=3Dq) =20 def _drop_from_queue(self, user, m, queue): query =3D QueuedSeries.objects.filter(user=3Duser, message__in=3Dm= .get_patches() + [m], name=3Dqueue) for q in query: - emit_event("MessageDropping", message=3Dq.message, queue=3Dq) + emit_event("MessageDropping", user=3Duser, message=3Dq.message= , queue=3Dq) q.delete() =20 def _update_watch_queue(self, series): --=20 2.21.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel