mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Error reporting
Password missing error only occurs if set to basic authentication. Token missing only occurs if set to XOAuth2.
This commit is contained in:
parent
aea1407745
commit
b433ed55f0
@ -196,9 +196,7 @@ module.exports = function(RED) {
|
||||
this.inport = n.port || (globalkeys && globalkeys.port) || "993";
|
||||
this.box = n.box || "INBOX";
|
||||
this.useSSL= n.useSSL;
|
||||
this.saslformat = n.saslformat;
|
||||
this.autotls= n.autotls;
|
||||
this.token = n.token || "oAuth2Response.access_token";
|
||||
this.protocol = n.protocol || "IMAP";
|
||||
this.disposition = n.disposition || "None"; // "None", "Delete", "Read"
|
||||
this.criteria = n.criteria || "UNSEEN"; // "ALL", "ANSWERED", "FLAGGED", "SEEN", "UNANSWERED", "UNFLAGGED", "UNSEEN"
|
||||
@ -216,14 +214,23 @@ module.exports = function(RED) {
|
||||
this.error(RED._("email.errors.nouserid"));
|
||||
}
|
||||
}
|
||||
if (this.credentials && this.credentials.hasOwnProperty("password")) {
|
||||
this.password = this.credentials.password;
|
||||
} else {
|
||||
if (globalkeys) {
|
||||
this.password = globalkeys.pass;
|
||||
flag = true;
|
||||
if(this.authtype === "BASIC" ) {
|
||||
if (this.credentials && this.credentials.hasOwnProperty("password")) {
|
||||
this.password = this.credentials.password;
|
||||
} else {
|
||||
this.error(RED._("email.errors.nopassword"));
|
||||
if (globalkeys) {
|
||||
this.password = globalkeys.pass;
|
||||
flag = true;
|
||||
} else {
|
||||
this.error(RED._("email.errors.nopassword"));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.saslformat = n.saslformat;
|
||||
if(n.token!=="") {
|
||||
this.token = n.token;
|
||||
} else {
|
||||
this.error(RED._("email.errors.notoken"));
|
||||
}
|
||||
}
|
||||
if (flag) {
|
||||
|
@ -72,6 +72,7 @@
|
||||
"errors": {
|
||||
"nouserid": "No e-mail userid set",
|
||||
"nopassword": "No e-mail password set",
|
||||
"notoken": "No token property set",
|
||||
"nocredentials": "No Email credentials found. See info panel.",
|
||||
"nosmtptransport": "No SMTP transport. See info panel.",
|
||||
"nopayload": "No payload to send",
|
||||
|
Loading…
x
Reference in New Issue
Block a user