@hyperbytes/wappler-imap-manager 1.0.0

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.
Files changed (68) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/LICENSE.md +21 -0
  3. package/README.md +10 -0
  4. package/package.json +22 -0
  5. package/server_connect/modules/imapcount.hjson +126 -0
  6. package/server_connect/modules/imapcount.js +53 -0
  7. package/server_connect/modules/imapcount.php +17 -0
  8. package/server_connect/modules/imapcreatefolder.hjson +124 -0
  9. package/server_connect/modules/imapcreatefolder.js +46 -0
  10. package/server_connect/modules/imapcreatefolder.php +17 -0
  11. package/server_connect/modules/imapdelete.hjson +148 -0
  12. package/server_connect/modules/imapdelete.js +73 -0
  13. package/server_connect/modules/imapdelete.php +17 -0
  14. package/server_connect/modules/imapdeletefolder.hjson +125 -0
  15. package/server_connect/modules/imapdeletefolder.js +65 -0
  16. package/server_connect/modules/imapdeletefolder.php +17 -0
  17. package/server_connect/modules/imapdirlist.hjson +122 -0
  18. package/server_connect/modules/imapdirlist.js +57 -0
  19. package/server_connect/modules/imapdirlist.php +17 -0
  20. package/server_connect/modules/imapexpunge.hjson +115 -0
  21. package/server_connect/modules/imapexpunge.js +63 -0
  22. package/server_connect/modules/imapexpunge.php +17 -0
  23. package/server_connect/modules/imapflag.hjson +153 -0
  24. package/server_connect/modules/imapflag.js +81 -0
  25. package/server_connect/modules/imapflag.php +17 -0
  26. package/server_connect/modules/imapgetattachments.hjson +159 -0
  27. package/server_connect/modules/imapgetattachments.js +94 -0
  28. package/server_connect/modules/imapgetattachments.php +17 -0
  29. package/server_connect/modules/imapgetrawheaders.hjson +120 -0
  30. package/server_connect/modules/imapgetrawheaders.js +121 -0
  31. package/server_connect/modules/imapgetrawheaders.php +17 -0
  32. package/server_connect/modules/imapmailcontent.hjson +192 -0
  33. package/server_connect/modules/imapmailcontent.js +113 -0
  34. package/server_connect/modules/imapmailcontent.php +17 -0
  35. package/server_connect/modules/imapmailheaders.hjson +174 -0
  36. package/server_connect/modules/imapmailheaders.js +184 -0
  37. package/server_connect/modules/imapmailheaders.php +71 -0
  38. package/server_connect/modules/imapmovefolder.hjson +158 -0
  39. package/server_connect/modules/imapmovefolder.js +86 -0
  40. package/server_connect/modules/imapmovefolder.php +17 -0
  41. package/server_connect/modules/imapremoveflag.hjson +151 -0
  42. package/server_connect/modules/imapremoveflag.js +72 -0
  43. package/server_connect/modules/imapremoveflag.php +17 -0
  44. package/server_connect/modules/imapsaveasdraft.hjson +202 -0
  45. package/server_connect/modules/imapsaveasdraft.js +184 -0
  46. package/server_connect/modules/imapsaveflag.php +17 -0
  47. package/server_connect/modules/imapsendmail.hjson +190 -0
  48. package/server_connect/modules/imapsendmail.js +171 -0
  49. package/server_connect/modules/imapsendmail.php +17 -0
  50. package/server_connect/modules/imapstore.hjson +160 -0
  51. package/server_connect/modules/imapstore.js +63 -0
  52. package/server_connect/modules/imapstore.php +17 -0
  53. package/server_connect/modules/imapsubscribe.hjson +128 -0
  54. package/server_connect/modules/imapsubscribe.js +43 -0
  55. package/server_connect/modules/imapsubscribe.php +17 -0
  56. package/server_connect/modules/imapsubscribedlist.hjson +122 -0
  57. package/server_connect/modules/imapsubscribedlist.js +57 -0
  58. package/server_connect/modules/imapsubscribedlist.php +17 -0
  59. package/server_connect/modules/imaptrashperms.hjson +115 -0
  60. package/server_connect/modules/imaptrashperms.js +51 -0
  61. package/server_connect/modules/imaptrashperms.php +17 -0
  62. package/server_connect/modules/imapunsubscribedlist.hjson +122 -0
  63. package/server_connect/modules/imapunsubscribedlist.js +80 -0
  64. package/server_connect/modules/imapunsubscribedlist.php +17 -0
  65. package/server_connect/modules/testfile.hjsonx +134 -0
  66. package/server_connect/modules/testfile.js +28 -0
  67. package/server_connect/modules/testfile_bug.hjsonx +141 -0
  68. package/server_connect/modules/testfile_bug.js +8 -0
