Installing the required packages
$sudo dnf install sendmail sendmail-cf Last metadata expiration check: 0:51:15 ago on Saturday 31 March 2018 01:28:13 PM IST. Package sendmail-8.15.2-19.fc26.x86_64 is already installed, skipping. Dependencies resolved. ============================================================================================================================================================================================================================ Package Arch Version Repository Size ============================================================================================================================================================================================================================ Installing: sendmail-cf noarch 8.15.2-19.fc26 updates 195 k Transaction Summary ============================================================================================================================================================================================================================ Install 1 Package Total download size: 195 k Installed size: 956 k Is this ok [y/N]: y Downloading Packages: sendmail-cf-8.15.2-19.fc26.noarch.rpm 253 kB/s | 195 kB 00:00 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 92 kB/s | 195 kB 00:02 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : sendmail-cf-8.15.2-19.fc26.noarch 1/1 Verifying : sendmail-cf-8.15.2-19.fc26.noarch 1/1 Installed: sendmail-cf.noarch 8.15.2-19.fc26 Complete!
Editing sendmail.mc file
2.[15:45 cipher@server ~]$ sudo vi /etc/mail/sendmail.mc
$grep LOCAL_DOMAIN /etc/mail/sendmail.mc LOCAL_DOMAIN(`server.sand.box')dnl $grep DAEMON_OPTIONS /etc/mail/sendmail.mc DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
Update sendmail configuration
sudo make -C /etc/mail
$ sudo make -C /etc/mail make: Entering directory '/etc/mail' make: Leaving directory '/etc/mail'
Restart and enable the service
$sudo systemctl enable sendmail Created symlink /etc/systemd/system/multi-user.target.wants/sendmail.service → /usr/lib/systemd/system/sendmail.service. Created symlink /etc/systemd/system/multi-user.target.wants/sm-client.service → /usr/lib/systemd/system/sm-client.service.
Sending test mail.
$mail -v pawaan.v@gmail.com Subject: test test . EOT pawaan.v@gmail.com... Connecting to [127.0.0.1] via relay... 220 localhost.localdomain ESMTP Sendmail 8.15.2/8.15.2; Sat, 31 Mar 2018 14:27:22 +0530 >>> EHLO localhost.localdomain 250-localhost.localdomain Hello localhost.localdomain [127.0.0.1], pleased to meet you 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-8BITMIME 250-SIZE 250-DSN 250-ETRN 250-AUTH GSSAPI DIGEST-MD5 CRAM-MD5 250-DELIVERBY 250 HELP >>> MAIL From:<cipher@localhost.localdomain> SIZE=213 AUTH=cipher@localhost.localdomain 250 2.1.0 <cipher@localhost.localdomain>... Sender ok >>> RCPT To:<pawaan.v@gmail.com> >>> DATA 250 2.1.5 <pawaan.v@gmail.com>... Recipient ok 354 Enter mail, end with "." on a line by itself >>> . 250 2.0.0 w2V8vMPS011733 Message accepted for delivery pawaan.v@gmail.com... Sent (w2V8vMPS011733 Message accepted for delivery) Closing connection to [127.0.0.1] >>> QUIT 221 2.0.0 localhost.localdomain closing connection