Per-domain SMTP gateway (smart-host) configuration - #102
Open
gott-alexander wants to merge 2 commits into
Open
gott-alexander wants to merge 2 commits into
gott-alexander wants to merge 2 commits into
Conversation
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).
StefanAkie
reviewed
Sep 18, 2026
StefanAkie
reviewed
Sep 18, 2026
| if not data.get("password"): | ||
| # Keep the existing password if the form submits an empty | ||
| # field (common UX for password fields). | ||
| data.pop("password", None) |
Member
There was a problem hiding this comment.
Why is there a default value if we don't save the return value
StefanAkie
reviewed
Sep 18, 2026
|
|
||
| from orm import DB | ||
| try: | ||
| if gw not in DB.session: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the grommunio-admin API surface for the per-domain SMTP-gateway table that gromox reads at SMTP delivery time.
Changes:
sql/001-domain-smtp-gateway.sqlthat creates thedomain_smtp_gatewaytable (one row per domain) and an index onenabled. Compatible with MariaDB 10.5+ and MySQL 8+.orm.domain_smtp_gateway.DomainSmtpGatewayregistered inorm/__init__.py.GET /api/v1/domains/<id>/smtpGatewayPUT /api/v1/domains/<id>/smtpGatewayDELETE /api/v1/domains/<id>/smtpGatewayThe endpoint re-emits the gromox config-reload signal so the
lookup table is picked up without restarting the daemons.
grommunio-admin domain smtp-gateway {set,show,delete,list}for headless configuration. Passwords are masked in
showandlistoutput./domains/{domainID}/smtpGatewaypath,domainSmtpGateway/domainSmtpGatewayWriteschemas.res/openapi.jsonregenerated fromopenapi.yaml.Companion changes: grommunio/gromox# (service registry +
cu_send_mailintegration) and grommunio/admin-web# (SMTP-gateway tab in the domain details).Now, all in one commit