From nobody Fri Apr 19 06:58:14 2024 Delivered-To: importer2@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=patchew-devel-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1648136138; cv=none; d=zohomail.com; s=zohoarc; b=KxO6Nuf+vDsnu3anHrCtvdxc5vuZCfnF9TcONAlc40BtWBjfxrOiFIVQdFNxAj2ZyL8hI5bttIlqydYjg+Ap9IvKvnZ1BrgMEmvoJbdt+o03vyD/cTBGlTvLpn/eiwwn3p9q8x6oUiuwU0XhlVR5HXHHnMTjMEIK0MOXWN7u+Kc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1648136138; 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; bh=nb6Bz7KbgRQj5M4iE2k3KZzt2hgntlNKo2gC6S6jfQQ=; b=QXcjVZeWMCuU+utCKbpBgnTKCRV/SfwB5jW559SBq/I9fkDhxRzSpsnSg8W152F5acvbTQw3c7tWSeM+VXOjPYQmIgAVQZw2QFNywVuHu33E174eiQ+9fGr5lev9mHc1bWtr6zcUitgf81TZsF0bEJhBlggDhl3OvHxuDh3NELA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1648136138810198.74670165401096; Thu, 24 Mar 2022 08:35:38 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-586-tYsunTqYPkilAGIP8Rv0EQ-1; Thu, 24 Mar 2022 11:35:34 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E9508811E76; Thu, 24 Mar 2022 15:35:33 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E21C4140262B; Thu, 24 Mar 2022 15:35:33 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A6B1B194034E; Thu, 24 Mar 2022 15:35:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8459F194034B for ; Thu, 24 Mar 2022 15:35:32 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 7431340F692; Thu, 24 Mar 2022 15:35:32 +0000 (UTC) Received: from avogadro.lan (unknown [10.39.195.210]) by smtp.corp.redhat.com (Postfix) with ESMTP id 07A1E434825 for ; Thu, 24 Mar 2022 15:35:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648136137; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=nb6Bz7KbgRQj5M4iE2k3KZzt2hgntlNKo2gC6S6jfQQ=; b=fzMnJs8z0VHaJMhb7CW+PuO7xm8T0TR+3NQMqT87a1CZoRCtDWzGCRqrUgG5hRtR5DDiEY IzocU+poKvqLlozGU6BkoZwtxy91zb9qY+T4fxfsjaOpkDSwHzcGT1D4VD8hGk3DKEvdVj AeWIiTQMnhqQnQkls76umxK/FHSrZ1I= X-MC-Unique: tYsunTqYPkilAGIP8Rv0EQ-1 X-Original-To: patchew-devel@listman.corp.redhat.com From: Paolo Bonzini To: patchew-devel@redhat.com Date: Thu, 24 Mar 2022 16:35:31 +0100 Message-Id: <20220324153531.187779-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Subject: [Patchew-devel] [PATCH] mbox: fall back to References header if In-Reply-To is missing X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchew-devel-bounces@redhat.com Sender: "Patchew-devel" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=patchew-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1648136140247100003 Content-Type: text/plain; charset="utf-8" Observed at https://patchew.org/linux/20220324134548.432837672@linutronix.d= e/. Signed-off-by: Paolo Bonzini --- mbox.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mbox.py b/mbox.py index 29a7570..8466f00 100644 --- a/mbox.py +++ b/mbox.py @@ -142,7 +142,12 @@ class MboxMessage(object): return msgid =20 def get_in_reply_to(self): - return self.trim_message_id(self._m["in-reply-to"]) + msgid =3D self._m["in-reply-to"] + if not msgid: + refs =3D self._m["references"] + if refs: + msgid =3D refs.split()[0] + return self.trim_message_id(msgid) =20 def get_date(self, timestamp=3DFalse): tup =3D email.utils.parsedate_tz(self._m["date"]) --=20 2.35.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://listman.redhat.com/mailman/listinfo/patchew-devel