Wednesday 28 December 2011

Mail server

Packages needed: sendmail, sendmail-cf, sendmail-doc

port used by this daemon : 25

Using yum installer to install the RPM's needed for configuration

yum list sendmail*
yum install sendmail*

CONFIGURING THE MTA TO RECEIVE MAIL

make a backup of your original sendmail.cf and sendmail.mc:
cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.orig
cp /etc/mail/sendmail.mc /etc/mail/sendmail.mc.orig
EDITING THE CONFIGURATION FILE
vim /etc/mail/sendmail.mc
search text /127.0.0.1
comment the line using "dnl #"



ENTER THE FOLLOWING ENTRY IN THE LAST LINE

Cw
Cwstationx.example.com
local-host-names - INCLUDE ALL ALIASES FOR YOUR MACHINE HERE.
vim /etc/mail/local-host-names
station9.example.com
www9.example.com
THEN REDIRECT sendmail.mc ENTRY TO sendmail.cf
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

START THE DAEMON SERVICES AND ENABLE AFTER REBOOT

service sendmail start/restart/reload/stop

chkconfig sendmail on
STARTING AND VERIFYING MTA OPERATION

TO CONFIRM THE SENDMAIL IS ENABLED FOR THE APPROPRIATE RUNLEVELS
chkconfig --list sendmail

IF IT IS NOT STARTED, TRY THE FOLLOWING TO START

ntsysv
serviceconf
sendmail -d0 < /dev/null

if sendmail is returning your station name as localhost, you have a misconfigured /etc/hosts, so

remove the localhost entries in /etc/hosts. Check the hostname in /etc/sysconfig/network
==>text mode

==>GUI mode
echo "this is the message"
mail -v -s this is the subject root@stationx

SENDING MAIL USING SMTP
STEP 1 : telnet 192.168.0.X 25
STEP 2 : helo stationX.example.com
STEP 3 : mail from : user@
STEP 4 : rcpt to : user@
STEP 5 : data + ENTER
STEP 6 : type the message
STEP 7 : "." + ENTER
STEP 8 : quit + ENTER

No comments:

Post a Comment