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:
-
Edited '/etc/mail/local-host-names' with my Linux server fqdn.
-
Edited '/etc/mail/access' and as below:
Connect:mailserver.xxx.com RELAY
Connect:mailserver RELAY
Connect:127.0.0.1 RELAY
-
makemap hash /etc/mail/access.db < /etc/mail/access
-
Edited
/etc/mail/sendmail.mc
as below:
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')
-
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
-
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:
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
Alternatively the name-servers you are using are not capable of resolving your domain, for instance because they are not recursive..