Sendmail Configuration

Sendmail Configuration

Question : How to configure sendmail in Linux rhel 6 centos 6 ? 

Question : Step by Step Sendmail configuration in centos 6 ? 

IP - 

Hostname -

OS - CentOS 6

MTA - Mail Transfer Agent

SMTP - Simple mail transfer protocol

Port : SMTP -25 | POP: 110 | POPs: 995 | IMAP: 143 | IMAPs: 993

Sendmail 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.
To install sendmail
# yum install sendmail*
Configure Sendmail file
# vi /etc/mail/
Serarch line  : DEMON_OPTIONS & disable by adding " dnl"

Output after disable

Search LOCAL_DOMAIN & change according your domain

Save & Exit

Now we will divert file in  , it is always configured
#  M4  /etc/mail/  >  /etc/mail/

Sendmail by default deny for everyone so we set permission
# vi  /etc/mail/access

We can add network/IP/ Hostnam for network,we not add zero bits in this file

Edit the file named  "/etc/mail/local-host-names" and add the following ( machine ip address for example my ip is
# vi  /etc/mail/local-host-names

Now restart sendmail
#  service  sendmail  restart
# chkconfig  sendmail  on
Add user for mail
# useradd -s /sbin/nologin user1
Set Password for user

# passwd user1
# useradd -s /sbin/nologin user2
# passwd user2
# useradd -s /sbin/nologin user3
# passwd user3

Test the mail server
# telnet

Quit for exit..

1.Send mail to user

# mail -v
# mail -v user1@
Subject:  type subject & enter


This is a test message
. Here dot (.) exit message and send

If we want user " user1" get all mails in " Sales" Group. So we will set aliases

To set aliases
# vi /etc/aliases

Next Post »