Nextcloud Mail Server


#41

Ultimately asking if it’ll be integrated directly into Nextcloud is the wrong approach in my opinion.
Contacts, calendar, LDAP, Spreed - they’re all apps, and none of them are enabled by default.

So, inkeeping with the idea of modularity and shipping a bloat-free solution, there’s no reason someone can’t develop an email server app to give the people who want it the opportunity to use it.

Whether that ultimately sees an approach similar to collabora or spreed in running another server to hook into, or someone very clever implements an email server as an app, there’ll be something to point people at.


#42

I used postfix and dovecot for email, and I’m somewhat satisfied. HOWEVER:

I would like email integration, instead of maintaining two separate logins for nextcloud and email. I’d also like to use things like app passwords against email.

What I’d like

  1. Email admin app that takes the functionality of Postfix Admin
  2. login against nextcloud auth
  3. integrated webmail client.(save/send from files), intergration with calendar/contacts
  4. User configuration
  5. web configuration for user sieve rules and spamassassin rules.
  6. administration functions like quotas, finding lost emails, purging old emails, etc…

But I’d like still use dovecot and postfix for the MTA and IMAP daemon, but use a PHP configuration front end, replacing or using something like Postfix Admin.


#43

Having frontend to dovecot, postfix, etc would certainly be nice. But I am afraid, the configuration of the underlying tools varies by linux distributions.

I just spent about two days configuring getmail (fetching mail from gmail and other mail providers), dovecot (imap server + authentication), postfix (SMTP relay back to the mail providers) and I cannot imaging how this could be done and managed in GUI - many tutorials simply did not apply to my install and I had to dig into more details than I originally expected.

Nevertheless, it might be feasible as a self-contained appliance (docker?), where anything would be under control.

P.S. Now I am looking into options of webmail (roundcube) integration with nextcloud, but that is another story. There does not seem to be any fully working solution either.


#44

I’ve been building a full featured IMAP server for a while by now and we hope to start rolling it out for our users in the coming months. Would be great to get it somehow integrated with Nextcloud (besides the obvious IMAP) as it allows to tap into the internals of the server via an HTTP API. All emails are parsed in the server so no need to handle any email RFCs, it’s all unicode JSON and binary attachments. https://github.com/nodemailer/wildduck


#45

your project sounds cool. do you know of anyone participating in making it “app”-ready for nc?


#46

Oh, wildduck certainly does sound cool @andris9 - really nice work! If it were an Nc app it would only require MongoDB, no other new dependencies on the server?


#47

WIldDuck would require Node.js (server application runtime), Redis (counters, pubsub) and MongoDB (actual storage). It’s not PHP so it wouldn’t be possible to integrate WildDuck into NextCloud directly (it can not be a NC app as it is a Node.js daemon) but it would be totally possible to control the server via HTTP API from a NC app.


#48

