In my home lab, I have a Microsoft Active Directory environment with an on-premises Exchange server. With the explosion of cloud-based services, especially email, there doesn't appear to be much demand for an SMTP gateway for inbound SMTP traffic. I eventually gave up on finding a cost-effective solution for my home lab to shield my Exchange server regarding SMTP inbound and decided to build one from scratch. I went with Rocky because I'm more familiar with RHEL than I am with Debian. If you're looking to do this in a production environment, my hunch is these procedures would work just fine on RHEL 9.
To start, these procedures are assuming you have a fresh Rocky 9 server with a properly configured network. It is also assumed that you have a certificate for your new SMTP server. I run a local certificate authority so please keep that in mind when you configure TLS certificates.
Note: This configuration assumes DNS used by the server has DNS MX records for your local domains pointing to your Exchange server!
Note 2: This configuration supports Exchange Smarthost though this server but it's IP must be included in the "mynetworks" parameter.
Note 3: Consider the following "variables" in this documentation:
- Domain.com is your primary domain
- Domain.net is your secondary domain
- 192.168.0.0/24 is your internal IP space
Base Postfix Installation
SPF Sender Verification
ClamAV Virus Scanning
SpamAssassin Filtering
Static Recipient Filtering
Active Directory LDAP Recipient Filtering
Reject Senders by Address and/or Domain
Home > Build Procedures