From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id mMQiDHa3fGCVxgAAgWs5BA (envelope-from ) for ; Mon, 19 Apr 2021 00:49:26 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id WFfMBna3fGC0IwAA1q6Kng (envelope-from ) for ; Sun, 18 Apr 2021 22:49:26 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CD1741CF78 for ; Mon, 19 Apr 2021 00:49:25 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id CC66427198; Sun, 18 Apr 2021 18:49:07 -0400 (EDT) Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) by mail.notmuchmail.org (Postfix) with ESMTPS id 90D8E27183 for ; Sun, 18 Apr 2021 18:49:02 -0400 (EDT) Received: by mail-ot1-x32b.google.com with SMTP id e89-20020a9d01e20000b0290294134181aeso5132605ote.5 for ; Sun, 18 Apr 2021 15:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AzVFrPf8HsMRDp+AMUNRVjj3Hesle5/D4T23lijADks=; b=ZJkJQxxg/wnfqsuoXptlziH1zhqrMUaWZEC2XCPFDyW0cd4RLe/NAOUoL4yYsTN456 UwgE3ynL2gtiJPfk9ccW0y4+h0U4Yk7Ftz/iLAabQE+e4LguZkGf9dGfhY6cRO5U227o PbuKYFFvZFcs3r5Eny/nUmwIo0blK/n4zVKy4Jdcc/bwefnWgyWtH62HH5bBzVh7bYNG WB+dto8PblaQfsPKKnGoL25kZOGFz2uKTFzTXPo3/EflGcfH4bv/Snd7Uorfm15r+QZp IJN9Z7j+2HDSrnAL0vsm+4ZqxY8oZxjHZIuAndghp5XFM+16wGdpEd3IiPKGmypw2FE9 XKvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AzVFrPf8HsMRDp+AMUNRVjj3Hesle5/D4T23lijADks=; b=MCeEWcLWYxTx9tLgCgJ5ucGmjGWePNUR91qmSz+2771/ukPDpsb9SlfsIOdu5wifFt pkr1lWpNIsCvLUCta5j4Uj17ejyV9zDMQpk/NzZnbbe3UN7uliSd4aKrtBba3R2B6RGF QQnKhLCFxXoIqU9zuQbtSesM28CFDonLnWULLcFZoQtQh3BqgvUINcE3bQkHbHgVvHRq PvZ9v2zaf/R47rPO2OIqppOQZUNvm9gutlaXoaGTpbQ+XCLgcO41PJ9vjHYX1RR5+LNC EFdWTQginROE04xF9o7crXyw05SA/9Gv5ts0GyD7trbp6zMSFQBz5s8eF03MbDdiqvl6 rMOA== X-Gm-Message-State: AOAM5313OVnStqUXQ9MfMq1i0DfIeBjovm18Ebe3l9zD1FBMwiZpTq2j blk+PrW07dJ0wsFFp7UGEMeLTJzo26flEQ== X-Google-Smtp-Source: ABdhPJzb2XIk5400/iDQGUeHAIVKlfMeX4uI5G29qweo291JJOUde+xCq/ZM9lccFBH4eGoI1wddtw== X-Received: by 2002:a05:6830:1398:: with SMTP id d24mr12813715otq.281.1618786141067; Sun, 18 Apr 2021 15:49:01 -0700 (PDT) Received: from localhost ([2806:2f0:4000:bfd0:a2c5:89ff:fe0c:1151]) by smtp.gmail.com with ESMTPSA id q23sm3134000ots.80.2021.04.18.15.49.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Apr 2021 15:49:00 -0700 (PDT) From: Felipe Contreras To: notmuch@notmuchmail.org Cc: Felipe Contreras Subject: [PATCH 04/13] vim: fix for missing parts Date: Sun, 18 Apr 2021 17:48:42 -0500 Message-Id: <20210418224851.88240-5-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210418224851.88240-1-felipe.contreras@gmail.com> References: <20210418224851.88240-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Message-ID-Hash: 6KOMJOZ2DCTWDWYWCI6FZ4BQDKHUSLZT X-Message-ID-Hash: 6KOMJOZ2DCTWDWYWCI6FZ4BQDKHUSLZT X-MailFrom: felipe.contreras@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1618786165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=ro8U0KTF1gmV6XHi0elA0/MKL41zQsmTcnOWHHVZW+U=; b=u0XtZ3CaP1KInHcRYclaJGShw1XwoYv3ODbfFkNCzlW/ND3Clkg89T1mUKR1TazccPpcYj dgmYsewnAXS+DlscajJ4rn1bsUJ+7JPFB46/f+JS91gGUO/4d2vwuhDRC/GWnKQPvfYQhB RVCtYpMKvtO18xG3zVyDmiYNmF6k+O04otrdjKUDUM/36dJzn7cNdFc50lIlOrOWcsvmbE ifuVqB00KO2XtY/7Y7tvz8W00iR/430W9wFuf1exzUhbr/WG0g1b8LHVvuqUbI4Z5GPwdU KEEqee3lVu67aPixi9LdfyWFM6boI4fyVAjvwTY/73htP/O6NJTlG/vEVQI0jg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618786165; a=rsa-sha256; cv=none; b=McAB4clFtEiO945xskF7b9TD0h/4fH5CqRxDPHyq+baOfkdW2Aljzi8J7YyvYnP/pHOuyi 6olZG636QgeTqWYRRMNFWTQ+2+ZUO+LZGPFMoCJl7k9Gc2UEqNhbOaVT9ucrCjexR2NOY5 2ViXsggP6jf2SMhXsFKH8a4UVX4TcI9qtYWhISno5wBxRpJTCyRjWGBSmF7iv9qib+LNc7 6ZiFFqRmCgwNYPWH+1FPay52ujpJYo6f0CS70LBa67MyCT1NMRYihi4Ym83B2wIO/hFs76 9tLyFSX1NHWm4bEPrPGoAKIuO9dZRi8P9NembnqfeshSK4W2aMtV/c8zNe9I5g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=ZJkJQxxg; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -0.96 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=ZJkJQxxg; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: CD1741CF78 X-Spam-Score: -0.96 X-Migadu-Scanner: scn0.migadu.com X-TUID: fZuT6/Oo4Vkc Sometimes Mail incorrectly parses multipart messages. See: https://github.com/mikel/mail/issues/1438 Check for empty parts instead of crashing. Signed-off-by: Felipe Contreras --- vim/notmuch.vim | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/vim/notmuch.vim b/vim/notmuch.vim index 541698cd..e2362a2d 100644 --- a/vim/notmuch.vim +++ b/vim/notmuch.vim @@ -332,9 +332,13 @@ ruby << EOF b << "Cc: %s" % msg['cc'] b << "Date: %s" % msg['date'] nm_m.body_start = b.count - b << "--- %s ---" % part.mime_type - part.convert.each_line do |l| - b << l.chomp + if part + b << "--- %s ---" % part.mime_type + part.convert.each_line do |l| + b << l.chomp + end + else + b << "--- %s ---" % 'missing' end b << "" nm_m.end = b.count -- 2.31.0