how to add "Relay domains" programmatically

Arsen Sirekanyan

New Member
Mar 9, 2018
4
0
1
33
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
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!