#pSmtpQueue
अनुशंसा: nextxch के आगे एक अतिरिक्त परत के रूप में Proxmox Mail Gateway
आगे लगाया गया मेल गेटवे इंटरनेट से आने वाली सभी मेल स्वीकार करता है, उन्हें एक दूसरे, स्वतंत्र एंटी-स्पैम और एंटीवायरस इंजन से जाँचता है और केवल साफ़ मेल nextxch को अग्रेषित करता है। यह पेज आर्किटेक्चर, nextxch के आगे Proxmox Mail Gateway (ओपन सोर्स, AGPLv3) का चरण-दर-चरण सेटअप और nextxch की महत्वपूर्ण सेटिंग्स दिखाता है।
गेटवे वैकल्पिक है: nextxch की अपनी स्पैम और वायरस सुरक्षा है। यदि आप इसका उपयोग करते हैं तो महत्वपूर्ण: nextxch में गेटवे के IP को विश्वसनीय गेटवे के रूप में जोड़ें (चरण 5)। तब nextxch वास्तविक प्रेषक IP को गेटवे के Received हेडर से पढ़ता है और गेटवे IP की जाँच करने के बजाय SPF, DMARC, ग्रेलिस्टिंग और DNSBL का सही मूल्यांकन जारी रखता है।
आगे एक गेटवे क्यों उपयोगी हो सकता है
- बहु-स्तरीय सुरक्षा (Defense in depth): किसी दुर्भावनापूर्ण संदेश के मेलबॉक्स तक पहुँचने से पहले दो स्वतंत्र प्रणालियों को विफल होना पड़ता है। एक उत्पाद में कमज़ोरी अकेले पर्याप्त नहीं है।
- दूसरा एंटी-स्पैम और एंटीवायरस इंजन: Proxmox Mail Gateway अपने स्वयं के नियम, बायेसियन फ़िल्टर, SPF, DNSBL और ClamAV का उपयोग करता है। जो एक फ़िल्टर से छूट जाता है, उसे अक्सर दूसरा पकड़ लेता है।
- क्वारंटीन: संदिग्ध संदेश गेटवे में रोके जाते हैं और व्यवस्थापक या उपयोगकर्ता स्पैम रिपोर्ट के माध्यम से उनकी समीक्षा करके उन्हें जारी कर सकते हैं।
- इंटरनेट से अलगाव: केवल गेटवे ही पोर्ट 25 पर इंटरनेट से कनेक्शन स्वीकार करता है। nextxch उसके पीछे रहता है, और पोर्ट 25 केवल गेटवे के लिए खुला होता है।
- रखरखाव के दौरान बफ़रिंग: यदि nextxch किसी अपडेट या रखरखाव के लिए थोड़े समय के लिए अनुपलब्ध है, तो गेटवे इनबाउंड संदेशों को अपनी कतार में रखता है और बाद में उन्हें डिलीवर करता है।
एक ईमानदार आकलन: nextxch अपनी स्वयं की स्पैम सुरक्षा (अनुकूली फ़िल्टर वाला SpamGuard, SPF/DKIM/DMARC/ARC, ग्रेलिस्टिंग, DNSBL, फ़िशिंग ह्यूरिस्टिक्स) के साथ आता है और ClamAV को एकीकृत करता है। अधिकांश इंस्टॉलेशन के लिए यह पर्याप्त है। आगे एक गेटवे वैकल्पिक है और उच्च आवश्यकताओं के लिए उपयोगी होता है: बहु-चरणीय फ़िल्टरिंग की माँग करने वाली नीतियाँ, एक केंद्रीय क्वारंटीन, एक MX के पीछे कई मेल सर्वर, या सख्त नेटवर्क पृथक्करण।
आर्किटेक्चर: इंटरनेट -> Proxmox Mail Gateway -> nextxch
MX रिकॉर्ड गेटवे की ओर इंगित करता है। गेटवे पोर्ट 25 पर मेल स्वीकार करता है, उसे फ़िल्टर करता है और SMTP के माध्यम से nextxch को अग्रेषित करता है। वैकल्पिक रूप से, nextxch आउटबाउंड मेल गेटवे के आंतरिक पोर्ट 26 के माध्यम से भेजता है।
Proxmox® Proxmox Server Solutions GmbH का पंजीकृत ट्रेडमार्क है। इस नाम का उपयोग केवल वर्णनात्मक रूप से किया गया है; nextxch का Proxmox Server Solutions GmbH से कोई संबंध नहीं है और न ही वह इसके द्वारा समर्थित या प्रमाणित है।
सेटअप एक नज़र में
यह क्रम मेल खोने से बचाता है: पहले गेटवे को पूरी तरह सेट अप और परीक्षण करें, फिर MX रिकॉर्ड बदलें, और अंत में nextxch पर पोर्ट 25 बंद करें।
1. Install Proxmox Mail Gateway (ISO, on Debian or as an LXC container)
2. Add relay domains (every domain nextxch accepts)
3. Default relay = nextxch host, port 25 (Mail Proxy -> Relaying)
4. Enable receiver verification, TLS and a certificate in the gateway
5. nextxch: add the gateway IP as a trusted gateway (SpamGuard)
6. Send a test message through the gateway, check Message Trace in nextxch
7. Switch the MX record to the gateway (remove the old MX only after the TTL expires)
8. Firewall: allow port 25 on nextxch from the gateway only
9. Optional outbound: gateway as smart host in nextxch (port 26, STARTTLS)
Example values on this page:
Gateway: pmg.company.com 203.0.113.25 (public, MX)
nextxch: mail.company.com 10.0.0.20 (internal, mailboxes)
1. Proxmox Mail Gateway इंस्टॉल करें
Proxmox Mail Gateway एक स्टैंडअलोन अप्लायंस (हार्डवेयर पर या VM के रूप में ISO इंस्टॉलर), मौजूदा Debian सिस्टम पर पैकेज के रूप में या LXC कंटेनर के रूप में चलता है। यदि आप Proxmox VE का उपयोग करते हैं, तो अप्लायंस मैनेजर में एक तैयार कंटेनर टेम्पलेट उपलब्ध है। इसके बाद आप इसे पोर्ट 8006 पर वेब इंटरफ़ेस के माध्यम से प्रबंधित करते हैं।
Option A: ISO installer (hardware or VM)
Download the ISO from proxmox.com/downloads -> boot -> run the installer
Host name: pmg.company.com (FQDN, matching the future MX and PTR)
IP: static IP, e.g. 203.0.113.25 or a DMZ address behind NAT
Option B: on an existing Debian system
Add the Proxmox package repository and install the packages as described in
"Install Proxmox Mail Gateway on Debian" in the PMG admin guide
Option C: LXC container in Proxmox VE
Proxmox VE -> Storage -> CT Templates -> Templates -> section "mail"
-> download the Proxmox Mail Gateway template -> create the container
Web interface: https://pmg.company.com:8006 (port 8006 from the admin network only)
Repositories: without a subscription, add the "pmg-no-subscription" repository.
For production, Proxmox recommends the enterprise repository (with subscription).
2. गेटवे में रिले डोमेन, डिफ़ॉल्ट रिले और प्राप्तकर्ता सत्यापन
सभी सेटिंग्स PMG वेब इंटरफ़ेस में Configuration -> Mail Proxy के अंतर्गत हैं। गेटवे केवल सूचीबद्ध रिले डोमेन के लिए मेल स्वीकार करता है और फ़िल्टरिंग के बाद उसे डिफ़ॉल्ट रिले को सौंपता है।
Configuration -> Mail Proxy -> Relay Domains
company.com
company-group.com (every domain configured in nextxch, including alias domains)
Configuration -> Mail Proxy -> Relaying
Default Relay: mail.company.com (or 10.0.0.20)
Relay Port: 25
Relay Protocol: SMTP
Disable MX lookup: yes (address the nextxch host directly)
Configuration -> Mail Proxy -> Ports
External SMTP Port: 25 (from the internet, untrusted)
Internal SMTP Port: 26 (from nextxch, trusted, for outbound mail)
Configuration -> Mail Proxy -> Options
Verify Receivers: 550 (reject unknown recipients right away)
SPF: yes
DNSBL Sites: e.g. zen.spamhaus.org (observe the list's terms of use)
Several internal servers: Configuration -> Mail Proxy -> Transports
(domain or single address -> its own target server)
3. MX रिकॉर्ड को गेटवे पर स्विच करें
स्विच तभी करें जब गेटवे के माध्यम से भेजा गया एक परीक्षण संदेश nextxch में पहुँच जाए (/admin/ में मैसेज ट्रेस)। इससे पहले MX रिकॉर्ड का TTL कुछ मिनटों तक घटा दें। nextxch के अपने रिकॉर्ड (A/AAAA, PTR, Autodiscover) न बदलें: क्लाइंट सीधे nextxch से कनेक्ट होते रहते हैं।
; Gateway
pmg.company.com. 3600 IN A 203.0.113.25
; PTR for 203.0.113.25 at your provider: pmg.company.com
; MX points to the gateway only
company.com. 3600 IN MX 10 pmg.company.com.
; nextxch stays reachable for clients (IMAP, SMTP submission, webmail)
mail.company.com. 3600 IN A 198.51.100.20
Test beforehand, without a DNS change:
swaks --to anna.weber@company.com --server pmg.company.com --port 25 --tls
4. वैकल्पिक आउटबाउंड: nextxch में गेटवे को स्मार्ट होस्ट के रूप में
तब आउटबाउंड मेल भी गेटवे के फ़िल्टर (उदा. वायरस स्कैनिंग, आँकड़े) से होकर गुज़रती है। एडमिन कॉकपिट में SMTP, Queue Controls & Live MX Tester (#pSmtpQueue) के अंतर्गत गेटवे को वैश्विक स्मार्ट होस्ट के रूप में दर्ज करें, या केवल कुछ प्रेषकों को गेटवे के माध्यम से भेजने के लिए SMTP रूट का उपयोग करें। महत्वपूर्ण: तब गेटवे का सार्वजनिक IP आपके डोमेन के SPF रिकॉर्ड में होना चाहिए, और उसका PTR गेटवे के HELO नाम से मेल खाना चाहिए।
# A) Global smart host: all outbound mail through the gateway
nextxch-cli update SmtpQueue --set outboundSmartHost=pmg.company.com \
--set outboundSmartPort=26 --set outboundSmartHostTlsMode=StartTlsRequired
# B) Exception: one partner domain still directly via DNS MX (route without target host)
nextxch-cli create Route --set domain=partner.com --set bypassSmartHost=true \
--set description="direct via MX, not through the gateway"
# C) Only certain senders through the gateway (#pSmtpQueue -> domain routes)
# Destination domain: *
# Only for senders: company.com, *.company.com (SenderDomains)
# Target host: pmg.company.com:26 (several, comma-separated = failover)
# TLS mode: StartTlsRequired
# Priority: 50 (smaller = first; default 100)
# Add the gateway IP to the SPF record of the sender domain:
company.com. IN TXT "v=spf1 mx ip4:203.0.113.25 -all"
# In the gateway: add the nextxch IP under Configuration -> Mail Proxy -> Networks
# if nextxch is not in the same subnet as the gateway.
5. nextxch में गेटवे IP को विश्वसनीय के रूप में जोड़ें
मेल गेटवे संदेश को स्वयं स्वीकार करता है और फिर से डिलीवर करता है। तब nextxch के लिए डिलीवर करने वाला IP हमेशा गेटवे IP होता है। ताकि SPF, DMARC, ग्रेलिस्टिंग, DNSBL और रिवर्स DNS जाँच फिर भी वास्तविक प्रेषक का आकलन करें, गेटवे को SpamGuard & ClamAV (#pSpam) में "Trusted gateways" के अंतर्गत जोड़ें। इन IP से आने वाले कनेक्शन के लिए nextxch प्रेषक IP को गेटवे द्वारा लिखे गए Received हेडर से पढ़ता है। हेडर का मूल्यांकन केवल सूचीबद्ध IP से आने वाले कनेक्शन के लिए होता है, इसलिए सीधे डिलीवर करने वाला प्रेषक इस तरह अपना IP नकली नहीं बना सकता। TrustedProxyCidrs (Cluster:EnableProxyProtocol) कुछ और हैं: वे केवल PROXY प्रोटोकॉल का उपयोग करने वाले HAProxy जैसे TCP प्रॉक्सी पर लागू होते हैं।
# nextxch: add the gateway as trusted (public and internal IP, CIDR allowed)
# (admin cockpit: SpamGuard & ClamAV (#pSpam) -> "Trusted gateways")
nextxch-cli update SpamGuard --set trustedRelayCidrs=203.0.113.25,10.0.0.25
# Check: send a test message through the gateway, then in the spam analyzer or Message Trace
# TRUSTED_RELAY Via gateway 10.0.0.25, sender IP 198.51.100.7 from Received header
# SPF_PASS (SPF now checked against 198.51.100.7)
# Stays active in nextxch:
# SPF/DKIM/DMARC/ARC, greylisting, DNSBL, adaptive content filter,
# phishing heuristics, allow/block lists, ClamAV (if enabled)
# Connection limit: all inbound mail comes from one IP.
# Check MaxConnectionsPerIp (#pSmtpQueue, default 48) for high volumes.
6. दोनों चरणों पर फ़ायरवॉल और TLS
होस्ट या परिधि फ़ायरवॉल (Windows Firewall, nftables, pfSense/OPNsense) में nextxch पर पोर्ट 25 बंद करें। nextxch IP नियम इसके लिए उपयुक्त नहीं हैं, क्योंकि वे सभी SMTP पोर्ट पर एक साथ लागू होते हैं और इसलिए क्लाइंट के 465 और 587 को भी प्रभावित करेंगे। दोनों हिस्सों को एन्क्रिप्ट करें: इंटरनेट <-> गेटवे और गेटवे <-> nextxch।
Firewall nextxch (inbound)
TCP 25 only from 203.0.113.25 / 10.0.0.25 (gateway)
TCP 465, 587 clients (SMTP submission) -> stay open
TCP 993, 443 clients (IMAP, webmail, DAV, push) -> stay open
Firewall gateway (inbound)
TCP 25 from the internet
TCP 26 from nextxch only (smart host, if used)
TCP 8006 from the admin network only
TLS internet <-> gateway
Configuration -> Mail Proxy -> TLS: "Enable TLS" on
Certificate: Certificates -> ACME (Let's Encrypt) for pmg.company.com
TLS gateway -> nextxch
nextxch offers STARTTLS on port 25 with the certificate of mail.company.com
Gateway: TLS destination policy for mail.company.com = encrypt
(or verify if the default relay is entered as a host name)
TLS nextxch -> gateway (smart host)
outboundSmartHostTlsMode = StartTlsRequired
7. DKIM/DMARC, ग्रेलिस्टिंग और बैकस्कैटर
तीन बिंदु जिन्हें व्यवहार में अक्सर अनदेखा किया जाता है। गेटवे को आउटबाउंड मेल नहीं बदलनी चाहिए, ग्रेलिस्टिंग केवल एक ही स्थान पर चलनी चाहिए और अज्ञात प्राप्तकर्ताओं को SMTP संवाद के दौरान ही अस्वीकार किया जाना चाहिए।
DKIM / DMARC
- nextxch signs outbound mail with DKIM. The gateway forwards it unchanged.
- No disclaimer rule for outbound mail and no content changes in the gateway
(otherwise the DKIM signature breaks and DMARC fails at the recipient).
- Leave DKIM signing off in the gateway; maintain disclaimers in nextxch if needed.
Greylisting
- Slows down spam bots but delays first messages from new senders (usually < 30 minutes per PMG docs).
- Run it in the gateway only; behind the gateway it would be ineffective in nextxch.
- For time-critical senders (e.g. login codes, order confirmations) use the welcomelist,
or skip greylisting entirely if the other filters are sufficient.
Avoid backscatter
- Verify Receivers = 550: the gateway asks nextxch via RCPT TO whether the address exists.
- nextxch rejects unknown recipients at RCPT TO, so the check takes effect immediately.
- Catch-all addresses in nextxch defeat the check and should be avoided.
8. लाइसेंस और लागत (1 नवंबर 2026 तक)
Proxmox Mail Gateway, GNU AGPLv3 के अंतर्गत ओपन सोर्स है और बिना सब्सक्रिप्शन के पूरी तरह उपयोग योग्य है; तब अपडेट pmg-no-subscription रिपॉज़िटरी से आते हैं, जिसे Proxmox परीक्षण और गैर-प्रोडक्शन सिस्टम के लिए अभिप्रेत करता है। सब्सक्रिप्शन प्रति होस्ट और वर्ष लागू होता है, Proxmox के अनुसार इसमें असीमित उपयोगकर्ता और डोमेन शामिल हैं, और यह एंटरप्राइज़ रिपॉज़िटरी तक पहुँच देता है। नीचे दिए गए मूल्य Proxmox मूल्य पृष्ठ से लिए गए हैं और बदल सकते हैं; proxmox.com हमेशा आधिकारिक स्रोत है। nextxch, Proxmox सब्सक्रिप्शन नहीं बेचता।
Licence: GNU Affero General Public License v3 (AGPLv3), since PMG 5.0
Optional subscriptions per host and year (net, per proxmox.com, as of 1 Nov 2026):
Community EUR 190 no ticket support (forum)
Basic EUR 540 5 tickets/year, response 1 business day
Standard EUR 1,260 15 tickets/year, response 4 hours
Premium EUR 1,900 unlimited tickets, response 2 hours
(response = first reply to critical requests within business hours)
Sources:
https://www.proxmox.com/en/products/proxmox-mail-gateway/pricing
https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html (admin guide 9.1.1: licence, repositories, ports)
सेटिंग्स, डिफ़ॉल्ट मान और बेस्ट प्रैक्टिस
| सेटिंग / स्थान | विवरण | डिफ़ॉल्ट मान | उत्पादन बेस्ट प्रैक्टिस |
|---|---|---|---|
PMG: Relay Domains (Mail Proxy) |
उन डोमेन की सूची जिनके लिए गेटवे मेल स्वीकार और अग्रेषित करता है। अन्य डोमेन के मेल अस्वीकार कर दिए जाते हैं। | leer |
nextxch में कॉन्फ़िगर किया गया हर डोमेन जोड़ें, उपनाम डोमेन सहित। जब आप nextxch में कोई डोमेन जोड़ें, तो उसे गेटवे में भी जोड़ें। |
PMG: Default Relay + Port (Mail Proxy -> Relaying) |
फ़िल्टरिंग के बाद इनबाउंड मेल का गंतव्य (Postfix transport)। प्रति डोमेन अतिरिक्त आंतरिक सर्वर Transports के माध्यम से। | Port 25 · SMTP |
mail.company.com या 10.0.0.20, पोर्ट 25, प्रोटोकॉल SMTP। यदि आप ऐसा होस्टनाम दर्ज करते हैं जिसका अपना MX रिकॉर्ड है, तो "Disable MX lookup" सक्षम करें। |
PMG: Verify Receivers (Mail Proxy -> Options) |
प्राप्तकर्ता सत्यापन: स्वीकार करने से पहले गेटवे RCPT TO के माध्यम से nextxch से पूछता है कि पता मौजूद है या नहीं, और SMTP संवाद के दौरान अज्ञात प्राप्तकर्ताओं को अस्वीकार कर देता है। | aus |
550 पर सेट करें। बैकस्कैटर रोकता है, क्योंकि गेटवे कभी भी काल्पनिक पतों के लिए ऐसा मेल स्वीकार नहीं करता जिसे बाद में उसे बाउंस करना पड़े। |
PMG: TLS + Zertifikat |
गेटवे के इनबाउंड और आउटबाउंड कनेक्शन के लिए STARTTLS। अपना स्वयं का प्रमाणपत्र न होने पर PMG एक सेल्फ़-साइन्ड प्रमाणपत्र बनाता है। | TLS aus |
TLS चालू करें, pmg.company.com के लिए ACME (Let's Encrypt) के माध्यम से एक विश्वसनीय प्रमाणपत्र प्राप्त करें और nextxch होस्ट के लिए "encrypt" की TLS नीति सेट करें। |
PMG: Disclaimer & DKIM-Signatur |
Disclaimer नियम कार्रवाई मुख्य भाग में टेक्स्ट जोड़ती है; DKIM Signing आंतरिक पोर्ट पर प्राप्त मेल को हस्ताक्षरित करता है। | aus |
दोनों बंद रखें। nextxch, DKIM से हस्ताक्षर करता है; गेटवे में सामग्री में कोई भी परिवर्तन हस्ताक्षर को और इसलिए DMARC को तोड़ देता है। अस्वीकरण केवल nextxch में बनाए रखें (हस्ताक्षर से पहले जोड़े जाते हैं)। |
nextxch: Smart-Host (#pSmtpQueue · outboundSmartHost) |
वैश्विक स्मार्ट होस्ट: सभी आउटबाउंड मेल सीधे प्राप्तकर्ता MX के बजाय इस रिले पर जाती है। | leer (direkt per MX) · Port 25 |
pmg.company.com, रिले पोर्ट 26 (गेटवे का आंतरिक पोर्ट), TLS मोड StartTlsRequired, कोई SMTP AUTH नहीं। गेटवे में nextxch IP को Networks के अंतर्गत सूचीबद्ध होना चाहिए (उसी सबनेट को स्वचालित रूप से अनुमति है)। |
nextxch: Route · SenderDomains |
SMTP रूट की प्रेषक शर्त: डोमेन (company.com, *.company.com) या पते (billing@company.com, *@company.com)। खाली = हर प्रेषक। | leer |
केवल कुछ टेनेंट को गेटवे के माध्यम से भेजें: गंतव्य डोमेन * और SenderDomains = company.com वाला एक रूट, लक्ष्य होस्ट pmg.company.com:26। |
nextxch: Route · Priority |
समान रैंक वाले रूट के बीच क्रम; छोटी संख्या जीतती है, फिर अधिक विशिष्ट पैटर्न। | 100 |
रैंक प्राथमिकता से पहले आता है: प्रेषक + गंतव्य डोमेन, फिर गंतव्य डोमेन, फिर केवल प्रेषक (गंतव्य *), फिर *, फिर वैश्विक स्मार्ट होस्ट, फिर DNS MX। |
nextxch: Route · BypassSmartHost |
केवल लक्ष्य होस्ट रहित रूट के लिए: इस डोमेन पर मेल सीधे DNS MX के माध्यम से जाती है, भले ही कोई वैश्विक स्मार्ट होस्ट सेट हो। | false |
उन अलग-अलग भागीदार डोमेन के लिए जिन्हें गेटवे से होकर नहीं जाना चाहिए। यदि रूट में लक्ष्य होस्ट है, तो स्विच को अनदेखा किया जाता है। |
nextxch: Vertrauenswürdige Gateways (#pSpam · trustedRelayCidrs) |
अपस्ट्रीम गेटवे के IP या CIDR नेटवर्क। जब कोई कनेक्शन वहाँ से आता है, तो nextxch प्रेषक IP और HELO को सबसे ऊपरी उस Received हेडर से लेता है जो किसी सूचीबद्ध गेटवे या localhost द्वारा नहीं लिखा गया था। | leer |
सार्वजनिक और आंतरिक गेटवे IP जोड़ें, उदा. 203.0.113.25 और 10.0.0.25। केवल अपने स्वयं के गेटवे: सूचीबद्ध IP से आए Received हेडर को सत्य माना जाता है। इसके बाद स्पैम विश्लेषक पहचाने गए प्रेषक IP के साथ नियम TRUSTED_RELAY दिखाता है। |
nextxch: SPF, DKIM, DMARC & ARC, Greylisting, DNSBL (#pSpam) |
गेटवे सूचीबद्ध होने पर वे वास्तविक प्रेषक IP की जाँच करते हैं। उसके बिना उन्हें केवल गेटवे IP दिखाई देगा, और SPF अन्य डोमेन के लिए अधिकतर softfail या fail लौटाएगा। | abhängig von der Konfiguration |
इन्हें चालू रहने दें। गेटवे और nextxch दोनों में जाँच करना हानिरहित है; यदि आप ग्रेलिस्टिंग केवल एक जगह चाहते हैं, तो इसे गेटवे में रखें और nextxch में बंद करें। |
Firewall: Port 25 auf nextxch |
MX स्विच के बाद केवल गेटवे ही पोर्ट 25 पर nextxch तक पहुँच सकता है। | offen für alle |
होस्ट या परिधि फ़ायरवॉल में पोर्ट 25 को केवल 203.0.113.25 या आंतरिक गेटवे IP से अनुमति दें। पोर्ट 465, 587, 993 और 443 क्लाइंट के लिए खुले रहते हैं। |