This tutorial explains how to set up your own e-mail server integrated with Nextcloud. You can have unlimited users and unlimited domains. Users will be able to use regular e-mail clients (IMAP) like Thunderbird, their smartphone or simply log in to Nextcloud and use an integrated Webmail app. The user database is unified. This means an e-mail account is also a Nextcloud account. You only have to login once, there is no additional webmail URL. There are also shared mailboxes, SPAM filters and other SPAM prevention measures like SPF and DKIM. Of course you also get everything that Nextcloud offers, i.e. contact and calendar sync via CardDAV and CalDAV and obviously all the file sharing. The base operating system is Debian Buster. Check the next chapter for a more detailed overview.
There are also some additional security and privacy features enabled by default.
Finally the creation of this tutorial resulted in the creation of two Nextcloud apps1 that increase the integration between the mail server and Nextcloud.
I have had my own mail server for over eight years now and originally used Christoph Haas' ispmail tutorial. From the start though I made my own modifications like using the imho superior PostgreSQL database and having a more strict and secure configuration, e.g. referential integrity or stricter restrictions when sending e-mails. At some point there were so many changes, that I decided to document the installation process for myself to be able to do a reinstall without reresearching. Because I think that my version is better and by now has even more substantial additions like the integration of Nextcloud, I decided to share it with the public and write this tutorial.
Why "Caramel Edition"?¶
I needed a word to make this tutorial googleable. It is annoying when people give their software or documentation generic names which makes it almost impossible to find it on the Internet. "mail tutorial nextcloud" is not specific enough, "ispmail" is already taken by Christoph. I like caramel, so hopefully you can remember "e-mail nextcloud caramel" and this tutorial will be easy to find. 🙂
Here is a picture of a caramel candy to help you remember: