From 262da1f2784856f7b40756e76caf1db6cab27aee Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Fri, 7 Mar 2014 13:53:44 +0200 Subject: [PATCH] Re: [PATCH] notmuch new: add a --in-directory option --- 7d/55bc2b8a2cd300153076dc5f8744e608180eb9 | 108 ++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 7d/55bc2b8a2cd300153076dc5f8744e608180eb9 diff --git a/7d/55bc2b8a2cd300153076dc5f8744e608180eb9 b/7d/55bc2b8a2cd300153076dc5f8744e608180eb9 new file mode 100644 index 000000000..1a9be4d1f --- /dev/null +++ b/7d/55bc2b8a2cd300153076dc5f8744e608180eb9 @@ -0,0 +1,108 @@ +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 03910431FB6 + for ; Fri, 7 Mar 2014 03:54:04 -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 QivQH+Haajgk for ; + Fri, 7 Mar 2014 03:53:52 -0800 (PST) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 9D456431FAE + for ; Fri, 7 Mar 2014 03:53:52 -0800 (PST) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id C6A0410008F; + Fri, 7 Mar 2014 13:53:44 +0200 (EET) +From: Tomi Ollila +To: Adam Wolfe Gordon , Austin Clements +Subject: Re: [PATCH] notmuch new: add a --in-directory option +In-Reply-To: + +References: <1394139507-15324-1-git-send-email-markwalters1009@gmail.com> + <20140306210622.GI4709@mit.edu> + +User-Agent: Notmuch/0.17+112~g4e0c1d5 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +Cc: Notmuch Mail +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, 07 Mar 2014 11:54:04 -0000 + +On Thu, Mar 06 2014, Adam Wolfe Gordon wrote: + +> On Thu, Mar 6, 2014 at 2:06 PM, Austin Clements wrote: +>> That aside, I'm curious what the use case for this is. + +I am also interested... How are mails delivered so that +--in-directory=folder is useful + +> +> My usecase for this is the same as for the similar patch I worked on +> previously (id:1373762746-22308-1-git-send-email-awg+notmuch@xvx.ca): + +... as this is (much more) interesting to me too ... + + +> I use inotify to watch for new messages in my maildir. When I receive +> a new message, I run notmuch new (after waiting a couple of seconds +> since messages sometimes arrive in batches). But since I already know +> exactly what changed, there's no need for notmuch new to scan the +> whole directory tree. I'm not sure whether this patch lets me specify +> a file, or only a directory: the former would be preferable for my +> usecase, but either way it's probably an enhancement for me. + +my mails are delivered by +https://github.com/domo141/nottoomuch/blob/master/md5mda.sh +to ~/mail/received/??/?????????????????????????????? +and log to the deliveries are kept: + +$ echo; tail -5 mail/log/md5mda-201403.log + +2014-03-07 (Fri) 11:58:37: Added 'received/a8/5bb1949aa85bb84287499555dabb00' +2014-03-07 (Fri) 12:33:57: Added 'received/34/b786dabccc980b3b651e85f3d7fd48' +2014-03-07 (Fri) 12:35:01: Added 'received/c0/e89f83383d066cc922512dc5eddb5d' +2014-03-07 (Fri) 13:04:32: Added 'received/f5/ff8b132d3c4f8ca63215d8de41de9c' +2014-03-07 (Fri) 13:25:00: Added 'received/9a/848dd40274fe5b6d6bcbad80b2e7fd' + +>From that information I could launch notmuch new [files...] +(or notmuch new --batch !) to index all files since last attempt(*) + + +Tomi + + +(*) routine would be: + 1) get size of last log file (for final stored offset) + 2) read the info of last read log file and offset + 3) feed the filenames between these 2 offsets. + 4) update the final stored offset + 5) check whether the size (or name) of the last log + file has changed and if had, go step 2 + +> -- Adam + +Tomi -- 2.26.2