haraka-plugin-alias-pg

1.0.1 • Public • Published

haraka-plugin-alias-pg

This plugin allows the configuration of aliases that change the RCPT address. Aliases are specified in a database table.

IMPORTANT: this plugin must appear in config/plugins before other plugins that run on hook_rcpt

WARNING: DO NOT USE THIS PLUGIN WITH queue/smtp_proxy.

Database Schema

Followed the recommended database schema for using this plugin. You may modify the schema as you need, but please DO NOT remove the source and destination column.

CREATE TABLE aliases (
	source VARCHAR(100) NULL,
	destination VARCHAR(100) NOT NULL,
	UNIQUE(source, destination)
)

Configuration

The alias-pg.json file has the following structure (defaults shown). Also note that this file will need to be created, if not present, in the config directory.

{
  "user": "mail",
  "database": "maildb",
  "password": "",
  "host": "127.0.0.1",
  "port": 5432,
  "max": 20,
  "idleTimeoutMillis": 30000,
  "sqlQuery": "SELECT destination FROM aliases WHERE source=$1",
  "sslCa": "/path/to/your/pgsql/ca/certificate" // Remove this if you don't use SSL mode
}

Package Sidebar

Install

npm i haraka-plugin-alias-pg

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

5.13 kB

Total Files

5

Last publish

Collaborators

  • schenkerx