# node-mailarchiva

> A library for interacting with Mailarchiva Email Archiver

Latest version **0.4.0** (published 2022-05-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-mailarchiva
pnpm add node-mailarchiva
yarn add node-mailarchiva
bun add node-mailarchiva
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2022-05-31 |
| First published | 2019-03-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 9.3 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jason Norwood-Young |
| Maintainers | jasony |
| Keywords | mailarchiva, mail, email |

## Links

- npm: https://www.npmjs.com/package/node-mailarchiva
- Repository: https://github.com/j-norwood-young/node-mailarchiva
- Homepage: https://github.com/j-norwood-young/node-mailarchiva#readme
- Issues: https://github.com/j-norwood-young/node-mailarchiva/issues
- npm.io page: https://npm.io/package/node-mailarchiva

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.25.0
- [mkdirp-promise](https://npm.io/package/mkdirp-promise.md) ^5.0.1

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.4.0 (latest) — 2022-05-31
- 0.3.0 — 2022-02-07
- 0.2.0 — 2021-09-13
- 0.1.2 — 2019-07-11
- 0.1.1 — 2019-05-09
- 0.1.0 — 2019-03-20
- 0.0.1 — 2019-03-20

## README

# Node Mailarchiva

A library for interacting with [Mailarchiva Email Archiver](https://www.mailarchiva.com/)

## Installation

`npm install node-mailarchiva`

## Usage

Eg. of usage in an Express app:

```
const express = require('express');
const router = express.Router();
const Mailarchiva = require("node-mailarchiva");

const mailarchiva = new Mailarchiva({
    "baseURL": "https://archiva.yoururl.com",
    "headers": {
        "Authorization": "ABC123BLAHBLAH"
    }
});

router.get("/search/:email", async(req, res) => {
    try {
        var emails = await mailarchiva.findByEmail(req.params.email);
        res.send({ emails });
    } catch(err) {
        console.error(err);
        res.status(500).send(err);
    }
});

router.get("/single/:volid/:id", async (req, res) => {
    try {
        var body = await mailarchiva.get(req.params.volid, req.params.id);
        var attachments = await mailarchiva.attachments(req.params.volid, req.params.id);
        res.send({ body, attachments });
    } catch(err) {
        console.error(err);
        res.status(500).send(err);
    }
});

router.get("/attachment/:volid/:id/:filename", async (req, res) => {
    try {
        var file = await mailarchiva.attachment(req.params.volid, req.params.id, req.params.filename, res);
        res.attachment(req.params.filename);
        res.download(file);
    } catch(err) {
        console.error(err);
        res.status(500).send(err);
    }
});

module.exports = router;
```

## Excluding certain emails or subjects

```
router.get("/search/:email", async(req, res) => {
    try {
        var emails = await mailarchiva.findByEmail(req.params.email, 0, 20, ["@workspaceman.nl", "joe@workspaceman.nl"], ["A subject with a wildcard*" "A specific subject"]);
        res.send({ emails });
    } catch(err) {
        console.error(err);
        res.status(500).send(err);
    }
});
```

## License

Copyright 2019 Jason Norwood-Young

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

---
_Source: https://npm.io/package/node-mailarchiva · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
