node.js - Get messages since beginning using IMAP in node -


i using mail-listener package of npm inbox messages since specific date.

here code getting inbox messages,

'listener':function(credit,userid = this.userid,date = (new date()).tostring()){         if(credit.port === "143" || credit.port === "993") {             let maillistener2 = new maillistener({                 username: credit.user,                 password: credit.password,                 host: credit.host,                 port: credit.port, // imap port                 tls: (credit.port === "993"),                 conntimeout: 10000, // default node-imap                 authtimeout: 5000, // default node-imap,                 debug: null, // or custom function 1 incoming argument. default: null                 tlsoptions: {rejectunauthorized: false},                 mailbox: "inbox", // mailbox monitor                 searchfilter: [["since", date]],                 markseen: false, // fetched email willbe marked seen , not fetched next time                 fetchunreadonstart: true, // use if want unread email on lib start. default `false`,                 //mailparseroptions: {streamattachments: true}, // options passed mailparser lib.                 attachments: false, // download attachments encountered project directory                 attachmentoptions: {directory: "/data/attachments/"} // specify download directory attachments             });              maillistener2.on("server:connected", meteor.bindenvironment(function () {                 console.log("imapconnected");             }));              maillistener2.on("server:disconnected", meteor.bindenvironment(function () {                 console.log("imapdisconnected");             }));              maillistener2.on("error", meteor.bindenvironment(function (err) {                 console.log("error listener", err);             }));             maillistener2.on("mail", meteor.bindenvironment(function (mail) {                 console.log("receive message");             }));              maillistener2.start();         }else if(credit.port === "587" || credit.port === "465"){             if not imap ....         }         return true;     }, 

i allow user select option if start on beginning or in specific date. problem here is,i don't know how inbox messages beginning. how can that?

do need use since also?


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -