How to delivery all or selected messages in quarantine ?

OlivierF

New Member
Oct 21, 2020
7
1
3
52
France
Hello,

I defined a rule to move specifics mails in quarantine to be check manually by an administator.

Now I had a lot of mails for many users I need to delivery to them. It's very fastidious to use the web UI and select mail address by mail address and delivery mails.
I didn't see anything in documentation or api.

Is there a way to do this ?
 
The WebUI is meant for the users to release the mails for themselves - thus not particularly tailored towards an admin walking through all mails.

one thing you could do is scripting the release via the API/pmgsh:
Code:
pmgsh get /quarantine/spamusers #get a list of user's pmail attribute
pmgsh get /quarantine/spam --pmail <pmail-from-above> #get a list of quarantined mail for a user
pmgsh create /quarantine/content --id <quarantine-mail-id-from-above> --action deliver #deliver one mail
same can be done with curl and the API:
https://pve.proxmox.com/wiki/Proxmox_VE_API

the tools provide json as output - you can use jq to parse that and script the calls

I hope this helps!
 
  • Like
Reactions: _toby_
This might save someone 5 minutes:
Bash:
FROM_STRING="..."
pmgsh get /quarantine/spamusers | jq -r '.[].mail' | while read mail; do
    pmgsh get /quarantine/spam --pmail $mail | jq -r '.[] | select(.from=="$FROM_STRING") | .id' | \
    xargs --no-run-if-empty -n1 pmgsh create /quarantine/content --action deliver --id
done