]> git.notmuchmail.org Git - notmuch/commitdiff
repair: set up codebase for repair functionality
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Thu, 29 Aug 2019 15:38:47 +0000 (11:38 -0400)
committerDavid Bremner <david@tethera.net>
Sun, 1 Sep 2019 11:20:25 +0000 (08:20 -0300)
This adds no functionality directly, but is a useful starting point
for adding new repair functionality.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
doc/man7/notmuch-properties.rst
lib/notmuch-private.h
notmuch-client.h
util/Makefile.local
util/repair.c [new file with mode: 0644]
util/repair.h [new file with mode: 0644]

index 802e6763341e55db0699121a391e07262368e3a2..2e6106830c4c995f60160e65ac98d28cae78f8bc 100644 (file)
@@ -109,6 +109,18 @@ of its normal activity.
     example, an AES-128 key might be stashed in a notmuch property as:
     ``session-key=7:14B16AF65536C28AF209828DFE34C9E0``.
 
     example, an AES-128 key might be stashed in a notmuch property as:
     ``session-key=7:14B16AF65536C28AF209828DFE34C9E0``.
 
+**index.repaired**
+
+    Some messages arrive in forms that are confusing to view; they can
+    be mangled by mail transport agents, or the sending mail user
+    agent may structure them in a way that is confusing.  If notmuch
+    knows how to both detect and repair such a problematic message, it
+    will do so during indexing.
+
+    If it applies a message repair during indexing, it will use the
+    ``index.repaired`` property to note the type of repair(s) it
+    performed.
+
 SEE ALSO
 ========
 
 SEE ALSO
 ========
 
index 9bdb68ab167d63b478b5e1c9963b4d688071cd2e..28ced3a2b125a227a6d79f7abfdf90f6ecc925b4 100644 (file)
@@ -53,6 +53,7 @@ NOTMUCH_BEGIN_DECLS
 #include "error_util.h"
 #include "string-util.h"
 #include "crypto.h"
 #include "error_util.h"
 #include "string-util.h"
 #include "crypto.h"
+#include "repair.h"
 
 #ifdef DEBUG
 # define DEBUG_DATABASE_SANITY 1
 
 #ifdef DEBUG
 # define DEBUG_DATABASE_SANITY 1
index d1b7801784f40850fe419b8a374b161694236e74..74690054d161ad9b2da297eac21ed62fdc8eb2cd 100644 (file)
@@ -52,6 +52,7 @@
 
 #include "talloc-extra.h"
 #include "crypto.h"
 
 #include "talloc-extra.h"
 #include "crypto.h"
+#include "repair.h"
 
 #define unused(x) x ## _unused __attribute__ ((unused))
 
 
 #define unused(x) x ## _unused __attribute__ ((unused))
 
index 46f8af3a1c8e321207c14748548056e6f5509baf..f5d72f79376c2ed9133cc2bd04542f3c0f099841 100644 (file)
@@ -6,6 +6,7 @@ extra_cflags += -I$(srcdir)/$(dir)
 libnotmuch_util_c_srcs := $(dir)/xutil.c $(dir)/error_util.c $(dir)/hex-escape.c \
                  $(dir)/string-util.c $(dir)/talloc-extra.c $(dir)/zlib-extra.c \
                $(dir)/util.c $(dir)/gmime-extra.c $(dir)/crypto.c \
 libnotmuch_util_c_srcs := $(dir)/xutil.c $(dir)/error_util.c $(dir)/hex-escape.c \
                  $(dir)/string-util.c $(dir)/talloc-extra.c $(dir)/zlib-extra.c \
                $(dir)/util.c $(dir)/gmime-extra.c $(dir)/crypto.c \
+               $(dir)/repair.c \
                $(dir)/unicode-util.c
 
 libnotmuch_util_modules := $(libnotmuch_util_c_srcs:.c=.o)
                $(dir)/unicode-util.c
 
 libnotmuch_util_modules := $(libnotmuch_util_c_srcs:.c=.o)
diff --git a/util/repair.c b/util/repair.c
new file mode 100644 (file)
index 0000000..f91c124
--- /dev/null
@@ -0,0 +1,21 @@
+/* notmuch - Not much of an email program, (just index and search)
+ *
+ * Copyright © 2019 Daniel Kahn Gillmor
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see https://www.gnu.org/licenses/ .
+ *
+ * Authors: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
+ */
+
+#include "repair.h"
diff --git a/util/repair.h b/util/repair.h
new file mode 100644 (file)
index 0000000..70e2b7b
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef _REPAIR_H
+#define _REPAIR_H
+
+#include "gmime-extra.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* This is a collection of message structure and message format repair
+ * techniques that are designed to improve the user experience of
+ * notmuch */
+
+#ifdef __cplusplus
+}
+#endif
+#endif