Home » Mail Server
Programming and Technology Blog
Fritz Crusius' blog on programming and technology, unix server administration, tutorials, and hacks and solutions for select problems.
Collection of hints and utilities creating web pages with the open source wordpress.org content management system.
Code, hints and solutions for various programming languages.
The R Project in Statistical Computing.
Birthday Reminders from your Linux Server
Perl script sending birthday reminder emails from you Linux server using an Excel CSV file as birthday database.
Virtual Server Basic Setup for Email Service
Picking an operating system, dual IPv4 and IPv6 network interfaces, hostname and reverse DNS record for virtual server email setup.
Restore Hostname During Reboot
A custom system service to restore hostname settings during reboot on virtual servers overwriting network configuration files.
Postfix With Courier IMAP Mail Server Installation
Install and configure Postfix mail server with Courier IMAP and Maildir storage on Debian 11 or Ubuntu 20.04.
Add a Catch-All Account with Postfix-Mysql
How to implement a catch-all account with Postfix-Mysql receiving emails to unused aliases without entry in users or aliases tables.
Maildrop Spam Filtering For Postfix MySQL
How to use Courier-Maildrop or compatible tools for spam filtering and mail folder administration with Postfix-MySQL.

Mail Server

With Linux V-Server offers for under 5€ per month, running an own email server has become very affordable. If you own domain names, you might even decide to set up a virtual server for complete self-hosting. Typically, this includes domain name service, a web server and the topic of this section, an option to send and receive emails.

Linux V-Server running Ubuntu with Postifx processes
Linux V-Server running Ubuntu with Postfix mailer daemon processes

Why Run an Own Mail Server?

An own mail server allows you to have the name of your business in the domain part of your email address. For example, with an own mail server a company Gigagain Inc could use email addresses like [email protected]. Without, its email address might read like [email protected]. Using some mass email provider instead of a business specific service has several downsides:

  • Mailprovider in your email address and on business cards looks like you can’t afford quality IT services. And you lose space advertising for someone else.
  • Big email providers sometimes promise 100% spam-free inboxes with at times legitimate messages ending up in the spam folder or worse, outright rejected, when you least need it.
  • A single mailbox for the company will be difficult to share between employees or functions like sales or service when your business grows.
  • Changing providers you risk losing your mail history, which is important business data.

Outsource Mail Service to Third Party Provider

Instead of running your own mail server, your could buy mail service from a web hosting provider. You get professional looking email addresses, mailing accounts for employees and save a lot of work. However, if you completely outsource mail service, you still put a third party in charge of your data. Be aware of the following possible issues:

  • Hosting companies may sell your email addresses to online marketers. Check the small print of your hosting contract!
  • You risk down-time when changing hosting providers.
  • Hosting companies often require transferring domain registration to them. This is like handing the keys of your house to your plumber. Best to keep domain registrar, where you hold the keys, and hosting company or cloud service separate.
  • You may not want to trust small hosting providers with highly confidential business data.

Instead of completely outsourcing your mail server, you could as well opt for a go-between. Run an own server, maybe even in-house, to keep control of your mail data, but use third party relay services especially for sending mail. Using the mail server of a bigger provider for sending can significantly your outgoing email falsely flagged as spam.

Downsides of Running an Own Mail Server

Let’s face it, running an own mail server can be a pain.

Our AI has identified your IP as being part of a botnet or otherwise compromised to send spam.

Your IP Blocking Service

As of yet, no AI is smart enough to correctly identify all spam. Therefore the choice of evils is to live with some spam in the inbox or some legitimate messages in the spam folder. Many big providers seem to prioritize 100% spam-free accounts, filtering legitimate mails as spam, like possibly the ones coming from your server.

It’s in my opinion again a choice of evils. With an own server you control the level of spam filtering to reliably avoid spam false positives. However, big providers tend to give lower credibility to small, independently administered mail servers and flag their messages as spam. In many cases, the problem can be solved by requesting an unblock following instructions in a rejection notification. Otherwise, consider using some bigger provider’s mail host for relay.

How to Run an Own Mail Server

Mail server administration is relatively complex because software components from multiple sources need to be configured to work together. Furthermore, settings need to be right or outgoing emails may be flagged as spam. For good acceptance of your messages, your V-Server and mailer setup need to have or support the following:

  • static IPv4 and IPv6 addresses.
  • an open outgoing SMTP port 25.
  • an administrative function to specify a reverse DNS record.
  • a sender policy framework (SPF) DNS record.
  • a Domain-based Message Authentication Reporting and Conformance (DMARC) DNS record.
  • DomainKeys Identified Mail (DKIM) signatures, verification and respective DNS records.
  • TLS/SSL encryption for mail clients connecting to your server.

If your budget is small and you don’t want to afford an expensive IT service, these pages are for you. With a basic grasp of Unix / Debian Linux administration, you can successfully run your own server and gain valuable tech skills on the way.

Aside of features for acceptance of outgoing mail, your server should meet your privacy requirements. Since V-Server directories are mounted on the host computers’ file system, your email files will be accessible by the virtualization software. Therefore, you might consider more expensive dedicated servers or a private network with in-house servers. However, since virtually all external email traffic is unencrypted, a simple V-Server will suffice for most.

Mail Server Setup Steps

I hope the following explanations and instructions will be helpful setting up a Postfix mail server with Courier Imap, virtual mail boxes and DKIM signatures on Ubuntu or Debian servers.

V-Server Basic Installation for Mail Service

How to set up a virtual server for mail service with firewall, dual IPv4 and IPv6 network activation, reverse DNS records and custom hostname.

Install Postfix with Courier IMAP

Install Postfix with Courier IMAP folder access and Maildir storage.

Related Articles

Friends upset about your forgetfulness on important birthdays? Receive birthday reminder emails from your Linux server or desktop.

Leave a Reply

Your email address will not be published. Required fields are marked *

Published: January 7, 2022
Updated: November 29, 2022

Tech Solutions and Programming