24 ms·
Maddy: Composable all-in-one mail server in Go
- gclawes 6y agoKinda disappointing there's no JMAP support. I understand why, though.
- faitswulff 6y agoThe relevant issue: https://github.com/foxcpp/maddy/issues/19 https://github.com/foxcpp/maddy/issues/19 > Status update: JMAP is a big complex protocol that is not used by any popular clients and has no server libraries available for Go. IMAP is a big complex but also widespread protocol that is well-known, supported by any email client and has server library available for Go. Some of IMAP disadvantages come from incomplete client implementations, not protocol flaws, as JMAP developers want to convince you. I do not expect wide JMAP adoption in next several years, therefore the decision was made to prioritize improving IMAP implementation. > If somebody insists on having JMAP, I recommend looking at Cyrus email server, perhaps write a Go library for its SASL delegation protocol so it could be used with maddy just as easy as Dovecot.
- josephg 6y agoI just replied on the linked issue. If anyone wants to get started making a jmap server, about a year ago I pulled out the cyrus jmap email parsing code into a standalone C/wasm library: https://www.npmjs.com/package/mime-to-jmap https://www.npmjs.com/package/mime-to-jmap Its a bit of a mess and it needs a write-up, but it should be a reasonable start to making more jmap servers. (This does not implement the jmap application protocol, but it does generate fantastic json from any email blob, incl attachments, snippets, html and text output. And thats crazy difficult to implement correctly.)
- NetOpWibby 6y agoAs soon as there’s an IMAP/JMAP module that’s useable I’m going work on my email client concept again. I got far enough, receiving and displaying mail but IMAP is super frustrating to deal with. Maddy looks great though, I may start playing around with it.
- andris9 6y agoI had similar issues where I wanted to remove IMAP complexity from client app, so I created a daemon proxy that sits between client and an IMAP server and “translates” REST API requests to IMAP commands: https://github.com/andris9/imapapi https://github.com/andris9/imapapi
- NetOpWibby 6y agoOh! I had your repo starred already!
- xyzzy_plugh 6y agoI've had a lot of discussions with technical-minded peers about how the only real options for email on your own domain are fastmail or gsuite, which work out to about the same amount of money for a family of 5+, which is a surprisingly large amount (imo worth it). This looks like something worth combining with alps[0] for easy self-hosted email. I might give it a go and ditch gsuite! [0] https://git.sr.ht/~migadu/alps https://git.sr.ht/~migadu/alps
- mtlynch 6y agoMost people don't realize, but you can actually send email from a custom domain with a free Gmail account.[0] You have to go through a 5-minute process for each sender address, but I used it fine for ~10 years. I recently switched to Fastmail, and one of the features I like about them is that they support wildcard sender aliases, so if I sign up for a service with someservice@mydomain.com, when I hit reply to any emails to that address, it automatically sends from someservice@mydomain.com even though I've never specifically registered that identity with Fastmail. [0] https://thedigitalnonprofit.com/use-gmail-own-domain-free/ https://thedigitalnonprofit.com/use-gmail-own-domain-free/
- xyzzy_plugh 6y agoThis is not the same thing. I agree with the link, in that it is most definitely a hack. This only works because your domain registrar is handling email for you to begin with, which is undesirable for many reasons. Also, while aliases in gmail work generally, I find they leak the main gmail account address, which makes them significantly less desirable.
- optimalsolver 6y agoWhen I last looked into setting up my own email server, I read that your messages ending up in the spam folder was almost inevitable if the receiver is using a major host (Gmail, iCloud etc.) Is that still an issue?
- 7kay 6y agoI run my own mail server and have never experienced such issues. The important thing is that your mail server is not an open relay and you set up DKIM and SPF. Oh, and never run a mail server with an ip originating in a residential area, you'll get blacklisted almost instantly by virtually any mail provider.
- yokem55 6y agoIt isn't even necessarily 'residential' IP's. It's IP's that don't have a valid reverse dns, preferably one that is also forward resolvable. Most ISP's won't let you set your reverse DNS on 'residential' connections, so it ends up being a blocker. Now you could set up a vpn tunnel to a vps provider that lets you set your reverse dns, and then things get a bit easier. So prereqs - 1) Valid reverse DNS on your sending IP. Preferably with a hostname that is also forward resolvable. 2) SPF Records 3) DKIM
- 7kay 6y agoYou're right, that's the basic ingredient #1 I forgot to mention. Functional rDNS is essential. You don't want to have your mail server running at home anyhow. A friend of mine had a janky setup at home until I convinced him it's a bad idea.
- krageon 6y ago> You don't want to have your mail server running at home anyhow I do in fact want this. It may not be possible, but I definitely want it to be.
- piaste 6y ago
- Mayzie 6y agoAnother email server like this one that I have used extensively is WildDuck[1] It's written in NodeJS, and is excellent and remarkably simple. [1] https://github.com/nodemailer/wildduck https://github.com/nodemailer/wildduck
- jeffbee 6y agoThere are no scarier words than "I wrote a mailer".
- deleted 6y ago[deleted]
- djsumdog 6y ago"I wrote a custom encryption library"
- aeden 6y ago"I wrote a name server"
- NetOpWibby 6y agoI’m actually interested in this
- alimoeeny 6y agocan you elaborate? I mean it is not obvious to me what is wrong with writing a new mail server,
- mattbee 6y agoI wrote a custom network block storage server.
- hu3 6y agoI wrote a custom P2P serverless noSQL GraphQL database that compiles to WASM powered by Blockchain leveraging smart contracts and artificial intelligence to achieve webscale.
- dhagz 6y agoYou forgot IoT.
- jijji 6y agoThis server seems really promising as it integrates all required functionality into one application, where as compared with most other MTA's (postfix, sendmail, etc) its about a 20 step process to get it all setup correctly (dkim, spf, etc)
- jeremy_wiebe 6y agoIs this a play on the name Caddy (the web server)?
- foxcpp 6y agoYes, it is. The project started as "Caddy for email".
- skyfaller 6y agoAs someone who uses and loves Caddy, I'm very excited about a mail server with a similar philosophy. I'm rooting for you! That said, Caddy's killer feature for me was automatically configuring certs, that's what made me switch from Apache back when we were moving everything to HTTPS. I still don't fully understand how certs work, but fortunately I don't really need to. Until Maddy does this, it won't be a good comparison. Also I would really appreciate some documentation for making this work with Caddy handling TLS certificates for me. I guess I'll file a bug about that.
- 1vuio0pswjnm7 6y agoQuestion to those running own mail servers: Putting aside issues with sending mail to recipients using third party providers, have you been able to receive mail reliably from (a) senders using third party providers or (b) senders running their own SMTP.
- edoceo 6y agoI've been able to receive nearly 100% from the big guys. For folks that run their own I run into less issues these days. I'm still on Postfix. Some of the client and header checks used to (c2005) be too strict. But! When it failed, there were logs I could see. If you run your own, you'll want to get some log checking tools to make sure things are tidy.
- illuminated 6y agoNo issues at all. It comes down to the way they have set up their own mail servers. Incoming email is being checked for DKIM, DMARC, etc and then handled based on that. Logs are also super helpful in determining what went how in the reception process.
- curiousfab 6y agoYes, and yes, no problems ever with receiving mail on my self-hosted systems. exim4, self-signed cert. Sending is what may be difficult but personally I only had very minor trouble with that (VPS on a reputable provider, all set up properly).
- Sylarr 6y agoWhich VPS provider is that? We send mail from a Linode VPS in Frankfurt, which works fine most of the time but a couple of times a year Microsoft puts us on a blacklist, most likely because of a neighbouring IP sending spam.
- curiousfab 6y agoHetzner. I once was blacklisted at MSFT and filled out their online form, which solved the problem within a day or two. The only provider that doesn't accept my mail (for years already) is AT&T but this is something I can live with (I rarely have to send something to AT&T, as I am only dealing with locals).
- seqizz 6y agoOne other all-in-one solution which I use (and love): SNM [0] Obviously only usable for NixOS zealots, but just import the class with your desired parameters and good to go. But Maddy-like consolidation seems like the way forward. Setting up 100 moving parts is not always easy. [0]: https://gitlab.com/simple-nixos-mailserver/nixos-mailserver https://gitlab.com/simple-nixos-mailserver/nixos-mailserver
- passerby1 6y agoWhat's the license for project? It's a bit odd to see a serious opensource project without any license specified as it prevents adoption for at least some of potensial users. I for example pay close attention to licensing as a personal user. It's just too risky to invest my time learning to use project which can any time in the future become paid or restricted in other way.
- lifty 6y agoThe license is clearly there. It’s GPLv3
- foxcpp 6y agoCurrently the license is GPLv3, you can find it in the COPYING file. There are some messy bits related to licensing because it was MIT licensed in the past (back then when I did not take this "little pet project" very seriously).
- pojntfx 6y agoIt's GPL: https://github.com/foxcpp/maddy/blob/master/COPYING https://github.com/foxcpp/maddy/blob/master/COPYING
- denysvitali 6y agoI strongly recommend looking into Chasquid: https://github.com/albertito/chasquid https://github.com/albertito/chasquid Only SMTP though, for the IMAP part you need to use something else like Dovecot.
- modinfo 6y agoA fullstack but simple mail server (SMTP, IMAP, Antispam, Antivirus...). Only configuration files, no SQL database. https://github.com/tomav/docker-mailserver https://github.com/tomav/docker-mailserver
- 0df8dkdf 6y agothere is also http://haraka.github.io http://haraka.github.io
- nolok 6y agoDoes anyone know of a mail server (imap) where the developper can be in control of the mail source? I wanted to expose one of our tool to mail clients, something that handles all the imap talk and gives you onread/onmark/ondelete/... events, but I found very little libraries or servers for that kind of usage
- specialist 6y agoHi @foxcpp. Project site says "all-in-one" (one daemon) to replace postfix, etc. Like sendmail? Please say more. For 20+ plus years I've been advocating for postfix instead of sendmail style architectures. I don't know what to call the "one task, one process" style of postfix. What's the opposite of monolithic? This tension is replaying (again) in the web services vs monolithic architecture debate. Ironically, I prefer monolithic web apps over web services based designs. Contradicting myself. I'd like to better understand when each style is better suited to the task at hand.
- cmroanirgo 6y ago> What's the opposite of monolithic? The web's answers for a suitable antonym seem inappropriate [0] (all referring to "small" rather than "many parts". I reckon megalithic is the way to go. Although I've been hosting my own mail server (postfix/dovecot) for years I must admit that I treat most of its parts as a single black box. My head just doesn't grok the entirety of processes and the various sub components (spam, grey listing, filters). I prefer monolithic every day. It's not hard to provide plugins that allow custom filtering/ spam etc, so the end result can easily be the same. Especially for personal /small business servers, simplicity wins everytime IMHO. [0] https://www.merriam-webster.com/thesaurus/monolithic https://www.merriam-webster.com/thesaurus/monolithic
- specialist 6y agoHeh. Small chuckle, thanks. Mono - one, lithic - stone. "One stone". It's in the name, right?
- foxcpp 6y ago>Please say more Default configuration runs everything as a single daemon. This has been done to minimize any management overhead, avoid the complexity and performance overhead introduced by IPC. It is definitely possible to split things apart though - this is not something of a hard design decision. This is what LMTP is for, right? maddy can work as both LMTP server and client and also supports both server and client parts of Dovecot's authentication delegation protocol. So you can do something like that: 1. maddy instance running SMTP on port 25, running inbound filtering and then doing transparent LMTP forwarding to ... 2. maddy instance running LMTP on some unix socket, delivering to local storage and providing access to it via IMAP, authenticating users using ... 3. maddy instance running Dovecot auth's protocol on some unix socket providing authentication service using some DB. 4. maddy instance running Submission, managing queue of outbound messages, trying delivery by forwarding them to ... 5. maddy instance running LMTP on some Unix socket, actually attempting outbound delivery. In fact, you can also put any of these on separate VMs/containers or even physical systems. And if we add some load-balancing capabilities to SMTP client then it can be used to scale message processing (though a single daemon can already handle quite a lot of emails and users without problems).