diff --git a/imap-core/test/imap-compiler-test.js b/imap-core/test/imap-compiler-test.js index 9098ed36..05f1a9c3 100644 --- a/imap-core/test/imap-compiler-test.js +++ b/imap-core/test/imap-compiler-test.js @@ -69,6 +69,7 @@ describe('IMAP Command Compiler', function() { describe('ATOM', function() { it('should compile correctly', function() { parsed.attributes = [ + // { type: 'ATOM', value: 'ALERT' diff --git a/imap.js b/imap.js index 69712fef..09ec61d0 100644 --- a/imap.js +++ b/imap.js @@ -22,7 +22,7 @@ const packageData = require('./package.json'); const BULK_BATCH_SIZE = 150; // how often to clear expired messages -const GC_INTERVAL = 1 * 60 * 1000; +const GC_INTERVAL = 60 * 60 * 1000; // Setup server const serverOptions = { @@ -1970,7 +1970,7 @@ function clearExpiredMessages() { clearTimeout(gcTimeout); // First, acquire the lock. This prevents multiple connected clients for deleting the same messages - gcLock.acquireLock('gc_expired', 10 * 60 * 1000 /* Lock expires after 10min if not released */, (err, lock) => { + gcLock.acquireLock('gc_expired', 61 * 60 * 1000 /* Lock expires after 61min if not released */, (err, lock) => { if (err) { server.logger.error( { diff --git a/lib/message-handler.js b/lib/message-handler.js index d3ad6c94..a8e9cea4 100644 --- a/lib/message-handler.js +++ b/lib/message-handler.js @@ -14,21 +14,8 @@ const counters = require('./counters'); const BULK_BATCH_SIZE = 150; const SCHEMA_VERSION = '1.0'; -// header prefixes that are skipped when building index -const IGNORE_HEADERS = [ - 'arc-', - 'authentication-', - 'content-', - 'dkim-', - 'list-', - 'mime-', - 'received', - 'x-gm-', - 'x-google-', - 'x-original-', - 'x-originating-', - 'x-received' -]; +// index only the following headers for SEARCH +const INDEXED_HEADERS = ['to', 'cc', 'subject', 'from', 'sender', 'reply-to', 'message-id', 'thread-index']; class MessageHandler { constructor(database, redisConfig) { @@ -726,7 +713,7 @@ class MessageHandler { let key = line.substr(0, line.indexOf(':')).trim().toLowerCase(); - if (IGNORE_HEADERS.find(prefix => key.indexOf(prefix) === 0)) { + if (!INDEXED_HEADERS.includes(key)) { // do not index this header return false; }