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.
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)
)
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
}