@@ -0,0 +1,153 @@
1
+ [{
2
+ type: 'imapflag-imapflag',
3
+ module : 'imapflag',
4
+ action : 'imapflag',
5
+ groupTitle : 'Mailer',
6
+ groupIcon : 'fas fa-envelope comp-general',
7
+ title : 'IMAP flag by UID',
8
+ icon : 'fas fa-solid fa-flag comp-exec',
9
+ dataPickObject: true,
10
+ usedModules : {
11
+ node: {
12
+ 'imap' : '^8.8.19',
13
+ 'mailparser' : '^3.7.2'
14
+ }
15
+ },
16
+ dataScheme: [
17
+ { type: "text",name: "uid"},
18
+ { type: "text",name: "mailbox"},
19
+ { type: "text",name: "flag"},
20
+ { type: "text",name: "status"}
21
+ ],
22
+ properties : [
23
+ {
24
+ group: 'IMAP Inputs',
25
+ variables: [
26
+
27
+ { name: 'actionName',
28
+ optionName: 'name',
29
+ title: 'Name',
30
+ type: 'text',
31
+ required: true,
32
+ baseName: "imap"
33
+ },
34
+ { name: 'selector', optionName: 'selector', title: 'IAMP Settings Selection',
35
+ type: 'droplist',
36
+ values: [
37
+ {title: 'Use ENV ', value: 'ENV' ,show:[],hide:['imap_msg','imap_host','imap_user','imap_password','imap_port','imap_tls']},
38
+ {title: 'Enable Manual Overrides', value: 'MANUAL',hide:[],show:['imap_msg','imap_host','imap_user','imap_password','imap_port','imap_tls'] },
39
+
40
+
41
+ ],
42
+ defaultValue: 'ENV',
43
+ help: 'Choose your TLS settings.',
44
+ initValue: "ENV"
45
+ },
46
+
47
+ {name: 'imap_msg',
48
+ optionName: 'imap_msg',
49
+ title: 'IMAP password',
50
+ type: 'static',
51
+ help: 'IMAP .ENV OVERRIDE SETTINGS'
52
+ },
53
+
54
+ {name: 'imap_host',
55
+ optionName: 'imap_host',
56
+ title: 'IMAP Host',
57
+ type: 'text',
58
+ defaultValue: "", initDisplay: 'none',
59
+ serverDataBindings: true,
60
+ help: 'The IMAP Host Server'
61
+ },
62
+ {name: 'imap_user',
63
+ optionName: 'imap_user',
64
+ title: 'IMAP User',
65
+ type: 'text',
66
+ defaultValue: "", initDisplay: 'none',
67
+ serverDataBindings: true,
68
+ help: 'The IMAP user'
69
+ },
70
+
71
+ {name: 'imap_password',
72
+ optionName: 'imap_password',
73
+ title: 'IMAP password',
74
+ type: 'text',
75
+ defaultValue: "", initDisplay: 'none',
76
+ serverDataBindings: true,
77
+ help: 'The IMAP password'
78
+ },
79
+ {name: 'imap_port',
80
+ optionName: 'imap_port',
81
+ title: 'IMAP Port',
82
+ type: 'text',
83
+ defaultValue: "", initDisplay: 'none',
84
+ serverDataBindings: true,
85
+ help: 'The IMAP port'
86
+ },
87
+ { name: 'imap_tls', optionName: 'imap_tls', title: 'TLS Settings',
88
+ type: 'droplist',
89
+ values: [
90
+ {title: 'Use ENV if available', value: 'ENV' },
91
+ {title: 'True', value: 'True' },
92
+ {title: 'False', value: 'False' },
93
+
94
+ ],
95
+ defaultValue: 'ENV', initDisplay: 'none',
96
+ help: 'Choose your TLS settings.',
97
+ initValue: "ENV"
98
+ },
99
+
100
+ {name: 'imap_msg2',
101
+ optionName: 'imap_msg2',
102
+ title: '',
103
+ type: 'static',
104
+ help: 'API ACTION SETTINGS'
105
+ },
106
+ { name: 'uid',
107
+ optionName: 'uid',
108
+ title: 'uid',
109
+ type: 'text',
110
+ required: true,
111
+ defaultValue: "0",
112
+ serverDataBindings: true,
113
+ help: 'The uid of the email'
114
+ },
115
+ { name: 'uidvalidity',
116
+ optionName: 'uidvalidity',
117
+ title: 'uidValidity',
118
+ type: 'text',
119
+ required: true,
120
+ defaultValue: "0",
121
+ serverDataBindings: true,
122
+ help: 'The uidValidity key of the email'
123
+ },
124
+ { name: 'mailbox',
125
+ optionName: 'mailbox',
126
+ title: 'mailbox',
127
+ type: 'text',
128
+ required: true,
129
+ defaultValue: "INBOX",
130
+ serverDataBindings: true,
131
+ help: 'The mailbox containing the email'
132
+ },
133
+ {name: 'imapflag',
134
+ optionName: 'imapflag',
135
+ title: 'Flag',
136
+ type: 'text',
137
+ required: true,
138
+ defaultValue: "\\Seen",
139
+ serverDataBindings: true,
140
+ help: 'The flag to add to email'
141
+ },
142
+ { name: 'output',
143
+ optionName: 'output',
144
+ title: 'Output',
145
+ type: 'boolean',
146
+ defaultValue: false
147
+ }
148
+ ]
149
+ },
150
+
151
+ ]
152
+ }
153
+ ]
@@ -0,0 +1,81 @@
1
+ const Imap = require('imap');
2
+
3
+ exports.imapflag = async function (options, name) {
4
+ const IMAP_HOST = this.parseOptional(options.imap_host, '*', process.env.IMAP_HOST);
5
+ const IMAP_PASSWORD = this.parseOptional(options.imap_password, '*', process.env.IMAP_PASSWORD);
6
+ const IMAP_USER = this.parseOptional(options.imap_usesr, '*', process.env.IMAP_USER);
7
+ const IMAP_PORT = this.parseOptional(options.imap_port, '*', process.env.IMAP_PORT);
8
+ const imap_tlsstring = this.parseOptional(options.imap_tls, '*', process.env.IMAP_TLS).toLowerCase();
9
+ const IMAP_TLS = (imap_tlsstring == 'true');
10
+
11
+ console.log(options.uid);
12
+ console.log(options.imapflag);
13
+
14
+ const uid = this.parseRequired(options.uid, '*', "No message UID specified");
15
+ const uidvalidity = this.parseRequired(options.uidvalidity, '*', "No message UIDValidity specified");
16
+ const mailbox = this.parseRequired(options.mailbox, '*', "No mailbox specified");
17
+ const flag = normalizeBackslash(this.parseRequired(options.imapflag, '*', "No Flag specified"));
18
+
19
+ function flagEmail(config, emailUID, mailboxName, expectedUidvalidity) {
20
+ return new Promise((resolve) => {
21
+ const imap = new Imap(config);
22
+
23
+ function openMailbox(cb) {
24
+ imap.openBox(mailboxName, false, function (err, box) {
25
+ if (err) {
26
+ imap.end();
27
+ return resolve({ uid: null, mailbox: mailboxName, flag: null, status: 401 });
28
+ }
29
+
30
+ if (Number(box.uidvalidity) !== Number(expectedUidvalidity)) {
31
+ imap.end();
32
+ return resolve({ uid: null, mailbox: mailboxName, flag: null, status: 401 });
33
+ }
34
+
35
+ imap.addFlags(emailUID, [flag], function (err) {
36
+ if (err) {
37
+ imap.end();
38
+ return resolve({ uid: emailUID, mailbox: mailboxName, flag: flag, status: 401 });
39
+ }
40
+
41
+ console.log(`Email UID ${emailUID} in ${mailboxName} flagged with ${flag}.`);
42
+ imap.end();
43
+ resolve({ uid: emailUID, mailbox: mailboxName, flag: flag, status: 200 });
44
+ });
45
+ });
46
+ }
47
+
48
+ imap.once('ready', function () {
49
+ openMailbox();
50
+ });
51
+
52
+ imap.once('error', function () {
53
+ resolve({ uid: null, mailbox: mailboxName, flag: null, status: 401 });
54
+ });
55
+
56
+ imap.once('end', function () {
57
+ console.log('IMAP Connection ended');
58
+ });
59
+
60
+ imap.connect();
61
+ });
62
+ }
63
+
64
+ // Config setup
65
+ const config = {
66
+ user: IMAP_USER,
67
+ password: IMAP_PASSWORD,
68
+ host: IMAP_HOST,
69
+ port: IMAP_PORT,
70
+ tls: IMAP_TLS
71
+ };
72
+
73
+ return flagEmail(config, uid, mailbox, uidvalidity);
74
+ };
75
+
76
+ function normalizeBackslash(inputString) {
77
+ if (inputString.startsWith("\\\\")) {
78
+ return inputString.replace(/^\\\\/, "\\");
79
+ }
80
+ return inputString;
81
+ }
@@ -0,0 +1,17 @@
1
+ <?php
2
+
3
+ namespace modules;
4
+
5
+ use \lib\core\Module;
6
+
7
+ class custom extends Module
8
+ {
9
+ public function imapflag($options, $name) {
10
+
11
+ $myObj->response = "This function is not yet available in PHP";
12
+
13
+ return json_encode($myObj);
14
+ }
15
+ }
16
+
17
+ ?>
@@ -0,0 +1,159 @@
1
+ [{
2
+ type: 'imapgetattachments-imapgetattachments',
3
+ module : 'imapgetattachments',
4
+ action : 'imapgetattachments',
5
+ groupTitle : 'Mailer',
6
+ groupIcon : 'fas fa-envelope comp-general',
7
+ title : 'IMAP Get Attachments by UID',
8
+ icon : 'fas fa-solid fa-trash comp-exec',
9
+ dataPickObject: true,
10
+ usedModules : {
11
+ node: {
12
+ 'imap' : '^8.8.19',
13
+ 'mailparser' : '^3.7.2'
14
+ }
15
+ },
16
+ dataScheme:[
17
+ {name: 'savedFiles', type:'array', sub:[
18
+ {name: '$value', type:'text'}
19
+ ]},
20
+ {name: 'message', type:'text'},
21
+ {name: 'url', type:'text'},
22
+ {name: 'path', type:'text'},
23
+ {name: 'status', type:'text'}
24
+ ],
25
+
26
+ properties : [
27
+ {
28
+ group: 'IMAP Inputs',
29
+ variables: [
30
+
31
+
32
+ { name: 'actionName',
33
+ optionName: 'name',
34
+ title: 'Name',
35
+ type: 'text',
36
+ required: true,
37
+ baseName: "imap"
38
+ },
39
+ { name: 'selector', optionName: 'selector', title: 'IAMP Settings Selection',
40
+ type: 'droplist',
41
+ values: [
42
+ {title: 'Use ENV ', value: 'ENV' ,show:[],hide:['imap_msg','imap_host','imap_user','imap_password','imap_port','imap_tls']},
43
+ {title: 'Enable Manual Overrides', value: 'MANUAL',hide:[],show:['imap_msg','imap_host','imap_user','imap_password','imap_port','imap_tls'] },
44
+
45
+
46
+ ],
47
+ defaultValue: 'ENV',
48
+ help: 'Choose your TLS settings.',
49
+ initValue: "ENV"
50
+ },
51
+
52
+ {name: 'imap_msg',
53
+ optionName: 'imap_msg',
54
+ title: 'IMAP password',
55
+ type: 'static',
56
+ help: 'IMAP .ENV OVERRIDE SETTINGS'
57
+ },
58
+
59
+ {name: 'imap_host',
60
+ optionName: 'imap_host',
61
+ title: 'IMAP Host',
62
+ type: 'text',
63
+ defaultValue: "", initDisplay: 'none',
64
+ serverDataBindings: true,
65
+ help: 'The IMAP Host Server'
66
+ },
67
+ {name: 'imap_user',
68
+ optionName: 'imap_user',
69
+ title: 'IMAP User',
70
+ type: 'text',
71
+ defaultValue: "", initDisplay: 'none',
72
+ serverDataBindings: true,
73
+ help: 'The IMAP user'
74
+ },
75
+
76
+ {name: 'imap_password',
77
+ optionName: 'imap_password',
78
+ title: 'IMAP password',
79
+ type: 'text',
80
+ defaultValue: "", initDisplay: 'none',
81
+ serverDataBindings: true,
82
+ help: 'The IMAP password'
83
+ },
84
+ {name: 'imap_port',
85
+ optionName: 'imap_port',
86
+ title: 'IMAP Port',
87
+ type: 'text',
88
+ defaultValue: "", initDisplay: 'none',
89
+ serverDataBindings: true,
90
+ help: 'The IMAP port'
91
+ },
92
+ { name: 'imap_tls', optionName: 'imap_tls', title: 'TLS Settings',
93
+ type: 'droplist',
94
+ values: [
95
+ {title: 'Use ENV if available', value: 'ENV' },
96
+ {title: 'True', value: 'True' },
97
+ {title: 'False', value: 'False' },
98
+
99
+ ],
100
+ defaultValue: 'ENV', initDisplay: 'none',
101
+ help: 'Choose your TLS settings.',
102
+ initValue: "ENV"
103
+ },
104
+
105
+ {name: 'imap_msg2',
106
+ optionName: 'imap_msg2',
107
+ title: '',
108
+ type: 'static',
109
+ help: 'API ACTION SETTINGS'
110
+ },
111
+ { name: 'uid',
112
+ optionName: 'uid',
113
+ title: 'uid',
114
+ type: 'text',
115
+ required: true,
116
+ defaultValue: "",
117
+ serverDataBindings: true,
118
+ help: 'The uid of the email'
119
+ },
120
+ { name: 'uidvalidity',
121
+ optionName: 'uidvalidity',
122
+ title: 'uidValidity',
123
+ type: 'text',
124
+ required: true,
125
+ defaultValue: "",
126
+ serverDataBindings: true,
127
+ help: 'The uidValidity key of the email'
128
+ },
129
+ { name: 'mailbox',
130
+ optionName: 'mailbox',
131
+ title: 'mailbox',
132
+ type: 'text',
133
+ required: true,
134
+ defaultValue: "",
135
+ serverDataBindings: true,
136
+ help: 'The mailbox containing the email'
137
+ },
138
+ { name: 'path',
139
+ optionName: 'path',
140
+ title: 'Path',
141
+ type: 'folder',
142
+ required: true,
143
+ serverDataBindings: true,
144
+ help: 'The folder to save to'
145
+ },
146
+
147
+ { name: 'output',
148
+ optionName: 'output',
149
+ title: 'Output',
150
+ type: 'boolean',
151
+ defaultValue: false
152
+ }
153
+
154
+ ]
155
+ },
156
+
157
+ ]
158
+ }
159
+ ]
@@ -0,0 +1,94 @@
1
+ const Imap = require('imap');
2
+ const fs = require('fs');
3
+ const { simpleParser } = require('mailparser');
4
+ const path = require('path');
5
+ const { toSystemPath } = require("../../../lib/core/path");
6
+
7
+ exports.imapgetattachments = async function (options, name) {
8
+ const IMAP_USER = process.env.IMAP_USER;
9
+ const IMAP_PASSWORD = process.env.IMAP_PASSWORD;
10
+ const IMAP_HOST = process.env.IMAP_HOST;
11
+ const IMAP_PORT = process.env.IMAP_PORT;
12
+
13
+ const uid = this.parseRequired(options.uid, '*', 'No UID Specified');
14
+ const uidvalidity = this.parseRequired(options.uidvalidity, '*', "No message UIDValidity specified");
15
+ const mailbox = this.parseRequired(options.mailbox, '*', "No mailbox specified");
16
+ let sentPath = this.parseRequired(options.path, '*', 'No path Specified');
17
+ const returnPath = sentPath.split('/').slice(2).join('/');
18
+ savePath = toSystemPath(sentPath);
19
+
20
+ // Ensure the directory exists or create it
21
+ if (!fs.existsSync(savePath)) {
22
+ fs.mkdirSync(savePath, { recursive: true });
23
+ }
24
+
25
+ return new Promise((resolve) => {
26
+ const imap = new Imap({
27
+ user: IMAP_USER,
28
+ password: IMAP_PASSWORD,
29
+ host: IMAP_HOST,
30
+ port: IMAP_PORT,
31
+ tls: true
32
+ });
33
+
34
+ imap.once('ready', () => {
35
+ imap.openBox(mailbox, false, (err, box) => {
36
+ if (err) {
37
+ imap.end();
38
+ return resolve({ savedFiles: [], message: "Mailbox Auth Failure", url: '', path: '', status: 401 });
39
+ }
40
+
41
+ // Validate UIDVALIDITY before proceeding
42
+ if (Number(box.uidvalidity) !== Number(uidvalidity)) {
43
+ imap.end();
44
+ return resolve({ savedFiles: [], message: "UID Validity mismatch", url: '', path: '', status: 401 });
45
+ }
46
+
47
+ const fetch = imap.fetch(uid, { bodies: '', struct: true });
48
+
49
+ fetch.on('message', (msg) => {
50
+ let buffer = '';
51
+
52
+ msg.on('body', (stream) => {
53
+ stream.on('data', (chunk) => buffer += chunk.toString('utf8'));
54
+ stream.on('end', async () => {
55
+ try {
56
+ const parsed = await simpleParser(buffer);
57
+
58
+ if (!parsed.attachments || parsed.attachments.length === 0) {
59
+ imap.end();
60
+ return resolve({ savedFiles: [], message: "No Attachments Found", url: returnPath, path: sentPath, status: 200 });
61
+ }
62
+
63
+ const savedFiles = [];
64
+ parsed.attachments.forEach(att => {
65
+ const filePath = path.join(savePath, att.filename);
66
+ fs.writeFileSync(filePath, att.content);
67
+ savedFiles.push(att.filename);
68
+ console.log(`Saved attachment: ${filePath}`);
69
+ });
70
+
71
+ imap.end();
72
+ resolve({ savedFiles, message: savedFiles.join(", "), url: returnPath, path: sentPath, status: 200 });
73
+
74
+ } catch (parseError) {
75
+ imap.end();
76
+ resolve({ savedFiles: [], message: "Parse Failure", url: '', path: '', status: 400 });
77
+ }
78
+ });
79
+ });
80
+ });
81
+
82
+ fetch.once('end', () => {
83
+ imap.end();
84
+ });
85
+ });
86
+ });
87
+
88
+ imap.once('error', () => {
89
+ resolve({ savedFiles: [], message: "Error Opening Mailbox", url: "", path: "", status: 401 });
90
+ });
91
+
92
+ imap.connect();
93
+ });
94
+ };
@@ -0,0 +1,17 @@
1
+ <?php
2
+
3
+ namespace modules;
4
+
5
+ use \lib\core\Module;
6
+
7
+ class custom extends Module
8
+ {
9
+ public function imapgetattachments($options, $name) {
10
+
11
+ $myObj->response = "This function is not yet available in PHP";
12
+
13
+ return json_encode($myObj);
14
+ }
15
+ }
16
+
17
+ ?>
@@ -0,0 +1,120 @@
1
+ [{
2
+ type: 'imapgetrawheaders-imapgetrawheaders',
3
+ module : 'imapgetrawheaders',
4
+ action : 'imapgetrawheaders',
5
+ groupTitle : 'Mailer',
6
+ groupIcon : 'fas fa-envelope comp-general',
7
+ title : 'IMAP Get Raw Headers',
8
+ icon : 'fas fa-solid fa-list comp-general',
9
+ dataPickObject: true,
10
+ usedModules : {
11
+ node: {
12
+ 'imap' : '^8.8.19',
13
+ 'mailparser' : '^3.7.2'
14
+ }
15
+ },
16
+
17
+ properties : [
18
+ {
19
+ group: 'IMAP Inputs',
20
+ variables: [
21
+
22
+
23
+ { name: 'actionName',
24
+ optionName: 'name',
25
+ title: 'Name',
26
+ type: 'text',
27
+ required: true,
28
+ baseName: "imap"
29
+ },
30
+ { name: 'selector', optionName: 'selector', title: 'IAMP Settings Selection',
31
+ type: 'droplist',
32
+ values: [
33
+ {title: 'Use ENV ', value: 'ENV' ,show:[],hide:['imap_msg','imap_host','imap_user','imap_password','imap_port','imap_tls']},
34
+ {title: 'Enable Manula Overrides', value: 'MANUAL',hide:[],show:['imap_msg','imap_host','imap_user','imap_password','imap_port','imap_tls'] },
35
+
36
+
37
+ ],
38
+ defaultValue: 'ENV',
39
+ help: 'Choose your TLS settings.',
40
+ initValue: "ENV"
41
+ },
42
+
43
+ {name: 'imap_msg',
44
+ optionName: 'imap_msg',
45
+ title: 'IMAP password',
46
+ type: 'static',
47
+ help: 'IMAP .ENV OVERRIDE SETTINGS'
48
+ },
49
+
50
+ {name: 'imap_host',
51
+ optionName: 'imap_host',
52
+ title: 'IMAP Host',
53
+ type: 'text',
54
+ defaultValue: "", initDisplay: 'none',
55
+ serverDataBindings: true,
56
+ help: 'The IMAP Host Server'
57
+ },
58
+ {name: 'imap_user',
59
+ optionName: 'imap_user',
60
+ title: 'IMAP User',
61
+ type: 'text',
62
+ defaultValue: "", initDisplay: 'none',
63
+ serverDataBindings: true,
64
+ help: 'The IMAP user'
65
+ },
66
+
67
+ {name: 'imap_password',
68
+ optionName: 'imap_password',
69
+ title: 'IMAP password',
70
+ type: 'text',
71
+ defaultValue: "", initDisplay: 'none',
72
+ serverDataBindings: true,
73
+ help: 'The IMAP password'
74
+ },
75
+ {name: 'imap_port',
76
+ optionName: 'imap_port',
77
+ title: 'IMAP Port',
78
+ type: 'text',
79
+ defaultValue: "", initDisplay: 'none',
80
+ serverDataBindings: true,
81
+ help: 'The IMAP port'
82
+ },
83
+ { name: 'imap_tls', optionName: 'imap_tls', title: 'TLS Settings',
84
+ type: 'droplist',
85
+ values: [
86
+ {title: 'Use ENV if available', value: 'ENV' },
87
+ {title: 'True', value: 'True' },
88
+ {title: 'False', value: 'False' },
89
+
90
+ ],
91
+ defaultValue: 'ENV', initDisplay: 'none',
92
+ help: 'Choose your TLS settings.',
93
+ initValue: "ENV"
94
+ },
95
+
96
+ {name: 'imap_msg2',
97
+ optionName: 'imap_msg2',
98
+ title: '',
99
+ type: 'static',
100
+ help: 'API ACTION SETTINGS'
101
+ },
102
+ {name: 'mailbox',
103
+ optionName: 'mailbox',
104
+ title: 'IMAP Mailbox',
105
+ type: 'text',
106
+ defaultValue: "",
107
+ serverDataBindings: true,
108
+ help: 'The IMAP Mailbox'
109
+ },
110
+
111
+ { name: 'output',
112
+ optionName: 'output',
113
+ title: 'Output',
114
+ type: 'boolean',
115
+ defaultValue: false
116
+ }
117
+
118
+ ]
119
+ },
120
+ ]}]