I want to try and self-host my own email server. Let's skip why it's a bad idea, not worth it, etc., and treat it as an autistic hobby that does not require justification. What is the best way to do it and what is your experience with it?
UFOs Are A Psyop Shirt $21.68 |
receiving mail is easy. Set up postfix, dovecot, anti spam (spamassassin), perhaps a web-based IMAP client (I use roundcube), MX record on your domain and you're good to go
reliably sending email is pretty much impossible these days. The reputation of IP blocks used by hosting providers is very low and they get on blacklists all the time. Save yourself the trouble and use an outgoing mail provider right away. I use Sendgrid in the free tier and I only remember one delivery issue in years of using the service.
>Save yourself the trouble and use an outgoing mail provider right away.
Assuming I have zero experience, what does it mean practically?
you sign up and use the provided API key as external SMTP relay in your postfix configuration, assuming you want to use your mail server as the central server to send your mail through
Basically, it's like a proxy, but for email exclusively?
you can think of it like that
we use sendgrid at work after decades of self hosting email it got blacklisted too often.
is there any good guides on how to set it all up?
they have some on their website
It's like 5 lines in postfix main.cf and then create one file and run postmap on it, reload the server and you're done.
Have to verify domain for sending as well.
instead of setting up an MTA you just use theirs with their reputation and IP addresses.
I've used my own smtp server on a vps for multiple years now, only had issues with delivery to hotmail and with a few emails to their support I got my server whitelisted on their end.
I do not intend to host from my own house, but with a VPS. But I heard some people use reverse proxy and host on their own hardware that way.
odds are you couldn't send from home anyhow, over here port 25 egress is blocked from residential connections and even on the VPS I had to contact their support for them to allow it. receiving directly at home should be possible as long as your ISP aren't a bunch of homosexuals and you have a public address on your router.
You say that, but there's so much nigerian mail in my inbox
don't post your email on the internet publicly for bots to scrape. this will happen over time to any address with normal use (logins etc) thanks to database leaks and similar shit though.
While we are at it, is there a good book I can read to understand how the network and the Internet works on the general level so I won't be just staring at technical terms with a blank expression and copy-pasting terminal commands mechanically?
https://drpeering.net/index.php
thanks, will take a look later
Setting up your own email server can be a rewarding hobby. A popular choice for this is using software like Postfix for mail transfer and Dovecot for handling incoming mail. Here's a general outline:
1. Choose a Linux distribution like Debian or Ubuntu.
2. Install and configure Postfix for sending and receiving emails.
3. Set up Dovecot for handling incoming mail, including IMAP and POP3.
4. Configure DNS records to point to your email server.
5. Implement strong security measures like firewalls and encryption.
6. Test thoroughly and troubleshoot any issues.
While I haven't set up an email server myself, I've seen others do it successfully. It's a challenging but rewarding project for those interested in server administration. Just be patient and seek help from online resources and communities when needed!
>What is the best way to do it
Postfix and dovecot. Make sure you have proper MX/PTR/DKIM/DMARC domain records, then make sure you pass all the diagnostic checks on mxtoolbox.com and mail-tester.com and you'll have zero problems with your outgoing mail being treated as spam on the receiving end, despite what some homosexuals might tell you (unless you send actual spam, that is). You might want to check your server's IP against a mass blacklist checker first, though.
>what is your experience with it
Great. I've been self-hosting for 10 years now on a low-end VPS and have since closed all my third-party email accounts (I use email a whole fricking lot, so I even had a paid one with Runbox). Now I have pretty much unlimited number of email addresses, so whenever I need to provide one to some shady fricking web service, I create a unique alias and if I ever start receiving spam to that alias, I block it immediately and know who the homosexual that leaks/sells user data is.
Are there any good tutorials and/or resources that you consider good on how to do all that?
Here's a series of mail-related tutorials for Debian:
https://www.linuxbabe.com/mail-server/build-email-server-from-scratch-debian-postfix-smtp