kazana-email-box

Downloads Email attachments into a kazana database

Usage no npm install needed!

<script type="module">
  import kazanaEmailBox from 'https://cdn.skypack.dev/kazana-email-box';
</script>

README

kazana-email-box plugin

Kazana service to listen for emails and download them into a kzana database

Build Status

Setup

git clone git@github.com:eHealthAfrica/kazana-email-box.git
cd kazana-email-box
npm install

Usage

module.exports = {
  name: 'myapp',
  version: '1.0.0',
  port: 5000,
  static: 'public',
  /* ... */,
  plugins: [
    require('@ehealthafrica/kazana-email-box')
    /* ... */
  ],
  /* ... */
}

Configuration

In your .kazanarc file

[kazana-email-box]
emailAccount = "me@gmail.com":password@imap.gmail.com:993  ; email account configuration
cacheDirectory = ./file_cache                              ; directory to store intermediate download and unzipped files
days = 40                                                  ; days the downloader should look back to on restart
timeout = 900000                                           ; timeout for connecting and quer
pollingBreak = 100000                                      ; timeout between polling of downloading attachments
filenameFilter = ^[^\.](.+\.xls.?)|(.+\.zip)$              ; filename regex of what attachments to handle

Test

TODO: tests: multiple zip files, test multiple xls and mixed

TODO: tests: auth timout should skip checkpointing

npm test

Credit

Brought to you by eHealth Africa — good tech for hard places.