Imagine that you have an APEX application where it requires you to read and download attachments if there is any, also these data needs to be stored in database. These attachments can then further be processed by oracle database, thinking of a XML file or json file.
With the requirements in mind, I started to search around, nodejs seems to easy enough to pick up and it also seems to meet my requirements.
- On the database, I would make a rest call to my expressJS end point to ask a list of all new mails.
- Database receives JSON back with all information it asked.
- Database process information, if mail indicates attachments, a subsequent call is made to get the attachements
- Database receives it/them and store it in table as blob
On the nodejs server, I will need to endpoints to make things a little bit cleaner. They would look like something like this:
- node.chaoyu.nl/newmails # for header, body structure , envolope and other meta data
- node.chaoyu.nl/downloadmail # for attachment only
For the nodejs, I need npm to install express and imapflow
Here is my github for this project.
Test with postman