Article View: comp.bugs.4bsd
Article #1343non-[IPC] SMTP mailers broken in sendmail (5.59, 5.61) +FIX
From: Steve Campbell
Date: Fri, 17 Feb 1989 20:59
Date: Fri, 17 Feb 1989 20:59
51 lines
2318 bytes
2318 bytes
Subject: non-[IPC] SMTP mailers broken in sendmail (5.59, 5.61) +FIX
Index: usr.lib/sendmail/src/deliver.c 4.3BSD
Description:
Sendmail makes the assumption that any mailer that speaks SMTP,
ie which has no $u in its argv, is an IPC mailer. In
particular it will call getmxrr for the "host" name. But the
assumption is wrong. You can have (and we do) a mailer that is
a program on the local host and speaks SMTP with sendmail.
Since this is a "local" mailer, ie its "l" flag is set, there
is no host associated with it, ie there is no $@host in the
ruleset zero resolution line for this mailer. Thus "host" is
null, getmxrr fails, and sendmail returns "host unknown" even
though the message is correct and could be delivered.
Repeat-By:
Create a local mailer that talks SMTP with sendmail.
Send mail to it. Watch the "host unknown."
Fix:
Have sendmail check for a null host name before calling
getmxrr. The patch is in deliver.c. A minor efficiency gain
is obtained by moving the expand() call to where it's needed.
These are patches to version 5.61, but the code in earlier
versions is similar.
*** /tmp/,RCSt1006583 Sun Feb 12 13:04:50 1989
--- deliver.c Thu Feb 9 18:39:02 1989
***************
*** 379,389 ****
#ifdef SMTP
if (clever)
{
- expand("\001w", buf, &buf[sizeof(buf) - 1], e);
rcode = EX_OK;
#ifdef NAMED_BIND
! if (host[0] != '[')
{
Nmx = getmxrr(host, MxHosts, buf, &rcode);
}
else
--- 379,389 ----
#ifdef SMTP
if (clever)
{
rcode = EX_OK;
#ifdef NAMED_BIND
! if (host[0] && host[0] != '[')
{
+ expand("\001w", buf, &buf[sizeof(buf) - 1], e);
Nmx = getmxrr(host, MxHosts, buf, &rcode);
}
else
Technical Details
Message-ID:
<12272@dartvax.Dartmouth.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!bu-cs!dartvax!eleazar.dartmouth.edu!steveShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!bu-cs!dartvax!eleazar.dartmouth.edu!steve From: steve@eleazar.dartmouth.edu (Steve Campbell) Newsgroups: comp.bugs.4bsd,comp.mail.sendmail Subject: non-[IPC] SMTP mailers broken in sendmail (5.59, 5.61) +FIX Message-ID: <12272@dartvax.Dartmouth.EDU> Date: 17 Feb 89 20:59:37 GMT Sender: news@dartvax.Dartmouth.EDU Reply-To: steve@eleazar.dartmouth.edu (Steve Campbell) Followup-To: comp.bugs.4bsd Organization: Dartmouth College, Hanover, NH Lines: 51