Pages

Friday, August 31, 2012

Sendmail Configuration


  • 25 is the port for Mail in Linux, so check whether sendmail / postfix is already configured and running using the following command,
     [root@Linux root]# netstat -antp | grep 25
    tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      28849/sendmail

    ·   Check the services running or idle according to the MTA,
    [root@castle-hat tmp]# service sendmail status
    sendmail (pid  28849) is running...
    sm-client (pid  28857) is running...

    [root@castle-hat tmp]# service postfix status
    master is stopped

    ·   Check the RPM’s got installed properly
    [root@Linux root]# rpm -qa | grep sendmail
    sendmail-cf-8.14.4-8.el6.noarch
    sendmail-8.14.4-8.el6.x86_64

    [root@ Linux root]# rpm -qa m4
    m4-1.4.13-5.el6.x86_64

    ·   Edit the sendmail.mc
    Enable the below lines
    LOCAL_DOMAIN(`localhost.localdomain')dnl
    EXPOSED_USER(`build')dnl  //////makes the mail comes from build user

    ·  Write it to sendmail.cf
     [root@ Linux root]# m4 sendmail.mc > sendmail.cf

    ·   Edit the submit.mc file
                Make sure the below lines are uncommented
    MASQUERADE_AS(`hat.com')dnl
    FEATURE(masquerade_envelope)dnl
    MASQUERADE_DOMAIN(`localhost')dnl
    MASQUERADE_DOMAIN(`localhost.localdomain')dnl
    FEATURE(`msp', `[relay.na.rsa.net]')dnl

    ·  Write it to the .CF File
    [root@ Linux root]# m4 submit.mc > submit.cf

    ·   Start the senmail service
             [root@ Linux root]# service sendmail start

    ·    Mail syntax
             [root@castle-hat mail]# mail -s <SUBJECT> <TOUSERID> < MAILSUB

No comments:

Post a Comment