Nextcloud Mail Server


Caveat here: It is not so easy to setup your own mail server; with good reason, exim4 and postfix and dovecot documentation spans dozens of pages with myriads of topics; you want to have secure access, spam protection, user authentication, DKIM, MX failover, basic integration of virus protection - just to name a few. That’s all off topic here and well documented where it belongs to. We should concentrate on a working mail client integration - there are enough things to do and to contribute (like ics attachment detection–> calendar; attachment handling --> data, signature handling).


I wholeheartedly agree, the last thing you want is to grow the army of misconfigured, unmanaged mail servers, ready to be abused by bots.


Mail-in-a-box is a mail server that (at the moment, at least) incorporates Owncloud 8.2 for contacts & calendars.

Sadly, the developer is looking for an alternative to owncloud due to some past problems with owncloud upgrades…


perhaps a migration to Nextcloud would be a good idea :wink:

On the subject of a mail server as part of Nextcloud, that seems a very bad idea to me, to be honest. We built end user software, not such infrastructural things. It is not only a monumental task but also not suited to what we do.

I wouldn’t stop somebody who wants to write a new mail server but I don’t think it is something ownCloud needs, on the contrary.


Already warned ownCloud about this bad news (that mailinabox wants to go away from ownCloud).

Here is the issue if you want to discuss.


well I added a note that we’ve released Nextcloud 9 but it is up to them to spend/waste time on migrating to another tool of course.


If you want a personal mail server, it is a kind of a hassle, but if you are really motivated, I’d recommend:

  • mail-in-a-box (As posted above)
  • yunohost

At IndieHosters, we have an offer that is basically a FLOSSaaS, it includes:

  • ownCloud (but we’ll switch to Nextcloud soon)
  • emails (spf, dkim, dmarc, imaps, smtps, pops)
  • contact app
  • calendar app
  • documents app
  • mail app
  • all with the same user/pass (with the user_sql backend)
    We plan to add libre office, and spreed.

And all our infrastructure is also open source, so you could have the same setup for you/your organisation!
The documentation is not perfect yet, but please ping me if you need help to setup, or if you want a demo account.


I too have been using for over a year now and the author does use an owncloud backend & is open-sourced on Github. However, he explicitly states that OwnCloud is primarily for the contacts & calendar integration and not for files.

But it is (would be) so cool to have a single sign-on for email AND my nextcloud instance as it is done on MiaB.

With that said, I’d second (third!) hope for a NC iteration. I’ve tested it and it works amazingly as an OC solution but because the primary purpose is to be a mail server he steers clear of what this forum is here for… The calendar and contacts just work out of the box & no need to support all of us customizing our federated clouds.

I’m certain he’d welcome the help to link a robust and hardened NextCloud connection to it in lieu of an old OC version because it does install OC faster than most things out there on a mail-server setup, with TLS, DNS & DNSSEC. As mentioned above, the OC version running on mine currently is 8.2 stable but I host my own separate NextCloud because I don’t want to mess with his amazing Mail-in-a-Box setup provided to me/us.


I have created a Docker images for NextCloud, a private email server using Postfix/Dovecot/SSL certs, Mysql, Nginx and OpenVPN. There is Control Center app to create and manage email users and manage the server. I’d be interested in collaborating if anyone could see value in this. Here is my site: - There are instructional slides there on how to configure NextCloud to use the Private Email Server. Thanks, Paul.


just 1 click and the mailserver + nextcloud is ready :slight_smile:


In my opinion part of the mail server is very welcome in Nextcloud.
The interesting part is the e-mail storage.
Mail handling, like MTA’s do, is something Postfix and the likes are excellent in, so don’t try to implement that.

Why? Well, if Nextcloud stores all the e-mails and attachments, they can be indexed, tagged, etc. They can be used as regular files, with versioning and all. The issues of “Where is that file’s latest version? in mail, or in a file folder?” could become solved. Everything is a file.

The way I imagine it to work is as follows:

  1. Nextcloud has an LDA to receive user’s e-mail and store it. Attachments separate from e-mail.
  2. There is an IMAP connector that reconstructs the e-mails with attachments, or places links to the location of the attachment in owncloud (That would have the added value of versioning for the attachment).
  3. The e-mail attachments are stored in separate folders, under a mail folder. Tagging can be applied, like mail-attachment, INBOX, …
  4. The e-mails themselves can be stored like regular EML files, where metadata and search indexes are in the database.

In the far future one can think about a own-style mail-retrieval protocol, that can be incorporated in e-mail clients, like Evolution, Outlook and Thunderbird. Think something in the line of mailDAV… :slight_smile:

In the end, Nextcloud is about storing your data and make it available to you. A big part of that data is in people’s e-mailboxes. So it makes sense to get that data in Nextcloud.

Greets, Bubbel


Your ideas are really great.

Where I have doubts: We have a simple webmail client in Nextcloud that even lacks some essential features (e.g. moving mails into subfolders). People are working on it for quite some time. So I don’t think it is very realistic to talk about an integration with a mail server which is a much larger effort. I don’t see this happening unless some companies subscribe to the enterprise version or a larger crowd-funding initiative provides the financial power to hire developers for this (or all people asking for feature start to become developers) :smiley:


Good point. It will take a considerate amount of designing and programming. For one, I would never be able to pull it off. I don’t know PHP at all.

But, one can dream… :grin:


wow. i just registered in order to reply to this nonsense.

its 2016, 15 years into 21st century, and someone says integrating email into a cloud application is a ‘horrible idea’.

so a cloud should integrate things like photos, file storage, but, for SOME Reason, the most critical element of online life, email, is a no no for a cloud.

lets get real.

