Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 14 / bd4ef9528e3f0186f7d1fe40de5eecbc192e4c
1 Return-Path: <jan.n.klug@rub.de>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 9F33B431FBD\r
6         for <notmuch@notmuchmail.org>; Mon, 26 Jan 2015 03:04:56 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.138\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.138 tagged_above=-999 required=5\r
12         tests=[DNS_FROM_AHBL_RHSBL=2.438, RCVD_IN_DNSWL_MED=-2.3]\r
13         autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id XP2464hS8gsN for <notmuch@notmuchmail.org>;\r
17         Mon, 26 Jan 2015 03:04:53 -0800 (PST)\r
18 Received: from mx4.rz.ruhr-uni-bochum.de (mi.ruhr-uni-bochum.de\r
19         [134.147.64.53])\r
20         by olra.theworths.org (Postfix) with SMTP id 19514431FAF\r
21         for <notmuch@notmuchmail.org>; Mon, 26 Jan 2015 03:04:52 -0800 (PST)\r
22 X-Queued: (qmail 9941 invoked by alias); 26 Jan 2015 11:04:52 -0000\r
23 X-RUB-Notes: Internal\r
24 X-Queued: (qmail 9878 invoked by uid 109); 26 Jan 2015 11:04:51 -0000\r
25 X-Qmailscanner: from 134.147.42.227 by mx4.rz.ruhr-uni-bochum.de\r
26         (envelope-from <jan.n.klug@rub.de>,\r
27         uid 103) with qmail-scanner-2.01 (clamdscan: 0.98.1/18526.  \r
28         Clear:RC:1(134.147.42.227):. \r
29         Processed in 0.0535 secs); 26 Jan 2015 11:04:51 -0000\r
30 Received: from mail1.mail.ruhr-uni-bochum.de (134.147.42.227)\r
31         by mx4.rz.ruhr-uni-bochum.de with SMTP; 26 Jan 2015 11:04:51 -0000\r
32 Received: from localhost (mobil-13.rubion.ruhr-uni-bochum.de [134.147.65.233])\r
33         by mail1.mail.ruhr-uni-bochum.de (Postfix) with ESMTPSA id 26923200D9\r
34         for <notmuch@notmuchmail.org>; Mon, 26 Jan 2015 12:04:50 +0100 (CET)\r
35 From: "Jan N. Klug" <jan.n.klug@rub.de>\r
36 To: notmuch@notmuchmail.org\r
37 Subject: [PATCH] Add support for missing Messsage-ID header\r
38 Date: Mon, 26 Jan 2015 12:04:48 +0100\r
39 Message-Id: <1422270288-6089-1-git-send-email-jan.n.klug@rub.de>\r
40 X-Mailer: git-send-email 2.1.4\r
41 X-Virus-Scanned: clamav-milter 0.98.5 at mail1.mail.ruhr-uni-bochum.de\r
42 X-Virus-Status: Clean\r
43 X-BeenThere: notmuch@notmuchmail.org\r
44 X-Mailman-Version: 2.1.13\r
45 Precedence: list\r
46 List-Id: "Use and development of the notmuch mail system."\r
47         <notmuch.notmuchmail.org>\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
51 List-Post: <mailto:notmuch@notmuchmail.org>\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
55 X-List-Received-Date: Mon, 26 Jan 2015 11:04:56 -0000\r
56 \r
57 ---\r
58  contrib/notmuch-mutt/notmuch-mutt | 14 +++++++++-----\r
59  1 file changed, 9 insertions(+), 5 deletions(-)\r
60 \r
61 diff --git a/contrib/notmuch-mutt/notmuch-mutt b/contrib/notmuch-mutt/notmuch-mutt\r
62 index 4969e4b..b9882fd 100755\r
63 --- a/contrib/notmuch-mutt/notmuch-mutt\r
64 +++ b/contrib/notmuch-mutt/notmuch-mutt\r
65 @@ -18,7 +18,7 @@ use Mail::Box::Maildir;\r
66  use Pod::Usage;\r
67  use String::ShellQuote;\r
68  use Term::ReadLine;\r
69 -\r
70 +use Digest::SHA qw (sha1_hex);\r
71  \r
72  my $xdg_cache_dir = "$ENV{HOME}/.cache";\r
73  $xdg_cache_dir = $ENV{XDG_CACHE_HOME} if $ENV{XDG_CACHE_HOME};\r
74 @@ -75,10 +75,14 @@ sub prompt($$) {\r
75  }\r
76  \r
77  sub get_message_id() {\r
78 -    my $mail = Mail::Internet->new(\*STDIN);\r
79 -    my $mid = $mail->head->get("message-id") or return undef;\r
80 -    $mid =~ /^<(.*)>$/;        # get message-id value\r
81 -    return $1;\r
82 +    my $mail = Mail::Internet->new(\*STDIN, Modify => 0);\r
83 +    my $mid = $mail->head->get("message-id");\r
84 +    if (defined $mid) { # get message-id value\r
85 +      $mid = $1 if ($mid =~ /^<(.*)>$/);       \r
86 +    } else { # generate synthetic message-id\r
87 +      $mid = "notmuch-sha1-".sha1_hex($mail->as_string());\r
88 +    }\r
89 +    return $mid;\r
90  }\r
91  \r
92  sub search_action($$$@) {\r
93 -- \r
94 2.1.4\r
95 \r