Skip to content

Instantly share code, notes, and snippets.

@budiantoip
Created March 28, 2026 13:17
Show Gist options
  • Select an option

  • Save budiantoip/37c53c8d0dcb8f0462eec06944f49cc3 to your computer and use it in GitHub Desktop.

Select an option

Save budiantoip/37c53c8d0dcb8f0462eec06944f49cc3 to your computer and use it in GitHub Desktop.
Proxmox CLI Cheatsheet

Search through the PMG spam spool directories for files containing the quarantine ID

# 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

Get a list of quarantine commands

# 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]

Get a list of quarantined email addresses

# pmgsh get quarantine/quarusers
200 OK
[
  {
     "mail" : "reception@greenvalleymedical.com.au"
  },
  {
     "mail" : "accounts@harboursidelogistics.com"
  },
  {
     "mail" : "info@westcoastfabricators.com.au"
  }
]

List quarantined spam for a specific recipient within a date range

# pmgsh get /quarantine/spam --starttime 1742256000 --endtime 1742947200 --pmail "info@westcoastfabricators.com.au"
200 OK
[]

Get verbose help for a quarantine endpoint (shows ID format, parameter details)

# pmgsh help /quarantine/content --verbose

Note: The quarantine content ID format is C<number>R<number>T<number>.

View quarantine content by ID

# pmgsh get /quarantine/content --id "C12345R67890T11223"

Deliver (release) a quarantined email by ID

# pmgsh create /quarantine/content --action deliver --id "C12345R67890T11223"

Get admin configuration

# pmgsh get /config/admin
200 OK
{
   "digest" : "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0",
   "email" : "support@example.com"
}

Get spam filter configuration

# pmgsh get /config/spam
200 OK
{
   "digest" : "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0"
}

Whitelist a sender for a specific recipient

# pmgsh create /quarantine/whitelist --address "sender@gmail.com" --pmail "recipient@example.com"
200 OK

Remove a sender from the whitelist

# pmgsh delete /quarantine/whitelist --address "sender@gmail.com" --pmail "recipient@example.com"
200 OK

Check file type of a quarantined email on disk

# file /var/spool/pmg/spam/D7/A3F72B76E2A9C19C43D7
/var/spool/pmg/spam/D7/A3F72B76E2A9C19C43D7: SMTP mail, ASCII text, with very long lines

Manually deliver a quarantined email file (bypass quarantine database)

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment