10 ms·
Maddy: Composable all-in-one mail server
- NonEUCitizen 5y agoHow complete is the IMAP4 support?
- foxcpp 5y agoIMAP4rev1 is fully and almost [1] correctly implemented. There are some useful protocol extensions supported but some other important ones are missing (e.g. CONDSTORE). There are no known issues with popular clients but performance may be a bit rough. Both due to missing extensions and storage implementation quality e.g. SEARCH may get slow for large inboxes. [1] https://github.com/foxcpp/maddy/issues/188 https://github.com/foxcpp/maddy/issues/188
- postmanpat 5y agoI used to run my own mail, but gave up due to the risk of me screwing up backups/restoration. Maddy (sqlite) + https://litestream.io/ https://litestream.io/ might be simple enough to get right.
- boardwaalk 5y agoMail is one of the easier things to backup IMO. It's just a directory if you use Maildir. Just tar it up with other important stuff on your filesystem you probably also want to save. No need for fancy "streaming SQLite replication."
- postmanpat 5y agoI recall Litestream citing a ~3s streaming replication lag. What replication lag could tar-on-a-cronjob reasonably achieve for a moderate 5GB mail store? Even tar'ing isn't trivial: I've seen casing of people having missed preserving file permissions, making restoration difficult.
- bombcar 5y agoAt 5G size you could do something with ZFS and tons of snapshots and zfs send.
- creshal 5y agoDepends on how much latency/what big a time window for data loss between runs you can afford. We went from streaming cyrus-imapd replication to minutely send/receive for availability, but that introduces a 30-90 time window where data can be lost. Fine for us (esp. considering the reduction in ops overhead), but not necessarily for everyone. (Backups are done by rsnapshot pulling from a snapshot, so we have another copy outside ZFS just in case.)
- jraph 5y agoI'd go with rsync for the transfer (+ zfs/btrfs snapshots on the receiving side to keep incremental backups)
- 3np 5y agoTwo popular alternatives for this: https://github.com/zrepl/zrepl https://github.com/zrepl/zrepl https://github.com/jimsalterjrs/sanoid/ https://github.com/jimsalterjrs/sanoid/
- creshal 5y agoReplication and backups are usually different things. If you need replication, yes, backup tools won't cut it latency wise. But proper backup tools like rsnapshot, borg, etc. pp. have no trouble correctly backing up email servers even at 10 or 100 times your mail store size.
- benbjohnson 5y agoLitestream author here. It has a 1s replication lag by default. It will snapshot the whole database periodically but otherwise it only incrementally uploads the new WAL pages (which are LZ4 compressed).
- kijin 5y agoIs the name meant to imply that this is the mail server equivalent of caddy? [edit] I found the FAQ: > It was intended to be one but developers quickly acknowledged the fact email cannot be easily abstracted behind some magic. So it can't be as simple as caddy, but they're doing their best. :)
- figbert 5y agoI've been using Maddy now for about a month for my email, and it's incredible. The dev says it's not caddy for email – but in my experience, it's certainly been that easy. I've got to write a longer article about this, but self-hosting email is incredibly liberating. I now own my entire digital identity. I can work on open source projects with developers around the world completely while relying only on my own capabilities.
- ta1234567890 5y agoWhat hosting service do you recommend to run it on?
- 3np 5y agoVultr, Linode, Njalla, Hetzner, Scaleway
- spuz 5y agoHave you actually hosted an email server on all five of those? As you mentioned in your other comment, it can be very helpful if your VPS provider is able to respond to support requests asking Microsoft for IP addresses to be whitelisted. I can't imagine all VPS providers would be so helpful but you didn't mention which one you were using in that comment.
- lifty 5y agoI’m hosting my email on Scaleway for 4-5 years and have no issues with deliverability. Last time I checked my email server was correctly configured.
- xarope 5y agoI'm hosting on linode, and once I had my SPF & DKIM records setup, things went a lot smoother.
- unethical_ban 5y agoLate to the game. Vultr does block port 25 by default, but if you request it to be unblocked for your account and agree not to be abusive with the protocol, they'll open it up for you.
- rdevsrex 5y agoThis is exactly the kind of thing that I’ve been planning to make for my own personal use. I’ll definitely check it out!
- lifty 5y agoYou can put it together in a weekend.
- xyzzy_plugh 5y agoUnrelated but: what VPS hosts are reliable for email? I've had trouble with Linode being blocked in the past. I'm aware Google Cloud blocks port 25. I haven't tried EC2 but I assume the worst.
- shankspeaks 5y agoI've run mail servers on EC2 before. You'll need to raise a request to remove the SMTP 25 restriction (both inbound and outbound), and also apply for a DNS reverse ptr update for that IP for it to work.
- danmur 5y agoThis doesn't answer your question, but I gave up on hosting my own email. I host my own other stuff where I can but email is just too much of a pain; constant delivery problems (especially to MS), spam is a pain to keep up with etc.
- andyana 5y agoYou can run your own stuff and use a commercial relay like Sendinblue to handle delivery for you. Best of both worlds, in my opinion.
- KronisLV 5y agoCurrently using Time4VPS with no issues so far: https://www.time4vps.com/?affid=5294 https://www.time4vps.com/?affid=5294 (affiliate link, personally i find it to be an affordable VPS host that i've used for years and host most of my stuff on). However, i'd say that it's less of a matter of choosing a VPS host and more one of making sure that the IP addresses that you get are not in any blacklists. This seems like a good starting point for those sorts of checks: https://dnschecker.org/ip-blacklist-checker.php https://dnschecker.org/ip-blacklist-checker.php Or maybe this: https://mxtoolbox.com/blacklists.aspx https://mxtoolbox.com/blacklists.aspx I think the actual question would be: "Which VPS hosts have the least blacklisted IP addresses for hosting mail servers?" But i'm afraid that i cannot answer that one, because after a brief search i could not find any articles, which would check the IP blocks owned by different hosts and what percentage of them are in blacklists, which would probably be a large undertaking. Until then, most of the answers will probably be subjective, along the lines of: "I use $HOST without many problems." (like my answer above, though even then someone could get a blacklisted IP address and their answer would be the exact opposite to mine).
- sergiomattei 5y agoThis is a great initiative. The last time I remember setting up a mail server using Postfix or Dovecot was around 2015. It was a traumatizing experience. It rarely worked, all my email went to spam and I absolutely hated the amount of hackery and duct tape required to keep it working. Configuration files, missed emails... It was so unpleasant, to this day I avoid messing with mail on servers at all costs. I'd much rather pay for Mailgun or some provider. Lately I've been seeing an uptick of these apps making self-hosted email easier. Mail in a box, Maddy, etc. I will unconditionally support anything that makes doing this easier. I'm not switching from GSuite, but I'm happy to see progress in the space.
- n3storm 5y agoYour mail will go to Spam too with Maddy, this is not about the MTA.
- reitanuki 5y agoThis is not (always) true. Maddy comes with a lot of the 'good stuff' like DKIM and DMARC ready to be used, whereas setting that up yourself with Postfix was a pain (from my experience a few years ago) and probably meant you didn't bother. I've had better deliverability, especially to Gmail and Microsoft, since using Maddy, probably for this reason. Now, of course, I must admit that self-hosted e-mail seems like it will always inevitably run into a blocklist problem, usually because of IP neighbours. But personally, I've managed to avoid that in the last year that I've been running Maddy -- main exception is I had to fill in Microsoft's silly form to get unblocked at the start (but I've had to do this for every deployment I've ever done).
- n3storm 5y agoSo you agree is not about the software but you did not implement best practices with Postfix. Also, whenever you give an address to someone else, family or friend, risk of going to spam increases. Links or src in emails without https, higher risk, Does Maudy prevent you from doing that?
- KronisLV 5y agoPersonally i use a mail server that's preconfigured and lives inside of a Docker container with all of the dependencies that it needs: https://hub.docker.com/r/mailserver/docker-mailserver https://hub.docker.com/r/mailserver/docker-mailserver ( GitHub: https://github.com/docker-mailserver/docker-mailserver https://github.com/docker-mailserver/docker-mailserver ). With it, adding a new e-mail account is as simple as running a script with some parameters and it interoperates nicely with most clients such as Thunderbird or even the one built into Nextcloud (for a lightweight hosted solution without a separate app to manage). It is pretty awesome to see new projects that try to improve the user experience for the system admins, for example, the Caddy web server and now the Maddy mail server. I'm not sure whether i'd have been able to set up a mail server the "old fashioned way", seemingly in line with the concerns of the other people here who have tried that more extensively. Somehow, while e-mail is super widespread and works decently for getting text information from place A to place B, it also feels a tad overcomplicated (the different components for sending/receiving mail, SMTP, IMAP, POP3, the sad need for anti virus scanning, SPF, DKIM, DMARC, the similarly sad need for anti spam protection). That said, the containerized solution above has also worked nicely for me - i'll still probably use GMail/other hosted solutions for personal e-mail stuff and communication, but right now i've already switched over to using my own mail server for all of the automated e-mails that i need, such as from SonarQube and Zabbix, as well as GitLab.
- sleavey 5y agoI tried it recently and was irritated that it doesn't play nicely with a existing LetsEncrypt instance on the host. Docker doesn't like mounting symlinks, and LetsEncrypt uses symlinks to point to the latest live certificate and key. I could configure Certbot (LetsEncrypt) on deployment of a new certificate to copy it to the Docker instance and tell it to load it, but at this point I just fished out my old Postfix and Dovecot configurations and notes and did it myself; at least this way I'm in complete control. I do approve of such a project existing though, and if I wasn't running other things on the host I would probably use it.
- Firerouge 5y agoConfiguration and setup wise, this looks somewhat simpler to setup than the comparable mailcow-dockerized. https://mailcow.github.io/mailcow-dockerized-docs/i_u_m_install/ https://mailcow.github.io/mailcow-dockerized-docs/i_u_m_inst... I wonder how it compares in multi account management and spam, phishing, & virus blocking, is it extensible?
- foxcpp 5y agoSpam, phishing, virus blocking - no builtin measures. It is easy to integrate rspamd (literally adding one line into config). ClamAV can be used via clamav-milter though some configuration is needed - no direct & easy integration for now. maddy implements de-facto standard milter protocol so it is possible to use any third-party filtering software supporting it.
- andix 5y agoMailcow is a great system. I use it and I love it. But it's a total mess. So many different components glued together, so much that can go wrong. The configuration is scattered into hundreds of files. There is no clear split between the product and user-configuration. To change some settings, you need to make adjustments in the core product (the config files that hold everything together). Replacing a lot of components with Maddy would probably make projects like mailcow way slimmer.
- the_duke 5y agoI've been using maddy as a personal and business email server for a while. Resource consumption is basically zero, no problems with sending or receiving emails at all. It did take me quite a few hours to properly set up a Kubernetes + Terraform config though. Getting all the bits and pieces for DKIM, SPF, DMARC right, including issuing certs via cert-manager, is quite finicky.
- smartbit 5y agoAre your .yaml & .tf files available somewhere?
- abdullahkhalids 5y agoI use nearlyfreespeech to host my personal website, but they don't allow for email hosting. What other similar host (cheap but reliable) would you recommend for hosting an email server like Maddy?
- tathatsnice 5y agoIs catch-all supported? Couldn’t find an answer to that in the FAQ.
- figbert 5y agoYes! You just have to get it set up properly in the config (I remember reading about it in the docs or mailing list somewhere).
- foxcpp 5y agohttps://github.com/foxcpp/maddy/issues/243#issuecomment-655694512 https://github.com/foxcpp/maddy/issues/243#issuecomment-6556... I guess that needs to be in FAQ...
- hardwaresofton 5y agoMaddy is fantastic -- for greater flexibility/ease of deployment, you can pre-provision your DKIM keys as well. Maddy also works wonderfully when combined with other technologies, it's nice, simple and light. It works great with Haraka[0] on the outside proxying email to maddy instances on the inside. I've also combined it with SES provisioned with Pulumi + k8s[1] (for those on AWS), which is a little bit more involved but is what I use on projects now. Another entry in this space is chasquid[2] but I've only used/can recommend maddy. Maddy is so good it makes me think anyone could run a hard-multitenant email provider with ease (I'm essentially doing that for each of my projects). [0]: https://haraka.github.io https://haraka.github.io [1]: https://www.vadosware.io/post/setting-up-ses-with-pulumi/ https://www.vadosware.io/post/setting-up-ses-with-pulumi/ [2]: https://github.com/albertito/chasquid https://github.com/albertito/chasquid
- dusted 5y agoI'm running a Postfix, Dovecot, OpenDKIM, OpenSPF stack, and it's not entirely trivial to setup and get working.. Next time, I'll try this, if I remember.. Next big issue is how difficult it is to actually get to send email from your email server when you're really self hosting it (as in, on a box in your actual home, like it's supposed to be)
- xarope 5y agoDitto for me (postfix, dovecot, opendkim, spf etc), took me about 3 months to get it working, and for the last 6+ years I haven't dared to touch my postfix configuration! I am severely tempted to give maddy a try now...!
- tommasoamici 5y agoI see no one has mentioned Mailu (https://mailu.io/1.7/ https://mailu.io/1.7/). It’s a self hosted mail server made up of a couple docker images. I would recommend it based on my use and experience. I’ve been using it for my personal email and for automated no-reply messages in a few projects with no delivery issues. I’m hosting on a Contabo VPS. It handles spam with rspamd, sets you up with DMARC, DKIM, has an admin interface, web mail interface.
- mattbee 5y agoSeconded, I've used it for a couple of years and it's a great package that I find quite understandable (a docker-compose stack).
- neals 5y agoWhat keeps me from running my own like this is stuff like, how easy would migration to another sever be and how easy is backup and recover.
- fragileone 5y agoDocker is pretty portable by design. If you use bind mounts you can just scp the docker-conpose.yml and your bind mount volumes to your new server and you're done. If using Docker-managed volumes you'll need to docker cp the data out of them first before scp, then docker cp them into your volumes once you docker-compose up your containers.
- fffrantz 5y agoI’ve been using YunoHost (https://yunohost.org/ https://yunohost.org/) for my VPS setup for years, including emails, and the setup is such a breeze. It takes care of everything from certs to spam detection, includes IMAP, and you can even choose you webmail interface. Maddy sure looks like a great alternative if you just want/need emails. Edit : typo
- kowlo 5y agoI hit `esc` on that page (no idea why) and it looks like a cool way to modify the content (or send a request to). It did confuse me for a moment!
- mehdix 5y agofwiw, I'm using postfix, dovecot and rspamd for a year now and it is working like charm ever since. However, gmx.de rejected emails due to reverse dns issues.
- soheilpro 5y agoI've always wanted SmarterMail for Linux. Maddy seems to be exactly that. I’ll definitely check it out.
- andix 5y agoI used to run CommuniGate from Stalker on my private mail server. It is more or less one binary and one data folder, available for all operating systems, providing a lot of functionality (SMTP, IMAP, ActiveSync, Webmail, Groupware, ...). Everything can be configured via one uniform Web UI. Multi domain, multi IP, and you could even cluster together multiple servers. It's closed source, but offers a free license for up to 5 mailboxes. Sadly this product died during the last 10 years and is now in an unusable state.
- zimpenfish 5y agoI'd love to move my crufty mail setup to something like this but after 15 years of self-hosting, there are many wrinkles and dragons that people rely on (e.g. rspamd whitelist from iOS notes, IMAP authentication and proxying via Perl+sqlite) which these pre-packaged solutions don't (and probably rightly!) support. But if I was setting up something new, I'd definitely use one.
- lorisdev 5y agoI've been using simple mail forwarder (https://github.com/huan/docker-simple-mail-forwarder https://github.com/huan/docker-simple-mail-forwarder) for a while now to catch-all and forward any email to my domain to my personal email on protonmail. Advantages are that I can move to another email provider without much hassle, and that I can have a different email address for any service I sign up for. The main disadvantage is that I can't make it look like I am replying from the same address. I wonder if it's something that's doable?
- fragileone 5y agoAnonAddy can do this and it has a nice web GUI. It also allows you to individually block any of the email addresses from forwarding to your inbox, which helps make spam control much easier.
- skyfaller 5y agoMy one question: Caddy is known for effortless TLS, has it on by default and makes it "just work". Why can't Maddy also automatically set up TLS, instead of having to use a cert acquired by some other means?
- foxcpp 5y agohttps://github.com/foxcpp/maddy/issues/3 https://github.com/foxcpp/maddy/issues/3 Here is the detailed discussion of problems related to automatic TLS configuration in email world.
- lazyweb 5y agoI've been running my own selfhosted mail server setup for about six years [1] without much trouble. It's a lot of work in the beginning, and there is a learning curve, but I've never experienced any of the issues lots of other people seem to have with their setups. [1] https://jschumacher.info/2021/05/running-a-private-mail-server-for-six-years-easy-peasy/ https://jschumacher.info/2021/05/running-a-private-mail-serv...
- zertrin 5y agoSame experience here, used the workaround.org tutorial as strong inspiration (not blindly copy pasting, but to serve as guided path to follow and learn). Steep learning curve indeed, but after initial setup it's just working and necessitate no tending except when I do major upgrades (of Debian so every 2.5 years on average), in case some config needs updating. But this is really a private email server with no users except me, thus probably not encountering the issues related to mail servers with many users that might or might not have a good email hygiene.
- whalesalad 5y agoI remember building my own mail server on a PIII with 500mhz and 128mb of ram. I used qmailrocks.org and learned so much about Linux and how things work. This was in like 2003 or 2004? My how times have changed!
- theshadowknows 5y agoIt’s every couple of months that someone at my job comes along and says hey give me access to this data because my team is building their own marketing email tool. I always ask them who they know at google so that they can call and get unbanned from gmail. So far no one ever has an answer…email is tough and people need to be very careful when they try to do it at scale. That’s not to say that projects like this aren’t great. They are. But enterprise scale email is very complicated especially in regulated industries like finance and healthcare.
- samtuke 5y agoYes running your own mail is still hard, and our approach is to manage and automate existing MTAs via an Open Source app: Lightmeter.io. Maddy looks great, and necessary. For people wanting to stick with Postfix, Lightmeter is worth a look. FYI we recently did the YC S21 interview but flunked the last hurdle this time around.