Global Whitelist via CSV

You can script something using the API which is accesible via the pmgsh tool on the Mail Gateway itself.

Here is the API documentation:{ogroup}/email

Such a command could then be:
pmgsh create config/ruledb/who/3/email --email ""

Make sure that the who group does have the correct ID (3 in the example) by running pmgsh get config/ruledb/who.
  • Like
Reactions: Stoiko Ivanov
Thanks Aaron.

It works with CLI.

Could you provide an example using CURL?
I tried
curl -d "" --insecure -X POST
whitout success.

Where do I include the credentials?

Kind regards
Thanks Aaron.
This is for PVE only. Not PMG.

curl -s -k -b "ticket='PMG:root@pam:64A56DA0::ZUrrn...'&" -H "CSRFPreventionToken: 64A56DA0:j/dg4ks..." -X POST

still isn't working...
Last edited:
I forgot to mention, that the API works the same way. So far it looks okay, except that the parameter should be added as --data-urlencode ''

Do you get any errors back? Adding the -v will show HTTP return codes.
The ticket that you get in the first step, is only valid for two hours. So if it took too long, you need to request a new one. Getting a current ticket can be the first step in the script you build.

Plus, the call should be -b "PMGAuthCookie=PMG:root@…, not -b "ticket=…
curl -v -d --data-urlencode "'64A58DE0:...'&PMGAuthCookie='PMG:root@pam:64A58DE0::...=='" --insecure -X POST

still returns

"HTTP/1.1 401 No ticket"

Are these Params correct?
  • email
  • CSRFPreventionToken
  • PMGAuthCookie
curl -v -XPOST -H '64A...' -k -b "PMGAuthCookie=PMG:root@pam:64A5...&" --insecure -X POST


"HTTP/1.1 401 Permission denied - invalid csrf token"

The PMGAuthCookie seems to be correct.


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!