0
I’m making an email application and my server is being made in Hapijs, and I’m having trouble taking the email and turning it into a String, Buffer or Stream.
I want to turn to these formats because it’s only the ones that Mailparser accepted, but I’m having some difficulties.
First I managed to do everything right, but for that I was creating TXT files and then reading them, and in both steps I used Fs. But I want to take the emails and parse them without creating any files, using Buffers, Streams or String that stay in memory until the parse is completed.
I’m already reading the documentation of Nodejs, Mailparser and Node-imap(that I’m using to get the emails, but I still can’t solve this problem...
How so get the emails? where are you receiving from? a request, from disk, another stream?
– Lauro Moraes
I’m receiving them from a test account that I created in gmail, using Node-imap, he makes the connection and after configuring the variables with login and password he searches the emails and can filter them through the flags, However, to be able to display these emails in my application I need to parse (with Mailparser) and I need to provide as input for parse a String, a Buffer or a Stream, and I want to do this without creating files on the disk, only save them in memory during the process. And I’m not managing to turn email into any of the three options I mentioned above...
– LeonardoEbert