Why You May Not Want To Run Your Own Mail Server | DigitalOcean

intro

When setting up a website or application under your own domain, your hosting provider may also offer you the option of setting up your own mail server. Although there are many robust open source solutions out there, such as dovecot, hosting your own mail is often not the best option for many deployments. Due to the relatively complicated way that DNS records, spam filters, and webmail interfaces are implemented, maintaining your own mail server is becoming less popular and less supported by hosting providers. most people will get more value from using a hosted email service. this guide will cover many of the reasons why you might not want to run your own mail server and offer some alternatives.

mail servers are complex

A typical mail server consists of many software components that provide a specific function. each component must be configured and tuned to work well together to provide a fully functional mail server. Because they have so many moving parts, mail servers can become complex and difficult to configure.

here is a list of the components needed in a mail server:

  • mail transfer agent
  • mail delivery agent
  • imap and/or pop3 server

In addition to those, you’ll probably want to add these components:

  • spam filter
  • antivirus
  • webmail

While some software packages include the functionality of multiple components, the choice of each component is often left up to you. In addition to the software components, mail servers need a domain name, the appropriate DNS records, and an SSL certificate.

Let’s look at each component in more detail.

mail transfer agent

A mail transfer agent (mta), which handles Simple Mail Transfer Protocol (smtp) traffic, has two responsibilities:

  1. to send mail from your users to an external mta (another mail server)
  2. to receive mail from an external mta

examples of mta software include postfix, exim, and sendmail.

mail delivery agent

a mail delivery agent (mda), sometimes called a local delivery agent (lda), retrieves mail from an mta and places it in the mail user’s mailbox.

See Also:  Giải pháp cho HTML Email Responsive

There are a variety of mailbox formats, such as mbox and maildir. each mda supports specific mailbox formats. The choice of mailbox format determines how messages are actually stored on the mail server, which, in turn, affects disk usage and mailbox access performance, as well as import/export compatibility.

examples of mda software include postfix and dovecot.

imap and/or pop3 server

imap and pop3 are protocols used by mail clients: software used to read emails, to retrieve them.

imap is the most complex protocol that allows, among other things, multiple clients to connect to a single mailbox simultaneously. email messages are copied to the client and the original message is left on the mail server.

pop3 is simpler and moves email messages to the mail client’s computer, usually the user’s local computer, by default.

examples of software that provide imap and/or pop3 server functionality include courier, dovecot and zimbra.

spam filter

The purpose of a spam filter is to reduce the amount of incoming spam, or junk mail, that reaches users’ mailboxes. spam filters accomplish this by applying spam detection rules, which consider a variety of factors, such as the server that sent the message, the content of the message, etc., to incoming mail. if the “spam level” of a message reaches a certain threshold, it is marked and treated as spam.

Spam filters can also be applied to outgoing mail. this can be useful if a user’s email account is compromised, to reduce the amount of spam that can be sent through your mail server.

spamassassin is a popular open source spam filter.

virus

Antivirus is used to detect viruses, Trojans, malware and other threats in incoming and outgoing mail. clamav is a popular open source antivirus engine.

webmail

many users expect their email service to provide access to webmail. webmail, in the context of running a mail server, is a mail client that users can access through a web browser. gmail is probably the best known example of this. the webmail component, which requires a web server like nginx or apache, can run on the mail server itself.

See Also:  Fix: email attachments blocked for security reasons

examples of software that provide webmail functionality include roundcube and citadel.

disadvantages of running a mail server

Although having to maintain a stack of four or five different software components to provide basic functionality is not ideal, it may not seem much worse than other implementations in that regard. this, however, does not take into account the significant “trust” issues of running your own mail server.

In many ways, mail server stacks represent a collision between the tools and values ​​of the early internet (self-hosted open source software using well-defined standards and interoperable protocols) and the reality of the modern internet (a Few centralized, trusted authorities More than web servers, database servers, or other cloud software, they have to handle a huge amount of untrusted information, and as a result, the trust standards of commercial mail servers are Because mail servers are constantly handling potentially harmful file attachments and constantly filtering out spam and spam addresses, it can be quite challenging to run a server that actually meets the expectations of email providers. modern webmail, many of them will not hesitate to block traffic from a compromised sender. or temporarily, especially if it’s a small self-hosted operation.

stay off blacklists

It’s not trivial to keep your server off of the various blacklists, also known as dnsbl, blocklists, or blackhole lists. These lists contain the IP addresses of mail servers that were reported to be sending spam or junk mail (or to have incorrectly configured DNS records). many mail servers subscribe to one or more of these blacklists and filter incoming messages based on whether the mail server that sent the messages is on the list(s). If your mail server is listed, your outgoing messages may be filtered and discarded before they reach their intended recipients.

When implementing a web server, it is quite common to experience occasional outages due to misconfigured dns. There is a substantial ecosystem of CDNs and load balancers whose primary goal is to prevent these minor outages from impacting your infrastructure. however, when it comes to mail servers, a minor misconfiguration can literally make it difficult to restore trust.

See Also:  Cute Happy Mail Ideas and Giveaway Maggie Holmes Design

If your mail server is blacklisted, it is often possible to remove it from the list (or remove it from the blacklist). you will need to determine the reason for your blacklisting and resolve the issue. after this, you will need to find the blacklist removal process for the particular list your mail server is on and follow it.

hosted mail services

Hosted email services fall into two broad categories. The first category is made up of personal webmail providers. These service providers are widely known for their free service levels and typically provide paid options for hosting a custom email domain, supporting multiple users of a shared business account, etc. they typically provide their own webmail interfaces and dedicated mobile apps.

  • google apps
  • zoho
  • fastmail
  • microsoft office365

A second category is mail delivery services. These providers are not necessarily in the personal email business, but instead provide access to APIs for any software that needs to send mass email, such as password change notifications or ad campaigns. These services typically include dedicated mail server credentials, the relevant trust and filtering features, and a web dashboard to monitor your mail volume and any related issues. they are generally priced based on usage.

  • mail gun
  • sendgrid
  • flash post

This list is not exhaustive, but should provide an overview of the service landscape.

conclusion

Although email is a fundamental internet technology, many cloud service providers are reluctant to support self-hosted mail servers due to its inherent challenges. we generally recommend using a third-party provider to handle email for your cloud.

If you’re determined to run your own mail server, you can view a complete example of how to set up a mail server using postfix, dovecot, mysql, and spamassasin.

Leave a Reply

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