Proxmox CLI Cheatsheet
# find /var/spool/pmg/spam/ -name "*A3F72B*" -o -name "*9C43D7*"
/var/spool/pmg/spam/E5/A3F72B48C1D6F923A4E5
/var/spool/pmg/spam/D7/A3F72B76E2A9C19C43D7
/var/spool/pmg/spam/F1/A3F72B2D84B5E3F71CF1
/var/spool/pmg/spam/93/A3F72B09A6C8D4B52E93
/var/spool/pmg/spam/A8/A3F72B61F3D7E8C946A8
/var/spool/pmg/spam/1C/A3F72B35B9E2F4A8D71C
/var/spool/pmg/spam/6B/A3F72B1C7A4DE63F926B
/var/spool/pmg/spam/54/A3F72B83E9F1A7D6B354
/var/spool/pmg/spam/2F/A3F72B5A2C8BF19DE42F
/var/spool/pmg/spam/C6/A3F72BE4D93AF58B17C6
/var/spool/pmg/spam/38/A3F72BF1B45CD8E26A38
/var/spool/pmg/spam/D2/A3F72BB8F62CE34A91D2
# pmgsh help /quarantine
help [path] [--verbose]
cd [path]
ls [path]
get /quarantine/attachment [OPTIONS]
create /quarantine/blacklist --address <string> [OPTIONS]
get /quarantine/blacklist [OPTIONS]
delete /quarantine/blacklist --address <string> [OPTIONS]
create /quarantine/content --action <string> --id <string> [OPTIONS]
get /quarantine/content --id <string> [OPTIONS]
get /quarantine/download --mailid <string> [OPTIONS]
get /quarantine/listattachments --id <string> [OPTIONS]
get /quarantine/quarusers [OPTIONS]
create /quarantine/sendlink --mail <string> [OPTIONS]
get /quarantine/spam [OPTIONS]
get /quarantine/spamstatus
get /quarantine/spamusers [OPTIONS]
get /quarantine/virus [OPTIONS]
get /quarantine/virusstatus
delete /quarantine/whitelist --address <string> [OPTIONS]
create /quarantine/whitelist --address <string> [OPTIONS]
get /quarantine/whitelist [OPTIONS]
# pmgsh get quarantine/quarusers
200 OK
[
{
"mail" : "reception@greenvalleymedical.com.au"
},
{
"mail" : "accounts@harboursidelogistics.com"
},
{
"mail" : "info@westcoastfabricators.com.au"
}
]
# pmgsh get /quarantine/spam --starttime 1742256000 --endtime 1742947200 --pmail "info@westcoastfabricators.com.au"
200 OK
[]
# pmgsh help /quarantine/content --verbose
Note: The quarantine content ID format is C<number>R<number>T<number>.
# pmgsh get /quarantine/content --id "C12345R67890T11223"
# pmgsh create /quarantine/content --action deliver --id "C12345R67890T11223"
# pmgsh get /config/admin
200 OK
{
"digest" : "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0",
"email" : "support@example.com"
}
# pmgsh get /config/spam
200 OK
{
"digest" : "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0"
}
# pmgsh create /quarantine/whitelist --address "sender@gmail.com" --pmail "recipient@example.com"
200 OK
# pmgsh delete /quarantine/whitelist --address "sender@gmail.com" --pmail "recipient@example.com"
200 OK
# file /var/spool/pmg/spam/D7/A3F72B76E2A9C19C43D7
/var/spool/pmg/spam/D7/A3F72B76E2A9C19C43D7: SMTP mail, ASCII text, with very long lines
Whitelist the sender first to prevent re-quarantine, then inject and clean up:
# pmgsh create /quarantine/whitelist --address "sender@gmail.com" --pmail "recipient@example.com"
200 OK
# sendmail -f sender@gmail.com recipient@example.com < /var/spool/pmg/spam/D7/A3F72B76E2A9C19C43D7
# pmgsh delete /quarantine/whitelist --address "sender@gmail.com" --pmail "recipient@example.com"
200 OK
Note: Tracker endpoints use single dash parameters (e.g. -starttime), unlike quarantine endpoints which use double dash (e.g. --starttime).
# pmgsh ls /
# pmgsh ls /nodes
# pmgsh ls /nodes/mx01-pmg/tracker
# pmgsh help /nodes/mx01-pmg/tracker -v
# pmgsh get /nodes/mx01-pmg/tracker -starttime $(($(date +%s) - 864000)) -endtime $(date +%s)
# pmgsh get /nodes/mx01-pmg/tracker -starttime $(($(date +%s) - 864000)) -endtime $(date +%s) -target example.com.au
# pmgsh get /nodes/mx01-pmg/tracker/F278163968D4 -starttime $(($(date +%s) - 864000)) -endtime $(date +%s)
Note: -starttime and -endtime are required even though the docs list them as optional. Without them, the query defaults to a 1-day window which may miss your target.
| Field | Description |
|---|---|
dstatus |
Delivery status: A = accepted, N = rejected, Q = quarantine, 2 = delivered, 4 = deferred |
rstatus |
Relay status: 2xx = success, 4xx = temporary failure |
id |
Mail tracking ID (use with /nodes/{node}/tracker/{id} for syslog details) |
qid |
Postfix queue ID |
relay |
Next hop relay server |
client |
Source IP/hostname |
from |
Envelope sender |
to |
Envelope recipient |
# pmgsh get /quarantine/spam -starttime $(($(date +%s) - 864000)) -endtime $(date +%s)
# pmgsh get /quarantine/virus -starttime $(($(date +%s) - 864000)) -endtime $(date +%s)