Skip to content

Per-domain SMTP gateway (smart-host) configuration - #96

Open
gott-alexander wants to merge 4 commits into
grommunio:masterfrom
gott-alexander:feature/per-domain-smtp-gateway
Open

Per-domain SMTP gateway (smart-host) configuration#96
gott-alexander wants to merge 4 commits into
grommunio:masterfrom
gott-alexander:feature/per-domain-smtp-gateway

Conversation

@gott-alexander

Copy link
Copy Markdown

Adds the grommunio-admin API surface for the per-domain SMTP-gateway table that gromox reads at SMTP delivery time.

Changes:

  • New SQL migration sql/001-domain-smtp-gateway.sql that creates the domain_smtp_gateway table (one row per domain) and an index on enabled. Compatible with MariaDB 10.5+ and MySQL 8+.
  • New ORM model orm.domain_smtp_gateway.DomainSmtpGateway registered in orm/__init__.py.
  • New REST endpoint mounted at
    GET /api/v1/domains/<id>/smtpGateway
    PUT /api/v1/domains/<id>/smtpGateway
    DELETE /api/v1/domains/<id>/smtpGateway
    The endpoint re-emits the gromox config-reload signal so the
    lookup table is picked up without restarting the daemons.
  • New CLI subcommand
    grommunio-admin domain smtp-gateway {set,show,delete,list}
    for headless configuration. Passwords are masked in show and
    list output.
  • OpenAPI 3 spec updated: /domains/{domainID}/smtpGateway path,
    domainSmtpGateway / domainSmtpGatewayWrite schemas.
  • res/openapi.json regenerated from openapi.yaml.

Companion changes: grommunio/gromox# (service registry + cu_send_mail integration) and grommunio/admin-web# (SMTP-gateway tab in the domain details).

This involves several repositories. It's probably not bug-free. It still needs testing and others to continue working on it, since I don't have the time.

It's already possible to send an email via the web interface using the SMTP gateway in the background (most of the time).

Alexander and others added 4 commits September 3, 2026 13:24
Adds the grommunio-admin API surface for the per-domain SMTP-gateway
table that gromox reads at SMTP delivery time.

Changes:

  * New SQL migration `sql/001-domain-smtp-gateway.sql` that creates
    the `domain_smtp_gateway` table (one row per domain) and an
    index on `enabled`. Compatible with MariaDB 10.5+ and MySQL 8+.
  * New ORM model `orm.domain_smtp_gateway.DomainSmtpGateway`
    registered in `orm/__init__.py`.
  * New REST endpoint mounted at
    `GET    /api/v1/domains/<id>/smtpGateway`
    `PUT    /api/v1/domains/<id>/smtpGateway`
    `DELETE /api/v1/domains/<id>/smtpGateway`
    The endpoint re-emits the gromox config-reload signal so the
    lookup table is picked up without restarting the daemons.
  * New CLI subcommand
    `grommunio-admin domain smtp-gateway {set,show,delete,list}`
    for headless configuration. Passwords are masked in `show` and
    `list` output.
  * OpenAPI 3 spec updated: `/domains/{domainID}/smtpGateway` path,
    `domainSmtpGateway` / `domainSmtpGatewayWrite` schemas.
  * `res/openapi.json` regenerated from `openapi.yaml`.

Companion changes: grommunio/gromox#<PR> (service registry +
`cu_send_mail` integration) and grommunio/admin-web#<PR>
(SMTP-gateway tab in the domain details).
The domain_smtp_gateway table is now created by gromox's dbop module
(schema version 134, lib/dbop_mysql.cpp), both on fresh installs
(gromox-dbop -C) and upgrades (gromox-dbop -U / mysql_adaptor
schema_upgrade). The standalone SQL file and its ORM docstring
reference are therefore obsolete.
Nothing consumes the from_address column anymore: outbound smart-host
routing (and any envelope rewriting) is the MTA's job, which evaluates
the domain_smtp_gateway table directly (see doc/mta-smart-hosts.rst in
gromox). Drop the column from the ORM, CLI, API docs and endpoint
documentation so the UI does not offer a field without effect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant