|
a/src/utils/idfile.cpp |
|
b/src/utils/idfile.cpp |
|
... |
|
... |
28 |
|
28 |
|
29 |
#ifndef NO_NAMESPACES
|
29 |
#ifndef NO_NAMESPACES
|
30 |
using namespace std;
|
30 |
using namespace std;
|
31 |
#endif /* NO_NAMESPACES */
|
31 |
#endif /* NO_NAMESPACES */
|
32 |
|
32 |
|
|
|
33 |
// Bogus code to avoid bogus valgrind mt warnings about the
|
|
|
34 |
// initialization of treat_mbox_... which I can't even remember the
|
|
|
35 |
// use of (it's not documented or ever set)
|
|
|
36 |
static int treat_mbox_as_rfc822;
|
|
|
37 |
class InitTMAR {
|
|
|
38 |
public:
|
|
|
39 |
InitTMAR() {
|
|
|
40 |
treat_mbox_as_rfc822 = getenv("RECOLL_TREAT_MBOX_AS_RFC822") ? 1 : -1;
|
|
|
41 |
}
|
|
|
42 |
};
|
|
|
43 |
static InitTMAR initTM;
|
|
|
44 |
|
33 |
/**
|
45 |
/**
|
34 |
* This code is currently ONLY used to identify mbox and mail message files
|
46 |
* This code is currently ONLY used to identify mbox and mail message files
|
35 |
* which are badly handled by standard mime type identifiers
|
47 |
* which are badly handled by standard mime type identifiers
|
36 |
* There is a very old (circa 1990) mbox format using blocks of ^A (0x01) chars
|
48 |
* There is a very old (circa 1990) mbox format using blocks of ^A (0x01) chars
|
37 |
* to separate messages, that we don't recognize currently
|
49 |
* to separate messages, that we don't recognize currently
|
|
... |
|
... |
47 |
const int wantnhead = 3;
|
59 |
const int wantnhead = 3;
|
48 |
|
60 |
|
49 |
// fn is for message printing
|
61 |
// fn is for message printing
|
50 |
static string idFileInternal(istream& input, const char *fn)
|
62 |
static string idFileInternal(istream& input, const char *fn)
|
51 |
{
|
63 |
{
|
52 |
static int treat_mbox_as_rfc822;
|
|
|
53 |
if (treat_mbox_as_rfc822 == 0) {
|
|
|
54 |
treat_mbox_as_rfc822 = getenv("RECOLL_TREAT_MBOX_AS_RFC822") ? 1 : -1;
|
|
|
55 |
}
|
|
|
56 |
|
|
|
57 |
bool line1HasFrom = false;
|
64 |
bool line1HasFrom = false;
|
58 |
bool gotnonempty = false;
|
65 |
bool gotnonempty = false;
|
59 |
int lookslikemail = 0;
|
66 |
int lookslikemail = 0;
|
60 |
|
67 |
|
61 |
// emacs VM sometimes inserts very long lines with continuations or
|
68 |
// emacs VM sometimes inserts very long lines with continuations or
|