From nobody Sat Apr 20 06:49:10 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=1557828119; cv=none; d=zoho.com; s=zohoarc; b=HyB9HOo7ltV1FLxgWrwrUZ73YsKkZtmm2QKRpOS0MLlmWhW/COjLSlWV+3vzJrINi2RfKYNBdJ22v7SCoPNBz4i6IVrmcLd+Oi/CTQxMbhDW78K/5ehN+O5S3Pn+XDSx4Md+pR9LDAGCvMFz0QyBz4tqiNW4TkcKeQYlMMA6D34= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557828119; 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=ehpPKXi3bWOy8JG4uoPcUwktDS1V2kIAaj6kMxVCfjk=; b=Z9+CaFkBHF/Czv/1ZZTbxQSZuUAZ2ZodbQzmUX72xOXvBEwR9/bUiWVvS14syGKGwVUK/6Jee/bmQXKQ0PMATOw/Ng4Y6loJ7iqGPbcHtbzi8yQ/Qbd11befiC+U6FZowPJ1AMPSFd7PCUEXdWBIOPqrIFrpp0ihJYExWwnoX38= 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 155782811914535.239381578028315; Tue, 14 May 2019 03:01:59 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E530A3092649; Tue, 14 May 2019 10:01:52 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D840160BCF; Tue, 14 May 2019 10:01:52 +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 8A6D241F56; Tue, 14 May 2019 10:01:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x4EA1o0C022089 for ; Tue, 14 May 2019 06:01:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0D7FC53B32; Tue, 14 May 2019 10:01:50 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0789C5C2E0 for ; Tue, 14 May 2019 10:01:47 +0000 (UTC) Received: from mail-oi1-f196.google.com (mail-oi1-f196.google.com [209.85.167.196]) (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 8C7813695F for ; Tue, 14 May 2019 10:01:28 +0000 (UTC) Received: by mail-oi1-f196.google.com with SMTP id t187so8330169oie.10 for ; Tue, 14 May 2019 03:01:28 -0700 (PDT) Received: from donizetti.gateway.innflux.com ([12.187.203.94]) by smtp.gmail.com with ESMTPSA id q205sm6097639oih.17.2019.05.14.03.01.27 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 03:01:27 -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=ukr5BkcEgVUFkv8hGzb9rdaS79JZnwsGOIFn5+cOChw=; b=Y+0mXGbfURStD8vYUyVAYGzZqfF3i4g86x7uwlkft1MB21Gmb5XTffNeoGAd5riu51 Cn+1+LUzMJJ8DsT3j/CeuMlAABxHFDOtGMCcSspmgsKT3Jxh6YIHvCFf+Zyr68Po0rDB 3nFoVSkXr2qXzJxn5w5RYP6tVlLd2uwup05q+hGq/OCNMa4Y++WUHFa+6KoLr+yG1b4/ 5obPgEGGRBQBCkXxuTnQ6HRf27dokxT2/Xxim5wT+h56FKbyiS9hLwgQ73o2rRd6S7Bu bnIc/X2cssAtvLXz+WSRkpso3/Ug/ow6tmI1Hvqr/jd3rxonRzIpP1P93ulBdo6V9Ar7 18vQ== 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=ukr5BkcEgVUFkv8hGzb9rdaS79JZnwsGOIFn5+cOChw=; b=rnzK2B+e0SNqbnE/WQ2QpkRyeBHyINzHBRjfGuhchPitA07zRgYiA5Iel6mjdwqV+5 +ugFQSCdvsDEAAH1MNxOqfUY5hx8Eueq8LniG0cwJ3KdN8L7M35fygxO705sEYuYW311 D8SjdaCebNAI9XeggVXDdoQP3rLMR0JPGNR9KyBttmXCSlvD769AZXWBZxrS5jBk+3pi Wbuw0nxlImtFgoEjYmMvHMh6PvXHltG1lLX/FFiy5LmxfpbvgVP7a6f+ItPJ2EVsrfKf bHhSObOfWztWdnSE2YB9B424bUzxJ1ZVeukfNYsp8OyNOQxsELvdrPVoZTHAiKtD51fK 0iKw== X-Gm-Message-State: APjAAAX5Vczs9zv4xh/m5xtHkkVNSfV+PwueqMj0amqfKrxYbbUJ//Cu BksGkrK8EEjZ4zMHrKCtugQBVbiok7c= X-Google-Smtp-Source: APXvYqxscMO4wYi3orhQJDG6kjwQVA5PzEY2kSroh7ZpE/p/+asmprMB8TomjrBhU1tiUz/s0dIAGQ== X-Received: by 2002:aca:f007:: with SMTP id o7mr2375452oih.59.1557828087722; Tue, 14 May 2019 03:01:27 -0700 (PDT) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Tue, 14 May 2019 12:01:26 +0200 Message-Id: <20190514100126.9830-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.30]); Tue, 14 May 2019 10:01:28 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 14 May 2019 10:01:28 +0000 (UTC) for IP:'209.85.167.196' DOMAIN:'mail-oi1-f196.google.com' HELO:'mail-oi1-f196.google.com' FROM:'paolo.bonzini@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.008 (DKIM_SIGNED, DKIM_VALID, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS) 209.85.167.196 mail-oi1-f196.google.com 209.85.167.196 mail-oi1-f196.google.com X-RedHat-Possible-Forgery: Paolo Bonzini X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH] email: tweak rules for including the original sender as a recipient 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Tue, 14 May 2019 10:01:57 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" If the To field is empty, always include the sender as a recipient. Signed-off-by: Paolo Bonzini --- mods/email.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mods/email.py b/mods/email.py index 4d71c9f..3ac1265 100644 --- a/mods/email.py +++ b/mods/email.py @@ -63,7 +63,7 @@ Email information is configured in "INI" style: desc=3D"Whether this event is enable= d", default=3DTrue), BooleanSchema("reply_to_all", "Reply to all", - desc=3D'Whether to "reply to all" if= the event has an associated email message', + desc=3D'If set, Cc all the receipien= ts of the email message associated to the event. Also, if set the original = sender of the email message will be a recipient even if the "to" field is n= onempty', default=3DFalse), BooleanSchema("in_reply_to", "Set In-Reply-To", desc=3D'Whether to set In-Reply-To t= o the message id, if the event has an associated email message', @@ -228,9 +228,11 @@ Email information is configured in "INI" style: cc =3D [x.strip() for x in Template(nt["cc"]).render(ctx).= strip().split()] except EmailCancelled: continue - if nt["reply_to_all"] and mo: - to +=3D [mo.get_sender_addr()] - cc +=3D [x[1] for x in mo.recipients] + if mo: + if nt["reply_to_all"] or not len(to): + to +=3D [mo.get_sender_addr()] + if nt["reply_to_all"]: + cc +=3D [x[1] for x in mo.recipients] if mo and nt["in_reply_to"]: headers["In-Reply-To"] =3D "<%s>" % mo.message_id if mo and nt["set_reply_to"]: --=20 2.21.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel