From 3b12d553352ded4a3eab96764e799ce6a383a046 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 27 Oct 2018 10:54:54 -0700 Subject: notmuch-slurp-debbug: skip messages without a Message-Id Signed-off-by: Sean Whitton --- debian/changelog | 7 +++++++ mailscripts.el | 2 +- notmuch-slurp-debbug | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 94a6218..6e301fe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +mailscripts (0.4-1) UNRELEASED; urgency=medium + + * Do not import messages without a Message-Id header (Closes: #909835). + Thanks to David Bremner for the report. + + -- Sean Whitton Sat, 27 Oct 2018 10:52:46 -0700 + mailscripts (0.3-1) unstable; urgency=medium * Add "Package-Requires: (notmuch)" (Closes: #909376). diff --git a/mailscripts.el b/mailscripts.el index 68a59ad..249cb42 100644 --- a/mailscripts.el +++ b/mailscripts.el @@ -1,7 +1,7 @@ ;;; mailscripts.el --- functions to access tools in the mailscripts package ;; Author: Sean Whitton -;; Version: 0.3 +;; Version: 0.4 ;; Package-Requires: (notmuch) ;; Copyright (C) 2018 Sean Whitton diff --git a/notmuch-slurp-debbug b/notmuch-slurp-debbug index 226a095..d289e31 100755 --- a/notmuch-slurp-debbug +++ b/notmuch-slurp-debbug @@ -89,6 +89,9 @@ system("mbox2maildir $mbox $dir") == 0 foreach my $message (glob "$dir/*/*") { my $message_head = MIME::Head->from_file($message); my $mid = $message_head->get('Message-ID'); + # if this message does not have a message-id, do not import it; + # that is asking for trouble + next unless defined $mid; $mid =~ s/(<|>)//g; my $match = `notmuch search id:$mid`; my $match_lines = $match =~ tr/\n//; -- cgit v1.2.3