Import relay domains

wwweiss

Well-Known Member
Apr 28, 2018
31
6
48
63
I need to add a lot of domains to Mail Proxy -> Relay Domains (about 600). It would be not good job to do this one by one in the web interface. Is there any option to do this on the command line having all domains in a text file?
 
Thank you. I am not used to the API - seems that I should change this ;-)
One question: if I understand the API call correct it only accepts one domain per call - or is it possible to send an array with many domains?
 
One question: if I understand the API call correct it only accepts one domain per call - or is it possible to send an array with many domains?
the API call only takes one domain - you need to loop over your list of domains to add them.

if you only want to add relay-domains - this (currently) can also be accomplished by editing '/etc/pmg/domains' and running `postmap /etc/pmg/domains` and reloading postfix afterwards .

@tom is correct - the API is usually preferable (it guarantees that everything is done in the right way and order)!
 
Thank you very much - I am already learning to use the api. Making my own scripts will help a lot, when there is the need for import or similar things. All typical tasks I do with your Webinterface, which is pretty good :) .
But your tip for editing the "domains" is really the fastest way now for this special task - this saves me time until I am fit in using the api!
 
  • Like
Reactions: Stoiko Ivanov

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!