diff --git a/api.js b/api.js index fdc98e82..c9a12665 100644 --- a/api.js +++ b/api.js @@ -53,15 +53,17 @@ const serverOptions = { let path = (req.route && req.route.path) || (req.url || '').replace(/(accessToken=)[^&]+/, '$1xxxxxx'); let message = { - short_message: 'API [' + path + '] ' + (body.success ? 'OK' : 'FAILED'), + short_message: 'HTTP [' + path + '] ' + (body.success ? 'OK' : 'FAILED'), _ip: req.headers['x-forwarded-for'] || req.connection.remoteAddress, _client_ip: ((req.body && req.body.ip) || (req.query && req.query.ip) || '').toString().substr(0, 40) || '', - _route_path: path, + _http_route: path, + _http_method: req.method, _user: req.user, _role: req.role, + _api_response: 'yes', _success: body.success ? 'yes' : 'no', _error: body.error, _error_code: body.code, diff --git a/lib/filter-handler.js b/lib/filter-handler.js index 0c27a79a..4e64f370 100644 --- a/lib/filter-handler.js +++ b/lib/filter-handler.js @@ -593,6 +593,12 @@ class FilterHandler { filterResults.push({ mailbox: info.mailbox && info.mailbox.toString(), id: info.id && info.id.toString() }); } + if (matchingFilters && matchingFilters.length) { + filterResults.push({ + matchingFilters: matchingFilters.map(filter => filter.toString()) + }); + } + // push to response list callback( null, diff --git a/package.json b/package.json index abacf431..540aaa18 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wildduck", - "version": "1.7.1", + "version": "1.7.2", "description": "IMAP/POP3 server built with Node.js and MongoDB", "main": "server.js", "scripts": { @@ -49,7 +49,7 @@ "iconv-lite": "0.4.24", "ioredfour": "1.0.2-ioredis-02", "ioredis": "4.2.0", - "isemail": "3.1.4", + "isemail": "3.2.0", "joi": "14.0.0", "js-yaml": "3.12.0", "key-fingerprint": "1.1.0",