@5minds/node-red-contrib-processcube-tools 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mocharc.json +5 -0
- package/dist/email-receiver/email-receiver.d.ts +3 -0
- package/{email-receiver → dist/email-receiver}/email-receiver.html +4 -82
- package/dist/email-receiver/email-receiver.js +342 -0
- package/dist/email-receiver/email-receiver.js.map +1 -0
- package/dist/email-sender/email-sender.d.ts +3 -0
- package/{email-sender → dist/email-sender}/email-sender.html +24 -106
- package/dist/email-sender/email-sender.js +193 -0
- package/dist/email-sender/email-sender.js.map +1 -0
- package/dist/html-to-text/html-to-text.d.ts +3 -0
- package/{processcube-html-to-text/processcube-html-to-text.html → dist/html-to-text/html-to-text.html} +3 -3
- package/dist/html-to-text/html-to-text.js +40 -0
- package/dist/html-to-text/html-to-text.js.map +1 -0
- package/dist/imap-config/imap-config.d.ts +3 -0
- package/dist/imap-config/imap-config.html +139 -0
- package/dist/imap-config/imap-config.js +22 -0
- package/dist/imap-config/imap-config.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/EmailReceiverMessage.d.ts +20 -0
- package/dist/interfaces/EmailReceiverMessage.js +3 -0
- package/dist/interfaces/EmailReceiverMessage.js.map +1 -0
- package/dist/interfaces/EmailSenderNodeProperties.d.ts +22 -0
- package/dist/interfaces/EmailSenderNodeProperties.js +3 -0
- package/dist/interfaces/EmailSenderNodeProperties.js.map +1 -0
- package/dist/interfaces/FetchState.d.ts +11 -0
- package/dist/interfaces/FetchState.js +3 -0
- package/dist/interfaces/FetchState.js.map +1 -0
- package/dist/interfaces/ImapConnectionConfig.d.ts +16 -0
- package/dist/interfaces/ImapConnectionConfig.js +3 -0
- package/dist/interfaces/ImapConnectionConfig.js.map +1 -0
- package/dist/smtp-config/smtp-config.d.ts +3 -0
- package/dist/smtp-config/smtp-config.html +138 -0
- package/dist/smtp-config/smtp-config.js +22 -0
- package/dist/smtp-config/smtp-config.js.map +1 -0
- package/package.json +28 -10
- package/tsconfig.json +23 -0
- package/email-receiver/email-receiver.js +0 -304
- package/email-sender/email-sender.js +0 -178
- package/examples/.gitkeep +0 -0
- package/processcube-html-to-text/processcube-html-to-text.js +0 -22
- package/test/helpers/email-receiver.mocks.js +0 -447
- package/test/helpers/email-sender.mocks.js +0 -368
- package/test/integration/email-receiver.integration.test.js +0 -515
- package/test/integration/email-sender.integration.test.js +0 -239
- package/test/unit/email-receiver.unit.test.js +0 -304
- package/test/unit/email-sender.unit.test.js +0 -570
package/.mocharc.json
ADDED
|
@@ -4,27 +4,13 @@
|
|
|
4
4
|
color: '#02AFD6',
|
|
5
5
|
defaults: {
|
|
6
6
|
name: { value: '' },
|
|
7
|
-
|
|
8
|
-
hostType: { value: 'str' },
|
|
9
|
-
port: { value: '', required: true, validate: RED.validators.typedInput('portType') },
|
|
10
|
-
portType: { value: 'num' },
|
|
11
|
-
tls: { value: true, required: true, validate: RED.validators.typedInput('tlsType') },
|
|
12
|
-
tlsType: { value: 'bool' },
|
|
13
|
-
user: { value: '', required: true, validate: RED.validators.typedInput('userType') },
|
|
14
|
-
userType: { value: 'str' },
|
|
15
|
-
password: { value: '', required: true },
|
|
16
|
-
passwordType: { value: 'env', required: true },
|
|
7
|
+
imapConfig: { value: '', type: 'imap-config', required: true },
|
|
17
8
|
folder: { value: '', required: true, validate: RED.validators.typedInput('folderType') },
|
|
18
9
|
folderType: { value: 'json' },
|
|
19
10
|
markseen: { value: true, validate: RED.validators.typedInput('markseenType') },
|
|
20
11
|
markseenType: { value: 'bool' },
|
|
21
|
-
sendstatus: { value: true },
|
|
22
12
|
},
|
|
23
13
|
inputs: 1,
|
|
24
|
-
// outputs: function () {
|
|
25
|
-
// const sendstatus = this.sendstatus === true || this.sendstatus === 'true';
|
|
26
|
-
// return sendstatus ? 2 : 1;
|
|
27
|
-
// },
|
|
28
14
|
outputs: 2,
|
|
29
15
|
outputLabels: function (index) {
|
|
30
16
|
if (index === 0) {
|
|
@@ -39,36 +25,6 @@
|
|
|
39
25
|
return this.name || 'E-Mail Receiver';
|
|
40
26
|
},
|
|
41
27
|
oneditprepare: function () {
|
|
42
|
-
$('#node-input-host').typedInput({
|
|
43
|
-
default: 'str',
|
|
44
|
-
types: ['str', 'msg', 'flow', 'global', 'env'],
|
|
45
|
-
typeField: '#node-input-hostType',
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
$('#node-input-port').typedInput({
|
|
49
|
-
default: 'num',
|
|
50
|
-
types: ['num', 'msg', 'flow', 'global', 'env'],
|
|
51
|
-
typeField: '#node-input-portType',
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
$('#node-input-tls').typedInput({
|
|
55
|
-
default: 'bool',
|
|
56
|
-
types: ['bool', 'msg', 'flow', 'global', 'env'],
|
|
57
|
-
typeField: '#node-input-tlsType',
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
$('#node-input-user').typedInput({
|
|
61
|
-
default: 'str',
|
|
62
|
-
types: ['str', 'msg', 'flow', 'global', 'env'],
|
|
63
|
-
typeField: '#node-input-userType',
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
$('#node-input-password').typedInput({
|
|
67
|
-
default: 'env',
|
|
68
|
-
types: ['msg', 'flow', 'global', 'env'],
|
|
69
|
-
typeField: '#node-input-passwordType',
|
|
70
|
-
});
|
|
71
|
-
|
|
72
28
|
$('#node-input-folder').typedInput({
|
|
73
29
|
default: 'json',
|
|
74
30
|
types: ['msg', 'flow', 'global', 'json', 'jsonata', 'env'],
|
|
@@ -91,38 +47,13 @@
|
|
|
91
47
|
</div>
|
|
92
48
|
|
|
93
49
|
<div class="form-row">
|
|
94
|
-
<label for="node-input-
|
|
95
|
-
<input type="text" id="node-input-
|
|
96
|
-
<input type="hidden" id="node-input-hostType" />
|
|
97
|
-
</div>
|
|
98
|
-
|
|
99
|
-
<div class="form-row">
|
|
100
|
-
<label for="node-input-port"><i class="fa fa-terminal"></i> Port</label>
|
|
101
|
-
<input type="text" id="node-input-port" placeholder="993" />
|
|
102
|
-
<input type="hidden" id="node-input-portType" />
|
|
103
|
-
</div>
|
|
104
|
-
|
|
105
|
-
<div class="form-row">
|
|
106
|
-
<label for="node-input-tls"><i class="fa fa-lock"></i> Use TLS</label>
|
|
107
|
-
<input type="text" id="node-input-tls" />
|
|
108
|
-
<input type="hidden" id="node-input-tlsType" />
|
|
109
|
-
</div>
|
|
110
|
-
|
|
111
|
-
<div class="form-row">
|
|
112
|
-
<label for="node-input-user"><i class="fa fa-user"></i> User</label>
|
|
113
|
-
<input type="text" id="node-input-user" />
|
|
114
|
-
<input type="hidden" id="node-input-userType" />
|
|
115
|
-
</div>
|
|
116
|
-
|
|
117
|
-
<div class="form-row">
|
|
118
|
-
<label for="node-input-password"><i class="fa fa-key"></i> Password</label>
|
|
119
|
-
<input type="text" id="node-input-password" />
|
|
120
|
-
<input type="hidden" id="node-input-passwordType" />
|
|
50
|
+
<label for="node-input-imapConfig"><i class="fa fa-server"></i> IMAP Server</label>
|
|
51
|
+
<input type="text" id="node-input-imapConfig" />
|
|
121
52
|
</div>
|
|
122
53
|
|
|
123
54
|
<div class="form-row">
|
|
124
55
|
<label for="node-input-folder"><i class="fa fa-folder-open"></i> Folder(s)</label>
|
|
125
|
-
<input type="text" id="node-input-folder" placeholder="
|
|
56
|
+
<input type="text" id="node-input-folder" placeholder='["INBOX"]' />
|
|
126
57
|
<input type="hidden" id="node-input-folderType" />
|
|
127
58
|
</div>
|
|
128
59
|
|
|
@@ -131,15 +62,6 @@
|
|
|
131
62
|
<input type="text" id="node-input-markseen" />
|
|
132
63
|
<input type="hidden" id="node-input-markseenType" />
|
|
133
64
|
</div>
|
|
134
|
-
<div class="form-row" style="margin-bottom: 3px;">
|
|
135
|
-
<input
|
|
136
|
-
type="checkbox"
|
|
137
|
-
checked
|
|
138
|
-
id="node-input-sendstatus"
|
|
139
|
-
style="display: inline-block; width: auto; vertical-align: top; margin-left: 5px;"
|
|
140
|
-
/>
|
|
141
|
-
<label style="width:auto" for="node-input-sendstatus">Send status</label>
|
|
142
|
-
</div>
|
|
143
65
|
</script>
|
|
144
66
|
|
|
145
67
|
<script type="text/html" data-help-name="email-receiver">
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
const node_imap_1 = __importDefault(require("node-imap"));
|
|
6
|
+
const mailparser_1 = require("mailparser");
|
|
7
|
+
// Default dependencies - production values
|
|
8
|
+
const defaultDependencies = {
|
|
9
|
+
ImapClient: node_imap_1.default,
|
|
10
|
+
mailParser: mailparser_1.simpleParser,
|
|
11
|
+
};
|
|
12
|
+
function toBoolean(val, defaultValue = false) {
|
|
13
|
+
if (typeof val === 'boolean')
|
|
14
|
+
return val;
|
|
15
|
+
if (typeof val === 'number')
|
|
16
|
+
return val !== 0;
|
|
17
|
+
if (typeof val === 'string') {
|
|
18
|
+
const v = val.trim().toLowerCase();
|
|
19
|
+
if (['true', '1', 'yes', 'on'].includes(v))
|
|
20
|
+
return true;
|
|
21
|
+
if (['false', '0', 'no', 'off'].includes(v))
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
return defaultValue;
|
|
25
|
+
}
|
|
26
|
+
const nodeInit = (RED, dependencies = defaultDependencies) => {
|
|
27
|
+
function EmailReceiverNode(config) {
|
|
28
|
+
RED.nodes.createNode(this, config);
|
|
29
|
+
const node = this;
|
|
30
|
+
// Store configuration validation error without failing construction
|
|
31
|
+
let configError = null;
|
|
32
|
+
// Get the IMAP config node
|
|
33
|
+
const imapConfigNode = RED.nodes.getNode(config.imapConfig);
|
|
34
|
+
try {
|
|
35
|
+
// Validate IMAP config node exists
|
|
36
|
+
if (!imapConfigNode) {
|
|
37
|
+
throw new Error('IMAP configuration node is not configured');
|
|
38
|
+
}
|
|
39
|
+
// Validate folder configuration
|
|
40
|
+
if (typeof config.folder === 'number') {
|
|
41
|
+
throw new Error("The 'folders' property must be an array of strings.");
|
|
42
|
+
}
|
|
43
|
+
if (Array.isArray(config.folder)) {
|
|
44
|
+
if (!config.folder.every((f) => typeof f === 'string')) {
|
|
45
|
+
throw new Error("The 'folders' property must be an array of strings.");
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else if (typeof config.folder !== 'string' && config.folder !== undefined) {
|
|
49
|
+
throw new Error("The 'folders' property must be an array of strings.");
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
configError = error instanceof Error ? error : new Error(String(error));
|
|
54
|
+
node.status({ fill: 'red', shape: 'ring', text: 'config error' });
|
|
55
|
+
// Store error for test framework to detect
|
|
56
|
+
node.configError = configError;
|
|
57
|
+
// Emit error immediately during construction for test framework
|
|
58
|
+
// Use setImmediate to ensure node is fully constructed first
|
|
59
|
+
setImmediate(() => {
|
|
60
|
+
node.error(configError.message);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
node.on('input', (msg, send, done) => {
|
|
64
|
+
send =
|
|
65
|
+
send ||
|
|
66
|
+
function (m) {
|
|
67
|
+
node.send(m);
|
|
68
|
+
};
|
|
69
|
+
done =
|
|
70
|
+
done ||
|
|
71
|
+
function (err) {
|
|
72
|
+
if (err)
|
|
73
|
+
node.error(err, msg);
|
|
74
|
+
};
|
|
75
|
+
// If there's a configuration error, report it and don't proceed
|
|
76
|
+
if (configError) {
|
|
77
|
+
node.error(configError.message);
|
|
78
|
+
done(configError);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
// Get configuration from config node
|
|
83
|
+
const imap_markSeen = RED.util.evaluateNodeProperty(String(config.markseen), config.markseenType, node, msg);
|
|
84
|
+
const imap_folder = RED.util.evaluateNodeProperty(String(config.folder), config.folderType, node, msg);
|
|
85
|
+
let folders;
|
|
86
|
+
if (Array.isArray(imap_folder)) {
|
|
87
|
+
folders = imap_folder;
|
|
88
|
+
}
|
|
89
|
+
else if (typeof imap_folder === 'string') {
|
|
90
|
+
folders = imap_folder
|
|
91
|
+
.split(',')
|
|
92
|
+
.map((f) => f.trim())
|
|
93
|
+
.filter((f) => f.length > 0);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
throw new Error("The 'folders' property must be an array of strings.");
|
|
97
|
+
}
|
|
98
|
+
// Evaluate user and password from config node (supports env and global)
|
|
99
|
+
const imap_user = RED.util.evaluateNodeProperty(imapConfigNode.user, imapConfigNode.userType || 'env', imapConfigNode, msg);
|
|
100
|
+
const imap_password = RED.util.evaluateNodeProperty(imapConfigNode.password, imapConfigNode.passwordType || 'env', imapConfigNode, msg);
|
|
101
|
+
const finalConfig = {
|
|
102
|
+
host: imapConfigNode.host,
|
|
103
|
+
port: imapConfigNode.port,
|
|
104
|
+
tls: imapConfigNode.tls,
|
|
105
|
+
user: imap_user,
|
|
106
|
+
password: imap_password,
|
|
107
|
+
folders: folders,
|
|
108
|
+
markSeen: toBoolean(imap_markSeen, true),
|
|
109
|
+
connTimeout: imapConfigNode.connTimeout,
|
|
110
|
+
authTimeout: imapConfigNode.authTimeout,
|
|
111
|
+
keepalive: imapConfigNode.keepalive,
|
|
112
|
+
autotls: imapConfigNode.autotls,
|
|
113
|
+
tlsOptions: { rejectUnauthorized: imapConfigNode.rejectUnauthorized },
|
|
114
|
+
};
|
|
115
|
+
// Enhanced validation after property evaluation
|
|
116
|
+
if (!finalConfig.user ||
|
|
117
|
+
!finalConfig.password ||
|
|
118
|
+
!finalConfig.port ||
|
|
119
|
+
!finalConfig.host ||
|
|
120
|
+
!finalConfig.folders ||
|
|
121
|
+
finalConfig.folders.length === 0) {
|
|
122
|
+
const missingFields = [];
|
|
123
|
+
if (!finalConfig.user)
|
|
124
|
+
missingFields.push('user');
|
|
125
|
+
if (!finalConfig.password)
|
|
126
|
+
missingFields.push('password');
|
|
127
|
+
if (!finalConfig.port)
|
|
128
|
+
missingFields.push('port');
|
|
129
|
+
if (!finalConfig.host)
|
|
130
|
+
missingFields.push('host');
|
|
131
|
+
if (!finalConfig.folders || finalConfig.folders.length === 0)
|
|
132
|
+
missingFields.push('folders');
|
|
133
|
+
throw new Error(`Missing required IMAP config: ${missingFields.join(', ')}. Aborting.`);
|
|
134
|
+
}
|
|
135
|
+
const fetchEmails = (fetchConfig, onMail) => {
|
|
136
|
+
// Use injected dependency instead of direct import
|
|
137
|
+
const imap = new dependencies.ImapClient({
|
|
138
|
+
user: fetchConfig.user,
|
|
139
|
+
password: fetchConfig.password,
|
|
140
|
+
host: fetchConfig.host,
|
|
141
|
+
port: fetchConfig.port,
|
|
142
|
+
tls: fetchConfig.tls,
|
|
143
|
+
connTimeout: fetchConfig.connTimeout,
|
|
144
|
+
authTimeout: fetchConfig.authTimeout,
|
|
145
|
+
keepalive: fetchConfig.keepalive,
|
|
146
|
+
autotls: fetchConfig.autotls,
|
|
147
|
+
tlsOptions: fetchConfig.tlsOptions,
|
|
148
|
+
});
|
|
149
|
+
const state = {
|
|
150
|
+
totalFolders: fetchConfig.folders.length,
|
|
151
|
+
processedFolders: 0,
|
|
152
|
+
folderCount: {},
|
|
153
|
+
successes: 0,
|
|
154
|
+
failures: 0,
|
|
155
|
+
totalMails: 0,
|
|
156
|
+
errors: [],
|
|
157
|
+
};
|
|
158
|
+
const updateStatus = (color, text) => {
|
|
159
|
+
node.status({ fill: color, shape: 'dot', text });
|
|
160
|
+
};
|
|
161
|
+
const finalizeSession = (error = null) => {
|
|
162
|
+
if (error) {
|
|
163
|
+
state.errors.push(error);
|
|
164
|
+
node.error('IMAP session terminated: ' + error.message);
|
|
165
|
+
node.status({ fill: 'red', shape: 'ring', text: 'connection error' });
|
|
166
|
+
node.send([
|
|
167
|
+
null,
|
|
168
|
+
{
|
|
169
|
+
payload: {
|
|
170
|
+
status: 'error',
|
|
171
|
+
message: error.message,
|
|
172
|
+
errors: state.errors,
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
]);
|
|
176
|
+
done(error);
|
|
177
|
+
}
|
|
178
|
+
else if (state.failures > 0) {
|
|
179
|
+
node.status({
|
|
180
|
+
fill: 'red',
|
|
181
|
+
shape: 'dot',
|
|
182
|
+
text: `Done, ${state.totalMails} mails from ${state.successes}/${state.totalFolders} folders. ${state.failures} failed.`,
|
|
183
|
+
});
|
|
184
|
+
node.send([
|
|
185
|
+
null,
|
|
186
|
+
{
|
|
187
|
+
payload: {
|
|
188
|
+
status: 'warning',
|
|
189
|
+
total: state.totalMails,
|
|
190
|
+
successes: state.successes,
|
|
191
|
+
failures: state.failures,
|
|
192
|
+
totalFolders: state.totalFolders,
|
|
193
|
+
errors: state.errors,
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
]);
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
node.status({
|
|
200
|
+
fill: 'green',
|
|
201
|
+
shape: 'dot',
|
|
202
|
+
text: `Done, fetched ${state.totalMails} mails from ${fetchConfig.folders.join(', ')}.`,
|
|
203
|
+
});
|
|
204
|
+
node.send([
|
|
205
|
+
null,
|
|
206
|
+
{
|
|
207
|
+
payload: {
|
|
208
|
+
status: 'success',
|
|
209
|
+
total: state.totalMails,
|
|
210
|
+
folderCount: state.folderCount,
|
|
211
|
+
folders: folders.join(', '),
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
]);
|
|
215
|
+
}
|
|
216
|
+
if (imap && imap.state !== 'disconnected') {
|
|
217
|
+
imap.end();
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
const fetchFromFolder = (folder) => {
|
|
221
|
+
updateStatus('yellow', `Fetching from "${folder}"...`);
|
|
222
|
+
imap.openBox(folder, false, (err, box) => {
|
|
223
|
+
if (err) {
|
|
224
|
+
node.error(`Could not open folder "${folder}": ${err.message}`);
|
|
225
|
+
state.failures++;
|
|
226
|
+
state.processedFolders++;
|
|
227
|
+
return startNextFolder();
|
|
228
|
+
}
|
|
229
|
+
state.folderCount[folder] = 0;
|
|
230
|
+
imap.search(['UNSEEN'], (err, results) => {
|
|
231
|
+
if (err) {
|
|
232
|
+
node.error(`Search failed in folder "${folder}": ${err.message}`);
|
|
233
|
+
state.failures++;
|
|
234
|
+
state.processedFolders++;
|
|
235
|
+
return startNextFolder();
|
|
236
|
+
}
|
|
237
|
+
if (!results || !results.length) {
|
|
238
|
+
state.successes++;
|
|
239
|
+
state.processedFolders++;
|
|
240
|
+
return startNextFolder();
|
|
241
|
+
}
|
|
242
|
+
state.totalMails += results.length;
|
|
243
|
+
const fetch = imap.fetch(results, { bodies: '', markSeen: finalConfig.markSeen });
|
|
244
|
+
fetch.on('message', (msg, seqno) => {
|
|
245
|
+
msg.on('body', (stream) => {
|
|
246
|
+
// Use injected dependency instead of direct import
|
|
247
|
+
dependencies.mailParser(stream, (err, parsed) => {
|
|
248
|
+
var _a, _b;
|
|
249
|
+
if (err) {
|
|
250
|
+
node.error(`Parse error for email from folder "${folder}": ${err.message}`);
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
const outMsg = {
|
|
254
|
+
topic: parsed.subject || '',
|
|
255
|
+
payload: parsed.text || '',
|
|
256
|
+
html: parsed.html || '',
|
|
257
|
+
from: ((_a = parsed.replyTo) === null || _a === void 0 ? void 0 : _a.text) || ((_b = parsed.from) === null || _b === void 0 ? void 0 : _b.text) || '',
|
|
258
|
+
date: parsed.date,
|
|
259
|
+
folder,
|
|
260
|
+
header: parsed.headers,
|
|
261
|
+
attachments: (parsed.attachments || []).map((att) => ({
|
|
262
|
+
contentType: att.contentType,
|
|
263
|
+
fileName: att.filename,
|
|
264
|
+
contentDisposition: att.contentDisposition,
|
|
265
|
+
generatedFileName: att.cid || att.checksum,
|
|
266
|
+
contentId: att.cid,
|
|
267
|
+
checksum: att.checksum,
|
|
268
|
+
length: att.size,
|
|
269
|
+
content: att.content,
|
|
270
|
+
})),
|
|
271
|
+
};
|
|
272
|
+
state.folderCount[folder] = (state.folderCount[folder] || 0) + 1;
|
|
273
|
+
onMail(outMsg);
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
if (fetchConfig.markSeen) {
|
|
277
|
+
msg.once('attributes', (attrs) => {
|
|
278
|
+
imap.addFlags(attrs.uid, 'SEEN', (err) => {
|
|
279
|
+
if (err) {
|
|
280
|
+
node.error(`Failed to mark message UID ${attrs.uid} as seen: ${err.message}`);
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
fetch.once('error', (err) => {
|
|
287
|
+
node.error(`Fetch error in folder "${folder}": ${err.message}`);
|
|
288
|
+
});
|
|
289
|
+
fetch.once('end', () => {
|
|
290
|
+
state.successes++;
|
|
291
|
+
state.processedFolders++;
|
|
292
|
+
updateStatus('green', `Fetched ${results.length} from "${folder}".`);
|
|
293
|
+
startNextFolder();
|
|
294
|
+
});
|
|
295
|
+
});
|
|
296
|
+
});
|
|
297
|
+
};
|
|
298
|
+
const startNextFolder = () => {
|
|
299
|
+
if (state.processedFolders >= state.totalFolders) {
|
|
300
|
+
finalizeSession();
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
fetchFromFolder(fetchConfig.folders[state.processedFolders]);
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
imap.once('ready', () => {
|
|
307
|
+
node.status({ fill: 'green', shape: 'dot', text: 'connected' });
|
|
308
|
+
startNextFolder();
|
|
309
|
+
});
|
|
310
|
+
imap.once('error', (err) => {
|
|
311
|
+
finalizeSession(err);
|
|
312
|
+
});
|
|
313
|
+
imap.once('end', () => {
|
|
314
|
+
updateStatus('green', 'IMAP connection ended.');
|
|
315
|
+
});
|
|
316
|
+
try {
|
|
317
|
+
updateStatus('yellow', 'Connecting to IMAP...');
|
|
318
|
+
imap.connect();
|
|
319
|
+
}
|
|
320
|
+
catch (err) {
|
|
321
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
322
|
+
updateStatus('red', 'Connection error: ' + error.message);
|
|
323
|
+
done(error);
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
fetchEmails(finalConfig, (mail) => {
|
|
328
|
+
send(mail);
|
|
329
|
+
});
|
|
330
|
+
done();
|
|
331
|
+
}
|
|
332
|
+
catch (error) {
|
|
333
|
+
node.status({ fill: 'red', shape: 'ring', text: 'config error' });
|
|
334
|
+
done(error instanceof Error ? error : new Error(String(error)));
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
node.on('close', () => { });
|
|
338
|
+
}
|
|
339
|
+
RED.nodes.registerType('email-receiver', EmailReceiverNode);
|
|
340
|
+
};
|
|
341
|
+
module.exports = nodeInit;
|
|
342
|
+
//# sourceMappingURL=email-receiver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-receiver.js","sourceRoot":"","sources":["../../src/email-receiver/email-receiver.ts"],"names":[],"mappings":";;;;AACA,0DAAwD;AACxD,2CAAkE;AAqBlE,2CAA2C;AAC3C,MAAM,mBAAmB,GAAiB;IACtC,UAAU,EAAE,mBAAI;IAChB,UAAU,EAAE,yBAAY;CAC3B,CAAC;AAEF,SAAS,SAAS,CAAC,GAAQ,EAAE,YAAY,GAAG,KAAK;IAC7C,IAAI,OAAO,GAAG,KAAK,SAAS;QAAE,OAAO,GAAG,CAAC;IACzC,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,GAAG,KAAK,CAAC,CAAC;IAC9C,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC1B,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QACnC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC;QACxD,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EA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