Setting up ✉️ Sendmail quick method

Setting up ✉️ Sendmail quick method

Here is how to set up Sendmail the quick method, but also you may want to also check out the better method for setting up Sendmail.

Allowing SMTP (open Port 25) using sendmail

On an initial installation of Linux, sendmail blocks smtp and only allows the localhost to access it. Within Linux there is a config file called sendmail.cf it will be either located in /etc or /etc/mail

The easiest way to locate the config file is to from the root type:

find –name sendmail.cf 

Once you have located the config file open it with your preferred method and find the line below

# SMTP daemon options

Once you have found this line, you will see the command below:

O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA

To disable it put a # in front of it as seen below

#O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA

restart the service with:

/etc/rc.d/init.d/sendmail restart

You should now be able to see SMTP/Port 25

Allowing relay of your domain mail

In the same location you need to go to /etc/mail and alter the config file “access” then add your domains into it.

example.com
192.168.7

Next you need to edit the relay-domains if it does not exist create it. In this file you should also put the following:

example.com
192.168.7

save the files and restart sendmail and all should work.

whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.