Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id A3838431FB6 for ; Thu, 10 Feb 2011 22:55:34 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.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 olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q1YfmpmgZuvD for ; Thu, 10 Feb 2011 22:55:33 -0800 (PST) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id 8E26A431FB5 for ; Thu, 10 Feb 2011 22:55:33 -0800 (PST) Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id 90A7A19F338E; Fri, 11 Feb 2011 07:55:31 +0100 (CET) X-Virus-Scanned: IMAP AMAVIS Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new, port 10044) with ESMTP id jrJo1U5ol0zq; Fri, 11 Feb 2011 07:55:30 +0100 (CET) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id 58FAC19F3396; Fri, 11 Feb 2011 07:55:30 +0100 (CET) Received: from steelpick.2x.cz (note-sojka.felk.cvut.cz [147.32.86.30]) (Authenticated sender: sojkam1) by imap.feld.cvut.cz (Postfix) with ESMTPSA id 4F3A5FA005; Fri, 11 Feb 2011 07:55:29 +0100 (CET) Received: from wsh by steelpick.2x.cz with local (Exim 4.72) (envelope-from ) id 1Pnmuf-0007LO-P7; Fri, 11 Feb 2011 07:55:29 +0100 From: Michal Sojka To: Jesse Rosenthal , notmuch@notmuchmail.org Subject: Re: Remote usage script updated In-Reply-To: References: <87oc72xs35.fsf@lucky.home> <87aaibylqe.fsf@steelpick.2x.cz> <87tygiowyi.fsf@wsheee.2x.cz> User-Agent: Notmuch/0.5-103-g1253785 (http://notmuchmail.org) Emacs/23.2.1 (x86_64-pc-linux-gnu) Date: Fri, 11 Feb 2011 07:55:29 +0100 Message-ID: <877hd712n2.fsf@steelpick.2x.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Fri, 11 Feb 2011 06:55:35 -0000 On Wed, 09 Feb 2011, Jesse Rosenthal wrote: > By the way, I've also realized that most attachment downloading is done > not by "--format=raw" but by "notmuch part". It's possible to do caching > there as well. There are a few options there: > > * One option would be to just cache by the attachment number -- but > this is very fragile if you delete an attachment through mutt or > some other client that allows it. This is obviously the simplest possibility. I do not know how often do you (and others) delete attachments, but I do it rarely and usually I delete all the attachments of the messages older than something. So this would work for me. Additionally, I have added the following command to the attachment fetching code: find ${CACHE} -ctime +$CACHE_MAX_DAYS -and -mtime +$CACHE_MAX_DAYS -print0 | xargs -r -0 rm -f It deletes attachments older than one week (in my case) so it there is some inconsistency, it would not last more than one week. > * cache by the hash of the attachment. The idea is that asking the > server to fetch it, hash it, and send the hash would still save > time over sending the whole attachment. Probably -- though most > attachments are small enough and most connections are fast enough > that this might not actually matter. If people do more weird things with their attachments, this is probably the best solution. > * Actually stick the attachment hash in the json output in the first > place. But this would be a lot of trouble for a small gain for > very few. Agreed. -Michal