Update setting

Set/update settings for system mailer (used to send system emails), postfix relayhost, junk/trash clearing interval and IMAP master password

  • HTTP Method: POST
  • URL: https://example.domain.tld/api/v1/settings/<setting>/
  • Require authentication: Yes
  • Permission level required: MasterAdmin

Path parameters

Parameter Type Description Required
setting str system_mailer or postfix_relayhost or junk_trash_clearing_interval or imap_master_password Required

Request parameters

Varies according to setting (see example below)

Response parameters

Varies according to setting (see example below)

Example request for system mailer (Python)

import requests
import json
from pprint import pprint

url = "https://example.domain.tld/api/v1/settings/system_mailer/"
data = {
"server_hostname" : "mail3.mymailcheap.com",
"server_port" : 587,
"username" : "noreply@vonmail.com",
"password" : "7Hp5jQ3GMNyLuwkAlDb3"
}
r = requests.post(url, json=data, auth=("admin","long-auth_token-here"))
try:
    pprint(r.json())
except:
    print(r.text)

Example response for system mailer (JSON)

'settings' : {
    'name' : 'system_mailer',
    'status' : 'applying',
    'value' : {
        'server_hostname' : 'mail3.mymailcheap.com',
        'server_port' : 587,
        'username' : 'noreply@vonmail.com'
    }
}

Example request for postfix relayhost (Python)

import requests
import json
from pprint import pprint

url = "https://example.domain.tld/api/v1/settings/postfix_relayhost/"
data = {
"server_hostname" : "filter1020.mymailcheap.com",
"server_port" : 587,
"username" : "relay-user",
"password" : "secure-relay-user-password"
}
r = requests.post(url, json=data, auth=("admin","long-auth_token-here"))
try:
    pprint(r.json())
except:
    print(r.text)

Example response for postfix relayhost (JSON)

'settings' : {
    'name' : 'postfix_relayhost',
    'status' : 'applying',
    'value' : {
        'server_hostname' : 'filter1020.mymailcheap.com',
        'server_port' : 587,
        'username' : 'relay-user'
    }
}

Example request for junk/trash clearing interval (Python)

import requests
import json
from pprint import pprint

url = "https://example.domain.tld/api/v1/settings/junk_trash_clearing_interval/"
data = {
"junk_days" : 7,
"trash_days" : 14
}
r = requests.post(url, json=data, auth=("admin","long-auth_token-here"))
try:
    pprint(r.json())
except:
    print(r.text)

Example response for junk/trash clearing interval (JSON)

'settings' : {
    'name' : 'junk_trash_clearing_interval',
    'status' : 'applying',
    'value' : {
        'junk_days' : 7,
        'trash_days' : 14
    }
}

Example request for IMAP master password (Python)

import requests
import json
from pprint import pprint

url = "https://example.domain.tld/api/v1/settings/imap_master_password/"
# some placeholder data
data = {
None : None
}
r = requests.post(url, json=data, auth=("admin","long-auth_token-here"))
try:
    pprint(r.json())
except:
    print(r.text)

Example response for IMAP master password (JSON)

'settings' : {
    'name' : 'imap_master_password',
    'status' : 'applying',
    'value' : 'long-imap-master-password-here'
}