Quick Reference

Cheatsheets

Practical command references for Linux, networking, servers, containers, databases, and more.

Cheatsheet#pmg-cheatsheet

Proxmox Mail Gateway (PMG) Cheatsheet

Proxmox Mail Gateway (PMG) is an open-source email security solution that protects your mail server against spam, viruses, trojans, and phishing emails.

Basic Service Management

systemctl status pmg-smtp-filter    # Check the main filtering service
systemctl restart pmg-smtp-filter   # Restart the filter
systemctl status postfix            # Check the underlying Postfix MTA
systemctl restart pmgapi            # Restart the web interface API

PMG Command Line Tool (pmgconfig)

pmgconfig is used to configure PMG via the command line.

pmgconfig dump             # Show all current configurations
pmgconfig sync             # Sync configuration to disk and restart services

Quarantine Management (pmgqm)

pmgqm status               # Show quarantine statistics
pmgqm purge                # Purge old emails from the quarantine (based on retention settings)
pmgqm send --receiver [email protected]  # Send quarantine report to a specific user

Rule System (pmgrule)

pmg rule list              # List all configured filtering rules

Log Viewing

Logs are critical for troubleshooting mail delivery.

pmg log view               # View PMG specific logs
tail -f /var/log/mail.log  # Follow the standard Postfix mail log
tail -f /var/log/syslog    # Follow the general system log

Backup and Restore

# Backup configuration to a file (default: /var/lib/pmg/backup/)
pmgbackup backup
 
# Restore configuration from a specific backup file
pmgbackup restore /var/lib/pmg/backup/pmg-backup_2024-01-01.tgz