Configure sendmail on RHEL 6.3 to send email using my Microsoft exchange account

5,858

[root@xxx ~]# nslookup -type=mx xxx.net

Server: xx.xxx.xx.10 Address: xx.xxx.xx.10#53

*** Can't find xxxx.net: No answer

****Sendmail didn't worked for me... atlast I sent email using postfix:****

PostFix:

Edit /etc/postfix/main.cf

Below the relayhost examples, add this line:

relayhost = smtp.xxx.com

Restart postfix:

/etc/init.d/postfix restart Sendmail:

Edit /etc/mail/sendmail.mc

Change: dnl #(SMART_HOST',localhost')dnl

To: (SMART_HOST',smtp.xxx.com')dnl

Save the file, and from the /etc/mail directory run "sudo make"

Restart sendmail /etc/init.d/sendmail restart

sendmail -v [email protected]

Mail working and recieved

Share:
5,858

Related videos on Youtube

syed
Author by

syed

Updated on September 18, 2022

Comments

  • syed
    syed almost 2 years

    I need to send email from RHEL host running 6.3 to my microsoft exchange email ID. Can any one please help me with detail steps for the configuration. I am new to Linux so tried some steps from webpages but not succeeded.

    I have done the configuration as follows:

    1. Edited '/etc/mail/local-host-names' with my Linux server fqdn.

    2. Edited '/etc/mail/access' and as below:

    Connect:mailserver.xxx.com RELAY
    Connect:mailserver RELAY
    Connect:127.0.0.1 RELAY

    1. makemap hash /etc/mail/access.db < /etc/mail/access

    2. Edited /etc/mail/sendmail.mc as below:

    dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')

    1. m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

    2. Service sendmail restart

    At this stage all service started ok

    [root@xxx mail]# service sendmail restart
    Shutting down sm-client:                                   [  OK  ]
    Shutting down sendmail:                                    [  OK  ]
    Starting sendmail:                                         [  OK  ]
    Starting sm-client:                                        [  OK  ]
    

    Now I tried to send email:

    mail -s "Test Email"  [email protected] < /dev/null
    Mail sent successfully but not delivered to mail ID.
    
    [root@xxxx mail]# mailq
    /var/spool/mqueue is empty
                    Total requests: 0
    

    But I am not able to receive any email. In /var/spool/mail/root it shows its sending mail but not able to deliever. Will keep trying for 5 days before giving up.

    Appreciate any support to fix this issue.

    • HBruijn
      HBruijn almost 9 years
      What exactly do you need? Simply configure sendmail such that messages from your server to [email protected] get delivered? Or should all outgoing message, to any address, get redirected so that messages such as to bob@ServerFault and to [email protected] end up in your mailbox on the Exchange server? Or should the exchange server be used as the outgoing smtp server, the smarthost in jargon?
    • syed
      syed almost 9 years
      Yes, I need to simply configure sendmail to send messages from my server to my email id [email protected] Also need to send email from an automated script of OracleDB to few users. HBruijn
    • HBruijn
      HBruijn almost 9 years
      Typically /var/log/maillog will give some hints on why the message is rejected.
    • syed
      syed almost 9 years
      [root@xxxxxx~]# echo hello |sendmail -v [email protected] xxx.com: Name server timeout [email protected]... Transient parse error -- message queued for future delivery [email protected].. queued HBruijn
    • HBruijn
      HBruijn almost 9 years
      The hint is: Name server timeout - That indicates that the resolver you've configured isn't responding, check the settings you used in /etc/resolv.conf
    • syed
      syed almost 9 years
      Able to send email from sendmail command but not recieving in my mailbox... Getting below error in /var/spool/mail/root after sending mail ----- The following addresses had permanent fatal errors ----- <[email protected]> ----- Transcript of session follows ----- 550 5.1.2 <[email protected]>... Host unknown (Name server: xxx.net: host not found) HBrujin