- Create an ‘/etc/netsvc.conf’ file, this is to tell sendmail to use ‘/etc/hosts’ for name resolution not DNS (default):
vi /etc/netsvc.conf
Add the following:
hosts=local
- Change the permissions on the ‘/etc/netsvc.conf’ file to lock down root only access:
chmod 600 /etc/netsvc.conf
- Add into the ‘/etc/hosts’ file the IP address and hostname of the Exchange server. If you wish to check the hostname of the server use telnet to connect to port 25 of the server:
telnet <IP address of Exchange server> 25
N.B. Type: quit to close the session
Add the IP and hostname into ‘/etc/hosts’:
vi /etc/hosts
- Copy away the original ‘/etc/sendmail.cf’ file
cp /etc/sendmail.cf /etc/sendmail.cf.orig
- Edit the ‘/etc/sendmail.cf’ and make the following changes:
Vi /etc/sendmail.cf
Change:
#DwYourHostName
To:
Dw<hostname of machine>
Change:
# "Smart" relay host (may be null)
# Relay host to forward outgoing mail not in the local domain to.
# To forward ALL mail to this relay host, uncomment the appropriate
# rule in ruleset 0, as indicated by the ruleset's comments.
#DSmailer:relayhostname
DS
To:
# "Smart" relay host (may be null)
# Relay host to forward outgoing mail not in the local domain to.
# To forward ALL mail to this relay host, uncomment the appropriate
# rule in ruleset 0, as indicated by the ruleset's comments.
#DSmailer:relayhostname
DS<hostname of Exchange Server>
Save the file.
- Refresh the ‘sendmail’ daemon to pick up the new changes to the ‘/etc/sendmail.cf’ file
refresh –s sendmail
It will take a few minutes for the ‘ps’ process to return:
root 5704 1 0 11:08:42 - 0:00 sendmail: accepting connections on port 25
In the interim period the following will be displayed via ‘ps’:
great timing. This is something I've been beating my head against the wall for for the last few days. Your directions actually got me closer but I still fail.
I after doing everything you said I still get an error that the route to remote host is not available.
During the verbose commands I can see it's attempting to connect to 25.tcp and then 25 (tcp) and then deferred with the above error message.
To solve this problem, I had to add the IP address of the exchange server to the hosts file with the host name of the domain that I was sending to. This is ok if you are only emailing out to one or two domains.
Whether this is the correct way to do it I couldn't say, other than it works for what I want.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.