Proxmox Mail Gateway (PMG) is an open-source email security solution that protects your mail server against spam, viruses, trojans, and phishing emails. It is deployed as an appliance (installed from ISO).
Service Management
# Main SMTP filter service
systemctl status pmg-smtp-filter # Check status of the filtering engine
systemctl restart pmg-smtp-filter # Restart the filter
# Underlying Postfix MTA
systemctl status postfix # Check status of the mail transport
systemctl restart postfix # Restart Postfix
# Web API and interface
systemctl restart pmgproxy # Restart the web interface proxy
systemctl restart pmgdaemon # Restart the PMG management daemonPMG Configuration (pmgconfig)
pmgconfig dump # Show all current configuration values
pmgconfig sync # Sync config to disk and restart affected servicesNetwork Configuration
PMG network settings are managed via /etc/network/interfaces or the web GUI. Useful CLI commands:
# Show current network interfaces
ip addr show
# Show routing table
ip route show
# Test DNS resolution
dig example.com
# Restart networking after changes
systemctl restart networkingQuarantine Management (pmgqm)
pmgqm status # Show quarantine database statistics
pmgqm purge # Purge old quarantined emails (based on retention policy)
pmgqm send --receiver [email protected] # Send quarantine report to a specific userRule System
pmg rule list # List all configured filtering rules and their statusSpam and Virus Engine
# Update SpamAssassin rules
sa-update # Download and apply the latest spam rules
# Update ClamAV virus definitions
freshclam # Download the latest virus signatures
# Check ClamAV service status
systemctl status clamav-daemon
systemctl restart clamav-daemon
# Manually scan a file with ClamAV
clamscan /path/to/fileLog Viewing
# PMG-specific logs
pmg log view
# Follow the Postfix mail log in real-time
tail -f /var/log/mail.log
# Follow the general system log
tail -f /var/log/syslog
# Use journalctl for service-specific logs
journalctl -u pmg-smtp-filter -f
journalctl -u postfix -fBackup and Restore
# Create a configuration backup (saved to /var/lib/pmg/backup/)
pmgbackup backup
# List existing backups
ls /var/lib/pmg/backup/
# Restore configuration from a specific backup file
pmgbackup restore /var/lib/pmg/backup/pmg-backup_2024-01-01.tgzUpdates
# Update PMG packages
apt update && apt full-upgrade
# Check current PMG version
pveversionCluster Management
PMG supports clustering for high availability.
# Show cluster status
pmgcm status
# Show cluster node info
pmgcm info