I am also looking for a Roundcube plugin to save/load attachment to/from Nextcloud.
I think using WebDAV is a right way to go. And found an plugin (https://github.com/messagerie-melanie2/Roundcube-Plugin-Roundrive) but it seems that the development of the plugin is stopped.

For the address books CardDAV, Roundcube already have a plugin for it and it works.


#49

@jacky The developer ceased development long ago, citing no support for his work.

As an alternative CardDAV is well supported by Rainloop which is supported on Nextcloud and there is an app in the store for it. Saving attachments to Nextcloud also works well in Rainloop.


#50

FWIW I have a half baked server setup solution for the latest *buntu based servers using plain old bash for install and setup and a simple PHP based standalone interface to manage adding virtual hosts and mailboxes. I’ve just been too busy to polish it off and get it to the point where other folks could use it… which, ironically, would very much help with said polishing. The PHP frontend is specifically written to able to easily create a plugin for Wordpress so it could work a little like a very very simply cPanel/WHM system from within Wordpress itself and after that I intend to also turn it into a Nextcloud app extension (think MainWP for managing remote Wordpress sites, only for an entire server stack.) The system installs and mostly manages nginx/php-fpm, postfix/dovecot, sieve/spamprobe and powerdns. All services are backed by either MySQL or SQLite so it’ll run in a lightly loaded 256MB ram LXD container just fine when using SQLite. The web interface is a mess atm because I am converting it to Bootstrap4 and the setup shell scripts just need to be run through a series of tests to make sure the last few months of tweaks haven’t ruined the entire setup flow… otherwise I’d confidently post a link to the repo.

Hmm, currently one SQLite based DO droplet (512MB ram) is using 170Mb of RSS ram and that’s with a serious 400GB rsync backup currently in progress while still working as a tertiary DNS server. It could easily handle 1/2 dozen active IMAP mailboxes and a dozen static websites (not Wordpress without switching to MySQL.)


#51

To add my 2 cents, I prefer a more generic approach: allow Nextcloud apps to include and run Ansible playbooks.

Once that’s made possible it will be trivial for developers of Nextcloud apps to include playbooks that reconfigure server components like postfix, dovecot, openldap, powerdns, etc. to work with their Nextcloud app.

It also minimizes efforts required from the Nextcloud core developers (allowing them to focus on the core code) while maximizing Nextcloud’s potential to include more functionality beyond synchronising files.


#52

I’m using another machine for email, ldap, user account etc…

In my case I use Yunohost for holding email server (postfix) with imap daemon (dovecot) with users integrated through ldap.

The admin interface is quite simple, and … by the way… it integrates with the machine with nextcloud for user accounts, even with the password. Been easy to change the password from nextcloud, and make it efective for imap server.

It’s not the best solution, but in my case, was the easiest…

I’m looking forward to migrate email, ldap, etc from the yunohost machine to the nextcloud machine. But it’s something I’ll do some day. Meanwhile … this 2 machines approach it’s great to not sacrifice too much… and with two virtual machines or two raspberry, you have enough for even a 100 users.


#53

I’ve tried to roll my own linux-based email server in the past (postfix, dovecot, dspam, squirrelmail, etc), and although it all worked, just barely, it had many quirks and it was a nightmare to manage. And I have a 4-year B. Sc. in Computer Science, plus 6 years experience as a Linux Sysadmin! So yah, I strongly vote “don’t” (even though we all feel a strong sense of entitlement to “own” email just the way we’d like). You’ll waste monumental efforts that could be better invested elsewhere (hint: in some successor technology to email).

Free email services like Gmail have spoiled people into expecting the moon from a technology which was never originally architected to have all those bells and whistles, and it’s very hard to retrofit them all. Anyone who tries to catch up to a service like Gmail will always be running on a treadmill, as Google, etc. keep raising the bar whenever they like, as they have huge, huge budgets to “just make it work”, unlike any Open Source community, which must sluggishly build consensus to get anything done on a larger scale.

I agree that email is critical and will never really go away. But my perspective on email has changed drastically now, which gives me much more sanity. I consider email to just sort of be a “back channel”, which is used to sign up for services which are somewhat email-like, but much better (in the way of security, and cohesiveness of many smaller services as an entire, comprehensive service, etc.). I virtually never use email to talk to actual humans any longer. Email mostly only helps me sign up for and manage accounts with other messaging services such as Signal and Wire (not to mention my bank, my governments income tax agency, etc). To me, this mere “back channel” need not have any place in Nextcloud, which is where actual humans get things done.

This is similar to how many people use their smartphones now. I know people now who don’t place actual POTS calls any longer with their smartphones. They instead message with WhatsApp, Signal, Wire, etc. Sure, SMS is still needed, as a “back-channel” to signing up to those services (for example, once in a while they want to send you an “activation code” over SMS). But that conventional POTS cell service is pretty much just a necessary throwback, compared to the thing people really want to use their smartphones for, which is to say, for various internet-based services, over mobile data connection. I’m connecting over cellular right now, to type this, in fact.

A fantastic example is this forum we’re all chatting on right here. This forum is web-based. Not email-based. Yet email is how accounts can be ocasionally managed, in a “back-channel” sort of way (say, in case you lose your password, and need a reset).

When it comes to email, I’m currently “getting by”, by using 1) Protonmail, 2) tutanota.com, another free email service, and 3) a custom linux email server with a hacked-together combination of Qmail + IMAP + Roundcube. And I’ve given up hopes to integrate that with Nextcloud until further notice.

I’m happy enough with this “just getting by” email arrangement for now, which is a protection to my hair turning prematurely grey. I’m patiently waiting for Zulip to mature more, so I can use it in the way that Slack is oftentimes used. I’m optimistic that Zulip, once matured, will become the thing that email wishes it was. Everyone else no doubt has their own favorite technology that they hope will similarily be the sucessor to email (although email will never die entirely, as it’s needed to be that necessary “back channel”).


#54

Interestingly enough - I just started using Nextcloud as a replacement for Dropbox/Google drive due to security concerns. Like other posters above, I also had security questions with Gmail and their eavesdropping on everything I do.

I ended up moving my google-apps-hosted domain to a Linux server and I’m using a package called “ISPConfig” - it is part of a scripted type system that uses all popular linux open source servers (postfix, dovecot, apache/ nginx, pure-ftp, bind) and pieces it all together is a way that makes it much easier that some of the manual installs.

