Re: [PATCH] lib: Save filenames for files detected as "not an email file" in the...
authorAustin Clements <amdragon@MIT.EDU>
Sat, 21 Jan 2012 23:49:19 +0000 (18:49 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:42:53 +0000 (09:42 -0800)
cd/cae9e9b90f3bf38fd286c1ee1d67ae7d9b68bf [new file with mode: 0644]

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