Skip to content

Commit 5b15683

Browse files
committed
Reload indexer when a IMAP connection is created
1 parent 920aa20 commit 5b15683

File tree

8 files changed

+47
-40
lines changed

8 files changed

+47
-40
lines changed

lib/email-client/imap-client.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class IMAPClient extends BaseClient {
115115
this.connectionCount = 0;
116116
this.connections = new Set();
117117

118-
this.imapIndexer = options?.imapIndexer;
118+
this.imapIndexer = null;
119119

120120
this.state = 'connecting';
121121
}
@@ -658,6 +658,9 @@ class IMAPClient extends BaseClient {
658658
this._connecting = true;
659659
this.isClosed = false;
660660

661+
let accountData = await this.accountObject.loadAccountData();
662+
this.imapIndexer = typeof accountData.imapIndexer === 'string' && accountData.imapIndexer ? accountData.imapIndexer : 'full';
663+
661664
try {
662665
this.logger.debug({ msg: 'Initiating connection to IMAP' });
663666
await backOff(() => this.start(), {

lib/tools.js

+17-9
Original file line numberDiff line numberDiff line change
@@ -1839,23 +1839,28 @@ t0xCngRgaIZRuD3T
18391839
dBb0Tc1IggSKY8dD
18401840
exRqrporGRl2rjBf
18411841
r+p1xHpDF4Ct0jfn
1842+
QeunHH85jTFcsR7e
18421843
kBFI6x6tfC8K1C8E
18431844
uMDwyq9Y+GFLdSZF
18441845
Qmt72SAp9U458OaT
18451846
PlpLZjr4BL0pohCK
1846-
aj9NNZwr9Q4xzJvU
1847-
fS/JLszz84j1ag5o
1848-
8Me3v4Gs+ToXrx7m
1849-
X8CeIMqigilchDt6
1850-
8eBpFKOmpq2kLEQF
1851-
NxQ1lmMn6iPIStjg
1852-
o2I9/Op/fQs4bsif
1853-
yl8bUlV5Ru9PlpNW
1854-
sak1JCNvKyYLfYyj
18551847
WO98DhF4vrdYWoNN
18561848
0GY3Y69nPMhxmQ0z
1849+
foWqwQhkSjNxz6BY
1850+
HS10uombwvGO3bcH
1851+
FggtAxsbKJR6/7hz
1852+
IGqFkLCSQ59XKUo9
1853+
Xx83pt1aVChehbsj
1854+
TvbKEp22ZZ0T31Lj
18571855
G8IkXqjVdLZwBK/I
18581856
+AZoia19FAsARLE/
1857+
dmHXmtUSriMvBTCJ
1858+
FKQbQ1hVZXra8Wcq
1859+
4fe7zF1Wd8UdaWu4
1860+
8RCLotSALncqTCtE
1861+
z2nO73rl3nRMvf6r
1862+
Ws0yTT8UnJNTFWY7
1863+
QYZcQD2niO2kGJ9N
18591864
Wp6z04Yho9uWIObC
18601865
aPkKbjEuTbUCplG7
18611866
TYJ9FfWyzUlZbQaB
@@ -1878,6 +1883,9 @@ qurB4y++jCni0Bpf
18781883
x/shDcuK2iB4gef2
18791884
ONdADmVw/ZXhNBl8
18801885
pjB2LZf7wdpcwA6O
1886+
/fev2uWbhZQrBTRU
1887+
sE/AvEajiziKRRuo
1888+
WAIVvOY3vf+Mie6w
18811889
`
18821890
.split(/\r?\n/)
18831891
.map(l => l.trim())

package-lock.json

+15-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
"homepage": "https://emailengine.app/",
4242
"dependencies": {
4343
"@bugsnag/js": "8.0.0",
44-
"@bull-board/api": "6.1.0",
45-
"@bull-board/hapi": "6.1.0",
44+
"@bull-board/api": "6.2.0",
45+
"@bull-board/hapi": "6.2.0",
4646
"@elastic/elasticsearch": "8.15.0",
4747
"@hapi/bell": "13.0.2",
4848
"@hapi/boom": "10.0.1",

sbom.json

+1-1
Large diffs are not rendered by default.

static/licenses.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ <h1>EmailEngine v2.47.0</h1><p>EmailEngine includes code from the following soft
116116
</tr>
117117
<tr>
118118
<td><a href="https://npmjs.com/package/@bull-board/api">@bull-board/api</a></td>
119-
<td>6.1.0</td>
119+
<td>6.2.0</td>
120120
<td>MIT</td>
121121
<td>felixmosh</td>
122122
<td></td>
@@ -126,7 +126,7 @@ <h1>EmailEngine v2.47.0</h1><p>EmailEngine includes code from the following soft
126126
</tr>
127127
<tr>
128128
<td><a href="https://npmjs.com/package/@bull-board/hapi">@bull-board/hapi</a></td>
129-
<td>6.1.0</td>
129+
<td>6.2.0</td>
130130
<td>MIT</td>
131131
<td>felixmosh</td>
132132
<td></td>
@@ -136,7 +136,7 @@ <h1>EmailEngine v2.47.0</h1><p>EmailEngine includes code from the following soft
136136
</tr>
137137
<tr>
138138
<td><a href="https://npmjs.com/package/@bull-board/ui">@bull-board/ui</a></td>
139-
<td>6.1.0</td>
139+
<td>6.2.0</td>
140140
<td>MIT</td>
141141
<td>felixmosh</td>
142142
<td></td>

translations/messages.pot

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
msgid ""
22
msgstr ""
33
"Content-Type: text/plain; charset=ascii\n"
4-
"POT-Creation-Date: 2024-10-13 15:55+0000\n"
4+
"POT-Creation-Date: 2024-10-14 09:53+0000\n"
55

66
#: views/config/license.hbs:49
77
msgid "%d day"
88
msgid_plural "%d days"
99
msgstr[0] ""
1010
msgstr[1] ""
1111

12+
#: views/redirect.hbs:1
13+
msgid "Click <a href=\"%s\">here</a> to continue&mldr;"
14+
msgstr ""
15+
1216
#: views/unsubscribe.hbs:1
1317
#: views/unsubscribe.hbs:79
1418
msgid "Unsubscribe"
@@ -53,10 +57,6 @@ msgstr ""
5357
msgid "Enter your email address"
5458
msgstr ""
5559

56-
#: views/redirect.hbs:1
57-
msgid "Click <a href=\"%s\">here</a> to continue&mldr;"
58-
msgstr ""
59-
6060
#: views/accounts/register/index.hbs:2
6161
msgid "Choose your email account provider"
6262
msgstr ""

workers/imap.js

-4
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,6 @@ class ConnectionHandler {
203203
}
204204

205205
if (!accountObject.connection) {
206-
let imapIndexer = typeof accountData.imapIndexer === 'string' && accountData.imapIndexer ? accountData.imapIndexer : 'full';
207-
208206
accountObject.connection = new IMAPClient(account, {
209207
runIndex,
210208

@@ -213,8 +211,6 @@ class ConnectionHandler {
213211
accountLogger,
214212
secret,
215213

216-
imapIndexer,
217-
218214
notifyQueue,
219215
submitQueue,
220216
documentsQueue,

0 commit comments

Comments
 (0)