What to be aware of before opening port 25 on a postfix Raspberry Pi?
from Flax_vert@feddit.uk to selfhosted@lemmy.world on 22 Apr 17:59
https://feddit.uk/post/10830588

I have a raspberry pi running postfix. I Realised unless I open port 25 I absolutely cannot receive emails (I have 587 open and can send but not receive them). However I heard there are scaries online which someone could potentially send emails from your server without consent. I believe as well my ISP doesn’t block port 25. Is there anything I should do right now before opening port 25, or should everything be safe enough?

#selfhosted

threaded - newest

lemmyreader@lemmy.ml on 22 Apr 18:05 next collapse

Avoid being an open relay indeed. Some background information : www.postfix.org/SMTPD_ACCESS_README.html#relay But with the defaults in postfix you should be fine unless you made a lot of changes and made a mistake in it.

catloaf@lemm.ee on 22 Apr 18:08 next collapse

Ideally, don’t. Self-hosting email is complicated, easy to get wrong (and dangerously wrong, where people could use your server as an open relay and send spam).

That said, if you really want to, make sure you’re not accepting email except for what’s destined for you. There are a bunch of postfix best-practice guides out there that can be easily found with a Google search. I don’t host my own email, so I can’t vouch for any.

markstos@lemmy.world on 22 Apr 18:29 next collapse

Agreed. I used to host email professionally and would not recommend managing your own mail server. It will constantly be under attack by spammers and if the inbox email address is exposed at all, soon 90% of incoming mail will be spam and you’ll need antispam software to filter it.

wildbus8979@sh.itjust.works on 22 Apr 19:00 collapse

Not sure about you latter point tbh. I run an email server, with nothing but grey listing and spamassassin and the amount of spam is absolutely minimal.

Proper config and fail2ban easily takes care of direct attacks.

Nevertheless, I wouldn’t recommend it to anyone but the most determined.

lud@lemm.ee on 23 Apr 06:09 collapse

To be fair, they said that you would need anti spam software and you do use anti spam software.

SeeJayEmm@lemmy.procrastinati.org on 24 Apr 11:59 collapse

And even if you do everything 100% right, your emails will mostly get flagged as spam if not outright blocked anyway. Esp. if you’re using a residential IP.

2xsaiko@discuss.tchncs.de on 22 Apr 18:13 next collapse

You can check for being an open relay with tools like this one: mxtoolbox.com/diagnostic.aspx

Flax_vert@feddit.uk on 22 Apr 19:25 collapse

Thank you so much! It just tested it for me

taladar@sh.itjust.works on 22 Apr 18:15 next collapse

You should be aware that a large number of mail hosters will block all mail from your server merely because it is sent from a dynamic IP address.

Flax_vert@feddit.uk on 22 Apr 18:25 next collapse

I’ve got a domain

wildbus8979@sh.itjust.works on 22 Apr 18:31 next collapse

The domain won’t change that. Even with a static IP if it’s coming from an ISP owned up block you’re likely going to get banned. Even with reputable VPS’ it’s hard. Make sure you have DMARC, DKIM, and SPF setup, but even then almost certainly going to get banned. The big player are creating and inherent monopoly instead of improving their spam filters.

lemmyreader@lemmy.ml on 22 Apr 18:58 next collapse

If you manage to get a good SMTP relay host or authenticated SMTP account for your outgoing email then playing around with small scale self hosting email (Granted that it is not your important daily driver email accounts) can be an interesting and fun experience. But you will have to invest some time reading and tweaking and figuring things out. Slightly comparable with installing Arch Linux. Lots of people will warn you to not do it but you might learn a few valuable things on the way there.

NeoNachtwaechter@lemmy.world on 23 Apr 02:38 collapse

It’s time to learn the difference between a domain and a dynamic IP.

Mixel@feddit.de on 23 Apr 07:20 collapse

Meh that sucks i even have a perfectly working ddns, I mean I know I don’t get something like a PTR record but i wish that mail hosters would allow for more self hosting options

toikpi@feddit.uk on 22 Apr 18:31 next collapse

Have you ensured that your setup will pass email authentication processes?

It has been a long time since email from random hosts is accepted for forwarding or delivery. This Wikipedia may help en.wikipedia.org/wiki/Email_authentication

originalucifer@moist.catsweat.com on 22 Apr 18:55 next collapse

friends dont let friends host email. its just become too top heavy (complexity-wise) if you want it to be fully functional and secure.

FalseMyrmidon@kbin.run on 22 Apr 19:22 next collapse

100% agreed. It's well worth outsourcing to someone else for $10/mo versus the amount of work it takes to do it well unless you're a large business.

I'd make this argument for DNS too - a lot of work for how easy it is to pay someone else to handle it.

