Configure sendmail on RHEL 6.3 to send email using my Microsoft exchange account
[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
Related videos on Youtube
syed
Updated on September 18, 2022Comments
-
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:
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" [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 almost 9 yearsWhat 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 tobob@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 almost 9 yearsYes, 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 almost 9 yearsTypically
/var/log/maillog
will give some hints on why the message is rejected. -
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 almost 9 yearsThe 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 almost 9 yearsAble 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