# haraka-plugin-auth-etcd-config

> Haraka plugin that checks authentication and domain for outgoing mails.

Latest version **1.0.4** (published 2021-03-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install haraka-plugin-auth-etcd-config
pnpm add haraka-plugin-auth-etcd-config
yarn add haraka-plugin-auth-etcd-config
bun add haraka-plugin-auth-etcd-config
```

## 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 | 1.0.4 |
| Published | 2021-03-14 |
| First published | 2021-03-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Bilge Onaycı |
| Maintainers | partypancakess |
| Keywords | haraka, plugin, auth-etcd-config |

## Links

- npm: https://www.npmjs.com/package/haraka-plugin-auth-etcd-config
- Repository: https://github.com/PartyPancakess/haraka-plugin-auth-etcd-config
- Homepage: https://github.com/PartyPancakess/haraka-plugin-auth-etcd-config#readme
- Issues: https://github.com/PartyPancakess/haraka-plugin-auth-etcd-config/issues
- npm.io page: https://npm.io/package/haraka-plugin-auth-etcd-config

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 1.0.4 (latest) — 2021-03-14
- 1.0.3 — 2021-03-02

## README

[![NPM][npm-img]][npm-url]

# haraka-plugin-auth-etcd-config

This plugin is based on auth-enc-file (https://github.com/AuspeXeu/haraka-plugin-auth-enc-file).
It uses SHA256CRYPT for user passwords.


## Configuration
Running etcd server must have key(s) in the config/mta/domains/\<domain>/user format.
The users defined under a domain is only allowed to send mails from that domain.

### Example etcd Configuration

For every user:

\<username> \<space> \<sha256 digest of password1> \<CRLF>

```
etcdctl put config/mta/domains/domain.com/user "user PtjxQL5GUfVgaUANlOrmXA4w7HPvxFfn2wfApOLWeZ2
user2 PtjxQL5GUfVgaUANlOrmXA4w7HPvxFfn2wfApOLWeZ2
"
```
In the above example, user and user2 have the passwords "pass" (converted) and are under the domain "domain.com." These 2 users will only be able to send mails from domain.com.
Such as:
```
swaks -s localhost:587 -f sender@domain.com -t goto@gmail.com -au user -ap pass --tls
```
Above command will work, while the below one will not:
```
swaks -s localhost:587 -f sender@test.com -t goto@gmail.com -au user -ap pass --tls
```


### Generating Password

The plugin has a generate script that will generate the etcd config input of a given username and password.

Usage:
```
node ./generate.js username1 pass

Returns:

username1 PtjxQL5GUfVgaUANlOrmXA4w7HPvxFfn2wfApOLWeZ2
```




<!-- leave these buried at the bottom of the document -->
[npm-img]: https://nodei.co/npm/haraka-plugin-auth-etcd-config.png
[npm-url]: https://www.npmjs.com/package/haraka-plugin-auth-etcd-config

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