[comp.bugs.4bsd] surprises from the `C' mailer flag

rickert@mp.cs.niu.edu (Neil Rickert) (03/14/91)

In article <125491@uunet.UU.NET> kyle@uunet.UU.NET (Kyle Jones) writes:
>In article <1991Mar13.003432.14835@mp.cs.niu.edu> rickert@mp.cs.niu.edu (Neil Rickert) writes:
> > In article <125390@uunet.UU.NET> kyle@uunet.UU.NET (Kyle Jones) writes:
> > > [...] sendmail 5.61.
> > >
> > > If the recipient mailer is sendmail's builtin SMTP mailer, then
> > > the user part of the (mailer, host, user) triple of ruleset 0
> > > will have the sender's domain appended, if the sending mailer has
> > > the C flag set and the user part doesn't have a domain spec.
> > > This means that the RCPT To: SMTP command is sent out with the
> > > _sender's_ domain appended to the recipient, instead of the
> > > recipient's own domain.

>I no longer have a pristine 5.61 sendmail to look at, but the
>problem is still there in sendmail 5.64.  Here's the offending
>line from src/usersmtp.c:
>
>        smtpmessage("RCPT To:<%s>", m, remotename(to->q_user, m, FALSE, TRUE));

 I just checked.  You are indeed correct, and this is a SERIOUS bug.
My sources contain instead:

	smtpmessage("RCPT To:<%s>", m, to->q_user);

but in checking the RCS archives, I find this correction is part of the
IDA mods.

> > While I agree you should normally resolve to (tcp,domain,user@domain)
> > there are circumstances where it is useful to resolve to just
> > (tcp,domain,user) -- in particular this lets you get mail to someone on
> > a badly misconfigured host which does not recognize its own domain name.

 Funny that I happened to mention that yesterday.  Today I find that a
neighboring machine which uses my host as a relay was recently misconfigured
during installation of a new release of SunOS.  The result is, it doesn't
recognize its own address, and relays it back here.  After 17 hops the
message is rejected, breaking the mailing loop.  I had to resort to the
configuration change of removing the domainname before forwarding to
the host.  Fortunately my sendmail does not suffer from this bug.

 Incidently, if my 'sendmail' receives a message to
'user@[n1.n2.n3.n4]' it always relays it without a domain name, since many
hosts do not recognize their own domain names.

 I have cross-posted this to comp.bugs.4bsd

-- 
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
  Neil W. Rickert, Computer Science               <rickert@cs.niu.edu>
  Northern Illinois Univ.
  DeKalb, IL 60115                                   +1-815-753-6940