[Patch v2 06/17] test: add broken roundtrip test
[notmuch-archives.git] / ee / 028d2359b4eba1b4cfe13515be96ed8b56a8a5
1 Return-Path: <too@guru-group.fi>\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 82D99431FAF\r
6         for <notmuch@notmuchmail.org>; Fri, 24 Aug 2012 10:29:17 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id QBlD78mAEhpy for <notmuch@notmuchmail.org>;\r
16         Fri, 24 Aug 2012 10:29:15 -0700 (PDT)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id 30E55431FAE\r
19         for <notmuch@notmuchmail.org>; Fri, 24 Aug 2012 10:29:15 -0700 (PDT)\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)\r
21         id 75BEE100386; Fri, 24 Aug 2012 20:29:23 +0300 (EEST)\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>\r
23 To: notmuch@notmuchmail.org\r
24 Subject: [PATCH] contrib/nmbug/nmbug-status: if realname empty,\r
25         use part of mailaddr\r
26 Date: Fri, 24 Aug 2012 20:29:21 +0300\r
27 Message-Id: <1345829361-29851-1-git-send-email-tomi.ollila@iki.fi>\r
28 X-Mailer: git-send-email 1.7.1\r
29 Cc: Tomi Ollila <tomi.ollila@iki.fi>\r
30 X-BeenThere: notmuch@notmuchmail.org\r
31 X-Mailman-Version: 2.1.13\r
32 Precedence: list\r
33 List-Id: "Use and development of the notmuch mail system."\r
34         <notmuch.notmuchmail.org>\r
35 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
36         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
37 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
38 List-Post: <mailto:notmuch@notmuchmail.org>\r
39 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
40 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
41         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
42 X-List-Received-Date: Fri, 24 Aug 2012 17:29:17 -0000\r
43 \r
44 When the From: field in patch email does not contain 'realname'\r
45 field, the patch listing does not show anything as patch sender.\r
46 In this case use the part before '@' in mail address as the sender\r
47 identification in patch listing.\r
48 ---\r
49  contrib/nmbug/nmbug-status |    4 +++-\r
50  1 files changed, 3 insertions(+), 1 deletions(-)\r
51 \r
52 diff --git a/contrib/nmbug/nmbug-status b/contrib/nmbug/nmbug-status\r
53 index f37ee84..9a334cc 100755\r
54 --- a/contrib/nmbug/nmbug-status\r
55 +++ b/contrib/nmbug/nmbug-status\r
56 @@ -90,7 +90,9 @@ def print_view(title, query, comment):\r
57                  val = str.join(' ', val.split(None)[1:4])\r
58                  val = str(datetime.datetime.strptime(val, '%d %b %Y').date())\r
59              elif header == 'from':\r
60 -                val = rfc822.parseaddr(val)[0]\r
61 +                (val, addr) = rfc822.parseaddr(val)\r
62 +                if val == '':\r
63 +                    val = addr.split('@')[0]\r
64  \r
65              if last[header] == val:\r
66                  out[header] = ''\r
67 -- \r
68 1.7.1\r
69 \r