mscdex/node-imap — Issue #47: Delete email messages
Author: AndreLigeiro
Created: 2012-02-12 15:57:16+00:00
State: open

Hi,

How can I delete an email?
What I'm doing wrong?
Thks.

fetch = imap.fetch(req.params.id, {request: {headers:true, body:false } });

fetch.on('message', function(msg)
{
msg.on('end', function() {
console.log("Flags: " + msg.flags);
msg.flags.push("\\Deleted");
console.log("Flags: " + msg.flags);
});
});

fetch.on('end', function()
{
imap.logout(cb);
imap.closeBox(function(err) {
if (err)
console.log(err);});
}