Pages

Thursday, September 16, 2010

How to configure sendmail server in linux

first configure following :-
  • A linux client with ip address 192.168.0.2 and hostname Client1
  • A Configured DNS server
  • A linux server with ip address 192.168.0.1 and hostname Server
  • on Linux server
  • Updated /etc/hosts file on both linux system
  • Running portmap and xinetd services
  • Firewall should be off on server
                               NOW CONFIGURE SEND MAIL SERVER

FIRST OF ALL INSTALL PACKAGE:-


open /etc/mail/sendmail.mc for editing
show hidden line with : set nu option on vi command mode
By default, the following line limits sendmail access to connect local host only [line no 116] 
comment this line with dnl keyword followed by # sign

Now generate new sendmail.cf file by using m4 command as shown here 
     M4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf  

Now restart sendmail service and also set it on with chkconfig

IT SHOULD BE RUN SUCCESSFULLY .

              NOW CONFIGURE SENDMAIL CLIENT

Check sendmail and m4 rpm for install. Open /etc/mail/sendmail.mc file and locate line no 116 and put a dnl with # sing and save file. All step are same which you have done on server.
Now generate new sendmail.cf file by using m4 command as shown here
  M4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf 

Now restart sendmail service and also set it on with chkconfig

Testing of sendmail server

We will test sendmail server by sending and receiving mail in lab environment. for this we use two user one on each system. Now create one user on each system . server and client .

Now send mail from server user toclient user and client user to server user  and also check each others mail by mail command

Use full user name to send mail. For example to send mail to server user use serveruser@server.example.com and to send mail to client user clientuser@example.com