From: paul@uxc.cso.uiuc.edu (Paul Pomes - UofIllinois CSO)
Newsgroups: comp.mail.sendmail
Subject: Re: Problems with IDA on SunOS 4.1.3
Date: 5 Nov 92 16:02:28 GMT
Article-I.D.: news.Bx9386.7xB
Reply-To: Paul-Pomes@uiuc.edu
Organization: University of Illinois at Urbana

mmuegel@next3.corp.mot.com (Michael S. Muegel) writes:

>I have been using 5.65c+IDA-1.4.4.1 on our two Internet gateways for
>a few weeks now with very few complaints. In fact, it has helped us
>to significantly improve the quality of our SMTP mail service.
>
>So tonight it came time to upgrade one of our two internal WAN SMTP
>gateways. Everything looked good for a few minutes until I started
>seeing processes wth identifiers like this:
>
>   -gethostbyname(pobox) failed, sleeping (sendmail)

The problem is that pobox can't contact a DNS server to determine its
canonical name (pobox.mot.com).  The second problem is that setproctitle()
should not be called at this point within sendmail.  Try replacing the
myhostname() routine with the following in daemon.c:

char **
myhostname(hostbuf, size)
	char hostbuf[];
	int size;
{
	struct hostent *hp;

	if (gethostname(hostbuf, size) < 0)
		(void) strcpy(hostbuf, "localhost");
# ifdef NAMED_BIND
	/*
	** See note in makeconnection() above for why we disable
	** recursive domain matching.   We need it here too.
	*/
#  ifdef apollo
	/* Only needed with the 6.8 compiler */
	{
		int     ii;

		for (ii = 0; ii < 16; ii++)
			if (((~RES_DNSRCH & 1<<ii) == 0) &&
			    ((_res.options & 1<<ii) != 0))
				_res.options -= 1<<ii;
	}
#  else /* !apollo */
	_res.options &= (~RES_DNSRCH & 0xffff);
#  endif /* apollo */

	/*
	** But make sure default domain qualification is enabled -
	** it may have been disabled in deliver.c.
	*/
	_res.options |= RES_DEFNAMES ;
	h_errno = 0;
	while ((hp = gethostbyname(hostbuf)) == NULL ||
	       (UseNameServer && h_errno == TRY_AGAIN))
	{
# ifdef LOG
		syslog(LOG_WARNING, "%s: gethostbyname(%s) failed, sleeping",
			CurEnv->e_id, hostbuf);
# endif /* LOG */
		Xsleep(30);
		h_errno = 0;
	}

	/* Now turn RES_DNSRCH back on. */
	_res.options |= RES_DNSRCH ;

# else /* !NAMED_BIND */
#  ifdef sun
	/*
	 *	An ugly hack.
	 *	This routine is mainly called to assign a default value
	 *	to $w .  As such it must be called before the config file
	 *	is processed.  On Sun systems this involves calls to some
	 *	of the yp lookup routines.  They apparently leave state
	 *	information lying around which is inconsistent with the
	 *	use of frozen configurations.  Since the standard Sun
	 *	setup leaves hostnames unqualified anyway, omitting the
	 *	gethostbyname() call should have little effect.
	 */

	hp = NULL;
#  else /* !sun */
	hp = gethostbyname(hostbuf);
#  endif /* sun */
# endif /* NAMED_BIND */
	if (hp != NULL)
	{
		(void) strcpy(hostbuf, hp->h_name);
		return (hp->h_aliases);
	}
	else
		return (NULL);
}
-- 
"The feminist agenda is not about equal rights for women.  It is about a
 socialist, anti-family political movement that encourages women to leave
 their husbands, kill their children, practice witchcraft, destroy capitalism,
 and become lesbians."  --Pat Robertson on Iowa's proposed ERA
Newsgroups: comp.mail.sendmail