1.0.4 • Published 3 years ago

haraka-plugin-auth-etcd-config v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

NPM

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/\/user format. The users defined under a domain is only allowed to send mails from that domain.

Example etcd Configuration

For every user:

\ \ \ \

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