RHCE Training - Postfix Mail Server Configuration

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] you this is day 20 and I am alok shrivastav ah so finally we are arriving at configuring servers so the objectives of the day are we as we will be starting with our first server the mail server postfix so the objectives are to understand how the email works and then we will be configuring the postfix as our mail server MTA as we technically call it mail transfer agent so let's first understand how exactly a mail work when you write a mail and click on the send button what exactly happens behind the scene so as you can see the picture for a user it's very simple from point A to point B but it actually is slightly more complicated so what happened is that as you can see it and the step a when the send to create and send the mail using some mu a mail user agent that means any application which you use to write the mail like you can use Outlook Outlook Express thunderbird evolution Lotus Notes anything these applications which you use to write the mail and receive the mail are known as the mu a so you will be using any mu a and write the mail and click on the send button now the step number B the MU a transferred the mail to the MD a mail delivery agent so if the mail is targeted for the local domain that means it's not going on to the internet that means let's suppose I am sending a mail from elope at the rate Network nuts dotnet to Manta at the rate Network nuts dotnet so it's not going on to the internet right it's because the recipient mailbox is also on the same server so in that case the MDA will deliver it locally it will not be sent to the m empty but the second case if it is not locally addressed that means from Alok at the rate network not stored I am sending it to say hallo Caron at gmail.com which is a different domain so if it is not addressed locally the MDA will forward the email to MTA mail transfer agent and obviously in between you can see this company network that means the mail will be going through the switches routers Tigers and not Tigers means all the network configurations so if it again I'll come again if it is not addressed locally the MDA will forward the mail to the MTA so MTS are the actual server which will be transferring the email like you have got a message from Microsoft Novell has got no well they call it what was the name sorry I forgot it Novell GroupWise yes then postfix San Mail Zimbra there are a lot of mail transfer agents available so once the MTA reaches get the mail that means it is targeted to the outside domain then comes trap number D mail queue might be there are hundreds of emails waiting to go outside so once the email enter the queue because the other males might be there prior to your email so there might be a delay in processing the queue once it is out then comes your step number E MTA to MTA that means my mail server MTA mail transfer agent will be finally routing it to the recipient domain so while transferring the email the sending MTA handles all aspects of the mail delivery until the message is either accepted or rejected by the receiving empty rejected might be in the case that the email address not found or the domain it does not exist or there might be a typo error then comes your step F now in case your MTA is reachable from the internet that means someone can send the mail to elope at the rate Network nuts dotnet from Gmail that means my MTA is reachable from internet so MDS are normally also configured as ms a--'s mail submission agents before accepting any email now from the recipient perspective before accepting any email i should scan the emails for virus was some like kind of spams or anything so the job of the MSS is to test all emails for spam and virus and it filters before it is allowed to pass inside my domain or it pass inside the firewall so ms a--'s they generally run on port number 587 using the tcp protocol so you might be having some mail filtering or like your virus scanning going on you might have noticed when you try to send an attachment using the gmail and the attachment size is big it sometimes gives you a warning that the attachment size is too big it cannot be scanned do you really want to send it so it's up to you that so if everything is okay then the recipient email your MTA it is accepted for that delivery by the receivers empty the companies I'm sorry yeah the other like MTA will receive it and once the receiver MTA will then call the local MD a mail delivery agent to deliver the mail to the correct mailbox so once it is delivered in the MD or the mailbox your friend or the recipient or the receiver will just when click on send receive button it will automatically be fetched from the mailbox into the MUA so this is how the whole mail process works and for sending the MTA is empty on the Protocol SMTP Simple Mail Transfer Protocol which is used to send the mail and for receiving the mails you have got two protocols IMAP or pop so pop stands for post office protocol and IMAP is internet message access protocol so these two protocols can be used to receive the mails and for sending the mail you have got SMTP and the basic difference between the pop and IMAP is that because we have got two protocols to receive the mails that whether you want your server or your company wants the mail to be downloaded into your MUA or not so if they are downloaded into your local hard disk so that you can access your mail even when you're offline that means the pop is activated but in case your company wants to give you only the web-based access like a simple example can be Gmail you have to have the internet connection when you are accessing the Gmail so by default they doesn't allow you to download the base into your local hard disk that means they are using IMAP internet message access protocol so as a rule of thumb guys if the mail is being downloaded using some MUA then the pop is working otherwise I'm APIs so once it is done you have gone through this particular diagram and the whole process is very clear to you the next is we can go and try configuring a postfix server which is my empty mail transfer agent so let's configure the postfix and it's exam objective also so you have to take care so as I've told you that its current configuring your postfix server is the exam objective so I will be configuring the postfix in two - one how actually the postfix will be configured practically when where the postfix will be listening the request of the emails on to the LAN card and and the other example I will show you how to configure postfix server as the nullcline nullcline means it will simply forward all the queries to a centralized mail server it won't do any processing on itself so let's first see how to configure uh normally not a not a null client configure a Porsche server normally so first thing make sure that you should have that postfix package installed I have main configuration directory for the Porsche fix is Etsy postfix will have certain files here so I will be interested in main dot C affair so open up the main dot C F okay if I don't do anything here okay I'll just open it this is the default file if I don't do anything here and I just start the service systemctl restart postfix see here what what will happen and I will just put it in the enable so that it should be available after the reboot system CTL enable POSIX so if I show you with an at stat 25 as SMTP drunk for 25 so you see they have postfix by default listen to only to the loopback address that means it will configure the mail or process the mails which will be originating from the same machine but practically the mail server will will be a different machine and the mail clients will be some different machines so that means I should configure my postfix to listen on the interface LAN card rather than on the loopback so let's consider this this is how practically your postage should be configured so open up the file let's do some small changes here this is not the exam objectives my exam objective is is much more easier so let's but let's see it let's see how to configure this so inside the internet host and domain name specify your hostname which hostname you are for the name your machine so my host name is server one dot X ample comm I put my host name here move down my domain so I can specify my domain so I can write here my domain is equal to say example.com and then move down my origin will be dollar my domain so dollar my domain will automatically get the value from this variable the all are my domain example.com that means all the Mail's will be originating from example.com this is good now move down a bit receiving this is interesting so see here this is why the netstat has given you the loopback because by default it listens only on the loopback so I just need to activate all the interfaces that means the mail server should be listening on all the interfaces not only the loopback then it's of no use so I'll move down a bit here my destination you can leave it as it is no problem here you need to define your network that which network I should be catering to so touched and relay control is a very important segment block so here you define your network ID which network ID so loopback obviously will be there so I just specify my IP address is afraid of 192 dot 168 so I'll just remove this and write one ninety two dot one sixty eight dot zero dot 0 / 24 is my ID so just click here and make it 24 that means it should be listening to the 100 or it addresses and the loopback obviously moved on a bit nothing to do here really a host you should specify the relay host then the mailboxes which are not available on to your server then what action the mail server should do so if I specify here say relay host some exams is some server some server dot example.com that means if the mail is not the mailbox or the recipient is not found here my machine will forward the mail to this machine it's a reliable so I'm not specifying it here the save and come out from here try to restart the postfix service and check the status also and if I give the netstat command once again I should see a change let's see yes now it is listening on all the addresses that means I should be able to send the mail ok let me see if I have got any mail boxes available on this machine so II if you don't know then the default mail location is vast pool mail so inside where's pool mail I have all the users which have got their mailboxes so I will try to send a mail from a low to RM let's do this so I can use the telnet commands though you might find it's initially slightly difficult but it's very interesting just write telnet your machine name server 1 dot X ample calm and port number 25 as SMTP listen on port number 25 then we have specific telnet commands to talk to the mail server hello so ello is actually a hello you being a courteous show us some curtsy and say hello to the server server will respond you back very good so mail from I say I look at server 1 dot X ample common so it will check it and will revert you ok recipient - to whom you are sending the mail I say RN ad server 1 dot X ample comm it will again check it now you write data and the subject of the mail say hello postfix and then your mail whatever mail you want to write say this is test email using postfix as the MTA and whenever you are done make sure the first character of the line is dot and to acquit here so if everything is right then this mail I should see this mail in the mailbox of our end user so if I do a cat where's pool mail RN sorry here it is you can see it it's coming from elope to RN this is a subject everything is coming up so this is how you configure a actual mail server but the exam objective says that you should be configuring a null client so let's now see how to configure a nullcline so this is the practical more practical stuff but will not be a part of the exam of the fit exam objective will tell you how ask you how to configure a null client so let's configure a null client on this machine this is my server too so just make sure that the host flames are getting resolved or you should have a corresponding entry in the HC host file my host name is server - dot example.com but how to configure a nullcline it's actually much more easier again same stuff check it out whether the postfix is installed or not bingo it's installed go to at C host fix main door cf now here you should be doing some changes now the changes will be much more easier go to the top the first thing that you need to see or check is I can specify just move down a bit queues need not to do a do anything my host name you need not to do anything for the my host names just leave it as it is my domain is again you need not to do anything my origin my origin is you need to change so in my origin you should write your machine name my origin the as it is a null client so write whatever machine name you have males will be originating only from this machine my origin ok and receiving it obviously I will be receiving it only on the back address so please make sure you sorry my origin I had riveted it I'll just do it again my origin and my machine name server 2 dot X ample calm and then in interface copy this line come in this sari and right here loop back - Oni as it is a nullcline loopback - only drop the mic that means you should be this machine will be listening to the mail requests only on the loopback then you move down a bit here my destination again need to be blank as it is a null client so we will not be specifying any destination here so just right here my destination and just leave it blank or and come and date this out so that you won't be relaying it to anywhere else my destination should be a blank ID so it should be blank we had changed this so my destination actually configure which domains the mail is an endpoint so I am giving it blank that means nowhere it's a null kind now interface I had explained you my origin I had explained you now if I moved on a bit here and we'll show you the IPS trust and relay control block inside my network just make it loop back that's it remove everything else my networks is loopback so we have changed the interface loopback only my networks to look back my origin is my hostname my destination admitted blank now I can also configure a relay host that means it should be forwarding all the emails to a particular machine which should be accept so I can I can configure my server one as the relay host so what I do here just inside the relay host you will be asked will be given a different host name in the exam so I write here server 1 dot example.com that means server wondered example.com should be accepting the emails which it is it is listening on the interfaces it is listening on all the interfaces so really a host is the machine where your mail requests will be forwarded so it's very important really who should be configured your loopback only you should be your interfaces network should be 127 loopback my origin should have got your host name and - means it should be blank so once this is done it's very simple stuff just try to restart them so service postfix check the status right - job done and I can confirm it I if I give the netstat command here tul NP I'll go the crap over 25 you will see it's a loopback it's a loopback only so this is how you configure null client which will be relaying all the Mail's to a particular relay host this is the exam objected this is what you need to learn to clear your RAC certification that's all for the day and I'll see you in the next class bye bye
Info
Channel: networknutsdotnet
Views: 52,889
Rating: undefined out of 5
Keywords: rhce videos, rhce training, red hat linux training, rhce tutorials, networknuts, network nuts, alok srivastava, postfix mail server configuration, rhce examination
Id: HmG6g0ujhJc
Channel Id: undefined
Length: 22min 5sec (1325 seconds)
Published: Mon Aug 06 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.