← Back to Projects

Microsoft Exchange Mail Server with SMTP Relay

Designed and deployed a self-hosted Microsoft Exchange environment with SMTP relay integration, secure HTTPS publishing, and enterprise-style mail flow configuration. This project provided hands-on experience with Exchange administration, DNS authentication, and secure email infrastructure within a fully self-managed homelab environment.

After successfully building several self-hosted infrastructure services within my homelab environment, I wanted to expand further into enterprise-style systems that are widely used in production environments. One of the most challenging and rewarding services I decided to implement was a fully self-hosted Microsoft Exchange mail server.

The primary goal of this project was to gain a deeper understanding of how enterprise email systems operate internally, including mail flow, mailbox management, authentication, DNS configuration, and secure external communication.

Rather than relying entirely on cloud-based email providers such as Microsoft 365 or Google Workspace, I wanted to understand the infrastructure and technologies that power these platforms behind the scenes by building and managing my own environment.

Project Goals

Before beginning the deployment, I established several core objectives for the environment:

  • Deploy a fully functional on-premises Microsoft Exchange environment
  • Support secure inbound and outbound email communication
  • Enable integration with Outlook and IMAP-compatible clients
  • Implement reliable outbound email delivery using an SMTP relay
  • Learn how enterprise mail flow, transport services, and DNS authentication function
  • Securely expose services externally using HTTPS and reverse proxy technologies

Research & Planning

Before deploying the server, I spent considerable time researching how enterprise email systems operate and the infrastructure required to support them reliably.

Areas of research included:

  • Microsoft Exchange architecture and transport services
  • SMTP, IMAP, and mail flow processes
  • DNS records including SPF, DKIM, and DMARC
  • Reverse proxying and SSL certificate management
  • Email deliverability and spam prevention techniques
  • Firewall rules, NAT, and secure external publishing

During the planning stage, I also discovered that hosting email services independently introduces several real-world challenges, particularly around outbound deliverability and spam reputation management.

To address this, I decided to integrate an external SMTP relay provider to handle outbound mail delivery while still maintaining full control of the internal Exchange infrastructure.

Initial Environment

The original deployment was hosted within my self-managed homelab infrastructure and consisted of:

  • Microsoft Exchange Server hosted within a VMware ESXi virtual machine
  • Windows Active Directory integration for authentication and user management
  • pfSense firewall for routing, NAT, and access control
  • Kemp LoadMaster for HTTPS publishing and SSL termination
  • SMTP relay integration for outbound email delivery

The environment was designed to closely mirror a production-style enterprise deployment while remaining fully self-hosted and manageable within my lab infrastructure.

Mail Flow & SMTP Relay Integration

One of the most important aspects of this project was understanding how mail flows through an Exchange environment and how external email providers determine trust and legitimacy.

To improve outbound email deliverability and reduce the risk of messages being flagged as spam, I integrated a third-party SMTP relay service into the Exchange transport configuration.

This involved:

  • Configuring Exchange send connectors
  • Securing SMTP authentication and relay communication
  • Testing outbound mail routing and queue handling
  • Implementing SPF, DKIM, and DMARC DNS records
  • Validating external email trust and deliverability

Through this process, I developed a much stronger understanding of how enterprise mail systems maintain reputation, security, and reliable communication across the internet.

Client Connectivity & Secure External Access

To provide secure external access to the environment, I integrated Kemp LoadMaster as a reverse proxy and SSL termination point for Exchange services.

This allowed me to securely publish services such as:

  • Outlook Web Access (OWA)
  • Exchange Admin Center (EAC)
  • IMAP services
  • Autodiscover services

During this stage, I gained hands-on experience with:

  • SSL certificate management
  • HTTPS service publishing
  • Reverse proxy configuration
  • Firewall rule management
  • External DNS configuration

I also configured Outlook and IMAP-compatible clients to test mailbox access, synchronisation, and overall service reliability across different devices.

Troubleshooting & Learning Experiences

Throughout the deployment, I encountered a number of real-world issues that required troubleshooting and investigation, particularly around DNS propagation, SSL certificates, outbound relay configuration, and service accessibility.

One of the most valuable aspects of this project was learning how interconnected enterprise services are. Small configuration mistakes within DNS, firewall policies, or SSL bindings could immediately impact mail flow or client connectivity.

Troubleshooting these issues significantly improved my understanding of:

  • Enterprise networking concepts
  • Mail transport troubleshooting
  • Service dependency management
  • Infrastructure security
  • Production-style system administration

Outcome

This project provided practical hands-on experience with enterprise-grade email infrastructure, secure mail delivery, reverse proxying, and infrastructure integration within a fully self-hosted environment.

More importantly, it demonstrated how multiple infrastructure layers — networking, virtualisation, DNS, authentication, reverse proxying, and application services — work together to deliver reliable enterprise communication platforms.

Through this deployment, I significantly strengthened my knowledge of:

  • Microsoft Exchange administration
  • SMTP and enterprise mail flow
  • DNS authentication standards
  • SSL/TLS certificate management
  • Reverse proxying and secure service publishing
  • Infrastructure troubleshooting and systems integration

This project became one of the core services within my enterprise-style homelab environment and further developed my passion for infrastructure engineering, networking, and self-hosted technologies.