System Administration

sendmail to our exchange server

 
Ahmed M. AlShafiy
Regular Advisor

sendmail to our exchange server

i want to send an email from hp-ux to our exchange server, i have configure the sendmail
but i wanna know if i configure it will
1- i add DNS from SAM
2- i access the sendmail.cf file and i add the domain name.
3- in the sendmail.cf i conf. the smtp to our exchange server address

and when i send mail with this command
/usr/sbin/sendmail -v a@a.com
test
.

i get the follow log file
Oct 5 15:18:40 nasjet /sbin/init.d/sendmail[27472]: #### rebooted ####
Oct 5 15:18:40 nasjet sendmail[27479]: gethostbyaddr(10.3.242.24) failed: 1
Oct 5 15:18:40 nasjet sendmail[27479]: alias database /etc/mail/aliases rebuilt by root
Oct 5 15:18:40 nasjet sendmail[27479]: /etc/mail/aliases: 7 aliases, longest 9 bytes, 88 bytes total
Oct 5 15:18:40 nasjet sendmail[27480]: gethostbyaddr(10.3.242.24) failed: 1
Oct 5 15:18:40 nasjet sendmail[27481]: starting daemon (8.9.3 (PHNE_26305)): SMTP+queueing@00:30:00
Oct 5 15:19:36 nasjet sendmail[27482]: PAA26967: to=aalshafiy@nasaviation.com, ctladdr=root (0/3), delay=00:17:16, xdelay=00:00:56, mailer=esmtp, relay=mail3., stat=Host unknown (Name server: mail3.: host not found)
Oct 5 15:19:36 nasjet sendmail[27482]: PAA26967: PAA27482: DSN: Host unknown (Name server: mail3.: host not found)
Oct 5 15:19:36 nasjet sendmail[27482]: PAA27482: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, stat=Sent
Oct 5 15:25:35 nasjet sendmail[27666]: gethostbyaddr(10.3.242.24) failed: 1
Oct 5 15:26:34 nasjet sendmail[27692]: gethostbyaddr(10.3.242.24) failed: 1
Oct 5 15:26:39 nasjet sendmail[27692]: PAA27692: from=root, size=5, class=0, pri=30005, nrcpts=1, msgid=<200510051226.PAA27692@nasjet.nasaviation.com>, relay=root@localhost
Oct 5 15:26:42 nasjet sendmail[27699]: gethostbyaddr(10.3.242.24) failed: 1
Oct 5 15:27:12 nasjet sendmail[27715]: gethostbyaddr(10.3.242.24) failed: 1
Oct 5 15:27:19 nasjet sendmail[27720]: gethostbyaddr(10.3.242.24) failed: 1
Oct 5 15:27:24 nasjet sendmail[27721]: gethostbyaddr(10.3.242.24) failed: 1

please can any one help me .
6 REPLIES 6
Ivan Ferreira
Honored Contributor

Re: sendmail to our exchange server

Did you used the hostname or the ip address in the sendmail.cf file?

Try adding the mail server to the hosts file and use the hostname instead of the ip address. It seems that mail3 cannot be resolved.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Volker Spies
Trusted Contributor

Re: sendmail to our exchange server

Hello Ahmed,

as Ivan mentioned your hpux does not "know" your mailserver name:

Oct 5 15:19:36 nasjet sendmail[27482]: PAA26967: to=aalshafiy@nasaviation.com, ctladdr=root (0/3), delay=00:17:16, xdelay=00:00:56, mailer=esmtp, relay=mail3., stat=Host unknown (Name server: mail3.: host not found)

It says "host unknown". Try to put the FQDN in the sendmail.conf (e.g mail3.whatever.com).
Make sure that your hpux box can resolv this name.
Or put it in your /etc/hosts file if you do not have an DNS.

Or put the ip adresse of the mailserver in the sendmail conf. wich is not recommendet but works.

Best regards

Volker
Steven E. Protter
Exalted Contributor

Re: sendmail to our exchange server

Windows exchange by default will now allow relay from any server that is not explicity setup to permit relay.

The Windows Exchange server must allow relay.

Then you set a DS directive in sendmail.cf and restart the sendmail daemon.

At this point the error you report, which is a failure of a DNS lookup should stop.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ahmed M. AlShafiy
Regular Advisor

Re: sendmail to our exchange server

i make the changes to the sendmail.cf as the follow:
dj.mail.nasaviation.com

and when i restart sendmail i check the mail.log i find this lines:

Oct 8 11:46:23 nasjet /sbin/init.d/sendmail[5735]: #### rebooted ####
Oct 8 11:46:23 nasjet sendmail[5742]: gethostbyaddr(10.3.242.24) failed: 1
Oct 8 11:46:23 nasjet sendmail[5742]: alias database /etc/mail/aliases rebuilt by root
Oct 8 11:46:23 nasjet sendmail[5742]: /etc/mail/aliases: 7 aliases, longest 9 bytes, 88 bytes total
Oct 8 11:46:23 nasjet sendmail[5743]: gethostbyaddr(10.3.242.24) failed: 1
Oct 8 11:46:23 nasjet sendmail[5744]: starting daemon (8.9.3 (PHNE_26305)): SMTP+queueing@00:30:00
Mel Burslan
Honored Contributor

Re: sendmail to our exchange server

Looks like you did not either read or understand Steven's answer

edit /etc/mail/sendmail.cf

find the line starting with DS (if there is none, add a new line like this

DSexchangeservername

save and exit.
just for outgoing mail messages, you do not need to restart sendmail but if you want, you can stop and restart sendmail at this time

then test it

echo test | sendmail -v user@domain.com

this command will give you a transaction log, on the screen. If your email does not arrive to the user@domain.com mailbox, post that log here.

Make sure the exchage server admins know that you are going to relay email over their server. Due to viruses and worms, almost all exchange servers are setup to reject mail relay requests from hosts which are not on the authorized and approved hosts list. Make sure your server name gets into this list.

Hope this helps
________________________________
UNIX because I majored in cryptology...
Ahmed M. AlShafiy
Regular Advisor

Re: sendmail to our exchange server

Thanks All my problem have been solved and thankz agin.......... :)