How To Setup Private email server with Public Domain

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys welcome to another video from the detectives Channel today we're going to be learning how to set up your own private mail server now it is fully working email server I have achieved to set up and also it is not being reported as spam most of the email servers whenever you set it up very first time your emails are going to tagged as a spam email and I will show you how to overcome that so it is a step-by-step guide do not skip anything on this tutorial if you're going to skip you might end up having trouble or issues with your email server so let's get started stay tuned and make sure you do not skip any part of this video otherwise you're gonna have a trouble let's get started so in this first part of tutorial I'm going to show you the some of the ports that are being blocked by my service provider which is my internet service provider which is slingshot and I'm going to select over here there will be option to turn off port filtering as you can see it is turned off because I have manually turned it off before but I will quickly show you usually you Internet service provider will block these ports as listed in this article by my ISP and these ports are very important and they should be unblocked and if they are being blocked you need to talk to your ISP or you need to look for an option to give them a ring or login to the online portal as I did to turn off that option so all these ports are unblocked 2584 4-3 these are the main ports that you will need now other ports for IMAP and pop3 are also also there so they should be unblocked as well so I have gotten this out of the way so it is not going to be a trouble for me and if you hosting your webmail server on cloud services as a VPS you shouldn't worry about that part and now we're gonna go ahead install Ubuntu on our hyper-v virtual machine so another step I'm going to do because I'm doing hosting on my PC at my home using my internet which is not a commercial Internet service so basically you can go ahead and have a lot of issues while doing that because you need to do lots of manual port forwarding I'm going to quickly show you what ports you need to forward I have already done the port forwarding so it's not gonna take our time you can take a snapshot of this video or I will mention these ports under the description of this video so you can manually follow these ports and now once again you do not need to do this if you're doing a webmail server hosting on a VPS like digital ocean or g-cloud or AWS or Microsoft Azure so whenever you would like to host your webmail server depends on you but these were the past that were very crucial if you're doing a hosting at your house on your personal PC now the another part which needs to be done in any case you have to have a public domain if you wanna send outgoing emails well you would be able to send outgoing emails without public domain but you won't be able to receive them so we want to send and receive and we don't want them to be acting marked as spam so as you can see I have no detectives com now every domain name provided has kind of a similar DNS setup so you need to add a record pointing towards your public IP and then you need to add another a record which will make it a submit sub domain so I'm going to name it mail so this will become my dot nerdy tech tips com so this is very crucial you need that as well and another part you need is you need a MX record so as you can see I do have a DNS type MX and the list you can see now which is named as @ and pointing towards mail dot nerdy tech tips com so these are the three records that are very crucial you can go ahead and add record at the very bottom you can see at nerdy tactics calm but I should work without it if it's not working you might end end up adding that as well so as you can see their part is also done now I'm trying to do it as slow as possible if you're trying to follow the guide and doing it at the same time so it totally depends on you so let's go ahead and let's install Ubuntu on hyper-v now you can skip the Ubuntu installation on hyper-v if you're doing it on VPS but those who are like me like to do it at home and just like to leverage edge you know so you can do it at home and follow this guide so I'm just gonna use the magic of video editing and I'm going to do it fast forward so you do not need to see all that time taken during the installation so let's go ahead and fast forward this part so during the fast-forwarding I just realized slow down the video that what I did is I went on I read mail and I quickly wanted to show you that what operating system are supported and you can choose one of them well you can choose any other flavor as well but you might not be able to get any support from I read mail because they do provide your support and they do have a sports platform now what we're going to do is we're going to use Ubuntu 18.04 because it is fully supported and everything is supported and this always so I'm gonna copy the stable version link because that's what we will be using to actually download and install it on our open two server let's go ahead with the fast forwarding part so as you can see that now we have successfully installed Ubuntu on hyper way and I've tested the internet connection is working now the very first thing on any Linux based operating system that you do is you check for updates if there is any update available now we're using sudo strudle is actually kind of an administrator command like we right click on Windows and say run it as administrator so when you type sudo in front of anything or any command that's basically saying things so that's what we typed sudo space apt space up right now basically when we type upgrade it checks if there is an upgrade update available and it will download the updates now to install them you need to type sudo space apt space upgrade so now it's installing on all the updates that are available now I'm going to go ahead and fast forward this part as well you what we do now as you can see it has completed now the next step is installing ssh server so we're going to type sudo space apt space install space open ssh and that - or - what we call server it's gonna go ahead and install OpenSSH server because we will be doing all kind of maintenance or updates or whatever you want to do using SSH so that's bit easier if you're doing it in VPS you might end up using SSH anyway so that's why I wanted to show you guys now to check if your SSH is active by default it should be automatically after installing you should just type that sudo space system CTLs by stylus space ssh and it will tell you active and running now as you can see we can't type further and to type further commands you need to press control C and when you press control C or give you an option to type for the commands I just told you guys those they are people who are not aware about Linux operating systems and they don't know how to use it like me I've just learned it so the next thing is we're going to allow a firewall to accept SSH and open the port for SSH ufw is actually a firewall so we're going to type sudo for administer to write space you have the fuse spice allow space SSH now it has basically added that and the next thing I'm showing you here is if config is not going to work straight away because you do not have any network tools available here so we're going to go ahead and type that command sudo space apt and install the tools so you can copy that all the commands will be available under description so if you type if config you should be able to see the IP address or anyway you should have been able to see the IP by typing this command you can see what I'm going to do it on-screen now so if you type IP in space a it should give you an IP address that you're using now it's very hard to look for the IP address in that way but it's definitely there if you look very carefully you can see 10.10 dot dot dot six is there so you know what's the IP address address of your virtual machine is but if you're using it up VPS or a cloud hosting you will know your IP address because you will end up buying a static IP for your VPS server now it is saying that a software update available but we have done that update already we don't want to go through that again now we're going to minimize this or close this so it's not using as much as for RAM in my computer so that's why I want to use SSH now we're gonna go ahead and open command prompt and we're gonna remotely connect to our SSH server I'm gonna do a bit of tuning here so it's better to see you for you guys I'm gonna increase the font size change the color so I'm going to go ahead and fast over that part because it's pretty useless for you guys so now fonts a bit bigger easy to see the color is also really shiny so get started connecting via SSH you might know how to connect with SSH otherwise this is how you connect it's acid spice type username and at the right type IP address or if you have domain assigned a local domain you can type that as well it will ask for your password remember to type yes here and when you type password it will be connected to your server why is SH now from here it's pretty easy go back to I read email click on right click on stable copy link location now that has copied the link of the file that we need to download on our server so basically what we do is we need to type W get so don't forget to type sudo so also type sudo before we download we also need to setup a house name so over here what I'm doing is I'm setting up a house name sudo space house name CTL speights it our - host name and then space whatever house name you want to give in my case I'm going to give it mail dot nerdy tech tips calm because this is my public domain that I'm going to be using so I want it to be matching with my public domain because when I'm sending emails out it will be sending that data it'll be generating some signatures with the header that will be going towards to the emails so my emails will not get reported as spam and if I configure all the DNS records properly so this is very crucial time to some same domain that you're using as your public domain so as you can see it asks for my password hasn't given me any error it has been done so the next part I'm going to download on mail server so type W get space and paste whatever you copied then command prompt this is how you paste basically now it's downloading all the files that what we need now it has successfully downloaded it what we need to do is we need to extract what we have download so if it's at our file you typed our space X V F and you type the name of the file you should be able to see the name of the file what is saved so you type it exactly how you see it if it's capital does make sure you type capital letters otherwise it's not gonna work so now we have successfully downloaded you can see all the files here what we need to do is we need to go to this I read mail folder so I'm going to CD that so CD space type it how it is in front of you you see our and M is capital make sure you make it capital otherwise you won't be able to go in so once you go and list the directory now if there is two ways you can list it that way you can see all the directories if you want more information you can type LS space - oh now that will give you a little more information when it was downloaded and it's organized in organized very easy to look for a file that we need to run in our case we will be running I read mail Sh it's a bash file which will be automatically setting up downloading and installing everything for you so this is how easy it is so what you need to do is you need to sit o space bash and type this I read mail dot SH now it is going to do everything for you there will be few steps that it will be asking you to type your domain name what kind of server you want what kind of GUI you want because it has roundcube for customers or you can say for users and there is a admin panel which is by default will be installed that i read mail now you have a choice you can install PHP my admin' I think that's what it is there are few other admin panels you can install but in the free version with I read mail it doesn't have many capabilities and if you want to use every single feature you might be doing it through command prompt so I'm Rickman I would recommend you to install a third-party admin panel they are few available on the internet I wouldn't be showing you how to install that and if you request me I might be able to show you in future before now I want it to be working and I want it to be not reported as and wanted to be working on a public domain because I haven't came across any video that shows you from A to Z steps a full set up for you private mail server over here you can select your default features that are selected already know if you getting this command prompt or this GUI in Ubuntu you might be able to click with the cursor by clicking on next but over here you won't be able to you use a spacebar key to select the options because we're doing it on windows CMD command prompt remember and you hit enter to go next so basically there's no changes you keep going ahead next you do have a capability to change you actually database server you can choose microscope but in my case I I just chose LD IP now whatever you want to do you can do so I'm gonna go ahead and click on next here so it will ask you to some set up some password remember you write down each and every single password that you are going to set up otherwise you will end up reinstalling your mail server you won't be able to recover those passwords however it does give you your passwords at the end of the installation but that's only for admin panel and default email address that is being created here so over here we're going to specify a password for you my SQL administrator as a root user on the server and after you finish with that I've just simply type 1 2 3 4 5 6 7 8 so we're gonna go ahead next over here we're going to type up a male domain name so in my case my male domain name is nerdy tech tips comm and it cannot be the same as server hostname like mail dot nerdy tech tips comm because remember guys this is a sub domain name mail dot nerdy taxes.com we need to tell our server that we will be using nerdy tech tips comm as a public domain so we need to specify that over here so let's go ahead and write that down so once you click enter and go to next screen as you can see it has it is creating an email address postmaster at NER detective dot-com the password that you're mentioning here is going to be for that email address and you can use that email address to send emails and also log in to admin panel because it will have administrator right now over here there are some additional components you can select and install well basically why you want to leave any of the company so I'm gonna click on spacebar key so go I'm gonna install web calendar and whatever it comes with I'm going to install everything over here the config file has been created you can review it and accidentally if you have clicked now or you have if you have it Enter key do not worry you don't have to go through the whole process again just verify everything here you can see the additional components here and roundcube mail is basically a GUI for you of our email you can use any you can use Outlook or you can use Zimbra email client whatever you know whatever flavor you like over here I purposely cancelled it just to I just wanted to show you guys actually what happened I've cancelled it the config file is already there nothing has been deleted if you run that command again sort of bash I read mail Sh it'll basically find that config file again and you can click yes and that will go through the process of installing the features that are mentioned in this config file so you do not have to go through that configuration screen again so I will go ahead and fast forward this part again so now I'm fast folding this part and it's installing once it finishes installing it will ask you to restart your firewall with the SSH port just hit yes and hit enter and then type reboot now over here you will see permission tonight because I forgot to type sudo remember guys administrator so type sudo space reboot it'll reboot your server once you've rebooted you can SSH again or you can just simple use it static IP or IP address to login into your server and I will show you what GUI you will be getting for your user accounts like you will be getting a GUI for roundcube because we do not have any other client software installed or client interface and we do not have any other admin panel installed basically so we'll be using the default features that it has come up with and gotten installed with our main server over here I'm going to change some IP addresses because the IP address over here is different for my port forwarding which is 10.00 3 I'm gonna forward all those ports 2 10.10 dots so I'm going to be finished with the port forwarding pretty soon because it's being fast forwarded I'm not that fast my computer is definitely not that fast at the stage so you can see our server has been restarted connecting to SSH I'm gonna type the IP address make sure you type HTTP dot slash slash 10.10.5.3 Kure risky head blah blah because we are not using authenticated SSL you can use let's encrypt to install legit certificates but if you decide not to do that don't worry about it because this is just for you web interface and the our SSL or TSL certificates created for your emails already and they're not gonna expire you don't need to change them if you wish to you can you but you still you're gonna have your emails working properly and they're not gonna get reported as spam so nothing to worry about as you can see we have logged in into GUI this is a this is a client interface over here I have logged in with postmaster and and detected comm it is just giving us a dummy PDF file it is very annoying it was keep coming up again and again but definitely it's just a quick fix you can fix that and we're gonna go ahead and see the email that we received this is a system email that is telling us the details what we have configured as you can see there is IP address that I not IP address sorry the password I have setup is one two three four five six seven eight and there is an email address and they are SSL Certificates you can change those you can get it from your public domain you can buy them you can get them for free you can generate for generate them for free if you want to using let's encrypt so you won't be getting that warning if you're giving access to your users and if they are logging publicly they will be getting that you know annoying link or not to sell link annoying warning you would say accept risk so there's nothing to worry about that so we're gonna go ahead and login into actually admin panel over here you need to type I read not mail I made a mistake here actually you need to type I read admin so as you can see I've typed I read admin after a slash and you can sign in with your email address that our system has generated and we set up a password pretty hard password that we got so user name is postmaster postmaster at nerdy tech tips common password is just one two three four five six seven eight and you go ahead and log in with that once you're logged in you should be able to see it is signed prising in upgrade now well make sure why up right the above tasks can be done in the open source version with example command-line tools or PHP myadmin there you go you can install third-party tools actually to manage your I read admin panel you don't need to actually buy this if you wish to you can buy all the features are included nothing to worry about everything is included you just need a user interface to use them however they can be used using command interface but we're gonna go ahead and create a new user here because I don't really like postmaster I like it to be admin so I'm going to go ahead and new user this is how you basically add more email addresses users will be able to change their password if you install a nice GUI that will give them a capability but in this case they won't be able to that is very limited they are limited features they would be able to use on roundcube but however you can install a better interface like Zimbrick line interface or PHP my admin' for admin panel now over here you will get an email that there is a new user created we're gonna log out and login with admin user it has admin rights as well we made sure we clicked on it now we're just going to send out a test email we just wanna see if we are able to send an email to our gmail address and also where does it go does it go to junk email spam box or inbox and why it happens I will quickly show you guys where it's going to end up and why it is going to end up there so we're just going to type hello gmail I am NOT spam or I am spam well that's right I am spam it should end up in spam folder according to what I see because there is few settings that ask that needs to be configured so it doesn't end up in spam now it is gonna take a little time you just wait for it and the reason why I have done the DNS configurations first before setting up my email server because it does take some time to you know take effect on your DNS records it's always best practice to do that first as you can see our email has ended up in rip spam folder if we open it up and click on report as not spam it is still gonna end up in spam folder it doesn't really matter how many times you click on it because Gmail the way the big your email companies look at emails is they look at a reputation of your domain and also they go by your SPF and DKIM records if they are not configured properly in your DNS records your emails will be marked as spam so let's see why it's ending up there check if your emails are authenticated so why they are not authenticated will quickly show you how you can check and how you can verify if you SPF and DKIM records are set up correctly we're going to reply because we want to make sure that we are receiving outgoing emails as well so we want to receive emails as well this is the you know you can say second last step of our email server setup we want to make sure we are able to send emails as we tested now we want to make sure we are able to receive emails so we want to receive that email in our inbox we're just gonna wait a little bit and maybe try refreshing it because we haven't received any bounced email if you see a bounced email there is a problem with the DNS records if you don't see any bounced email it means there is no problem with your DNS records there might be something else wrong so let's wait a little bit it is a little bit slow maybe DNS records hasn't taken place or taken place Changez I would say but we're going to keep refreshing okay let's see we got an email here you don't need to refresh I just wanted to make it fast it should appear automatically as you can see don't worry I trust you I send that email from Gmail so it has been received Oh the hard part is done now let's move on to easy part now we're going to go ahead and make sure that our emails are not being reported as spam so the very first thing you need to do is you need to open a command prompt login to your server while SSH and also and the on the one side or on the other side make sure you have your DNS tab open I am with GoDaddy so this is already there you can see the a few records there is a text record which it does say V equal to SPF 1 space MX and then space - oh now this is not complete I just copied that from somewhere from the website random website but I need to fix that I did a bit of research how to fix that now you should be able to see the time changes the email server installation was at 3 o clock in the morning now at 6 p.m. so I've been working on that all day trying to work out why things are not working some of the port problems and spam problem it took me a while to understand and learn all of that so you need to type your domain here this is the complete set up whatever domain you bought you need to type it with MX V equal to SPF 1 space MX and type your domain make sure the structure is saying nothing is missing SPF one is completely configured there the next thing is we need to add DKIM record now remember guys I read somewhere online on the documentation that it has to be a cname record but allah miyan not i tried that it didn't work out for me it might work out with other guys maybe other DNS providers but I didn't work out with GoDaddy I had to meet a text record now to get DKI and key which is auto automatically generated by u.s. mail server and it is very specific to your mail server you need to type that command make sure the command is type and you're typing it with sudo as I did so I type sudo space and a vis Dee - new space show keys type it exactly you should be able to see your DKIM t now what we're going to do is we're going to click on add and it will give us some tabs that we need to fill out so we're going to select text well under hosts you need to type very simple you type DKIM dot underscore domain key that's all you gotta type here do not worry whatever domain you have whatever settings you have you just basically type that under house that will make other servers understand that this is a DKIM key and your Dana's records will be configured properly now under text value you need to copy from V alright so we're going to copy that and I'm going to paste that in notepad for a reason so I'm going to open a notepad and paste all of that there because I do need to remove all the commas that we got there so we're gonna slowly delete all the comments make sure you do not delete any other special symbols like slash or plus whatever just delete the commas so I'm gonna delete those I don't know what they called in English part of me but I call them commas basically so whatever they are I'm getting rid of them once I've gotten rid of them I'm gonna copy it again so make sure you remove the prices and there you go so you copy the whole text again and paste it under text value all right now we're going to say way once it's saved you can see your record now you need to wait for a while if your domain is really all domain and you had a few old configurations but this is fairly a new record so every record is working instantly whatever changes I do they work straight away there is no delay but usually there is a minimum one hour and maximum up to 24 hours delay in your DNS configuration but I was able to do it instantly so what I'm gonna show you is our dkim and SPF records are they being detected are they passing you don't need to use any fancy commands you just send out an outgoing email to your gmail address testing dkim SPF so test run and we're going to send it let's see what happens so first it is going to end up in spam not to worry if it hasn't if the records hasn't been updated properly or hasn't taken you it hasn't taken its time because DNS records does take time as you can see it is ending up in spam folder but not to worry you can still click on not a spam once you click on not a spam it will go into your inbox now what we're gonna do is we're gonna do another test because we haven't been able to really find it but we can maybe try click on show original over here you should be able to see SPF pass and DKIM pass now taking a little time to test it and make sure that it is passed now I'm going to test another email but I'm going to test that email from my admin account that I created previously so I'm gonna log out of that post master account and let's login into admin account let's see what happens we're going to send out another email and according to me it should not go into spam folder anymore well it might be ending up into spam spam folder for like Outlook emails or any other emails but slowly it will gain its reputation and your emails will be actually authenticated for every email service provider and they will not be marking as spam and if you've got a good reputation for your public IP and you're not spamming people if a lot of people are clicking on your emails and reporting it as spam while your emails are gonna end up in spam folder no matter what you do so let's wait for it there's no emails here we're gonna go on inbox and maybe refresh let's see hopefully it comes in Inbox oh there's one email let's go ahead and check it primary oh there you go see it's not coming up in spam folder anymore so there you go if you followed here every single step and you miss always up and running let me know comment down below if you're running into trouble I will try my best to help you out and don't forget to Like and subscribe thank you for your support guys bye for now [Music]
Info
Channel: Nerdy Tech Tips
Views: 7,345
Rating: undefined out of 5
Keywords: email server setup, free email server setup, private email server, mail server, professional email, setup email on domain, domain email, custom email, professional email address, own domain email, own domain email gmail, mail server linux, mail server configuration, mail server ubuntu, postfix email server setup, private email server setup, how to remove category archives title from a wordpress website, email server setup linux
Id: RMroC2TskW4
Channel Id: undefined
Length: 36min 11sec (2171 seconds)
Published: Wed Apr 29 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.