Linux – Configure sendmail on RHEL 6.3 to send email using the Microsoft exchange account

linuxsendmail

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"  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.

Best Answer

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
nameserver 8.8.8.8
nameserver 8.8.4.4

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

Related Topic