Please find the below steps of send mail configuration.

1) Install Sendmail with the below command.
apt-get install sendmail sendmail-cf
2) Please check for saslauthd service, if it is not there on the server then install it with the below command.
apt-get install sasl2-bin
3) Go to vim /etc/default/saslauthd and keep “start=yes”(by default it will be no)
4) Set your authorization informations by putting the following line to /etc/mail/authinfo file: “” “P:1234” “M:PLAIN”
5)Go to vi /etc/mail/ and scroll down to the end of the line and paste the below lines dnl # SMTP Relay setup
define(`RELAY_MAILER_ARGS’, `TCP $h 587′)dnl
define(`ESMTP_MAILER_ARGS’, `TCP $h 587′)dnl
define(`SMART_HOST’, `’)dnl
FEATURE(`authinfo’,`hash /etc/mail/authinfo’)dnl

6)Update and access.db files through the below commands
cd /etc/mail
m4 > makemap hash authinfo < authinfo

7) Now restart the send mail service by using the below command. /etc/init.d/sendmail restart
8) Try to send a testmail by using the below command
echo “mail” | mail -s “Hello”
9)Wait for some time and check the mail.

Leave a Reply