From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 60FDE6DE00F5 for ; Thu, 14 Jul 2016 09:22:14 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yRgyJLHV0jL3 for ; Thu, 14 Jul 2016 09:22:05 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTP id CC8A36DE00C9 for ; Thu, 14 Jul 2016 09:22:05 -0700 (PDT) Received: from fifthhorseman.net (pD95765AE.dip0.t-ipconnect.de [217.87.101.174]) by che.mayfirst.org (Postfix) with ESMTPSA id 8A17DF98B; Thu, 14 Jul 2016 12:22:03 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id 3D9CC20111; Thu, 14 Jul 2016 18:22:02 +0200 (CEST) From: Daniel Kahn Gillmor To: David Bremner , Notmuch Mail Subject: Re: [PATCH v4 09/16] index encrypted parts when asked. In-Reply-To: <87lh14e2x8.fsf@tesseract.cs.unb.ca> References: <1467970047-8013-1-git-send-email-dkg@fifthhorseman.net> <1467970047-8013-10-git-send-email-dkg@fifthhorseman.net> <87lh14e2x8.fsf@tesseract.cs.unb.ca> User-Agent: Notmuch/0.22+77~gaba8744 (https://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Thu, 14 Jul 2016 18:22:01 +0200 Message-ID: <8737ncmbpy.fsf@alice.fifthhorseman.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2016 16:22:14 -0000 On Thu 2016-07-14 15:59:15 +0200, David Bremner wrote: > Daniel Kahn Gillmor writes: > >> + status = _notmuch_crypto_get_gmime_ctx_for_protocol (&(indexopts->crypto), >> + protocol, &crypto_ctx); >> + if (status) { >> + _notmuch_database_log (notmuch, "Warning: setup failed for decrypting " >> + "during indexing. (%d)\n", status); >> + status = notmuch_message_add_property (message, "index-decryption", "failure"); >> + if (status) >> + _notmuch_database_log (notmuch, "failed to add index-decryption " >> + "property (%d)\n", status); >> + return; >> + } > > Currently the only correct usage of _notmuch_database_log is the > following pattern > > _notmuch_database_log (notmuch, "Cannot write to a read-only database.\n"); > return NOTMUCH_STATUS_READ_ONLY_DATABASE; > > In particular, the log buffer is only one line, and the caller needs to > know to retrieve it. > > I agree it's not ideal, but I doubt you want to delay your stuff in > order to extend/fix the internal logging API. I understand that the internal log is currently only a single line, but following the usage pattern you describe isn't useful for this case. What is your suggested fix? a given message could have multiple parts, some of which are decryptable and others of which are not. It makes no sense to stop indexing a message just because one of the parts failed to decrypt, so i'm not going to immediately return. I'm willing to accept that only the last log message will make it out to the caller, and i could track whether anything has been written to the log and change the return value in that case. would that be acceptable? --dkg