repair: set up codebase for repair functionality

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>
This commit is contained in:
Daniel Kahn Gillmor 2019-08-29 11:38:47 -04:00 committed by David Bremner
parent dcfa2fc996
commit 1b29822cf5
6 changed files with 53 additions and 0 deletions

View 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``.
**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
========

View file

@ -53,6 +53,7 @@ NOTMUCH_BEGIN_DECLS
#include "error_util.h"
#include "string-util.h"
#include "crypto.h"
#include "repair.h"
#ifdef DEBUG
# define DEBUG_DATABASE_SANITY 1

View file

@ -52,6 +52,7 @@
#include "talloc-extra.h"
#include "crypto.h"
#include "repair.h"
#define unused(x) x ## _unused __attribute__ ((unused))

View 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 \
$(dir)/repair.c \
$(dir)/unicode-util.c
libnotmuch_util_modules := $(libnotmuch_util_c_srcs:.c=.o)

21
util/repair.c Normal file
View file

@ -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"

17
util/repair.h Normal file
View file

@ -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