# ehlo

> SMTP server to rest

Latest version **0.0.9** (published 2015-09-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install ehlo
pnpm add ehlo
yarn add ehlo
bun add ehlo
```

Provides the command `ehlo`.

## 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.0.9 |
| Published | 2015-09-16 |
| First published | 2015-04-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.12 |
| Dependencies | 7 |
| Known vulnerabilities | 0 (+4 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 33 |
| Author | OpenDena |
| Maintainers | nasga |
| Keywords | SMTP, rest, ehlo, API |

## Links

- npm: https://www.npmjs.com/package/ehlo
- Repository: https://github.com/ehlo-io/ehlo
- Issues: https://github.com/ehlo-io/ehlo/issues
- npm.io page: https://npm.io/package/ehlo

## Dependencies (7)

- [request](https://npm.io/package/request.md) ~2.60
- [winston](https://npm.io/package/winston.md) ~1.0
- [commander](https://npm.io/package/commander.md) ~2.8
- [human-size](https://npm.io/package/human-size.md) ~1.1
- [mailparser](https://npm.io/package/mailparser.md) ~0.5
- [smtp-server](https://npm.io/package/smtp-server.md) ~1.4
- [stream-to-buffer](https://npm.io/package/stream-to-buffer.md) ~0.1

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 0.0.9 (latest) — 2015-09-16
- 0.0.7 — 2015-09-14
- 0.0.6 — 2015-07-14
- 0.0.5 — 2015-07-04
- 0.0.4 — 2015-06-15
- 0.0.3 — 2015-04-21
- 0.0.2 — 2015-04-20
- 0.0.1 — 2015-04-20

## README

# Ehlo SMTP Server

[![NPM version](https://img.shields.io/npm/v/ehlo.svg?style=flat-square)](https://npmjs.org/package/ehlo)
[![license](https://img.shields.io/npm/l/ehlo.svg?style=flat-square)](http://opensource.org/licenses/MIT)
[![Downloads](https://img.shields.io/npm/dm/ehlo.svg?style=flat-square)](https://npmjs.org/package/ehlo)

[![Build Status](https://img.shields.io/travis/ehlo-io/ehlo.svg?style=flat-square)](https://travis-ci.org/ehlo-io/ehlo)
[![Coverage Status](https://img.shields.io/coveralls/ehlo-io/ehlo.svg?style=flat-square)](https://coveralls.io/r/ehlo-io/ehlo?branch=master)
[![Codacy Badge](https://img.shields.io/codacy/ba83ed6ee04c4eb2b40131d68b12bcff.svg?style=flat-square)](https://www.codacy.com/public/ehlo-io/ehlo.git)
[![Code Climate](https://img.shields.io/codeclimate/github/ehlo-io/ehlo.svg?style=flat-square)](https://codeclimate.com/github/ehlo-io/ehlo)

[![Dependencies Status](https://img.shields.io/david/ehlo-io/ehlo.svg?style=flat-square)](https://david-dm.org/ehlo-io/ehlo) 
[![devDependencies Status](https://img.shields.io/david/dev/ehlo-io/ehlo.svg?style=flat-square)](https://david-dm.org/ehlo-io/ehlo#info=devDependencies)
[![peerDependencies Status](https://img.shields.io/david/peer/ehlo-io/ehlo.svg?style=flat-square)](https:/david-dm.org/ehlo-io/ehlo#info=peerDependencies)

> `Ehlo` is a SMTP server which send every mails to an api in a nice json format

## Install

```bash
npm i -g ehlo
```

## Using It
```
ehlo -p 10025 -a http://localhost/myAwesomApi
```

Now send a mail with your favorite lib (like `nodemailer`) with `localhost:10025` as SMTP server.

Your mail will be send with a POST request to `http://localhost/myAwesomApi`. All the json is posted in a `mail` form-data variable.

Here a tcpdump of a POST request :
```
13:41:45.987903 IP 127.0.0.1.52340 > 127.0.0.1.80: Flags [P.], seq 1:274, ack 1, win 12759, options [nop,nop,TS val 756661265 ecr 756661265], length 273
E..EP!@.@............t.P8...:jef..1..9.....
-...-...POST / HTTP/1.1
host: localhost
content-type: multipart/form-data; boundary=--------------------------511395648416127300743092
content-length: 249
Connection: close

----------------------------511395648416127300743092
Content-Disposition: form-data; name="mail"

13:41:45.987961 IP 127.0.0.1.52340 > 127.0.0.1.80: Flags [P.], seq 274:422, ack 1, win 12759, options [nop,nop,TS val 756661265 ecr 756661265], length 148
E...%.@.@............t.P8...:jef..1........
-...-...{"text":"Just an example\n","headers":{"subject":"Try"},"subject":"Try","priority":"normal"}
```

You can also store emails to disk with the `--save [path]` or `-s [path]` option.
![Demo](save.gif)

For more informations about the json results, look at the [mailparser](https://github.com/andris9/mailparser) library.

## Setting DNS
If you want to receive *real* emails on your api, you should setup your **DNS RECORDS**.
For example, if you want to receive emails at `*@example.com`.

- An MX Record: `example.com MX 10 mx.domain.com`
- A a record: `mx.subdomain A <ip of your ehlo server>`

## Contributing

Provide a pull request (with tested code) to include your work in this main project. Issues may be awaiting for help so feel free to give a hand, with code or ideas.

## License
Ehlo is under the MIT license. Please see 
[`LICENSE`](LICENSE)

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