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 4B422429E40 for ; Sat, 21 Jan 2012 15:49:46 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 nSa-iE1QiQEb for ; Sat, 21 Jan 2012 15:49:45 -0800 (PST) Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU [18.7.68.34]) by olra.theworths.org (Postfix) with ESMTP id BC803431FAF for ; Sat, 21 Jan 2012 15:49:45 -0800 (PST) X-AuditID: 12074422-b7fd66d0000008f9-ee-4f1b4f19d6b2 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP id 6B.CE.02297.91F4B1F4; Sat, 21 Jan 2012 18:49:45 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q0LNniZ0024885; Sat, 21 Jan 2012 18:49:45 -0500 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q0LNnheB014922 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sat, 21 Jan 2012 18:49:44 -0500 (EST) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1RokgR-00006F-A2; Sat, 21 Jan 2012 18:49:19 -0500 Date: Sat, 21 Jan 2012 18:49:19 -0500 From: Austin Clements To: Jani Nikula Subject: Re: [PATCH] lib: Save filenames for files detected as "not an email file" in the database. Message-ID: <20120121234919.GM16740@mit.edu> References: <1327096827-5760-1-git-send-email-amdragon@mit.edu> <87lip0acfy.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87lip0acfy.fsf@nikula.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrPIsWRmVeSWpSXmKPExsUixG6noivpL+1vMLeHz6JpurPF9ZszmR2Y PG7df83u8WzVLeYApigum5TUnMyy1CJ9uwSujJUPDzIXbOKt+PB8L2MD42muLkZODgkBE4nt j/6yQ9hiEhfurWcDsYUE9jFKfJib08XIBWRvYJRYdeMvI4Rzkkli9aRORoiqJYwSF5d6gNgs AqoSzy9+ZwWx2QQ0JLbtXw5WIyKgKLH55H4wm1lAWuLb72YmEFtYIFVi4bZGMJtXQEeiad9a li5GDqCZsRLHzuVBhAUlTs58wgLRqiVx499LJpASkDHL/3GAmJxAmxbOTgapEBVQkZhychvb BEahWUiaZyFpnoXQvICReRWjbEpulW5uYmZOcWqybnFyYl5eapGuqV5uZoleakrpJkZwOLso 7WD8eVDpEKMAB6MSD2/CPkl/IdbEsuLK3EOMkhxMSqK8B72k/YX4kvJTKjMSizPii0pzUosP MUpwMCuJ8JZ1AZXzpiRWVqUW5cOkpDlYlMR51bXe+QkJpCeWpGanphakFsFkZTg4lCR4J/kB DRUsSk1PrUjLzClBSDNxcIIM5wEafgikhre4IDG3ODMdIn+KUVFKnHcaSEIAJJFRmgfXC0s3 rxjFgV4RhmjnAaYquO5XQIOZgAZz5EmBDC5JREhJNTDyn805usZUyMVfdXfEhJLQNtF1Pg6F FrvjrZ4n6Im4qDK5+3h5566Uu++77SPjsUkdretFp09RLLr/Kmzumh3/DJ+F1jN1mLQmsLnW b2F87iegybxA/pfwb0lP/4mTNN1iuy8ZRu3/zin5/PX8Dd03cq4skdh7oYrXR1NhlY6NaVDk lFMTmpVYijMSDbWYi4oTAW1Npo8SAwAA Cc: notmuch@notmuchmail.org 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: Sat, 21 Jan 2012 23:49:46 -0000 Quoth Jani Nikula on Jan 22 at 1:00 am: > On Fri, 20 Jan 2012 17:00:27 -0500, Austin Clements wrote: > > Later runs of "notmuch new" won't scan these files again and won't > > print warnings. > > > > Various programs (Dovecot, in my case) store indexes and caches and > > such in the maildir. Without this, notmuch persistently complains > > about such files. > > Overall, sounds good and doing this automagically is nice. Superficially > the code looks sensible, but I didn't really dig into it. A few nasty > questions instead: > > What happens if you delete a non-email file? Does the entry stay in the > database? Phooey. I thought this worked, but you're right that it doesn't (I even wrote a test for this, but the test was based on a false assumption). Non-email files do get returned by the directory iterator, so without any changes, notmuch new will notice that they're gone. What I missed is that it then uses notmuch_database_find_message_by_filename to find the "message" and remove the filename, which won't work since there's no message to find. I'll have to think about this more. > What happens if you replace a non-email file with an email file? It will not notice because notmuch new only inspects directory mtimes. This would require checking the mtimes of every non-email in the database on every notmuch new. > Does it matter what happens above? > > These are corner cases, but what remains in TODO suggests that it would > be difficult to debug and figure out if the above ever did happen to > someone. Yes. It's possible this needs to get a search syntax before it is acceptable for general use. > BR, > Jani.