The pmgsh tool can be used to access the Proxmox Mail Gateway API via the command line.

Examples

List entries:

# pmgsh ls /

Call the GET method on a specific API path:

# pmgsh get /version

View current mail configuration:

# pmgsh get /config/mail

Get help for a specific path:

# pmgsh help /config/mail  -v

Disable option spf in /config/mail

# pmgsh set /config/mail  -spf 0

Delete spf setting from /config/mail

# pmgsh set /config/mail  -delete spf