What this module does
This simple module takes mail objects stored on AWS S3 from AWS SES and indexes them into your mongo database. You have to pass in the AWS Bucketname as described below and setup your AWS shared authentication and you should be good to go!
How to use
In order to use this module, you must have AWS shared credential set up on your computer. You must pass in a configuration object to the configure method with a property called "Bucket" with your unique AWS bucket name. You can also choose to overwrite other options in the configuration (more on that below).
NOTE: This module automatically saves attachments in /data/uploads. This will be dynamic soon, but was added as saving the buffers to the database was causing issues.
const getNewMessages = ;getNewMessages;
Consuming with a promise example:
Overwriting Configuration Options
This is the default configuration:
Bucket: ''DB: 'Mail'MailSchema:headers: falsesubject: truefrom: trueto: truecc: truebcc: truedate: truemessageId: trueinReplyTo: true'reply-to': truereferences: falsehtml: falsetext: truetextAsHtml: falseattachments: trueread: true
You can overwrite any of the above values as long as you give it the same data type it was originally set to. For example, if you wanted to save the
html value but not save the
text you could do this: