Self-hosted Email Server reddit / selfhosted ---------------------------------------------------------------------- russellfolk · 2023-10-28 04:36 I would love to run my mail server self-hosted at home. I have a small N100 box that I would like to dedicate for this purpose. ## Needs * capability to handle a handful of domains * each domain has at least one user (no more than a handful each) * the ability for users to have multiple aliases * relatively small amounts of email per day total (mostly incoming) ## Concerns / Possible Mitigations: * residential IP won’t work with SMTP * I have a Vultr VPS I could use as a relay between the world and me (IP reports as clean on blacklist checkers [both IPv4 and IPv6]) ## Questions: * Could I set up WireGuard between the home server and VPS then have that handle sending out the email? * What software stack would I need? Would this be something like postfix to postfix or..? ---------------------------------------------------------------------- JzJad12 · 2023-10-28 05:49 1. You can definitely use wireguard for this purpose. 2. I personally prefer mailcow dockerized, you can specify an outgoing relay. If the vps will be just for email you could go as far as installing proxmox's email security gateway but that could be a bit much. ---------------------------------------------------------------------- russellfolk · 2023-10-28 09:14 I’d like to run as close to the metal as possible and on FreeBSD as that’s where I’m most comfortable. Is this essentially what I’m doing? Setting an outgoing relay? ---------------------------------------------------------------------- NikStalwart · 2023-10-28 10:31 > Could I set up WireGuard between the home server and VPS then have that handle sending out the email? Yes, you can. > What software stack would I need? Would this be something like postfix to postfix or..? I don't think you need postfix-to-postfix. You just configure your VPS server's VPN-facing IP address in your dovecot or mail client (instead of the conventual localhost address). ---------------------------------------------------------------------- Ox450x6c · 2023-10-28 10:52 \> Could I set up WireGuard between the home server and VPS then have that handle sending out the email? Yes, however wireguard protocol is easy to detect, my provider is blocking this protocol, so I use xray (which is not VPN, but can be used as bridge), it works great. \> What software stack would I need? Would this be something like postfix to postfix or..? As an option: try maddy, it is easy to setup. ---------------------------------------------------------------------- McQueen2063 · 2023-10-28 11:33 this is basically the setup I run at home. FreeBSD jail. inside the jail: opensmtpd, dovecot, relayd. virtual users, but auth against local passwd file. no databaes involved. MX records point to a cname which resolves to my resential IP. Mail users send mail to my MX, but as you said, outgoing mail wont work from resential IP. So local mailserver relays mail to a tiny vps running OpenBSD with opensmtpd and that one relays out to the world. Proper SPF records (and dmsrc, dkim) all set. Runs super smooth. Never been blacklisted. If you need more details of this setup, I planned to do a write up. I cobbled things together from other opensmtpd and dovecot guides I found. I just thought its not worth the time, since my setup inside a freebsd jail is somewhat special. for the curious reader about why? I love zfs. I can easily backup all my mails of all users with snapshots and send them away. next step even to a remote location. if my isp is down too long, change cname of mx and let the jail run somewhere else… ---------------------------------------------------------------------- base-scan · 2023-10-28 11:43 I can suggest https://mailcow.email/ ---------------------------------------------------------------------- thaexistentialist · 2023-10-28 12:03 Here is a guide that I found helpful when setting up my email server: [https://workaround.org/ispmail-bookworm/whats- new/](https://workaround.org/ispmail-bookworm/whats-new/) It allows for multiple aliases and domains. Has spam blocking and uses both postfix and dovecot for handling the mail. ​ Vultr blocks outgoing port 25 so you'll have to ask support for it to be opened. ​ Test your residential IP by connecting to smtp/imap servers using telnet. ---------------------------------------------------------------------- russellfolk · 2023-10-28 17:03 This is almost exactly what I’d love to do!!! I’d love to talk more. ---------------------------------------------------------------------- roman5588 · 2023-10-28 20:58 Mailu or mail cow and smtp2go for outgoing. Don’t make a hard decision be harder than it needs to! ---------------------------------------------------------------------- JzJad12 · 2023-10-29 04:23 Perfect because I have not done email on FreeBSD yet :D ---------------------------------------------------------------------- McQueen2063 · 2023-10-29 19:33 I try to do a write up of my setup during this week. ping me sometime, so I don’t forget ;) in the meantime, you can do some reading here: https://prefetch.eu/blog/2020/email-server/ https://www.vultr.com/docs/an-openbsd-e-mail-server-using-opensmtpd- dovecot-rspamd-and-rainloop/ https://poolp.org/posts/2019-09-14/setting-up-a-mail-server-with- opensmtpd-dovecot-and-rspamd/ ---------------------------------------------------------------------- rrrmmmrrrmmm · 2023-10-30 08:17 If you want something with older components that's bigger but has a nice GUI, then use [MailCow](https://mailcow.email/). If you want something efficient with better security and modern standards then use [Stalwart](https://stalw.art/) ([Reddit](https://www.reddit.com/r/stalwartlabs/)).