Flax_vert@feddit.uk on 22 Apr 19:23 collapse

How can I have reliable email that I can control, then?

FalseMyrmidon@kbin.run on 22 Apr 19:29 next collapse

Buy your own domain name and put it in front of someone else's service. This is going to be a ton of work to do correctly and you're unlikely to be able to host it out of your house.

Also, something you're running off a Raspberry Pi in your house is not going to meet most definitions of 'reliable'.

EngineerGaming@feddit.nl on 23 Apr 17:41 collapse

What “someone else’s service” would you recommend?

FalseMyrmidon@kbin.run on 23 Apr 21:44 next collapse

Personally I'd probably go with MS hosted exchange or a Google business account. If you don't trust those entities I've heard good things about ProtonMail - I imagine they have some kind of business solution.

EngineerGaming@feddit.nl on 23 Apr 21:57 collapse

Google and MS are the entities you’d definitely want to keep your data away from, no thanks. And Proton doesn’t work with normal mail clients, which is kind of a dealbreaker. I remember seeing a comparison chart somewhere with an assortment of other services.

wurstgulasch3000@lemmy.world on 24 Apr 15:50 next collapse

There’s mailbox.org for example

bastion@feddit.nl on 27 Apr 13:38 collapse

Mango mail, porkbun, proton mail

Each does a slightly different niche.

Mango is cheap, but limits outbound mail. Porkbun has a good all-around mail service, bit is a little more costly. Proton is very secure, but can be inconvenient for export (though it can be done, it requires purchase of a month of business service to export away from them).

MangoPenguin@lemmy.blahaj.zone on 22 Apr 21:09 collapse

If you own your domain name, then you can use any email service and still have control over it and move around if needed.

Decronym@lemmy.decronym.xyz on 22 Apr 19:05 next collapse

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I’ve seen in this thread:

Fewer Letters More Letters
DNS Domain Name Service/System
IMAP Internet Message Access Protocol for email
IP Internet Protocol
RPi Raspberry Pi brand of SBC
SBC Single-Board Computer
SMTP Simple Mail Transfer Protocol
TCP Transmission Control Protocol, most often over IP
VPS Virtual Private Server (opposed to shared hosting)

7 acronyms in this thread; the most compressed thread commented on today has 5 acronyms.

[Thread #705 for this sub, first seen 22nd Apr 2024, 19:05] [FAQ] [Full list] [Contact] [Source code]

FalseMyrmidon@kbin.run on 22 Apr 19:24 next collapse

Many ISPs will also block inbound SMTP unless you have business account (and sometimes even then) because it's a common malware/spam vector.

If you insist on going through with this the key thing is to make sure that you're not an open relay.

TCB13@lemmy.world on 22 Apr 20:52 next collapse

If you follow the ISPMail guide at workaround.org you’ll be safe.

I heard there are scaries online which someone could potentially send emails from your server without consent

That’s called an open relay and websites like mxtoolbox.com/diagnostic.aspx can test for it.

Either way your biggest issue won’t be that, if you’re running on a residential internet connection the IP is already flagged as such and will have a very low reputation with other e-mail providers causing Microsoft, Google and any other large provider will simply refuse your email. You’ll also need reverse DNS for your IP pointing at the domain you’re using that your ISP is most likely not going to provide.

Flax_vert@feddit.uk on 22 Apr 22:16 collapse

What do you mean reserve DNS?

slickJujitsu@lemmy.today on 22 Apr 22:43 collapse

Pretty sure they meant reverse dns :)

TCB13@lemmy.world on 23 Apr 01:01 collapse

Yes, reverse DNS. Typo there.

NeoNachtwaechter@lemmy.world on 23 Apr 02:43 next collapse

IMHO a RasPi is just not reliable enough. Your internet connection is just not reliable enough. You are going to lose some of your incoming mail and NOT notice it, unless you have somebody who hosts a secondary MX for your domain.

Chances are also that it’s not powerful enough when some of these automated attacks come knocking.

Gooey0210@sh.itjust.works on 23 Apr 07:43 collapse

If you know how to set it up, RPI can be reliable enough

Even, IMAP is TCP already, any coming mail should be cached by the router until delivered, and your router usually doesn’t loose connection as often as the connected devices

CriticalMiss@lemmy.world on 24 Apr 17:14 next collapse

Hi, I recommend you read the book “Run Your Own Mail Server”. The fact that a book exists for this topic is all the proof you need to not do this decision. But if you absolutely must, this is the way.

Flax_vert@feddit.uk on 24 Apr 19:27 collapse

🤣

possiblylinux127@lemmy.zip on 24 Apr 22:15 collapse

Don’t do that

Flax_vert@feddit.uk on 25 Apr 05:56 collapse

too late.