This document outlines the steps to configure PMG (Proxmox Mail Gateway) with an SMTP mail server (e.g., Exchange, Zimbra, Postfix) to manage incoming and outgoing email traffic.
✅ Ensure incoming emails from external sources are routed through PMG before reaching the mail server
✅ Ensure outgoing emails from internal systems are delivered to the internet via PMG
Port | Description |
---|---|
25 | Incoming SMTP connections from the internet (external) |
26 | Relay connections from internal systems (e.g., mail server) |
8006 | PMG Web interface (should only be accessible from internal network) |
ss -tuln | grep :25
ss -tuln | grep :26
(Configuration > Mail Proxy > Networks)
IP/Subnet | Description |
---|---|
192.168.1.0/24 | Internal network (optional) |
192.168.1.50/32 | Mail server IP address |
(Configuration > Mail Proxy > Relay Domains)
Relay Domain |
---|
example.com |
mail.example.com |
(Configuration > Mail Proxy > Transports)
Relay Domain | Host | Protocol | Port |
---|---|---|---|
example.com | 192.168.1.50 | smtp | 25 |
Connect to PMG via SSH and run the following:
postconf -e "inet_interfaces = all"
postconf -e "mynetworks = 127.0.0.0/8 192.168.1.0/24 192.168.1.50/32 [::1]/128"
postconf -e "smtpd_relay_restrictions = permit_mynetworks, reject_unauth_destination"
systemctl restart postfix
This ensures that only the defined IPs can relay outbound emails.
192.168.1.10
(PMG IP)26
(Internal SMTP relay port on PMG)PMG listens on port
25
for incoming external emails. For internal relays, port26
is commonly used.
Set-SendConnector "InternetMail" -Port 26
Retry-Queue -Filter {Status -eq "Retry"}
On Postfix or similar systems, use
mailq
orpostqueue -f
to flush the queue.
connect from mail-xxx.google.com[209.x.x.x]
from=<us**@***il.com>
to=<us**@*****le.com>
status=sent (250 ...)
→ Indicates that an external email was successfully delivered to the internal mail server.
from=<us**@*****le.com>
to=<re*******@*****il.com>
relay=mx1.hotmail.com[65.x.x.x]:25
status=sent (250 ...)
→ Shows that an internal email was successfully relayed to the external recipient.
Function | Status |
---|---|
Inbound mail | ✅ Delivered to internal mail server via PMG |
Outbound mail | ✅ Routed to the internet via PMG |
Internal/External ports | ✅ Port 25: external, Port 26: internal relay |
Trusted IPs | ✅ Controlled via trusted networks |
port 8006
) to internal network or VPN only