Closed CodeCook83 closed 6 years ago
Sorry for taking so long on this, have been stretched really thin over the last couple of weeks. this would require you to list the entire directory and then sum up the individual messages. this can take a very long time, as i have folders that easily exceed 10000 messages.
Anyway, fetching RFC822.SIZE
should do the trick:
return imap.listMessages('inbox', '1:*', ['RFC822.SIZE']).then((messages) => {
console.log(messages)
expect(messages).to.not.be.empty
})
Output:
[ { '#': 1, 'rfc822.size': 28 },
{ '#': 2, 'rfc822.size': 28 },
{ '#': 3, 'rfc822.size': 28 },
{ '#': 4, 'rfc822.size': 170 },
{ '#': 5, 'rfc822.size': 28 },
{ '#': 6, 'rfc822.size': 28 },
{ '#': 7, 'rfc822.size': 28 } ]
Hi, it would be great if you could help me with the question on how to extend the mailboxes-object by the amount of emails currently in a folder and its size in kb recursively, when I go over the "selectFolder" route?
https://github.com/CodeCook83/offhaul/blob/c6e797c00b2072326e5c4d746e1e66ada237315c/controller/migration.js#L111
My first approach is as follows:
Your help is greatly appreciated.