how to configure sendmail server in linux

Upload: amitiihtdhn280

Post on 01-Mar-2018

228 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/25/2019 How to Configure Sendmail Server in Linux

    1/4

    How to confgure sendmail server in Linux

    In a company environment, email is an essential component to the work day. Email is used to

    communicate with both internal employees and external customers. In exam you will be tested to

    configure the send mail serverfor you local LAN.

    y default sendmail server allows to connect to local host only. !o we should edit

    the/etc/mail/sendmail.mcfile to allow connect to other hosts.

    "he sendmaildaemon is configured from a directory of files in #etc#mail and a directory of

    configuration files in/usr/share/sendmail-cf. "here are two basic configuration files$

    sendmail.cf"he main sendmail configuration file.

    sendmail.mcA macro that%s easier to edit, which can be used to generate a

    new sendmail.cffile.

    &or this example we are using two systems one linux server one linux clients. "hese are the pre 'uest

    for a sendmail server

    A linux server with ip address ()*.(+.-.*/ and hostname !erver

    A linux client with ip address ()*.(+.-.( and hostname 0lient(

    A 0onfigured 1N! server on Linux server

    2pdated #etc#hosts file on both linux system

    3unning portmap and xinetd services

    &irewall should be off on server

    4e suggest you to review that article and configure 1N! server before start configuration

    of sendmail server.5nce you have completed the necessary steps follow this guide.

    0onfigure sendmail server

    sendmailand m4 rpm are re'uired to configure sendmail server check them for install if not found

    install them.

    6ail server program reads the/etc/mail/sendmail.cf. "o change the configuration on mail server, we

    should edit the/etc/mail/sendmail.mcfile. 4hen !endmail is started or restarted with the service

    sendmail restartcommand a newsendmail.cffile is automatically generated if sendmail.mchas

    been modified. In exam you should generate it with m4command.

    open/etc/mail/sendmail.mcfor editing

    show hidden line with : set nu option on vi command modey default, the following line limits sendmail access to connect local host only [line no 116]

    7ou can allow other computers to use your sendmail serverby commenting out this line.

    In the sendmail.mcfile , lines that begin with dnl, which stands for delete to new line, are considered

    comments. !ome lines end with dnl, but lines ending in dnl are not comments

    http://computernetworkingnotes.com/network-administrations/sendmail-server.htmlhttp://computernetworkingnotes.com/network-administrations/sendmail-server.html
  • 7/25/2019 How to Configure Sendmail Server in Linux

    2/4

    comment this line with dnlkeyword followed by # sign

    save this file with :wqand exit.

    Now generate new sendmail.cffile by using m4command as shown here

    Now restart sendmail serviceand also set it on with chkconfig

    if sendmail servicerestart without any error means you have configured sendmailsuccessfully.

    0onfigure sendmail client side

    4e are using another linux system to test sendmail server. All configuration are same as you have

    done on server system.

    0heck sendmailand m4rpm for install. 5pen/etc/mail/sendmail.mcfile and locate line no 116and

    put a dnlwith # sing and save file. All step are same which you have done on server.

    Now generate new sendmail.cffile by using m4command as shown here

    Now restart sendmail serviceand also set it on with chkconfig

    "esting of sendmail server

    4e will test sendmail serverby sending and receiving mail in lab environment. for this we use two

    user one on each system.

    Now create one user on each system vinitaon server

  • 7/25/2019 How to Configure Sendmail Server in Linux

    3/4

    and nikita on client sstem

    Now send mail from user vinita to nikita and from nikita to user vinita and also check each others mail

    by mail command

    2se full user name to send mail. &or example to send mail to nikita use nikita!client1

  • 7/25/2019 How to Configure Sendmail Server in Linux

    4/4