[2021-05-16]

ISPmail guide for Debian 11 “Bullseye”

Beta warning

The guide for Debian Bullseye has been released on 2021-11-20. It has been tested on two servers. If you get stuck or find something that does not make sense tough then please do not hesitate to post a comment on the respective page. Help will be on the way.

christoph-haas

Stop using public freemail/cloud services like G**gle Mail. This is a complete and free guide that teaches you how to set up and run your own mail server. At the end of the guide you will have your own fully featured mail server based on open-source software using a cheap (virtual) server. And you will have learned all about the various components, protocols and technologies.

This guide is free. There is no catch. I am publishing this guide without any commercial interest. My motivation is to get more people away from centralized email services. The internet wasn’t meant to run on services offered by only few monopolistic companies. People have become lazy and stopped caring. But running your own server must not become a forgotten art. As IT managers blindly follow the hype to put everything into the “cloud” we sysadmins get stupider by the day. If the trend continues only few people will know how to run a mail server while everyone else is degrading into stupid consumers. Don’t let that happen to you.

So what will the mail server cost you? The only recurring costs you may face are for running your mail server and for renting a domain. Cheap virtual servers are usually available at around $5 / 5€ per month and have enough space to run a mail server for your friends and family. The software being used is completely free and open-source. You can even sell your service if you like. After all it is called “ISPmail” (ISP = internet service provider). Are you a sysadmin and your organization needs a mail server for a few hundred users? Go with this guide. It has been battle-tested by thousands of other sysadmins and constantly evolved over the last 20 years.

What your mail server can do

  • Receive emails on your domains.
  • Filter out spam. (We will not deal with detection of Wind*ws malware though.)
  • Send emails out to any other servers/domains on the internet. Connections will be encrypted when possible.
  • Add automatic cryptographic signatures (DKIM / Domain Keys) to outgoing emails to prove that you are the owner of your domain.
  • Store as many emails for as many email addresses as you have disk space. Set limits (“quotas”) per user. The only limit is the size of your disk.
  • Let your users fetch email using IMAP or POP3 and send email through your servers using SMTP.
  • Allow users to manage server-based filter rules. Distribute incoming emails to different folders. Forward copies. Or send out-of-office notifications.
  • Provide a webmail interface so users can access their emails securely from any location using a web browser.
  • Mitigate brute force attacks.

What you will need

  • Linux experience. Preferably a Debian-derivative. No godlike skills required. But know your basics: navigating through the file system, editing files, watching log files and having basic understanding of DNS and SQL (SELECT, INSERT, rows, columns).
  • Time. 2 hours to 2 days.
  • server that runs with Debian Bullseye. 1 GB of RAM and a 20 GB disk/SSD is fine for your friends and family. Rent a cheap virtual server. Or use a decommissioned laptop. Other Linux distributions likely come with other versions of the software and have different configurations and paths on disk. It will work but you will need to deviate from this guide.
  • Your server needs to have a public IP address that does not belong to a range of typical ISP customers. You usually can’t operate the mail server from a dialup IP address at home because those IP ranges are blacklisted by most other mail servers. Make sure that your IP address is not blacklisted before you start. If you rent a virtual server from your favorite hosting company you probably won’t have any problems.
  • An internet domain (or several) to receive emails for. You need to be able to set A, MX and TXT records for that domain.
  • Patience. We will proceed slowly and after every step ensure that are still on track. Don’t hurry and skip parts even if they appear confusing at first. If you get lost just submit your question at the bottom of any page throughout this guide and help is on the way. Or join the chat channel.

What this is not about

If you just want to have a working mail server and do not care how it works then this guide is not for you. Check out ready solutions like iRedMail. Running a mail server requires technical understanding. And that’s what the ISPmail guide is for. Experience from giving support to other sysadmins shows that most problems appear because some detail in a complex setup goes wrong and they have no idea how to fix it. Email has evolved a lot over the past 40 years. Go with ready solutions if you like. But I have a feeling that we meet again. And you will probably not save time either taking the easy route. This guide tries to follow the mantra:

Everything should be made as simple as possible, but no simpler.
(Albert Einstein)

Ready?

The whole tutorial is split into several pages. Please use the links on the right side to navigate through the pages. Let’s go.

7 thoughts on “ISPmail guide for Debian 11 “Bullseye”

  • 2021-11-20 at 21:30
    Permalink

    Nice! Just at the right moment. Few ours earlier it was not there and i thought whether I should try the Debian 10 guide on Debian 11. Reloaded now and it was there πŸ˜‰ Thanks

    Reply
  • 2021-11-20 at 22:56
    Permalink

    @Nomsis. Nice timing. I wasn’t even sure how to announce that the new guide is online. πŸ™‚

    Reply
  • 2021-11-24 at 12:21
    Permalink

    Awesome and just in time πŸ™‚ Thanks indeed for your great work. I appreciate that very much.

    Reply
    • 2021-11-27 at 17:50
      Permalink

      I find it tricky (beyond acceptable) to run different processes within the same Docker container. For testing I started with a Vagrant box and later deployed on a cheap virtual server. If you are interested in scaling or dockerisation maybe Kubernetes is an option. That however will require that you are willing to jump through piles of burning catfood. πŸ™‚

      Reply
  • 2021-11-29 at 03:59
    Permalink

    From the beta warning- If you get stuck or find something that does not make sense **tough** then please do not hesitate to post a comment on the respective page.

    I think you meant **though**??

    I’ve been following your guides for several years and have been running my own email server. Thank you for such a thorough guide and for the privacy, security, and independence it provides. I do like to think that I learned a few things about postfix and dovecot along the way.

    I’ll test out the guide in a VM and let you know if I spot anything.

    Reply

Leave a Reply

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