Sendmail Sendmail is another one of the major service that is used in Linux or Unix environment Sendmail
is a program that is run in Linux systems to send emails and receive e-mails.
But I would say primarily it is used to send emails because when you have a program running in your
system or workflow running in your system and you do want it to be notified, if this if the process
finishes or if the whole workflow finished successfully, you do want to get an email at the end.
That's when you actually have to have some kind of mailing program.
And the most and ready, readily used program that runs in Linux is sendmail.
So the purpose is, again, to send and receive emails, the files that the configuration files of sendmail
is ETSI Mails and Melda MSI, which is the main file.
It makes sense for mail configuration and you configure everything in this.
And once you actually compile this configuration file, it sends all its configuration to ETSI emails
and Murdocks.
Many people go straight to Sendmail docs, which is also OK.
It's fine.
It's nothing that you're going to break anything, but it is a standard and practical, practical way
that you should always go to send mail that M.S. and then compile and start the system, start to send
mail, and it automatically pushed the changes out to the configuration file.
All the configuration file of sendmail is located.
All the files are located in ETSI mail directory.
The service that you need to run or start with your system.
Start and start program is system ctrl restart send mail send.
Mail is one of those programs that does not have D at the end, but it does not mean that it's not running
at all times.
It does run in the background.
It is still a demon, but it's somehow never got a D at the end.
The command that you will run if you want to send email out from your server would be email Dasch at
S, which is an option.
And then Cote's you put a subject line followed by the email address that you are sending it to.
Once you send it and hit return on your keyboard, it will bring you a kind of inter active are like
V.I. kind of mode where you will type everything.
And then once you are done then you will just simply do control D and it will get you out of that mail
program and it will send the email out.
So to illustrate that more, we will get into our Linux machine and we'll look at some of the files
and commands are related to Sendmail.
So we have our server here and log in as ourself and most likely it has already logged in as root.
How do we verify it?
We will just run Wehmeyer, which is a command that tells you which users logged it.
I'm going to move the window to the side so we'll see exactly what we are doing based on our slide in
the back.
So the first configuration file is sendmail.
But of course, before we get into the files, the first thing what we need to do is we need to find
out whether we have the sendmail program installed in our system and how do we need to find that out.
There is a command that you were on R.P.M. minus Keyway and then you grew up for Sendmail R.P.M. minus
Q A list.
Every single program or repository or package that you have installed in your system.
So I ran it.
I see it.
It's not there.
So the next thing we'll do is we will install it to install a package, will run Jum, install sendmail
and of course remember that this is going to go outside on the Internet where all the S.O.S repositories
are located and we'll get that package from there.
If you do not have Internet access on your Linux machine, it's not going to work.
It will fail.
Safes cannot reach the Internet or cannery's to the repositories mirrors.
So once I run regime install sendmail, it's telling me that it found one package and the size of the
uninstall it.
Yes, of course.
I do want to sort out click.
Yes.
And it'll start installing it.
Download, install, verify, clean up all that stuff it's going to go through.
OK, the installation of Sendmail is completed.
Anyway, there is another package that you do need to install which does the configuration of your sendmail,
and that is Sendmail Dash CFF.
Click here to install it.
OK, it is complete, it's awesome.
So once you have the package installed, it means it already creates your directress for you where they
belong.
It already creates a configuration file for you.
So the first thing you have to do is go to a configuration file to define its configuration parameters,
the configuration files, all of them are located in email.
And you will see right here, the first third one from the top.
This is Sendmail MCE.
This is where we will define our mail relay server.
And what is a mail relay server.
Mail relay server is a server that is set up in a company, an environment which will accept your emails
that are coming from any of the server and then deliver.
It's like a middleman which takes on the left hand.
It takes your message on the right hand and delivers it.
It's a it's a server as well.
Sometimes it's a Windows server, sometimes it's Linux server, depending on your environment.
But it's a mail really server.
OK, so when we come down to this file, anything that starts with DNO, it means that it's just a comment
you could ignore that you have to come down to a line where it says define smart host and the smart
host is our SMTP server or relay server where we are going to send our emails and it's going to accept
it.
So you just put the hostname with a fully qualified domain name, meaning the host name dot your domain
name, dot com.
You will add it here once that is added.
And next thing you have to do is you have to start the service system CTO, you start or start sendmail.
OK, the sendmail service has restarted.
Let's check the status.
It says it's up and running.
You can also check the status of Sendmail by running the command post minus F, and then you could just
simply go for Sendmail and it will tell you the second one.
The first one I was just telling you, it is accepting connections and this is the main process that
runs that you go kill it by typing the command kill, followed by the process.
Idzik zero to three.
Now you could send emails and the the command to send email is male minus s subject line is male set
up and I wanted to send it to myself, so I'll put my email, which is Emran underscore NY at Hotmail
dot com.
I hit enter and once I hit enter and that's where the male body is.
Whatever that you want to type, the text goes in.
Hi.
Hello.
Goodbye.
And once it's done you all you have to do is type control d troll D is typed you will get out of your
mail program and that's how you send and configure your mail mail again.
Once again, it's one of the critical services that oftentimes you do have to configure in your system.
So familiarize yourself with mail files, the configuration, how to start and stop this mail service
and how to monitor it and how to send mails.