Jump to content

self hosted email server, or something like it


50Cal

Recommended Posts

I've been self-hosting some things that have logins and stuff. For example Nextcloud needs an email server to connect to so it can send notification emails. I was going to set up my own email server for this purpose but I am pretty sure my ISP blocks port 25, which I believe is required to send out any email.

 

So, I am wondering what is the closest I can get to self-hosting my own SMTP server using my own domain and stuff.

 

Should I purchase an email hosting service from the registrar of my domain? Anything I can do to get a little closer to self-hosting, like having emails stored on my unraid server somehow?

 

Thanks for any wisdom on this matter!

Link to comment

First of all, port 25 is used for INCOMING mail to your server. But of course, if it is blocked, you will never get it.

 

Second to know is that even if port 25 is open, this wont be enough these days. You need to own a domain, need to add specific codes to your dns records to prove that you are legally using this mail address (SPAM protection) and finally have some MX records pointing at your server.

 

Third, if your ISP gives you a dynamic IP address it is likely that this is blocked by many mail servers on the internet (SPAM protection) and you will never get a mail from them or be able to send one to them.

 

You see? today it is almost impossible to run your own mail server.

 

Thats what these "email hosting services" are for, you can hire them and all your mail arrives there (and can be automatically forwarded to your private server, the hosting service does not use the same restrictions that I have described above). It also gives you a "safe forwarding server" for you to send out mails from your private server (called a "smarthost").

Usually these services are cheap, I for instance pay 99cents per month for a web server with some databases and wordpress (not used), a domain with static entries (partly used, forwarded to Dyndns server) and the mail host for 25 mailboxes (not used, all mail is directly forwarded to my own server).

 

  • Thanks 1
Link to comment

Thanks for the clarification.


The registrar of my domain offers email hosting. It does not explicitly say anything about a smarthost or email relay. I'm sure I could ask their support to double check.


I want to be sure I understand this right:

  • the email hosting service runs and SMTP server that my domain points to, say, `stmp.example.com`.
  • then I set up an SMTP server locally on unraid. ... would this be `smtp2.example.com`?
  • The email hosting service forwards all emails recieved to my local server.
  • If I send an email from `[email protected]` to `[email protected]` it first goes to `smtp.example.com` and then goes to
  • `[email protected]` all without being blocked or whatever.
  • And the reverse can happen so I can receive emails?
  • And also the email only stays in `smtp.example.com` momentarily before forwarding to `smtp2.example.com`.

is this the general idea?

Link to comment

yes, totally correct.

 

There are some other complications like you have to make sure that ONLY "smtp.example.com" and computer from your local net are allowed to put emails for the outside world onto "smtp2.example.net" (relaying).

 

The email hosting service usually gives you some mailboxes on "smtp.example.com" only which you can read and write with a client program like thunderbird or outlook. So you need to check if the service also includes and is capable or forwarding mail to your own server "smtp2.example.com".

 

Be prepared to see the bad sides of the internet, the hacking frequency is high, several thousands attempts per day.

As long as you only serve local clients, its quite easy to handle, block everybody besides local net and smtp.example.com. But things become much more complicated if you want mail access from the outside, maybe for your cell phone or tablet. Then you have to let in arbitary address ranges and open more ports like 143, 587 and so on.

Then you need to deal with programs like spamassassin or fail2ban and consult block lists. The mail server setup becomes pretty much complicated then.

The breakin attempts focus on reading/writing your mailboxes but mostly they just search an "open relay" to use your server as a forwarder and multiplicator for their spam mails (they send you ONE mail, you send out THOUSANDS). If this happens you will end up on one or more block list in no time. You wont get any mail and cannot send it out too. And its hard to get off those lists again....

 

 

Link to comment
On 12/15/2022 at 6:46 PM, 50Cal said:

what is the closest I can get to self-hosting my own SMTP server using my own domain

You can't self host and spam away... Get a good email provider. Maybe you'd like MailChimp?

 

I'm assuming you want to *send* lots of emails.

 

Just my opinion.

 

6.

Link to comment
  • 2 weeks later...
On 12/19/2022 at 11:58 PM, MrGrey said:

You can't self host and spam away... Get a good email provider. Maybe you'd like MailChimp?

 

I'm assuming you want to *send* lots of emails.

 

Just my opinion.

 

6.

I do not plan on sending lots of emails. Like I said in my original post, a number of self hosted services need an email server to send notifications, like to reset passwords and stuff.

Link to comment
7 hours ago, 50Cal said:

I do not plan on sending lots of emails.

It has nothing to do with YOU sending emails. The precautions are for machines that get highjacked by hackers and used for relaying gazillions of spam mails (1 comes in, your computer sends out thousands of copies). This happens without your notice and if they do it "politely", you do not see any negative effect (slowdowns or so) yourself.

Therefore some dozens of robots are crawling the net each day to find such "open relays" and blacklist them.

 

"in the beginning, internet was nice, but then SPAM was invented..."

 

So it does not matter if YOU send tons of emails or just one per month, it is your exposed server that is a risk for everybody else.

 

Link to comment
1 hour ago, MAM59 said:

"in the beginning, internet was nice, but then SPAM was invented..."

 

LMFAO!...

 

8 hours ago, 50Cal said:

I do not plan on sending lots of emails. Like I said in my original post, a number of self hosted services need an email server to send notifications, like to reset passwords and stuff.

My apologizes, if needed... Then use something like Nextcloud, but you still need a "verified/certified" "ISP" to handle the email and make sure everything is synced. You can't run your own "DIY" email SMTP server. I'll recommend mailCheap, instead of mailChimp now.

 

I really do hope this helps,

 

MrGrey.

 

Link to comment
14 hours ago, MAM59 said:

It has nothing to do with YOU sending emails. The precautions are for machines that get highjacked by hackers and used for relaying gazillions of spam mails (1 comes in, your computer sends out thousands of copies).

 

Yes I understand. That makes sense. My response was to MrGrey's suggestion of MailChimp, which is more for like newsletters n' stuff. I didn't want miscommunication so I wanted to be clear that wasn't the type of problem I wanted to solve.

 

12 hours ago, MrGrey said:

My apologizes, if needed... Then use something like Nextcloud, but you still need a "verified/certified" "ISP" to handle the email and make sure everything is synced. You can't run your own "DIY" email SMTP server. I'll recommend mailCheap, instead of mailChimp now.

 

I really do hope this helps,

 

MrGrey.

 

Thanks for the suggestion. Ya I can see that email is the one thing that should not be self-hosted.

 

 

What I will do is get an email hosting service (that isn't just the usual free Outlook or Gmail), then some day later *maybe* look into having it forwarded to a private server; that would be the "...or something like it" part of the solution.

 

Thanks all.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...