The web interface is based on the concept that YOU are an ISP offering those servcies to clients. However, it very functional for use as your own personal set up as well. It even has the ability to generate free SSL certs and keep them updated for use in all your apps.

Hopefully this will help someone else as I really feel it has met my needs and it works very well with Nextcloud.


#55

I’m looking around to see if there are any decent open source email servers that bundle together several services in an easy-to-install container. IRedMail, which is normally poorly packaged (and will probably lead to “Dependency Hell”), has been turned into a Docker container by some guy on github:

Has anyone tried this, perhaps installed on the same server alongside Nextcloud?

Note that this Docker container bundles in Roundcube, which is going to want to use ports 80 and 443, which Nextcloud will already be using. But I think it’s possible to specify nonstandard ports for the built in Roundcube, like ports 88 and 444, so as to not clash with those ports already getting used by Nextcloud on the same server. For example, starting the Docker container with a command a little different than stated in the README.md above (note the use of 88 and 444):

docker run --privileged -p 88:80 -p 444:443 \
       -h HOSTNAME.DOMAIN \
       -e "MYSQL_ROOT_PASSWORD=password" \
       -e "SOGO_WORKERS=1" \
       -e "TZ=Europe/Prague" \
       -e "POSTMASTER_PASSWORD={PLAIN}password" \
       -e "IREDAPD_PLUGINS=['reject_null_sender', 'reject_sender_login_mismatch', 'greylisting', 'throttle', 'amavisd_wblist', 'sql_alias_access_policy']" \
       -v PATH/mysql:/var/lib/mysql \
       -v PATH/vmail:/var/vmail \
       -v PATH/clamav:/var/lib/clamav \
       --name=iredmail lejmr/iredmail:mysql

#56

I took a look at ISPconfig, and appreciated the online demos they offered. ISPconfig looks really, really Enterprise grade; maybe more serious than what I’m looking for. ISPconfig has “Four Access Levels:”

  • Administrator
  • Reseller
  • Client
  • Email Login

…I’m guessing that for a single Nextcloud server, you only really need the “Administrator” access level, and perhaps “Email Login”, while “Reseller” and “Client” might not be needed (as “Administrator” access level seems to be a superset of “Reseller” and “Client” access levels).


#57

@esbeeb - my domain might lead you to believe that I am an ISP. However, that is not the case. I do IT consulting. I set ISPConfig up for my personal services, plus a couple of domains host for myself and a friend. It “may” be overkill, but it works well for me. Best wishes.


#58

I just installed ISPconfig myself, on a cheap VPS where I’m not running Nextcloud. I strongly recommend that you let ISPconfig take full control of a virginally-installed Debian server. ISPconfig is quite “opinionated” (in a very reasonable, sensible way, mind you), but don’t assume it will “play nice” with other things you’ve already installed on a server, such as Nextcloud (even if Nextcloud is in a snap).

Word to the wise: ISPconfig will work on a server with only 1GB of RAM, but you’ll probably want to disable “clamd” (as it will consume at least 550MB of RAM!).

Here’s the goodies which I appreciate ISPconfig providing (which act as a compliment to Nextcloud’s “Mail” app):

  • IMAPS
  • SMTPS (SSL-encrypted SMTP submission on port 587)
  • A web admin interface allowing me to create email accounts, as well as set up vacation autoresponse.

Here’s the guide I followed to do my install.

ISPconfig indeed may be overkill for a lot of people. ISPconfig wants to do many other things for you, besides email hosting setup and management (for multiple domains you might own). I wasn’t interested in having ISPconfig host services like FTP, XMPP, manage multiple domains/multiple websites for nginx, run my own DNS server (BIND9), etc.


#59

I mentioned above my HCP/SH system for managing web and mail services on lightweight servers and in the last year it’s been pretty solid for me. It’s an excellent foundation for Nextcloud on any VPS or LXD container on local hardware. It currently uses Ubuntu 18.04 with nginx/php-fpm and postfix/dovecot/spamprobe. If WordPress is not needed then the entire system can use SQLite which means it will run with less than 256 MB ram and seeing Nextcloud can use SQLite that means a lightly used single user Nextcloud could run in a 200 Mb LXD container on, say, a Kubuntu desktop. A 1GB ram droplet would be fine for Nextcloud with MySQL and WordPress. Not much documentation so feel free to email me for assistance.


#60

You can also use Mailcow dockerized. It’s my Solution for an selfhosted Mailserver.