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: 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=, 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"  syed@xxx.com < /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.

  • What exactly do you need? Simply configure sendmail such that messages from your server to syed@example.com get delivered? Or should all outgoing message, to any address, get redirected so that messages such as to bob@ServerFault and to alice@example.gov.uk 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? – HBruijn Aug 5 '15 at 12:25
  • Yes, I need to simply configure sendmail to send messages from my server to my email id syed@example.com Also need to send email from an automated script of OracleDB to few users. HBruijn – syed Aug 9 '15 at 7:21
  • 1
    Typically /var/log/maillog will give some hints on why the message is rejected. – HBruijn Aug 9 '15 at 9:12
  • [root@xxxxxx~]# echo hello |sendmail -v Syed@xxx.com xxx.com: Name server timeout Syed@xxxx.com... Transient parse error -- message queued for future delivery Syed@xxxx.com.. queued HBruijn – syed Aug 9 '15 at 10:12
  • 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 – HBruijn Aug 9 '15 at 11:47

From your latest comment:

The following addresses had permanent fatal errors ----- ----- Transcript of session follows ----- 550 5.1.2 ... Host unknown (Name server: xxx.net: host not found)

Seems a clear indication of what's wrong. You have resolving problems.

Either your name servers are not configured correctly. Check your /etc/resolv.conf and from the commandline with for instance with nslookup -type=mx example.com

# Sample /etc/resolv.conf using Google's public DNS

Alternatively the name-servers you are using are not capable of resolving your domain, for instance because they are not recursive..


[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:****


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 Syed@xxx.com

Mail working and recieved

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.