Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!decwrl!pa.dec.com!vixie From: vixie@decwrl.dec.com (Paul A Vixie) Newsgroups: comp.mail.sendmail Subject: Re: Problem with host sending MX-ed mail to itself Message-ID: Date: 16 Feb 91 05:30:58 GMT References: <6166@rex.cs.tulane.edu> Sender: news@pa.dec.com (News) Organization: DEC Western Research Lab Lines: 131 In-Reply-To: mb@rex.cs.tulane.edu's message of 15 Feb 91 15:13:25 GMT As Mr. Rickert points out, you need to make sure that $w is the same as the name listed in the MX. If you are a multi-homed host, and your interface addresses have different names attached to them, and if you are listed in some MX's by one name and in other MX's by some other name, then you might wish that sendmail would ignore MX's in $=w rather than those which match $w, and in that case, you need a patch that I made to KJS last week. It will appear in the next release, which should also be based on 5.65 (but don't hold your breath or you may turn blue). The patch goes something like this (assuming -DDECWRL in Makefile): *** /tmp/,RCSt1a25728 Fri Feb 15 23:30:16 1991 --- domain.c Thu Jan 31 13:41:35 1991 *************** *** 41,48 **** static char hostbuf[MAXMXHOSTS*PACKETSZ]; ! getmxrr(host, mxhosts, localhost, rcode) ! char *host, **mxhosts, *localhost; int *rcode; { extern int h_errno; --- 41,48 ---- static char hostbuf[MAXMXHOSTS*PACKETSZ]; ! getmxrr(host, mxhosts, rcode) ! char *host, **mxhosts; int *rcode; { extern int h_errno; *************** *** 118,124 **** if ((n = dn_expand((char *)&answer, eom, cp, bp, buflen)) < 0) break; cp += n; ! if (!strcasecmp(bp, localhost)) { if (seenlocal == 0 || pref < localpref) localpref = pref; seenlocal = 1; --- 118,124 ---- if ((n = dn_expand((char *)&answer, eom, cp, bp, buflen)) < 0) break; cp += n; ! if (host_is_local(bp)) { if (seenlocal == 0 || pref < localpref) localpref = pref; seenlocal = 1; *************** *** 166,171 **** --- 166,179 ---- } } return(nmx); + } + + int + host_is_local(h) + char *h; + { + STAB *s = stab(h, ST_CLASS, ST_FIND); + return (s != NULL && bitnset('w', s->s_class)); } /* *** /tmp/,RCSt1a25728 Fri Feb 15 23:30:17 1991 --- deliver.c Thu Jan 31 13:35:22 1991 *************** *** 18,24 **** #ifndef lint static char sccsid[] = "@(#)deliver.c 5.26 (Berkeley) 1/1/89"; ! static char rcsid[] = "$Header: deliver.c,v 1.8 90/10/23 20:03:33 vixie Locked $"; #endif /* not lint */ #include --- 18,24 ---- #ifndef lint static char sccsid[] = "@(#)deliver.c 5.26 (Berkeley) 1/1/89"; ! static char rcsid[] = "$Header: deliver.c,v 1.8 90/10/23 20:03:33 vixie Exp $"; #endif /* not lint */ #include *************** *** 449,466 **** #ifdef SMTP if (clever) { expand("\001w", buf, &buf[sizeof(buf) - 1], e); rcode = EX_OK; #ifdef NAMED_BIND if (host[0] != '[' && m->m_mailer[0] != '/') { - Nmx = getmxrr(host, MxHosts, buf, &rcode); #ifdef DECWRL if (Nmx == -1) { Nmx = 1; MxHosts[0] = host; } #endif DECWRL } else --- 449,470 ---- #ifdef SMTP if (clever) { + #ifndef DECWRL expand("\001w", buf, &buf[sizeof(buf) - 1], e); + #endif DECWRL rcode = EX_OK; #ifdef NAMED_BIND if (host[0] != '[' && m->m_mailer[0] != '/') { #ifdef DECWRL + Nmx = getmxrr(host, MxHosts, &rcode); if (Nmx == -1) { Nmx = 1; MxHosts[0] = host; } + #else DECWRL + Nmx = getmxrr(host, MxHosts, buf, &rcode); #endif DECWRL } else -- Paul Vixie DEC Western Research Lab Palo Alto, California ...!decwrl!vixie