mercredi 15 avril 2015

MailParser, stop after headers have been parsed

I am using MailParser to parse incoming mail. It's done in two steps:



  1. analyze (figuring out what to do with the email) and

  2. handing it in several different ways depending on analysis result.


For analyze step I do not need to have any of the bodies or attachments parsed, just headers.


MailParser has this handy event:



mailparser.on("headers", function(headers) {
console.log(headers.received);
})


Is there any way to break execution here? There's no need for MailParser to spend any CPU cycles after this point in my use case.


Thanks


Aucun commentaire:

Enregistrer un commentaire