From 0e7089899513bfe9c0557a2f6eb24a1ebab8bfe0 Mon Sep 17 00:00:00 2001 From: Andris Reinman Date: Tue, 19 Mar 2024 11:53:18 +0200 Subject: [PATCH] fix(account-listing): Show accounts as initializing if account has not yet been processed after startup --- lib/account.js | 19 +- lib/api-client/base-client.js | 3 + lib/imap-connection.js | 3 +- lib/lua/h-set-bigger.lua | 8 +- lib/mailbox.js | 30 +- lib/routes-ui.js | 14 +- package.json | 9 +- sbom.json | 2 +- server.js | 11 +- static/licenses.html | 560 +--------------------------------- translations/messages.pot | 26 +- workers/imap.js | 9 +- 12 files changed, 92 insertions(+), 602 deletions(-) diff --git a/lib/account.js b/lib/account.js index 78685166..3643bdca 100644 --- a/lib/account.js +++ b/lib/account.js @@ -7,7 +7,7 @@ const { normalizePath, formatAccountListingResponse, unpackUIDRangeForSearch, me const crypto = require('crypto'); const { MessageChannel } = require('worker_threads'); const { MessagePortReadable } = require('./message-port-stream'); -const { deepStrictEqual, strictEqual } = require('assert'); +const { deepStrictEqual, strictEqual, ok: assertOk } = require('assert'); const { encrypt, decrypt } = require('./encrypt'); const { oauth2Apps, LEGACY_KEYS } = require('./oauth2-apps'); const settings = require('./settings'); @@ -51,6 +51,10 @@ class Account { page = Math.max(Number(page) || 0, 0); let skip = page * limit; + const runIndex = await this.call({ + cmd: 'runIndex' + }); + let result = await this.redis.sListAccounts(`${REDIS_PREFIX}ia:accounts`, state || '*', skip, limit, `${REDIS_PREFIX}`, query); let accounts = result[2].map(formatAccountListingResponse).map(this.unserializeAccountData.bind(this)); @@ -92,7 +96,7 @@ class Account { accountData.oauth2 && accountData.oauth2.provider && accountData.oauth2.provider !== accountData.type ? accountData.oauth2.provider : undefined, - state: accountData.state, + state: runIndex <= accountData.runIndex ? accountData.state : 'init', webhooks: accountData.webhooks || undefined, proxy: accountData.proxy || undefined, @@ -260,6 +264,7 @@ class Account { // number values case 'connections': case 'listRegistry': + case 'runIndex': result[key] = Number(accountData[key]) || 0; break; @@ -425,7 +430,7 @@ class Account { return result; } - async loadAccountData(account, requireValid) { + async loadAccountData(account, requireValid, runIndex) { if (!this.account || (account && account !== this.account)) { let message = 'Invalid account ID'; let error = Boom.boomify(new Error(message), { statusCode: 400 }); @@ -441,6 +446,9 @@ class Account { } let accountData = this.unserializeAccountData(result); + + accountData.state = runIndex <= accountData.runIndex ? accountData.state : 'init'; + if (requireValid && !['connected', 'connecting', 'syncing'].includes(accountData.state)) { let err; switch (accountData.state) { @@ -635,11 +643,16 @@ class Account { } } + const runIndex = await this.call({ + cmd: 'runIndex' + }); + let pipeline = this.redis .multi() .hgetall(this.getAccountKey()) .hmset(this.getAccountKey(), this.serializeAccountData(accountData)) .hsetnx(this.getAccountKey(), 'state', 'init') + .hsetnx(this.getAccountKey(), 'runIndex', runIndex.toString()) .hsetnx(this.getAccountKey(), `state:count:connected`, '0') .sadd(`${REDIS_PREFIX}ia:accounts`, this.account); diff --git a/lib/api-client/base-client.js b/lib/api-client/base-client.js index 1c596ad8..e55ae10f 100644 --- a/lib/api-client/base-client.js +++ b/lib/api-client/base-client.js @@ -7,10 +7,13 @@ const { REDIS_PREFIX } = require('../consts'); class BaseClient { constructor(account, options) { this.account = account; + this.options = options || {}; this.cid = this.getRandomId(); + this.runIndex = this.options.runIndex; + this.accountObject = this.options.accountObject; this.accountLogger = this.options.accountLogger; this.redis = this.options.redis; diff --git a/lib/imap-connection.js b/lib/imap-connection.js index 64cef78b..97e9b593 100644 --- a/lib/imap-connection.js +++ b/lib/imap-connection.js @@ -732,6 +732,7 @@ class IMAPConnection extends BaseClient { let [[e1], [e2, prevVal], [e3, incrVal], [e4, stateVal]] = await this.redis .multi() .hSetExists(this.getAccountKey(), 'state', this.state) + .hSetBigger(this.getAccountKey(), 'runIndex', this.runIndex.toString()) .hget(this.getAccountKey(), `state:count:${this.state}`) .hIncrbyExists(this.getAccountKey(), `state:count:${this.state}`, 1) .hget(this.getAccountKey(), 'state') @@ -1819,7 +1820,7 @@ class IMAPConnection extends BaseClient { deleted: false // set to true if mailbox is actually deleted }; try { - let lock = await connectionClient.getMailboxLock(path); + let lock = await connectionClient.getMailboxLock(path, { description: `Delete mailbox ${path}` }); try { await connectionClient.mailboxClose(); diff --git a/lib/lua/h-set-bigger.lua b/lib/lua/h-set-bigger.lua index 0fe0d1c3..45b3a298 100644 --- a/lib/lua/h-set-bigger.lua +++ b/lib/lua/h-set-bigger.lua @@ -7,11 +7,13 @@ if redis.call("HEXISTS", hashKey, entryKey) == 1 then local existing = redis.call("HGET", hashKey, entryKey); if tonumber(value) > tonumber(existing) then redis.call("HSET", hashKey, entryKey, value); - return 2; + return 3; + else + return 1; end; -else +elseif redis.call("EXISTS", hashKey) == 1 then redis.call("HSET", hashKey, entryKey, value); - return 1; + return 2; end; return 0; diff --git a/lib/mailbox.js b/lib/mailbox.js index 2e4a35d6..bf5a8699 100644 --- a/lib/mailbox.js +++ b/lib/mailbox.js @@ -353,7 +353,7 @@ class Mailbox { } async select(skipIdle) { - let lock = await this.getMailboxLock(); + let lock = await this.getMailboxLock(null, { description: `Select mailbox ${this.path}` }); // have to release the lock immediatelly, otherwise difficult to process 'exists' / 'expunge' events lock.release(); @@ -363,14 +363,14 @@ class Mailbox { } } - async getMailboxLock(connectionClient) { + async getMailboxLock(connectionClient, options) { connectionClient = connectionClient || this.connection.imapClient; if (!connectionClient) { throw new Error('IMAP connection not available'); } - let lock = await connectionClient.getMailboxLock(this.path, {}); + let lock = await connectionClient.getMailboxLock(this.path, options || {}); if (connectionClient === this.connection.imapClient) { clearTimeout(this.connection.completedTimer); @@ -470,7 +470,7 @@ class Mailbox { storedStatus = storedStatus || (await this.getStoredStatus()); let mailboxStatus = this.getMailboxStatus(); - let lock = await this.getMailboxLock(); + let lock = await this.getMailboxLock(null, { description: 'Partial sync' }); this.connection.syncing = true; this.syncing = true; try { @@ -1663,7 +1663,7 @@ class Mailbox { let fields = { uid: true, flags: true, modseq: true, emailId: true, labels: true, internalDate: true }; let opts = {}; - let lock = await this.getMailboxLock(); + let lock = await this.getMailboxLock(null, { description: 'Full sync' }); this.connection.syncing = true; this.syncing = true; try { @@ -2075,7 +2075,7 @@ class Mailbox { let lock; if (!options.skipLock) { - lock = await this.getMailboxLock(connectionClient); + lock = await this.getMailboxLock(connectionClient, { description: `Get text ${message.uid}` }); } try { @@ -2133,7 +2133,7 @@ class Mailbox { options = options || {}; const connectionClient = await this.connection.getImapConnection(allowSecondary); - let lock = await this.getMailboxLock(connectionClient); + let lock = await this.getMailboxLock(connectionClient, { description: `Get attachment ${message.uid}:${part}` }); let streaming = false; let released = false; @@ -2202,7 +2202,7 @@ class Mailbox { try { let lock; if (!options.skipLock) { - lock = await this.getMailboxLock(connectionClient); + lock = await this.getMailboxLock(connectionClient, { description: `Get message ${message.uid}` }); } try { @@ -2365,7 +2365,7 @@ class Mailbox { const connectionClient = await this.connection.getImapConnection(allowSecondary); - let lock = await this.getMailboxLock(connectionClient); + let lock = await this.getMailboxLock(connectionClient, { description: `Update message ${message.uid}` }); try { let result = {}; @@ -2434,7 +2434,7 @@ class Mailbox { const connectionClient = await this.connection.getImapConnection(allowSecondary); - let lock = await this.getMailboxLock(connectionClient); + let lock = await this.getMailboxLock(connectionClient, { description: `Update messages` }); try { let result = {}; @@ -2503,7 +2503,7 @@ class Mailbox { const connectionClient = await this.connection.getImapConnection(allowSecondary); - let lock = await this.getMailboxLock(connectionClient); + let lock = await this.getMailboxLock(connectionClient, { description: `Move message ${message.uid}` }); try { let result = {}; @@ -2532,7 +2532,7 @@ class Mailbox { const connectionClient = await this.connection.getImapConnection(allowSecondary); - let lock = await this.getMailboxLock(connectionClient); + let lock = await this.getMailboxLock(connectionClient, { description: `Move messages` }); try { let result = {}; @@ -2561,7 +2561,7 @@ class Mailbox { async deleteMessage(message, force, allowSecondary) { const connectionClient = await this.connection.getImapConnection(allowSecondary); - let lock = await this.getMailboxLock(connectionClient); + let lock = await this.getMailboxLock(connectionClient, { description: `Delete message ${message.uid}` }); try { let result = {}; @@ -2601,7 +2601,7 @@ class Mailbox { async deleteMessages(search, force, allowSecondary) { const connectionClient = await this.connection.getImapConnection(allowSecondary); - let lock = await this.getMailboxLock(connectionClient); + let lock = await this.getMailboxLock(connectionClient, { description: `Delete messages` }); try { let result = {}; @@ -2649,7 +2649,7 @@ class Mailbox { const connectionClient = await this.connection.getImapConnection(allowSecondary); - let lock = await this.getMailboxLock(connectionClient); + let lock = await this.getMailboxLock(connectionClient, { description: `List messages` }); try { let mailboxStatus = this.getMailboxStatus(connectionClient); diff --git a/lib/routes-ui.js b/lib/routes-ui.js index cb16e8a7..f2ae577f 100644 --- a/lib/routes-ui.js +++ b/lib/routes-ui.js @@ -5979,7 +5979,11 @@ ${Buffer.from(data.content, 'base64url').toString('base64')} method: 'GET', path: '/admin/accounts', async handler(request, h) { - let accountObject = new Account({ redis }); + let accountObject = new Account({ redis, call }); + + const runIndex = await call({ + cmd: 'runIndex' + }); const accounts = await accountObject.listAccounts(request.query.state, request.query.query, request.query.page - 1, request.query.pageSize); @@ -5989,7 +5993,7 @@ ${Buffer.from(data.content, 'base64url').toString('base64')} for (let account of accounts.accounts) { let accountObject = new Account({ redis, account: account.account }); - account.data = await accountObject.loadAccountData(); + account.data = await accountObject.loadAccountData(null, null, runIndex); if (account.data && account.data.oauth2 && account.data.oauth2.provider) { let oauth2App = await oauth2Apps.get(account.data.oauth2.provider); @@ -6789,9 +6793,13 @@ ${Buffer.from(data.content, 'base64url').toString('base64')} let accountObject = new Account({ redis, account: request.params.account, call, secret: await getSecret() }); let accountData; + const runIndex = await call({ + cmd: 'runIndex' + }); + try { // throws if account does not exist - accountData = await accountObject.loadAccountData(); + accountData = await accountObject.loadAccountData(null, null, runIndex); } catch (err) { if (Boom.isBoom(err)) { throw err; diff --git a/package.json b/package.json index fe29bc43..91b7cece 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,8 @@ "test": "grunt && node --test test/", "swagger": "./getswagger.sh", "build-source": "rm -rf node_modules && npm install && rm -rf node_modules && npm install --omit=dev && ./update-info.sh", - "build-dist": "npx pkg --compress Brotli package.json && npm install && node winconf.js", - "build-dist-fast": "npx pkg --debug package.json && npm install && node winconf.js", + "build-dist": "pkg --compress Brotli package.json && npm install && node winconf.js", + "build-dist-fast": "pkg --debug package.json && npm install && node winconf.js", "licenses": "license-checker --excludePackages emailengine-app --json | node list-generate.js > static/licenses.html", "gettext": "find ./views -name \"*.hbs\" -print0 | xargs -0 xgettext-template -L Handlebars -o translations/messages.pot --force-po && jsxgettext lib/routes-ui.js workers/api.js lib/tools.js -j -o translations/messages.pot", "prepare-docker": "echo \"EE_DOCKER_LEGACY=$EE_DOCKER_LEGACY\" >> system.env && cat system.env", @@ -59,7 +59,7 @@ "ace-builds": "1.32.7", "base32.js": "0.1.0", "bull-arena": "4.2.0", - "bullmq": "5.4.2", + "bullmq": "5.4.3", "compare-versions": "6.1.0", "dotenv": "16.4.5", "encoding-japanese": "2.0.0", @@ -75,7 +75,7 @@ "humanize": "0.0.9", "ical.js": "1.5.0", "iconv-lite": "0.6.3", - "imapflow": "1.0.156", + "imapflow": "1.0.157", "ioredfour": "1.3.0-ioredis-07", "ioredis": "5.3.2", "ipaddr.js": "2.1.0", @@ -121,7 +121,6 @@ "grunt-eslint": "24.3.0", "jsxgettext": "0.11.0", "pino-pretty": "10.3.1", - "pkg": "5.8.1", "resedit": "2.0.0", "xgettext-template": "5.0.0" }, diff --git a/sbom.json b/sbom.json index 04ccee2e..f34b66c9 100644 --- a/sbom.json +++ b/sbom.json @@ -1 +1 @@ -{"bomFormat":"CycloneDX","specVersion":"1.4","version":1,"metadata":{"timestamp":"2024-03-14T11:13:09Z","tools":[{"vendor":"advanced-security","name":"gh-sbom","version":"0.0.9"}],"licenses":[{"expression":"CC0-1.0"}]},"components":[{"type":"library","group":"@hapi","name":"boom","version":"10.0.1","purl":"pkg:npm/%40hapi/boom@10.0.1","licenses":[{"expression":"BSD-3-Clause"}]},{"type":"library","group":"@hapi","name":"crumb","version":"9.0.1","purl":"pkg:npm/%40hapi/crumb@9.0.1","licenses":[{"expression":"BSD-3-Clause"}]},{"type":"library","group":"@hapi","name":"hapi","version":"21.3.3","purl":"pkg:npm/%40hapi/hapi@21.3.3"},{"type":"library","name":"humanize","version":"0.0.9","purl":"pkg:npm/humanize@0.0.9","licenses":[{"expression":"MIT"}]},{"type":"library","name":"libbase64","version":"1.3.0","purl":"pkg:npm/libbase64@1.3.0"},{"type":"library","name":"nodemailer","version":"6.9.11","purl":"pkg:npm/nodemailer@6.9.11","licenses":[{"expression":"MIT-0"}]},{"type":"library","name":"prom-client","version":"15.1.0","purl":"pkg:npm/prom-client@15.1.0","licenses":[{"expression":"Apache-2.0"}]},{"type":"library","group":"@elastic","name":"elasticsearch","version":"8.12.2","purl":"pkg:npm/%40elastic/elasticsearch@8.12.2"},{"type":"library","name":"socks","version":"2.8.1","purl":"pkg:npm/socks@2.8.1","licenses":[{"expression":"MIT"}]},{"type":"library","name":"startbootstrap-sb-admin-2","version":"3.3.7","purl":"pkg:npm/startbootstrap-sb-admin-2@3.3.7","licenses":[{"expression":"MIT"}]},{"type":"library","name":"xgettext-template","version":"5.0.0","purl":"pkg:npm/xgettext-template@5.0.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"resedit","version":"2.0.0","purl":"pkg:npm/resedit@2.0.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"gettext-parser","version":"7.0.1","purl":"pkg:npm/gettext-parser@7.0.1","licenses":[{"expression":"MIT"}]},{"type":"library","name":"hapi-swagger","version":"17.2.1","purl":"pkg:npm/hapi-swagger@17.2.1"},{"type":"library","name":"ioredfour","version":"1.3.0-ioredis-07","purl":"pkg:npm/ioredfour@1.3.0-ioredis-07","licenses":[{"expression":"MIT"}]},{"type":"library","name":"jsxgettext","version":"0.11.0","purl":"pkg:npm/jsxgettext@0.11.0","licenses":[{"expression":"MPL-2.0"}]},{"type":"library","name":"bullmq","version":"5.4.2","purl":"pkg:npm/bullmq@5.4.2"},{"type":"library","name":"psl","version":"1.9.0","purl":"pkg:npm/psl@1.9.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"joi","version":"17.12.2","purl":"pkg:npm/joi@17.12.2","licenses":[{"expression":"BSD-3-Clause"}]},{"type":"library","name":"encoding-japanese","version":"2.0.0","purl":"pkg:npm/encoding-japanese@2.0.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"exponential-backoff","version":"3.1.1","purl":"pkg:npm/exponential-backoff@3.1.1","licenses":[{"expression":"Apache-2.0"}]},{"type":"library","name":"grunt","version":"1.6.1","purl":"pkg:npm/grunt@1.6.1","licenses":[{"expression":"MIT"}]},{"type":"library","name":"imapflow","version":"1.0.156","purl":"pkg:npm/imapflow@1.0.156"},{"type":"library","name":"msgpack5","version":"6.0.2","purl":"pkg:npm/msgpack5@6.0.2","licenses":[{"expression":"MIT"}]},{"type":"library","name":"murmurhash","version":"2.0.1","purl":"pkg:npm/murmurhash@2.0.1","licenses":[{"expression":"MIT"}]},{"type":"library","name":"punycode","version":"2.3.1","purl":"pkg:npm/punycode@2.3.1","licenses":[{"expression":"MIT"}]},{"type":"library","name":"dotenv","version":"16.4.5","purl":"pkg:npm/dotenv@16.4.5","licenses":[{"expression":"BSD-2-Clause"}]},{"type":"library","name":"timezones-list","version":"3.0.3","purl":"pkg:npm/timezones-list@3.0.3","licenses":[{"expression":"MIT"}]},{"type":"library","group":"@hapi","name":"vision","version":"7.0.3","purl":"pkg:npm/%40hapi/vision@7.0.3","licenses":[{"expression":"BSD-3-Clause"}]},{"type":"library","name":"ical.js","version":"1.5.0","purl":"pkg:npm/ical.js@1.5.0","licenses":[{"expression":"MPL-2.0"}]},{"type":"library","name":"speakeasy","version":"2.0.0","purl":"pkg:npm/speakeasy@2.0.0","licenses":[{"expression":"MIT"}]},{"type":"library","group":"@hapi","name":"cookie","version":"12.0.1","purl":"pkg:npm/%40hapi/cookie@12.0.1","licenses":[{"expression":"BSD-3-Clause"}]},{"type":"library","name":"handlebars","version":"4.7.8","purl":"pkg:npm/handlebars@4.7.8","licenses":[{"expression":"MIT"}]},{"type":"library","name":"he","version":"1.2.0","purl":"pkg:npm/he@1.2.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"iconv-lite","version":"0.6.3","purl":"pkg:npm/iconv-lite@0.6.3","licenses":[{"expression":"MIT"}]},{"type":"library","name":"pino","version":"8.19.0","purl":"pkg:npm/pino@8.19.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"uuid","version":"9.0.1","purl":"pkg:npm/uuid@9.0.1","licenses":[{"expression":"MIT"}]},{"type":"library","name":"bull-arena","version":"4.2.0","purl":"pkg:npm/bull-arena@4.2.0"},{"type":"library","name":"ioredis","version":"5.3.2","purl":"pkg:npm/ioredis@5.3.2","licenses":[{"expression":"MIT"}]},{"type":"library","name":"license-checker","version":"25.0.1","purl":"pkg:npm/license-checker@25.0.1","licenses":[{"expression":"BSD-3-Clause"}]},{"type":"library","name":"mailparser","version":"3.6.9","purl":"pkg:npm/mailparser@3.6.9"},{"type":"library","name":"mailsplit","version":"5.4.0","purl":"pkg:npm/mailsplit@5.4.0","licenses":[{"expression":"EUPL-1.1+ OR MIT OR (EUPL-1.1+ AND MIT)"}]},{"type":"library","name":"pubface","version":"1.0.9","purl":"pkg:npm/pubface@1.0.9"},{"type":"library","name":"xml2js","version":"0.6.2","purl":"pkg:npm/xml2js@0.6.2","licenses":[{"expression":"MIT"}]},{"type":"library","name":"express","version":"4.18.3","purl":"pkg:npm/express@4.18.3","licenses":[{"expression":"MIT"}]},{"type":"library","name":"eslint","version":"8.57.0","purl":"pkg:npm/eslint@8.57.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"node-gettext","version":"3.0.0","purl":"pkg:npm/node-gettext@3.0.0","licenses":[{"expression":"MIT"}]},{"type":"library","group":"@postalsys","name":"hecks","version":"3.0.0-fork.3","purl":"pkg:npm/%40postalsys/hecks@3.0.0-fork.3","licenses":[{"expression":"MIT"}]},{"type":"library","name":"hapi-auth-bearer-token","version":"8.0.0","purl":"pkg:npm/hapi-auth-bearer-token@8.0.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"ipaddr.js","version":"2.1.0","purl":"pkg:npm/ipaddr.js@2.1.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"marked","version":"9.1.6","purl":"pkg:npm/marked@9.1.6","licenses":[{"expression":"MIT"}]},{"type":"library","name":"eerawlog","version":"1.5.1","purl":"pkg:npm/eerawlog@1.5.1","licenses":[{"expression":"ISC"}]},{"type":"library","name":"ace-builds","version":"1.32.7","purl":"pkg:npm/ace-builds@1.32.7"},{"type":"library","name":"grunt-eslint","version":"24.3.0","purl":"pkg:npm/grunt-eslint@24.3.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"nanoid","version":"3.3.4","purl":"pkg:npm/nanoid@3.3.4","licenses":[{"expression":"MIT"}]},{"type":"library","name":"smtp-server","version":"3.13.3","purl":"pkg:npm/smtp-server@3.13.3"},{"type":"library","group":"@postalsys","name":"templates","version":"1.0.8","purl":"pkg:npm/%40postalsys/templates@1.0.8"},{"type":"library","name":"html-to-text","version":"9.0.5","purl":"pkg:npm/html-to-text@9.0.5","licenses":[{"expression":"MIT"}]},{"type":"library","name":"qrcode","version":"1.5.3","purl":"pkg:npm/qrcode@1.5.3","licenses":[{"expression":"MIT"}]},{"type":"library","group":"@bugsnag","name":"js","version":"7.22.4","purl":"pkg:npm/%40bugsnag/js@7.22.4"},{"type":"library","name":"libqp","version":"2.1.0","purl":"pkg:npm/libqp@2.1.0"},{"type":"library","name":"minimist","version":"1.2.8","purl":"pkg:npm/minimist@1.2.8","licenses":[{"expression":"MIT"}]},{"type":"library","name":"pino-pretty","version":"10.3.1","purl":"pkg:npm/pino-pretty@10.3.1","licenses":[{"expression":"MIT"}]},{"type":"library","name":"pkg","version":"5.8.1","purl":"pkg:npm/pkg@5.8.1","licenses":[{"expression":"MIT"}]},{"type":"library","name":"undici","version":"5.28.3","purl":"pkg:npm/undici@5.28.3","licenses":[{"expression":"MIT"}]},{"type":"library","name":"libmime","version":"5.3.4","purl":"pkg:npm/libmime@5.3.4"},{"type":"library","group":"@postalsys","name":"email-ai-tools","version":"1.8.6","purl":"pkg:npm/%40postalsys/email-ai-tools@1.8.6"},{"type":"library","name":"compare-versions","version":"6.1.0","purl":"pkg:npm/compare-versions@6.1.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"hapi-pino","version":"12.1.0","purl":"pkg:npm/hapi-pino@12.1.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"wild-config","version":"1.7.1","purl":"pkg:npm/wild-config@1.7.1","licenses":[{"expression":"MIT"}]},{"type":"library","group":"@hapi","name":"inert","version":"7.1.0","purl":"pkg:npm/%40hapi/inert@7.1.0","licenses":[{"expression":"BSD-3-Clause"}]},{"type":"library","name":"grunt-cli","version":"1.4.3","purl":"pkg:npm/grunt-cli@1.4.3","licenses":[{"expression":"MIT"}]},{"type":"library","group":"@phc","name":"pbkdf2","version":"1.1.14","purl":"pkg:npm/%40phc/pbkdf2@1.1.14","licenses":[{"expression":"MIT"}]},{"type":"library","group":"@postalsys","name":"certs","version":"1.0.8","purl":"pkg:npm/%40postalsys/certs@1.0.8"},{"type":"library","name":"chai","version":"4.3.10","purl":"pkg:npm/chai@4.3.10","licenses":[{"expression":"MIT"}]},{"type":"library","name":"jquery","version":"3.7.1","purl":"pkg:npm/jquery@3.7.1","licenses":[{"expression":"MIT"}]},{"type":"library","group":"@hapi","name":"bell","version":"13.0.1","purl":"pkg:npm/%40hapi/bell@13.0.1","licenses":[{"expression":"BSD-3-Clause"}]},{"type":"library","group":"@postalsys","name":"joi-messages","version":"1.0.1","purl":"pkg:npm/%40postalsys/joi-messages@1.0.1"},{"type":"library","name":"base32.js","version":"0.1.0","purl":"pkg:npm/base32.js@0.1.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"eslint-config-nodemailer","version":"1.2.0","purl":"pkg:npm/eslint-config-nodemailer@1.2.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"eslint-config-prettier","version":"9.1.0","purl":"pkg:npm/eslint-config-prettier@9.1.0","licenses":[{"expression":"MIT"}]},{"type":"library","group":"@postalsys","name":"email-text-tools","version":"2.1.7","purl":"pkg:npm/%40postalsys/email-text-tools@2.1.7"},{"type":"library","group":"actions","name":"checkout","version":"4","purl":"pkg:github/actions/checkout@4"},{"type":"library","group":"docker","name":"metadata-action","version":"5","purl":"pkg:github/docker/metadata-action@5"},{"type":"library","group":"google-github-actions","name":"release-please-action","version":"3","purl":"pkg:github/google-github-actions/release-please-action@3"},{"type":"library","group":"actions","name":"setup-node","version":"3","purl":"pkg:github/actions/setup-node@3"},{"type":"library","group":"actions","name":"setup-node","version":"1","purl":"pkg:github/actions/setup-node@1"},{"type":"library","group":"shimataro","name":"ssh-key-action","version":"2","purl":"pkg:github/shimataro/ssh-key-action@2"},{"type":"library","group":"docker","name":"build-push-action","version":"5","purl":"pkg:github/docker/build-push-action@5"},{"type":"library","group":"docker","name":"login-action","version":"3","purl":"pkg:github/docker/login-action@3"},{"type":"library","group":"docker","name":"setup-buildx-action","version":"3","purl":"pkg:github/docker/setup-buildx-action@3"},{"type":"library","group":"docker","name":"setup-qemu-action","version":"3","purl":"pkg:github/docker/setup-qemu-action@3"}]} +{"bomFormat":"CycloneDX","specVersion":"1.4","version":1,"metadata":{"timestamp":"2024-03-19T09:31:15Z","tools":[{"vendor":"advanced-security","name":"gh-sbom","version":"0.0.9"}],"licenses":[{"expression":"CC0-1.0"}]},"components":[{"type":"library","name":"joi","version":"17.12.2","purl":"pkg:npm/joi@17.12.2","licenses":[{"expression":"BSD-3-Clause"}]},{"type":"library","name":"jquery","version":"3.7.1","purl":"pkg:npm/jquery@3.7.1","licenses":[{"expression":"MIT"}]},{"type":"library","name":"mailparser","version":"3.6.9","purl":"pkg:npm/mailparser@3.6.9"},{"type":"library","name":"speakeasy","version":"2.0.0","purl":"pkg:npm/speakeasy@2.0.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"eslint-config-nodemailer","version":"1.2.0","purl":"pkg:npm/eslint-config-nodemailer@1.2.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"gettext-parser","version":"7.0.1","purl":"pkg:npm/gettext-parser@7.0.1","licenses":[{"expression":"MIT"}]},{"type":"library","name":"grunt-eslint","version":"24.3.0","purl":"pkg:npm/grunt-eslint@24.3.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"hapi-auth-bearer-token","version":"8.0.0","purl":"pkg:npm/hapi-auth-bearer-token@8.0.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"hapi-swagger","version":"17.2.1","purl":"pkg:npm/hapi-swagger@17.2.1"},{"type":"library","name":"uuid","version":"9.0.1","purl":"pkg:npm/uuid@9.0.1","licenses":[{"expression":"MIT"}]},{"type":"library","name":"socks","version":"2.8.1","purl":"pkg:npm/socks@2.8.1","licenses":[{"expression":"MIT"}]},{"type":"library","name":"startbootstrap-sb-admin-2","version":"3.3.7","purl":"pkg:npm/startbootstrap-sb-admin-2@3.3.7","licenses":[{"expression":"MIT"}]},{"type":"library","name":"timezones-list","version":"3.0.3","purl":"pkg:npm/timezones-list@3.0.3","licenses":[{"expression":"MIT"}]},{"type":"library","group":"@postalsys","name":"hecks","version":"3.0.0-fork.3","purl":"pkg:npm/%40postalsys/hecks@3.0.0-fork.3","licenses":[{"expression":"MIT"}]},{"type":"library","name":"eslint","version":"8.57.0","purl":"pkg:npm/eslint@8.57.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"eslint-config-prettier","version":"9.1.0","purl":"pkg:npm/eslint-config-prettier@9.1.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"minimist","version":"1.2.8","purl":"pkg:npm/minimist@1.2.8","licenses":[{"expression":"MIT"}]},{"type":"library","group":"@bugsnag","name":"js","version":"7.22.4","purl":"pkg:npm/%40bugsnag/js@7.22.4"},{"type":"library","name":"ioredfour","version":"1.3.0-ioredis-07","purl":"pkg:npm/ioredfour@1.3.0-ioredis-07","licenses":[{"expression":"MIT"}]},{"type":"library","name":"ioredis","version":"5.3.2","purl":"pkg:npm/ioredis@5.3.2","licenses":[{"expression":"MIT"}]},{"type":"library","name":"qrcode","version":"1.5.3","purl":"pkg:npm/qrcode@1.5.3","licenses":[{"expression":"MIT"}]},{"type":"library","group":"@phc","name":"pbkdf2","version":"1.1.14","purl":"pkg:npm/%40phc/pbkdf2@1.1.14","licenses":[{"expression":"MIT"}]},{"type":"library","group":"@postalsys","name":"joi-messages","version":"1.0.1","purl":"pkg:npm/%40postalsys/joi-messages@1.0.1"},{"type":"library","name":"handlebars","version":"4.7.8","purl":"pkg:npm/handlebars@4.7.8","licenses":[{"expression":"MIT"}]},{"type":"library","name":"ical.js","version":"1.5.0","purl":"pkg:npm/ical.js@1.5.0","licenses":[{"expression":"MPL-2.0"}]},{"type":"library","name":"license-checker","version":"25.0.1","purl":"pkg:npm/license-checker@25.0.1","licenses":[{"expression":"BSD-3-Clause"}]},{"type":"library","name":"undici","version":"5.28.3","purl":"pkg:npm/undici@5.28.3","licenses":[{"expression":"MIT"}]},{"type":"library","name":"xgettext-template","version":"5.0.0","purl":"pkg:npm/xgettext-template@5.0.0","licenses":[{"expression":"MIT"}]},{"type":"library","group":"@elastic","name":"elasticsearch","version":"8.12.2","purl":"pkg:npm/%40elastic/elasticsearch@8.12.2"},{"type":"library","name":"express","version":"4.18.3","purl":"pkg:npm/express@4.18.3","licenses":[{"expression":"MIT"}]},{"type":"library","name":"libbase64","version":"1.3.0","purl":"pkg:npm/libbase64@1.3.0"},{"type":"library","name":"libmime","version":"5.3.4","purl":"pkg:npm/libmime@5.3.4"},{"type":"library","name":"nanoid","version":"3.3.4","purl":"pkg:npm/nanoid@3.3.4","licenses":[{"expression":"MIT"}]},{"type":"library","group":"@hapi","name":"crumb","version":"9.0.1","purl":"pkg:npm/%40hapi/crumb@9.0.1","licenses":[{"expression":"BSD-3-Clause"}]},{"type":"library","group":"@postalsys","name":"email-text-tools","version":"2.1.7","purl":"pkg:npm/%40postalsys/email-text-tools@2.1.7"},{"type":"library","name":"humanize","version":"0.0.9","purl":"pkg:npm/humanize@0.0.9","licenses":[{"expression":"MIT"}]},{"type":"library","name":"marked","version":"9.1.6","purl":"pkg:npm/marked@9.1.6","licenses":[{"expression":"MIT"}]},{"type":"library","name":"jsxgettext","version":"0.11.0","purl":"pkg:npm/jsxgettext@0.11.0","licenses":[{"expression":"MPL-2.0"}]},{"type":"library","name":"msgpack5","version":"6.0.2","purl":"pkg:npm/msgpack5@6.0.2","licenses":[{"expression":"MIT"}]},{"type":"library","name":"pubface","version":"1.0.9","purl":"pkg:npm/pubface@1.0.9"},{"type":"library","group":"@hapi","name":"hapi","version":"21.3.6","purl":"pkg:npm/%40hapi/hapi@21.3.6"},{"type":"library","name":"eerawlog","version":"1.5.1","purl":"pkg:npm/eerawlog@1.5.1","licenses":[{"expression":"ISC"}]},{"type":"library","name":"grunt","version":"1.6.1","purl":"pkg:npm/grunt@1.6.1","licenses":[{"expression":"MIT"}]},{"type":"library","name":"html-to-text","version":"9.0.5","purl":"pkg:npm/html-to-text@9.0.5","licenses":[{"expression":"MIT"}]},{"type":"library","name":"punycode","version":"2.3.1","purl":"pkg:npm/punycode@2.3.1","licenses":[{"expression":"MIT"}]},{"type":"library","group":"@hapi","name":"cookie","version":"12.0.1","purl":"pkg:npm/%40hapi/cookie@12.0.1","licenses":[{"expression":"BSD-3-Clause"}]},{"type":"library","name":"exponential-backoff","version":"3.1.1","purl":"pkg:npm/exponential-backoff@3.1.1","licenses":[{"expression":"Apache-2.0"}]},{"type":"library","name":"imapflow","version":"1.0.156","purl":"pkg:npm/imapflow@1.0.156"},{"type":"library","name":"prom-client","version":"15.1.0","purl":"pkg:npm/prom-client@15.1.0","licenses":[{"expression":"Apache-2.0"}]},{"type":"library","name":"ace-builds","version":"1.32.7","purl":"pkg:npm/ace-builds@1.32.7"},{"type":"library","name":"compare-versions","version":"6.1.0","purl":"pkg:npm/compare-versions@6.1.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"grunt-cli","version":"1.4.3","purl":"pkg:npm/grunt-cli@1.4.3","licenses":[{"expression":"MIT"}]},{"type":"library","group":"@hapi","name":"bell","version":"13.0.1","purl":"pkg:npm/%40hapi/bell@13.0.1","licenses":[{"expression":"BSD-3-Clause"}]},{"type":"library","group":"@postalsys","name":"templates","version":"1.0.8","purl":"pkg:npm/%40postalsys/templates@1.0.8"},{"type":"library","name":"dotenv","version":"16.4.5","purl":"pkg:npm/dotenv@16.4.5","licenses":[{"expression":"BSD-2-Clause"}]},{"type":"library","name":"ipaddr.js","version":"2.1.0","purl":"pkg:npm/ipaddr.js@2.1.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"node-gettext","version":"3.0.0","purl":"pkg:npm/node-gettext@3.0.0","licenses":[{"expression":"MIT"}]},{"type":"library","group":"@hapi","name":"vision","version":"7.0.3","purl":"pkg:npm/%40hapi/vision@7.0.3","licenses":[{"expression":"BSD-3-Clause"}]},{"type":"library","group":"@postalsys","name":"email-ai-tools","version":"1.8.6","purl":"pkg:npm/%40postalsys/email-ai-tools@1.8.6"},{"type":"library","name":"base32.js","version":"0.1.0","purl":"pkg:npm/base32.js@0.1.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"chai","version":"4.3.10","purl":"pkg:npm/chai@4.3.10","licenses":[{"expression":"MIT"}]},{"type":"library","name":"murmurhash","version":"2.0.1","purl":"pkg:npm/murmurhash@2.0.1","licenses":[{"expression":"MIT"}]},{"type":"library","name":"wild-config","version":"1.7.1","purl":"pkg:npm/wild-config@1.7.1","licenses":[{"expression":"MIT"}]},{"type":"library","group":"@hapi","name":"inert","version":"7.1.0","purl":"pkg:npm/%40hapi/inert@7.1.0","licenses":[{"expression":"BSD-3-Clause"}]},{"type":"library","name":"bull-arena","version":"4.2.0","purl":"pkg:npm/bull-arena@4.2.0"},{"type":"library","name":"bullmq","version":"5.4.2","purl":"pkg:npm/bullmq@5.4.2"},{"type":"library","name":"mailsplit","version":"5.4.0","purl":"pkg:npm/mailsplit@5.4.0","licenses":[{"expression":"EUPL-1.1+ OR MIT OR (EUPL-1.1+ AND MIT)"}]},{"type":"library","name":"psl","version":"1.9.0","purl":"pkg:npm/psl@1.9.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"smtp-server","version":"3.13.3","purl":"pkg:npm/smtp-server@3.13.3"},{"type":"library","name":"iconv-lite","version":"0.6.3","purl":"pkg:npm/iconv-lite@0.6.3","licenses":[{"expression":"MIT"}]},{"type":"library","name":"libqp","version":"2.1.0","purl":"pkg:npm/libqp@2.1.0"},{"type":"library","name":"pino-pretty","version":"10.3.1","purl":"pkg:npm/pino-pretty@10.3.1","licenses":[{"expression":"MIT"}]},{"type":"library","name":"pkg","version":"5.8.1","purl":"pkg:npm/pkg@5.8.1","licenses":[{"expression":"MIT"}]},{"type":"library","group":"@hapi","name":"boom","version":"10.0.1","purl":"pkg:npm/%40hapi/boom@10.0.1","licenses":[{"expression":"BSD-3-Clause"}]},{"type":"library","name":"hapi-pino","version":"12.1.0","purl":"pkg:npm/hapi-pino@12.1.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"resedit","version":"2.0.0","purl":"pkg:npm/resedit@2.0.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"pino","version":"8.19.0","purl":"pkg:npm/pino@8.19.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"xml2js","version":"0.6.2","purl":"pkg:npm/xml2js@0.6.2","licenses":[{"expression":"MIT"}]},{"type":"library","group":"@postalsys","name":"certs","version":"1.0.8","purl":"pkg:npm/%40postalsys/certs@1.0.8"},{"type":"library","name":"encoding-japanese","version":"2.0.0","purl":"pkg:npm/encoding-japanese@2.0.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"he","version":"1.2.0","purl":"pkg:npm/he@1.2.0","licenses":[{"expression":"MIT"}]},{"type":"library","name":"nodemailer","version":"6.9.12","purl":"pkg:npm/nodemailer@6.9.12","licenses":[{"expression":"MIT-0"}]},{"type":"library","group":"actions","name":"checkout","version":"4","purl":"pkg:github/actions/checkout@4"},{"type":"library","group":"docker","name":"build-push-action","version":"5","purl":"pkg:github/docker/build-push-action@5"},{"type":"library","group":"docker","name":"login-action","version":"3","purl":"pkg:github/docker/login-action@3"},{"type":"library","group":"docker","name":"setup-qemu-action","version":"3","purl":"pkg:github/docker/setup-qemu-action@3"},{"type":"library","group":"google-github-actions","name":"release-please-action","version":"3","purl":"pkg:github/google-github-actions/release-please-action@3"},{"type":"library","group":"shimataro","name":"ssh-key-action","version":"2","purl":"pkg:github/shimataro/ssh-key-action@2"},{"type":"library","group":"docker","name":"metadata-action","version":"5","purl":"pkg:github/docker/metadata-action@5"},{"type":"library","group":"docker","name":"setup-buildx-action","version":"3","purl":"pkg:github/docker/setup-buildx-action@3"},{"type":"library","group":"actions","name":"setup-node","version":"3","purl":"pkg:github/actions/setup-node@3"},{"type":"library","group":"actions","name":"setup-node","version":"1","purl":"pkg:github/actions/setup-node@1"}]} diff --git a/server.js b/server.js index 733aac4e..54e1e0a6 100644 --- a/server.js +++ b/server.js @@ -239,6 +239,8 @@ const THREAD_CONFIG_VALUES = { const queueEvents = {}; +let runIndex; + let preparedSettings = false; const preparedSettingsString = readEnvValue('EENGINE_SETTINGS') || config.settings; if (preparedSettingsString) { @@ -1033,7 +1035,8 @@ async function assignAccounts() { await call(worker, { cmd: 'assign', - account + account, + runIndex }); if (CONNECION_SETUP_DELAY) { @@ -1835,6 +1838,10 @@ async function onCommand(worker, message) { ); return; + case 'runIndex': { + return runIndex; + } + case 'update': case 'sync': case 'pause': @@ -2015,6 +2022,8 @@ process.on('SIGINT', () => { // START APPLICATION const startApplication = async () => { + runIndex = await redis.hincrby(`${REDIS_PREFIX}settings`, 'run', 1); + // process license if (config.licensePath) { try { diff --git a/static/licenses.html b/static/licenses.html index 5bd4c11f..6f022a69 100644 --- a/static/licenses.html +++ b/static/licenses.html @@ -1,6 +1,6 @@ EmailEngine Licenses
-

EmailEngine v2.40.3

EmailEngine includes code from the following software packages:

+

EmailEngine v2.40.5

EmailEngine includes code from the following software packages:

@@ -65,46 +65,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -115,16 +75,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -675,56 +625,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1136,16 +1036,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -1285,16 +1175,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -1345,16 +1225,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -1406,7 +1276,7 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- + @@ -1426,16 +1296,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -1506,16 +1366,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -1536,7 +1386,7 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- + @@ -1695,16 +1545,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -2095,16 +1935,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -2205,16 +2035,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -2255,16 +2075,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -2784,16 +2594,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -2855,7 +2655,7 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- + @@ -2874,16 +2674,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -3094,36 +2884,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - - - - - - - - - - - - - - - @@ -3254,16 +3014,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -3354,16 +3104,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -3574,16 +3314,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -3735,16 +3465,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -3815,7 +3535,7 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- + @@ -3884,16 +3604,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -3984,16 +3694,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -4244,16 +3944,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -4294,16 +3984,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -4694,16 +4374,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -4764,16 +4434,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -5164,16 +4824,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -5264,16 +4914,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -5294,16 +4934,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -5354,16 +4984,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -5644,16 +5264,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -5854,16 +5464,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -5954,26 +5554,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - - - - - - - - @@ -5984,16 +5564,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -6034,16 +5604,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -6214,16 +5774,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -6644,36 +6194,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - - - - - - - - - - - - - - - @@ -6904,16 +6424,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -6955,16 +6465,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -7044,26 +6544,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - - - - - - - - @@ -7124,16 +6604,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -7234,16 +6704,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - @@ -7354,16 +6814,6 @@

EmailEngine v2.40.3

EmailEngine includes code from the following soft

- - - - - - - diff --git a/translations/messages.pot b/translations/messages.pot index 15798011..361659e9 100644 --- a/translations/messages.pot +++ b/translations/messages.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Content-Type: text/plain; charset=ascii\n" -"POT-Creation-Date: 2024-03-14 11:13+0000\n" +"POT-Creation-Date: 2024-03-19 09:31+0000\n" #: views/config/license.hbs:48 msgid "%d day" @@ -9,6 +9,10 @@ msgid_plural "%d days" msgstr[0] "" msgstr[1] "" +#: views/redirect.hbs:1 +msgid "Click here to continue…" +msgstr "" + #: views/unsubscribe.hbs:1 #: views/unsubscribe.hbs:79 msgid "Unsubscribe" @@ -53,10 +57,6 @@ msgstr "" msgid "Enter your email address" msgstr "" -#: views/redirect.hbs:1 -msgid "Click here to continue…" -msgstr "" - #: views/accounts/register/imap.hbs:11 msgid "Your name" msgstr "" @@ -80,6 +80,14 @@ msgstr "" msgid "Continue" msgstr "" +#: views/accounts/register/index.hbs:2 +msgid "Choose your email account provider" +msgstr "" + +#: views/accounts/register/index.hbs:15 +msgid "Standard IMAP" +msgstr "" + #: views/accounts/register/imap-server.hbs:18 msgid "IMAP" msgstr "" @@ -181,14 +189,6 @@ msgstr "" msgid "HTTP error!" msgstr "" -#: views/accounts/register/index.hbs:2 -msgid "Choose your email account provider" -msgstr "" - -#: views/accounts/register/index.hbs:15 -msgid "Standard IMAP" -msgstr "" - #: lib/routes-ui.js:580 msgid "Invalid API key for OpenAI" msgstr "" diff --git a/workers/imap.js b/workers/imap.js index 1621c898..74dfe816 100644 --- a/workers/imap.js +++ b/workers/imap.js @@ -127,7 +127,7 @@ class ConnectionHandler { }; } - async assignConnection(account) { + async assignConnection(account, runIndex) { logger.info({ msg: 'Assigned account to worker', account }); let accountLogger = await this.getAccountLogger(account); @@ -148,6 +148,7 @@ class ConnectionHandler { if (oauth2App.baseScopes === 'api') { // Use API instead of IMAP accountObject.connection = new GmailClient(account, { + runIndex, accountObject, redis, accountLogger, @@ -159,6 +160,8 @@ class ConnectionHandler { if (!accountObject.connection) { accountObject.connection = new IMAPConnection(account, { + runIndex, + accountObject, redis, accountLogger, @@ -626,7 +629,6 @@ class ConnectionHandler { case 'resource-usage': return threadStats.usage(); - case 'assign': case 'delete': case 'update': case 'sync': @@ -634,6 +636,9 @@ class ConnectionHandler { case 'resume': return await this[`${message.cmd}Connection`](message.account); + case 'assign': + return await this[`${message.cmd}Connection`](message.account, message.runIndex); + case 'listMessages': case 'getText': case 'getMessage':
PackageVersionLicensePublisherPublisher's EmailPackage URL
@babel/generator7.18.2MITThe Babel Team -github.com/babel/babel -
@babel/helper-string-parser7.23.4MITThe Babel Team -github.com/babel/babel -
@babel/helper-validator-identifier7.22.20MITThe Babel Team -github.com/babel/babel -
@babel/parser7.18.4MITThe Babel Team -github.com/babel/babel -
@babel/runtime 7.24.0 MIT
@babel/types7.19.0MITThe Babel Team -github.com/babel/babel -
@bugsnag/browser 7.22.4 MIT
@jridgewell/gen-mapping0.3.5MITJustin Ridgewelljustin@ridgewell.name -github.com/jridgewell/gen-mapping -
@jridgewell/resolve-uri3.1.2MITJustin Ridgewelljustin@ridgewell.name -github.com/jridgewell/resolve-uri -
@jridgewell/set-array1.2.1MITJustin Ridgewelljustin@ridgewell.name -github.com/jridgewell/set-array -
@jridgewell/sourcemap-codec1.4.15MITRich Harris -github.com/jridgewell/sourcemap-codec -
@jridgewell/trace-mapping0.3.25MITJustin Ridgewelljustin@ridgewell.name -github.com/jridgewell/trace-mapping -
@jsdevtools/ono 7.1.3 MIT
agent-base6.0.2MITNathan Rajlichnathan@tootallnate.net -github.com/TooTallNate/node-agent-base -
agent-base 7.1.0 MIT Nathan Rajlich
array-union2.1.0MITSindre Sorhussindresorhus@gmail.com -github.com/sindresorhus/array-union -
asap 2.0.6 MIT
at-least-node1.0.0ISCRyan Zimmermanopensrc@ryanzim.com -github.com/RyanZim/at-least-node -
atomic-sleep 1.0.0 MIT
binary-extensions2.2.02.3.0 MIT Sindre Sorhus sindresorhus@gmail.com
bl4.1.0MIT -github.com/rvagg/bl -
bl 5.1.0 MIT
buffer5.7.1MITFeross Aboukhadijehfeross@feross.org -github.com/feross/buffer -
buffer 6.0.3 MIT Feross Aboukhadijeh
bullmq5.4.25.4.3 MIT Taskforce.sh Inc.
chownr1.1.4ISCIsaac Z. Schlueteri@izs.me -github.com/isaacs/chownr -
clean-css 4.2.4 MIT
decompress-response6.0.0MITSindre Sorhussindresorhus@gmail.com -github.com/sindresorhus/decompress-response -
deep-eql 4.1.3 MIT
detect-libc2.0.2Apache-2.0Lovell Fullernpm@lovell.info -github.com/lovell/detect-libc -
detect-node 2.0.4 ISC
dir-glob3.0.1MITKevin Mårtenssonkevinmartensson@gmail.com -github.com/kevva/dir-glob -
doctrine 3.0.0 Apache-2.0
expand-template2.0.3(MIT OR WTFPL)LMralphtheninja@riseup.net -github.com/ralphtheninja/expand-template -
expand-tilde 2.0.2 MIT
fast-copy3.0.13.0.2 MIT tony_quetano@planttheidea.com
fast-glob3.3.2MITDenis Malinochkin -github.com/mrmlnc/fast-glob -
fast-json-stable-stringify 2.1.0 MIT
from22.3.0MITHugh Kennedyhughskennedy@gmail.com -github.com/hughsk/from2 -
fs-constants1.0.0MITMathias Buus -github.com/mafintosh/fs-constants -
fs-extra9.1.0MITJP Richardsonjprichardson@gmail.com -github.com/jprichardson/node-fs-extra -
fs.realpath 1.0.0 ISC
github-from-package0.0.0MITJames Hallidaymail@substack.net -github.com/substack/github-from-package -
glob-parent 5.1.2 ISC
globby11.1.0MITSindre Sorhussindresorhus@gmail.com -github.com/sindresorhus/globby -
gopd 1.0.1 MIT
has1.0.4MITThiago de Arrudatpadilha84@gmail.com -github.com/tarruda/has -
hasown 2.0.2 MIT
https-proxy-agent5.0.1MITNathan Rajlichnathan@tootallnate.net -github.com/TooTallNate/node-https-proxy-agent -
https-proxy-agent 7.0.4 MIT Nathan Rajlich
imapflow1.0.1561.0.157 MIT Postal Systems OÜ
into-stream6.0.0MITSindre Sorhussindresorhus@gmail.com -github.com/sindresorhus/into-stream -
ioredfour 1.3.0-ioredis-07 MIT
is-core-module2.9.0MITJordan Harbandljharb@gmail.com -github.com/inspect-js/is-core-module -
is-expression 3.0.0 MIT
jsesc2.5.2MITMathias Bynens -github.com/mathiasbynens/jsesc -
json-buffer 3.0.1 MIT
jsonfile6.1.0MITJP Richardsonjprichardson@gmail.com -github.com/jprichardson/node-jsonfile -
jsxgettext 0.11.0 MPL-2.0
merge21.4.1MIT -github.com/teambition/merge2 -
methods 1.1.2 MIT
mimic-response3.1.0MITSindre Sorhussindresorhus@gmail.com -github.com/sindresorhus/mimic-response -
minimalistic-assert 1.0.1 ISC
mkdirp-classic0.5.3MITMathias Buus -github.com/mafintosh/mkdirp-classic -
mkdirp 0.5.6 MIT
multistream4.1.0MITFeross Aboukhadijehfeross@feross.org -github.com/feross/multistream -
murmurhash 2.0.1 MIT
napi-build-utils1.0.2MITJim Schlight -github.com/inspiredware/napi-build-utils -
natural-compare 1.4.0 MIT
node-abi3.56.0MITLukas Geiger -github.com/electron/node-abi -
node-abort-controller 3.1.1 MIT
p-is-promise3.0.0MITSindre Sorhussindresorhus@gmail.com -github.com/sindresorhus/p-is-promise -
p-limit 2.3.0 MIT
path-type4.0.0MITSindre Sorhussindresorhus@gmail.com -github.com/sindresorhus/path-type -
pathval 1.1.1 MIT
pkg-fetch3.4.2MIT -github.com/vercel/pkg-fetch -
pkg5.8.1MIT -github.com/vercel/pkg -
pngjs 5.0.0 MIT
prebuild-install7.1.1MITMathias Buus -github.com/prebuild/prebuild-install -
prelude-ls 1.2.1 MIT
progress2.0.3MITTJ Holowaychuktj@vision-media.ca -github.com/visionmedia/node-progress -
prom-client 15.1.0 Apache-2.0
rc1.2.8(BSD-2-Clause OR MIT OR Apache-2.0)Dominic Tarrdominic.tarr@gmail.com -github.com/dominictarr/rc -
read-installed 4.0.3 ISC
simple-concat1.0.1MITFeross Aboukhadijehfeross@feross.org -github.com/feross/simple-concat -
simple-get4.0.1MITFeross Aboukhadijehfeross@feross.org -github.com/feross/simple-get -
slash3.0.0MITSindre Sorhussindresorhus@gmail.com -github.com/sindresorhus/slash -
slick 1.12.2 MIT*
stream-meter1.0.4MITBryce B. Baril -github.com/brycebaril/node-stream-meter -
string-width 4.2.3 MIT
strip-json-comments2.0.1MITSindre Sorhussindresorhus@gmail.com -github.com/sindresorhus/strip-json-comments -
strip-json-comments 3.1.1 MIT Sindre Sorhus
tar-fs2.1.1MITMathias Buus -github.com/mafintosh/tar-fs -
tar-stream2.2.0MITMathias Buusmathiasbuus@gmail.com -github.com/mafintosh/tar-stream -
tdigest 0.1.2 MIT
to-fast-properties2.0.0MITSindre Sorhussindresorhus@gmail.com -github.com/sindresorhus/to-fast-properties -
to-regex-range 5.0.1 MIT
tunnel-agent0.6.0Apache-2.0Mikeal Rogersmikeal.rogers@gmail.com -github.com/mikeal/tunnel-agent -
type-check 0.4.0 MIT
universalify2.0.1MITRyan Zimmermanopensrc@ryanzim.com -github.com/RyanZim/universalify -
unpipe 1.0.0 MIT