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 - 10.20.2.33 

Hostname - khandwa.lokesh.com

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/sendmail.mc
Serarch line  : DEMON_OPTIONS & disable by adding " dnl"



Output after disable






Search LOCAL_DOMAIN & change according your domain





Save & Exit

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


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






We can add network/IP/ Hostnam for network  10.20.2.0,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 10.20.2.33)
# 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 khandwa.lokesh.com

Quit for exit..

1.Send mail to user

# mail -v user1@lokesh.com
Or
# mail -v user1@10.20.2.33
Subject:  type subject & enter

Hello

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


Previous
Next Post »