# simple-node-imap

> Simple imap module for listening and retreiving mails in node.js.

Latest version **2.0.3** (published 2020-01-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-node-imap
pnpm add simple-node-imap
yarn add simple-node-imap
bun add simple-node-imap
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2020-01-29 |
| First published | 2019-12-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 9 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Oguntuberu Nathan O |
| Maintainers | noguntuberu |
| Keywords | mail, job, imap, mail listener, email, email parser |

## Links

- npm: https://www.npmjs.com/package/simple-node-imap
- Repository: https://github.com/noguntuberu/simple-node-imap
- Issues: https://github.com/noguntuberu/simple-node-imap/issues
- npm.io page: https://npm.io/package/simple-node-imap

## Dependencies (2)

- [imap](https://npm.io/package/imap.md) ^0.8.19
- [mailparser](https://npm.io/package/mailparser.md) ^2.7.7

## 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

- 2.0.3 (latest) — 2020-01-29
- 2.0.2 — 2020-01-29
- 2.0.1 — 2020-01-29
- 1.0.2 — 2020-01-26
- 1.0.1 — 2019-12-30
- 1.0.0 — 2019-12-30

## README

# Overview

Simple imap module for node.js.

## Use

Install

`npm install simple-node-imap`


JavaScript Code:


```javascript

var SimpleImap = require("simple-node-imap");

var simpleImap = new SimpleImap({
  username: "imap-username",
  password: "imap-password",
  host: "imap-host",
  port: 993, // imap port
  tls: true,
  connTimeout: 10000, // Default by node-imap
  authTimeout: 5000, // Default by node-imap,
  debug: console.log, // Or your custom function with only one incoming argument. Default: null
  tlsOptions: { rejectUnauthorized: false },
  mailbox: "INBOX", // mailbox to monitor
  searchFilter: ["UNSEEN", "FLAGGED"], // the search filter being used after an IDLE notification has been retrieved
  markSeen: true, // all fetched email willbe marked as seen and not fetched next time
  fetchUnreadOnStart: true, // use it only if you want to get all unread email on lib start. Default is `false`,
  mailParserOptions: {streamAttachments: true}, // options to be passed to mailParser lib.
  attachments: true, // download attachments as they are encountered to the project directory
});

simpleImap.start(); // start listening


simpleImap.on("server:connected", () => {
  console.log("imapConnected");
});

simpleImap.on("server:disconnected", () => {
  console.log("imapDisconnected");
});

simpleImap.on("error", err => {
  console.log(err);
});

//
simpleImap.on("message", message => {
  console.log(message);
});


// stop listening
simpleImap.stop();

```

## Attachments

Attachments are converted into base64 strings.

## License

MIT

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