how to add "Relay domains" programmatically

Arsen Sirekanyan

New Member
Mar 9, 2018
4
0
1
35
Hi,
I would like to be able to add relay domains through some sort of api. Is that possible?

I notice that relay domains are saved to "/etc/pmg/domains"
and `/usr/sbin/postmap /etc/pmg/domains` can update domains.db ?
But it seems that changing `/etc/pmg/domains` and updating domains.db is not enough?

Can someone please clarify how to update accepted domains list correctly?
 
Of course, you can use the REST API (see docs). A simpler way is to use the 'pmgsh' command line tool:

# pmgsh help /config/domains --verbose

Example to ad a new domain:

# pmgsh create /config/domains --domain test1

And remove it later:

# pmgsh delete /config/domains/test1
 
  • Like
Reactions: Arsen Sirekanyan
Thank you very much, that should resolve the issue.

I had checked the admin guide pdf, but, it seems, had missed the actual documentation..
(link to the documentation can be found here https://forum.proxmox.com/threads/rest-api-documentation.43218/ )

Great products/projects !
Best regards,
Arsen

We include the docs with any installation, so you can view it using:

https://FQDN:8006/pmg-docs/index.html

The API doc is at the end of that link:

https://FQDN:8006/pmg-docs/api-viewer/index.html

It is similar to the pve API described here: https://pve.proxmox.com/wiki/Proxmox_VE_API