im researching for hours for a solution to move all my organization’s data into a private cloud, and the only reason i havent yet installed owncloud on our allocated server is because i cant be sure if the fledgling email app for owncloud is sufficient enough to supply basic email needs. otherwise i would have already set up everything by now.

you put everything that is needed under the sun in the product which is intended to offer all of those functionality that is needed under the sun. because people need them.

the biggest plague for open source, especially linux, is TOO much modularity for the end user. that’s why we are getting nowhere. there is nothing which people will just install and from the get go start to use what they need in a simple fashion. private companies offer it with proprietary software, and open source ends up having to fight ailing dinosaurs like microsoft solely because of that reason.

im an IT professional, and even i dont want to deal with crapload of modular software which needs to be made play nice with each other to provide most basic of functions. there is no way im going to go through extra hassles for gathering all the services in need in a supposed cloud software one by one.

its illogical to do so - if even an IT professional needs to go through all that hassle to provide the most basic of storage functionality, s/he can just compile some stuff from existing linux repositories/apps. there is no need for a specific software distribution which claims to be a ‘cloud’ solution yet fails to integrate most critical of services.

email is critical in 21st century. email was critical at the end of 20th century too. MANY people are trying to escape big-brother services like gmail.

not having it in a software package which intends to bring people freedom and information privacy is rationally inexplicable.


Nobody denies email is critical.
Please reread the things that have been said about the topic.
The short version is, again:

  • there are already good and stable email solutions around. NC should not duplicate these functions but use it. It’s up to you to decide on the proper server backend; just setup exim4, dovecot, fetchmail, spamassasin, whatever you need.
  • For the mail client, we all agree that the current attempt to make it work didn’t arrive at a 1.0 state. For some basic things, it is useable, but still has some shortcomings. You are invited to show your friendly face and professionally support development here.

  • there are already good and stable email solutions around. NC should not duplicate these functions but use it. It’s up to you to decide on the proper server backend; just setup exim4, dovecot, fetchmail, spamassasin, whatever you need.

no, actually not. each of these are a major pain in the ass to set up and configure even for people experienced with maintaining their own servers. they are beyond reach for people who are escaping google and trying to set up a safe haven with limited experience.

and they are 3-4 different pieces of software in one go for maintaining the email - all of them need to be maintained and you risk an update breaking the configuration and pushing you to research for hours to find out what was changed.

there is a reason why the first advice in linux forums to those who attempt to set up their private email server is ‘dont’.

something which even deters experienced system admins cannot be expected of non professional audience.

long story short if email is integrated, its no cloud solution. with that mindset the project should not have been started in the first place - “Pick a server of your choosing and set it up”.



I read your pieces twice now, but I cannot get a full understanding of your arguments. I’ll try to put up my view of the issue, dor healthy discussion’s sake.
For one, I do believe e-mail is a service which could be delivered as a cloud service. It should be easy to set up for an end user. Which it is, in my opinion.

As you’re are an admin, you would know that many, if not all, e-mail solutions tend to have a challenging install and configuration process. This is not new and will not change in the short term. The use cases for end users and admins are so divers, that there is no way to get the install-and-run option correct for the whole world. Microsoft’s Exchange does tend to have decent default values, but it still needs a solid design process to get it working the way you want it in your organisation.

Linux-like mail servers do tend to use a different approach: Read the (design) manuals, design the damn thing, read the installation/configuration manuals and build the damn thing.

Installation and configuration of the mail server back-end is more like setting up the mail infrastructure. To use the e-mail service, a cloud front-end will be providing the SAAS solution to get the mail up and running.

To put it in technical terms: I don’t think it is a smart move to put MTA functionality into NC. MDA/LDA functionality would be great to let NC handle it. Then you can do many extra things, like (sieve) filtering and offloading attachments to NC. In any case, the MUA should be part of NC. E-mail is still a hugely important part of communication.

Since use cases are so vastly different, it makes sense to provide the MDA/LDA and MUA as addons.

Reference material:


To summarize:

  • Email is the most important service in regard to privacy, safety and security. A project trying to liberate people from corporate strangleholds, mass-hacks, even easy surveillance, cannot ignore/omit email as a service.

  • Email is hard to set up and configure and this is exactly why it should have been integrated to this project long time ago - it doesnt need to work splendidly - something that just works out of the box and liberates users from gmail, hotmail is ok. Spam etc can be left to be configured, and community/users can develop many spam configs and share them with each other.

“Hey, there is this software/project that liberates you from all these services out of the box” is much better than “If you want X, install/compile this, if you want Y, install/compile ZzTop”.


Yes, I agree on that.


I wouldn’t been so keen on seeing NC try to integrate everything. Today is email server, tomorrow there will be an XMPP server, because you know: instant messaging is important, and then more?

I wouldn’t like the project to combine both a “core” function and an integration function. NC is a “core” function provider: a cloud to access and share files! To me, calendar and contacts are nice to have as an all-in-one, but they are already borderline. There are dedicated tools for that that do work well.

If you want all services at once, what you need is not one project to swallow all features, but an integrator. I personally use Yunohost’s solution, that provides me a mail server, an XMPP server, NC, and web interfaces for all of these.
I use NC’s contact & calendars, but that’s because at the time Baikal did not have calendars sharing.
I have a single log-in entry for all these, and that’s what I expect from the integrator. I wouldn’t like to see all the “core” projects attempting to do everything and ending up having the choice between a good files cloud with half-baked mail server and a good communication system with mail, instant messaging and so on but that has a crappy file storage and sharing management that conflicts with NC.

The NC project is good at what it’s doing, let’s not expect it to be the all-we-ever-wished-and-more-in-one-app solution.