From 831514145ae5f20ffe7d977210f1fe238b0b0709 Mon Sep 17 00:00:00 2001 From: Andris Reinman Date: Thu, 15 Dec 2022 10:55:53 +0200 Subject: [PATCH] ensure origin in hook request --- lib/api/messages.js | 2 +- lib/maildropper.js | 4 +--- package.json | 20 ++++++++++---------- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/lib/api/messages.js b/lib/api/messages.js index d7f2ddfd..522f26c8 100644 --- a/lib/api/messages.js +++ b/lib/api/messages.js @@ -3039,7 +3039,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler, setti from: envelope.from, to: envelope.to, sendTime, - origin: options.ip, + origin: options.origin || options.ip, runPlugins: true }, (err, ...args) => { diff --git a/lib/maildropper.js b/lib/maildropper.js index 738017cf..39ffc00f 100644 --- a/lib/maildropper.js +++ b/lib/maildropper.js @@ -113,9 +113,7 @@ class Maildropper { envelope.reason = options.reason; } - if (options.origin) { - envelope.origin = options.origin; - } + envelope.origin = options.origin || '127.0.0.1'; let messageInfo = { 'message-id': '<>', diff --git a/package.json b/package.json index 3e71a0c2..c4eec36f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wildduck", - "version": "1.38.0", + "version": "1.38.1", "description": "IMAP/POP3 server built with Node.js and MongoDB", "main": "server.js", "scripts": { @@ -31,15 +31,15 @@ "eslint-config-prettier": "8.5.0", "grunt": "1.5.3", "grunt-cli": "1.4.3", - "grunt-eslint": "24.0.0", + "grunt-eslint": "24.0.1", "grunt-mocha-test": "0.13.3", "grunt-shell-spawn": "0.4.0", "grunt-wait": "0.3.0", - "imapflow": "1.0.116", - "mailparser": "3.5.0", - "mocha": "10.1.0", + "imapflow": "1.0.117", + "mailparser": "3.6.2", + "mocha": "10.2.0", "request": "2.88.2", - "supertest": "6.3.2" + "supertest": "6.3.3" }, "dependencies": { "@andris/restify-cors-middleware2": "2.1.2-patch.3", @@ -49,7 +49,7 @@ "@root/acme": "3.1.0", "@root/csr": "0.8.1", "accesscontrol": "2.2.1", - "axios": "1.2.0", + "axios": "1.2.1", "base32.js": "0.1.0", "bcryptjs": "2.4.3", "bson": "4.7.0", @@ -59,7 +59,7 @@ "generate-password": "1.7.0", "hash-wasm": "4.9.0", "he": "1.2.0", - "html-to-text": "9.0.0", + "html-to-text": "9.0.3", "humanname": "0.2.2", "iconv-lite": "0.6.3", "ioredfour": "1.2.0-ioredis-06", @@ -70,10 +70,10 @@ "js-yaml": "4.1.0", "key-fingerprint": "1.1.0", "libbase64": "1.2.1", - "libmime": "5.1.0", + "libmime": "5.2.0", "libqp": "2.0.1", "mailauth": "4.0.2", - "mailsplit": "5.3.2", + "mailsplit": "5.4.0", "mobileconfig": "2.4.0", "mongo-cursor-pagination": "8.1.2", "mongodb": "4.12.1",