Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / ff / 0197d9c02e9fa6e50eb8561a227430b3897be4
1 Return-Path: <ketil@malde.org>\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 arlo.cworth.org (Postfix) with ESMTP id D2B1E6DE0B25\r
6  for <notmuch@notmuchmail.org>; Mon, 14 Sep 2015 05:25:52 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.001\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.001 tagged_above=-999 required=5\r
12  tests=[SPF_HELO_PASS=-0.001] autolearn=disabled\r
13 Received: from arlo.cworth.org ([127.0.0.1])\r
14  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
15  with ESMTP id 1EhOafEO-ZQd for <notmuch@notmuchmail.org>;\r
16  Mon, 14 Sep 2015 05:25:50 -0700 (PDT)\r
17 X-Greylist: delayed 451 seconds by postgrey-1.35 at arlo;\r
18  Mon, 14 Sep 2015 05:25:50 PDT\r
19 Received: from engen.priv.no (engen.priv.no [64.22.125.231])\r
20  by arlo.cworth.org (Postfix) with ESMTP id B85AF6DE0A4A\r
21  for <notmuch@notmuchmail.org>; Mon, 14 Sep 2015 05:25:50 -0700 (PDT)\r
22 Received: from localhost (localhost [127.0.0.1])\r
23  by engen.priv.no (Postfix) with ESMTP id 50A3B13292\r
24  for <notmuch@notmuchmail.org>; Mon, 14 Sep 2015 14:18:16 +0200 (CEST)\r
25 X-Virus-Scanned: Debian amavisd-new at engen.priv.no\r
26 Received: from engen.priv.no ([127.0.0.1])\r
27  by localhost (vegard.engen.priv.no [127.0.0.1]) (amavisd-new, port 10024)\r
28  with ESMTP id O5wmUXj9iriC for <notmuch@notmuchmail.org>;\r
29  Mon, 14 Sep 2015 14:18:16 +0200 (CEST)\r
30 Received: from wespe.malde.org (localhost [127.0.0.1])\r
31  by engen.priv.no (Postfix) with ESMTPSA id B03A613290\r
32  for <notmuch@notmuchmail.org>; Mon, 14 Sep 2015 14:18:15 +0200 (CEST)\r
33 From: Ketil Malde <ketil@malde.org>\r
34 To: notmuch@notmuchmail.org\r
35 Subject: bug: notmuch-poll doesn't check return value\r
36 User-Agent: Notmuch/0.20.1 (http://notmuchmail.org) Emacs/24.5.1\r
37  (x86_64-pc-linux-gnu)\r
38 Date: Mon, 14 Sep 2015 14:18:14 +0200\r
39 Message-ID: <87bnd5qjnd.fsf@wespe.malde.org>\r
40 MIME-Version: 1.0\r
41 Content-Type: text/plain\r
42 X-Mailman-Approved-At: Mon, 14 Sep 2015 09:02:42 -0700\r
43 X-BeenThere: notmuch@notmuchmail.org\r
44 X-Mailman-Version: 2.1.18\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, 14 Sep 2015 12:25:52 -0000\r
56 \r
57 \r
58 Hi,\r
59 \r
60 I've been stumped occasionally when new mail fails to appear in notmuch,\r
61 and then I suddenly discover it by some other means (web front end,\r
62 mobile, etc).\r
63 \r
64 The problem is that notmuch-poll fails silently when it fails, which is\r
65 usually due to broken symlinks in my mail directories, or some IMAP\r
66 configuration mistake.  Easy to fix when you know about it.\r
67 \r
68 I've, uh, "fixed" this by redefining notmuch-poll like so:\r
69 \r
70 ---8<-------------------------------------\r
71 ;;; Make notmuch-poll fail gracelessly when something goes wrong\r
72 ;;; Better than failing silently, in ancy case.\r
73 (defun notmuch-poll ()\r
74   "Run \"notmuch new\" or an external script to import mail.\r
75 \r
76 Invokes `notmuch-poll-script', \"notmuch new\", or does nothing\r
77 depending on the value of `notmuch-poll-script'."\r
78   (interactive)\r
79   (if (not (equal 0\r
80                   (if (stringp notmuch-poll-script)\r
81                       (unless (string= notmuch-poll-script "")\r
82                         (call-process notmuch-poll-script nil nil))\r
83                     (call-process notmuch-command nil nil nil "new"))))\r
84      (error "Notmuch: poll failed!")))\r
85 ---8<-------------------------------------\r
86 \r
87 Surely, somebody who knows lisp can do something far more elegant than\r
88 this, but the point is to bug out when something doesn't work.\r
89 \r
90 In addtion, I had to fix my notmuch-poll-script, which contains\r
91 'offlineimap', then 'notmuch new', followed by some tagging commands.\r
92 As the tagging commands tend to work even if 'new' doesn't, this will\r
93 often (pretend to) exit successfully.  A 'set -e' at the top of the\r
94 script is probably a good idea, and should probably be mentioned in\r
95 documentation somewhere.\r
96 \r
97 -k\r
98 -- \r
99 If I haven't seen further, it is by standing in the footprints of giants\r