Used example coffeescript code from bergie's gist. Check it out!
Once configured checkmail.js
listens for new mail. Console log will display from
, subject
, and body
then wait for more mail to parse. Thanks to NodeJS's event loop this will happen over and over again.
node-imap and mailparser are used heavily. Make sure these modules are installed.
npm install imap
npm install mailparser
After copying and editing config.json
with your email settings run checkmail.js
cp example.config.json config.json
node checkmail.js
`ctrl C` a couple times will end the script.