From 1116bc067537b787f37ccfa963baaac39719ca93 Mon Sep 17 00:00:00 2001 From: Andris Reinman Date: Fri, 18 Jan 2019 11:23:31 +0200 Subject: [PATCH] v1.13.1 --- lib/api/messages.js | 15 +++++++++++++-- lib/filter-handler.js | 4 ++++ lib/message-handler.js | 4 ++++ package.json | 2 +- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/lib/api/messages.js b/lib/api/messages.js index 916383ab..f43164ab 100644 --- a/lib/api/messages.js +++ b/lib/api/messages.js @@ -1039,7 +1039,7 @@ module.exports = (db, server, messageHandler, userHandler) => { * @apiSuccess {Boolean} draft Does this message have a \Draft flag * @apiSuccess {String[]} html An array of HTML string. Every array element is from a separate mime node, usually you would just join these to a single string * @apiSuccess {String} text Plaintext content of the message - * @apiSuccess {Object[]} attachments List of attachments for this message + * @apiSuccess {Object[]} [attachments] List of attachments for this message * @apiSuccess {String} attachments.id Attachment ID * @apiSuccess {String} attachments.filename Filename of the attachment * @apiSuccess {String} attachments.contentType MIME type @@ -1047,6 +1047,12 @@ module.exports = (db, server, messageHandler, userHandler) => { * @apiSuccess {String} attachments.transferEncoding Which transfer encoding was used (actual content when fetching attachments is not encoded) * @apiSuccess {Boolean} attachments.related Was this attachment found from a multipart/related node. This usually means that this is an embedded image * @apiSuccess {Number} attachments.sizeKb Approximate size of the attachment in kilobytes + * @apiSuccess {Object} [verificationResults] Security verification info if message was received from MX. If this property is missing then do not automatically assume invalid TLS, SPF or DKIM. + * @apiSuccess {Object} verificationResults.tls TLS information. Value is false if TLS was not used + * @apiSuccess {Object} verificationResults.tls.name Cipher name, eg "ECDHE-RSA-AES128-GCM-SHA256" + * @apiSuccess {Object} verificationResults.tls.version TLS version, eg "TLSv1/SSLv3" + * @apiSuccess {Object} verificationResults.spf Domain name (either MFROM or HELO) of verified SPF or false if no SPF match was found + * @apiSuccess {Object} verificationResults.dkim Domain name of verified DKIM signature or false if no valid signature was found * @apiSuccess {Object} contentType Parsed Content-Type header. Usually needed to identify encrypted messages and such * @apiSuccess {String} contentType.value MIME type of the message, eg. "multipart/mixed" * @apiSuccess {Object} contentType.params An object with Content-Type params as key-value pairs @@ -1219,7 +1225,8 @@ module.exports = (db, server, messageHandler, userHandler) => { text: true, textFooter: true, forwardTargets: true, - meta: true + meta: true, + verificationResults: true } } ); @@ -1362,6 +1369,10 @@ module.exports = (db, server, messageHandler, userHandler) => { metaData: messageData.meta.custom || '{}' }; + if (messageData.verificationResults) { + response.verificationResults = messageData.verificationResults; + } + if (messageData.meta.reference) { response.reference = messageData.meta.reference; } diff --git a/lib/filter-handler.js b/lib/filter-handler.js index d80e22f4..74146f33 100644 --- a/lib/filter-handler.js +++ b/lib/filter-handler.js @@ -536,6 +536,10 @@ class FilterHandler { flags }; + if (options.verificationResults) { + messageOpts.verificationResults = options.verificationResults; + } + if (outbound && outbound.length) { messageOpts.outbound = [].concat(outbound || []); } diff --git a/lib/message-handler.js b/lib/message-handler.js index e132e0a9..68a1f9e3 100644 --- a/lib/message-handler.js +++ b/lib/message-handler.js @@ -190,6 +190,10 @@ class MessageHandler { copied: false }; + if (options.verificationResults) { + messageData.verificationResults = options.verificationResults; + } + if (options.outbound) { messageData.outbound = [].concat(options.outbound || []); } diff --git a/package.json b/package.json index 1bdab24b..eaebdcc0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wildduck", - "version": "1.13.0", + "version": "1.13.1", "description": "IMAP/POP3 server built with Node.js and MongoDB", "main": "server.js", "scripts": {