Introduction
Every freelancer knows the sinking feeling of opening your inbox only to find that a critical client message landed in spam—or worse, never arrived at all. For developers working on freelance platforms like Upwork, Freelancer, or Fiverr, email is the primary lifeline. Miss one message, and you could lose a contract worth thousands.
One experienced developer decided enough was enough. After repeatedly losing income because platform notifications were delayed or silently dropped by mainstream email providers (Gmail, Outlook, Yahoo), they took an extreme but effective approach: they wrote their own SMTP server from scratch. This article unpacks their journey, the technical hurdles they faced, and the lessons learned for anyone tired of playing email roulette.
The Problem: Why Freelance Emails Go Missing
Freelance marketplaces rely heavily on email to relay messages, offers, and payment notifications. However, these emails often originate from shared or low-reputation IP addresses. Popular email providers use aggressive spam filtering algorithms that can flag such messages as suspicious. The result? Important emails land in the spam folder or are silently rejected.
The developer in question noted that they were missing an average of 3–5 client messages per week. Over a month, that translated into lost opportunities worth over $2,000. Standard fixes—like whitelisting sender addresses or marking messages as "not spam"—provided only temporary relief. The fundamental issue was the trustworthiness of the email path between the platform and their inbox.
The Solution: Build a Dedicated SMTP Server
Instead of relying on third-party email providers, the developer decided to host their own SMTP server. The goal was simple: create a dedicated, custom-configured mail infrastructure that could reliably receive all messages from the freelance platforms without interference.
What is an SMTP Server?
SMTP (Simple Mail Transfer Protocol) is the standard protocol for sending and receiving email. Most people use SMTP indirectly through services like Gmail or Outlook. Running your own SMTP server means taking control of the entire email delivery chain—from accepting incoming messages to storing them in a mailbox.
Technical Architecture
The developer chose Postfix as the MTA (Mail Transfer Agent) due to its robustness and extensive documentation. The setup included:
- Postfix configured to listen on port 25 (incoming) and port 587 (submission for outbound, though outbound wasn't the primary focus).
- Dovecot as the IMAP/POP3 server for storing and accessing messages.
- SpamAssassin for lightweight spam filtering, set to a very permissive threshold to avoid dropping any platform emails.
- OpenDKIM to sign outgoing messages (for reputation) and verify incoming DKIM signatures.
- DNS records: Properly configured SPF, DKIM, and DMARC records to ensure deliverability.
One critical design decision was to bypass aggressive spam filtering entirely. Instead of using Bayesian filters or greylisting, the server simply accepted all messages from the known IP ranges of the freelance platforms (obtained from their published SPF records or by monitoring). Any message that matched these allowed senders was delivered immediately to the local mailbox.
Handling Reputation and Blacklists
Running your own mail server comes with a notorious risk: IP addresses with no history are often blacklisted. The developer took steps to warm up their IP by:
- Sending a small volume of test emails to known accounts.
- Monitoring blacklist databases (like Spamhaus, Barracuda) daily.
- Registering a dedicated domain with a positive reputation (not a new domain).
- Setting up consistent, valid reverse DNS (PTR record).
After a few weeks of careful monitoring, the IP achieved a neutral reputation—neither blacklisted nor highly trusted, but sufficient to accept incoming mail from known senders.
Results: Zero Lost Messages
Once the custom SMTP server went live, the developer started receiving every single email from freelance platforms in a dedicated mailbox. No spam folder, no delays, no silent drops. In the first month of operation, they logged 847 incoming messages from five platforms, and 100% were delivered without issue.
The setup also provided detailed logging. For each email, the developer could see:
| Metric | Value |
|---|---|
| Delivery time | < 2 seconds |
| SPF pass rate | 100% |
| DKIM verification pass | 100% |
| DMARC policy applied | quarantine/reject (none for allowed) |
This level of transparency was impossible with a standard Gmail inbox, where filtering decisions are opaque.
Lessons Learned: Is This Practical for Everyone?
Building a custom SMTP server is not for the faint of heart. The developer spent roughly 40 hours over two weeks setting up and tuning the system. The ongoing maintenance includes:
- Security patches and regular updates for Postfix and Dovecot.
- Monitoring logs and blacklists.
- Backup and redundancy (the server is a single VPS; a crash would mean lost inbox).
For many freelancers, this level of effort may be overkill. However, the developer argues that for those whose primary income depends on timely client communication, the return on investment is enormous. They estimated that the server paid for itself within the first month by preventing missed opportunities.
Alternatives
If building your own server is too complex, the developer recommends using a dedicated email API service like SendGrid or Mailgun for outgoing mail, and for incoming mail, consider using a custom catch-all address with a provider like MXRoute or PurelyMail, which gives you more control than Gmail while still being managed.
For those who still want the DIY route, the full source code and configuration files were shared in the original article on Habr.
Conclusion
The story of one developer who wrote their own SMTP server to stop missing freelance messages is a stark reminder that the "free" email ecosystem is not always reliable for business-critical communications. By taking ownership of their email infrastructure, they achieved perfect delivery rates and reclaimed hundreds of dollars in lost opportunities.
While not everyone will run to spin up a Postfix instance, the underlying lesson is universal: if email is central to your business, you need to understand how it works—and be willing to invest in reliability. Whether through self-hosted servers, managed providers, or a hybrid approach, the goal is the same: never miss a message that could be worth thousands.
This article is based on a real case study published on Habr. Full technical details and configuration scripts are available in the original post.
ASI Biont supports integration with email systems via API — more at asibiont.com/courses
Comments