how to add "Relay domains" programmatically

Discussion in 'Mail Gateway: Installation and configuration' started by Arsen Sirekanyan, Jun 9, 2018.

  1. Arsen Sirekanyan

    Arsen Sirekanyan New Member

    Joined:
    Mar 9, 2018
    Messages:
    4
    Likes Received:
    0
    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?
     
  2. dietmar

    dietmar Proxmox Staff Member
    Staff Member

    Joined:
    Apr 28, 2005
    Messages:
    15,996
    Likes Received:
    250
    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
     
    Arsen Sirekanyan likes this.
  3. Arsen Sirekanyan

    Arsen Sirekanyan New Member

    Joined:
    Mar 9, 2018
    Messages:
    4
    Likes Received:
    0
  4. dietmar

    dietmar Proxmox Staff Member
    Staff Member

    Joined:
    Apr 28, 2005
    Messages:
    15,996
    Likes Received:
    250
    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
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice