code: function ListenToEmail(params) {
          RED.nodes.createNode(this, params);
          this.name = params.name;
          this.waitfor = params.waitfor;
          let node = this;
          this.on('input', function(msg) {
              if (msg.error) {
                  // FIXME: Add error handling here
              } else {
                  node.log('ListenToEmail');
                  // node.log(JSON.stringify(params));
                  retryParams = params;
                  emailInNode(node, params, msg);
              }
          });
          this.on('close', function() {
              if (node.interval_id != null) {
                  clearInterval(node.interval_id);
              }
              if (imap) {
                  imap.destroy();
              }
          });
  
          // Repeat interval
          if (!isNaN(params.repeat) && params.repeat > 0) {
              node.interval_id = setInterval(function() {
                  if (retryParams) {
                      console.log('>Calling node emit input');
                      node.emit('input', retryParams);
                  }
              }, params.repeat * 1000);
          }
      }
docs: /* RED.nodes.registerType("email-listen",EmailInNode,{
  credentials: {
  userid: { type:"text" },
  password: { type: "password" },
  global: { type:"boolean" }
  }
  }); 
  __DOCSPLACEHOLDER__
  
  @param {any} params __DOCSPLACEHOLDER__