How to Install Sendmail Service on CentOS 6.5

This post will show how to install sendmail smtp service on CentOS 6.5. By default only postfix smtp service included in CentOS 6.5. Due to some reasons you will to run sendmail service instead of postfix. But the purpose of both services still the same providing SMTP email transport service and running as an email relay on your linux system.

1. Install sendmail :

[root@centos6.5 ~]# yum install sendmail -y
..
..
..
..
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package sendmail.x86_64 0:8.14.4-8.el6 will be installed
--> Processing Dependency: procmail for package: sendmail-8.14.4-8.el6.x86_64
--> Processing Dependency: libhesiod.so.0()(64bit) for package: sendmail-8.14.4-8.el6.x86_64
--> Running transaction check
---> Package hesiod.x86_64 0:3.1.0-19.el6 will be installed
---> Package procmail.x86_64 0:3.22-25.1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                Arch                 Version                       Repository          Size
====================================================================================================
Installing:
 sendmail               x86_64               8.14.4-8.el6                  base               717 k
Installing for dependencies:
 hesiod                 x86_64               3.1.0-19.el6                  base                20 k
 procmail               x86_64               3.22-25.1.el6                 base               163 k

Transaction Summary
====================================================================================================
Install       3 Package(s)

Total download size: 900 k
Installed size: 1.9 M
Downloading Packages:
(1/3): hesiod-3.1.0-19.el6.x86_64.rpm                                        |  20 kB     00:00
(2/3): procmail-3.22-25.1.el6.x86_64.rpm                                     | 163 kB     00:00
(3/3): sendmail-8.14.4-8.el6.x86_64.rpm                                      | 717 kB     00:06
----------------------------------------------------------------------------------------------------
Total                                                               117 kB/s | 900 kB     00:07
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : procmail-3.22-25.1.el6.x86_64                                                    1/3
  Installing : hesiod-3.1.0-19.el6.x86_64                                                       2/3
  Installing : sendmail-8.14.4-8.el6.x86_64                                                     3/3
  Verifying  : hesiod-3.1.0-19.el6.x86_64                                                       1/3
  Verifying  : procmail-3.22-25.1.el6.x86_64                                                    2/3
  Verifying  : sendmail-8.14.4-8.el6.x86_64                                                     3/3

Installed:
  sendmail.x86_64 0:8.14.4-8.el6

Dependency Installed:
  hesiod.x86_64 0:3.1.0-19.el6                    procmail.x86_64 0:3.22-25.1.el6

Complete!

2. Start Sendmail service :

[root@centos6.5 ~]# service sendmail start
Starting sendmail:                                         [  OK  ]
Starting sm-client:                                        [  OK  ]

3. Test sendmail respond on port 25 :

[root@centos6.5 ~]# telnet localhost 25
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 centos6.5.ehowstuff.local ESMTP Sendmail 8.14.4/8.14.4; Sun, 10 Aug 2014 20:48:52 +0800

How to Stop and Remove Sendmail on Fedora 16

sendmailSendmail is a general purpose internetwork email routing facility that supports many kinds of mail-transfer and -delivery methods, including the Simple Mail Transfer Protocol (SMTP) used for email transport over the Internet. In certain cases, you has to stop and remove the sendmail service on your server. It could be you want to install other smtp service such as postfix. In order to make postfix smoothly running, sendmail should be stop and removed. This post will show you on how to stop and remove sendmail on linux Fedora 16 server.

Command to stop sendmail service :

[root@fedora16 ~]# service sendmail stop
'Redirecting to /bin/systemctl  stop sendmail.service

Simply run this command to remove sendmail package on your server :

[root@fedora16 ~]# yum remove sendmail -y

Examples :

[root@fedora16 ~]# yum remove sendmail
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package sendmail.i686 0:8.14.5-6.fc16 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package               Arch              Version                     Repository                Size
====================================================================================================
Removing:
 sendmail              i686              8.14.5-6.fc16               @anaconda-0              1.5 M

Transaction Summary
====================================================================================================
Remove        1 Package

Installed size: 1.5 M
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing    : sendmail-8.14.5-6.fc16.i686                                                      1/1

Removed:
  sendmail.i686 0:8.14.5-6.fc16

Complete!