Apply this patch to update an 8.6.1 sendmail to 8.6.2. *** RELEASE_NOTES.OLD Sat Oct 9 08:04:28 1993 --- RELEASE_NOTES Fri Oct 15 09:00:07 1993 *************** *** 1,3 **** --- 1,49 ---- + 8.6.2/8.6.2 93/10/15 + Put a "successful delivery" message in the transcript for + addresses that get return-receipts. + Put a prominent "this is only a warning" message in warning + messages -- some people don't read carefully enough + and end up sending the message several times. + Include reason for temporary failure in the "warning" return + message. Currently, it just says "cannot send for + four hours". + Fix the "Original message received" time generated for + returntosender messages. It was previously listed as + the current time. Bug reported by Eric Hagberg of + Cornell University Medical College. + If there is an error when writing the body of a message, + don't send the trailing dot and wait for a response + in sender SMTP, as this could cause the connection to + hang up under some bizarre circumstances. From Eric + Wassenaar. + Fix some server SMTP synchronization problems caused when + connections fail during message collection. From + Eric Wassenaar. + Fix a problem that can cause srvrsmtp to reject mail if the + name server is down -- it accepts the RCPT but rejects + the DATA command. Problem reported by Jim Murray of + Stratus. + Fix a problem that can cause core dumps if the config file + incorrectly resolves to a null hostname. Reported by + Allan Johannesen of WPI. + Non-root use of -C flag, dangerous -f flags, and use of -oQ + by non-root users were not put into + X-Authentication-Warning:s as intended because the + config file hadn't set the PrivacyFlags yet. Fix + from Sven-Ove Westberg of the University of Lulea. + Under very odd circumstances, the alias file rebuild code + could get confused as to whether a database was + open or not. + Check "vendor code" on the end of V lines -- this is + intended to provide a hook for vendor-specific + configuration syntax. (This is a "new feature", + but I've made an exception to my rule in a belief + that this is a highly exceptional case.) + Portability fixes for DG/UX (from Douglas Anderson of NCSC), + SCO Unix (from Murray Kucherawy), A/UX, and OSF/1 + (from Jon Forrest of UC Berkeley) + CONFIG: fix ``mailer:host'' form of UUCP relay naming. + 8.6.1/8.6 93/10/08 Portability fixes for A/UX and Encore UMAX V. Fix error message handling -- if you had a name server down *** cf/m4/proto.m4.OLD Thu Oct 14 09:16:38 1993 --- cf/m4/proto.m4 Fri Oct 15 08:35:24 1993 *************** *** 34,40 **** # divert(0) ! VERSIONID(`@(#)proto.m4 8.18 (Berkeley) 10/2/93') MAILER(local)dnl --- 34,40 ---- # divert(0) ! VERSIONID(`@(#)proto.m4 8.19 (Berkeley) 10/15/93') MAILER(local)dnl *************** *** 574,586 **** ifdef(`_NO_UUCP_', `dnl', `# resolve remotely connected UUCP links (if any) ifdef(`_CLASS_V_', ! `R$* < @ $=V . UUCP > $* $: $>_SET_95_ < $V > <@ $V> : $1 @ $2.UUCP $3', `dnl') ifdef(`_CLASS_W_', ! `R$* < @ $=W . UUCP > $* $: $>_SET_95_ < $W > <@ $W> : $1 @ $2.UUCP $3', `dnl') ifdef(`_CLASS_X_', ! `R$* < @ $=X . UUCP > $* $: $>_SET_95_ < $X > <@ $X> : $1 @ $2.UUCP $3', `dnl')') # resolve fake top level domains by forwarding to other hosts --- 574,586 ---- ifdef(`_NO_UUCP_', `dnl', `# resolve remotely connected UUCP links (if any) ifdef(`_CLASS_V_', ! `R$* < @ $=V . UUCP > $* $: $>_SET_95_ < $V > $1 <@$2.UUCP> $3', `dnl') ifdef(`_CLASS_W_', ! `R$* < @ $=W . UUCP > $* $: $>_SET_95_ < $W > $1 <@$2.UUCP> $3', `dnl') ifdef(`_CLASS_X_', ! `R$* < @ $=X . UUCP > $* $: $>_SET_95_ < $X > $1 <@$2.UUCP> $3', `dnl')') # resolve fake top level domains by forwarding to other hosts *************** *** 598,604 **** ifdef(`UUCP_RELAY', `# forward non-local UUCP traffic to our UUCP relay ! R$*<@$*.UUCP>$* $: $>_SET_95_ < $Y > <@ $Y> : $1 @ $2.UUCP $3 uucp mail', `ifdef(`_MAILER_uucp_', `# forward other UUCP traffic straight to UUCP R< @ $+ .UUCP > : $+ $#uucp $@ $1 $: $2 @host.UUCP:... --- 598,604 ---- ifdef(`UUCP_RELAY', `# forward non-local UUCP traffic to our UUCP relay ! R$*<@$*.UUCP>$* $: $>_SET_95_ < $Y > $1 @ <$2.UUCP> $3 uucp mail', `ifdef(`_MAILER_uucp_', `# forward other UUCP traffic straight to UUCP R< @ $+ .UUCP > : $+ $#uucp $@ $1 $: $2 @host.UUCP:... *** cf/m4/version.m4.OLD Fri Oct 15 09:01:24 1993 --- cf/m4/version.m4 Fri Oct 15 08:58:31 1993 *************** *** 32,39 **** # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # ! VERSIONID(`@(#)version.m4 8.6 (Berkeley) 10/5/93') # divert(0) # Configuration version number ! DZ8.6 --- 32,39 ---- # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # ! VERSIONID(`@(#)version.m4 8.6.1.2 (Berkeley) 10/15/93') # divert(0) # Configuration version number ! DZ8.6.2 *** src/Makefile.OSF1.OLD Thu Oct 14 06:45:06 1993 --- src/Makefile.OSF1 Fri Oct 15 08:17:06 1993 *************** *** 5,11 **** # old make program (I recommend that you get and port the new make if you # are going to be doing any signficant work on sendmail). # ! # This has been tested on OSF/1 T1.3-4. # # use O=-O (usual) or O=-g (debugging) --- 5,11 ---- # old make program (I recommend that you get and port the new make if you # are going to be doing any signficant work on sendmail). # ! # This has been tested on OSF/1 1.3 # # use O=-O (usual) or O=-g (debugging) *************** *** 38,53 **** BINDIR= ${DESTDIR}/usr/sbin # location of sendmail.st file (usually /var/log or /usr/lib) ! STDIR= ${DESTDIR}/var/log # location of sendmail.hf file (usually /usr/share/misc or /usr/lib) ! HFDIR= ${DESTDIR}/usr/share/misc # additional .o files needed OBJADD= # additional link flags ! LDADD= -non_shared ################### end of user configuration flags ###################### --- 38,53 ---- BINDIR= ${DESTDIR}/usr/sbin # location of sendmail.st file (usually /var/log or /usr/lib) ! STDIR= ${DESTDIR}/var/adm/sendmail # location of sendmail.hf file (usually /usr/share/misc or /usr/lib) ! HFDIR= ${DESTDIR}/usr/share/lib # additional .o files needed OBJADD= # additional link flags ! LDADD= ################### end of user configuration flags ###################### *************** *** 59,65 **** savemail.o srvrsmtp.o stab.o stats.o sysexits.o \ trace.o udb.o usersmtp.o util.o version.o ${OBJADD} ! LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq BINOWN= root BINGRP= kmem BINMODE=6555 --- 59,65 ---- savemail.o srvrsmtp.o stab.o stats.o sysexits.o \ trace.o udb.o usersmtp.o util.o version.o ${OBJADD} ! LINKS= ${BINDIR}/newaliases ${BINDIR}/mailq BINOWN= root BINGRP= kmem BINMODE=6555 *** src/READ_ME.OLD Tue Oct 12 15:38:34 1993 --- src/READ_ME Fri Oct 15 08:35:08 1993 *************** *** 30,36 **** # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # ! # @(#)READ_ME 8.28 (Berkeley) 10/8/93 # This directory contains the source files for sendmail. --- 30,36 ---- # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # ! # @(#)READ_ME 8.29 (Berkeley) 10/15/93 # This directory contains the source files for sendmail. *************** *** 66,72 **** --- 66,75 ---- 2.4.x. THERE IS A BUG IN THE GCC OPTIMIZER THAT CAUSES SENDMAIL TO FAIL MISERABLY. + IMPORTANT: Read the appropriate paragraphs in the section on + ``Operating System and Compile Quirks''. + +----------------------+ | DATABASE DEFINITIONS | +----------------------+ *************** *** 359,364 **** --- 362,410 ---- extern int opterr; extern int optind; + A/UX + Date: Tue, 12 Oct 1993 18:28:28 -0400 (EDT) + From: "Eric C. Hagberg" + Subject: Fix for A/UX ndbm + + I guess this isn't really a sendmail bug, however, it is something + that A/UX users should be aware of when compiling sendmail 8.6. + + Apparently, the calls that sendmail is using to the ndbm routines + in A/UX 3.0.x contain calls to "broken" routines, in that the + aliases database will break when it gets "just a little big" + (sorry I don't have exact numbers here, but it broke somewhere + around 20-25 aliases for me.), making all aliases non-functional + after exceeding this point. + + What I did was to get the gnu-dbm-1.6 package, compile it, and + then re-compile sendmail with "-lgdbm", "-DNDBM", and using the + ndbm.h header file that comes with the gnu-package. This makes + things behave properly. + + I suppose porting the New Berkeley db package is another route, + however, I made a quick attempt at it, and found it difficult + (not easy at least); the gnu-dbm package "configured" and + compiled easily. + + DG/UX + Apparently, /bin/mail doesn't work properly for delivery on + DG/UX -- the person who has this working, Douglas Anderson + , used procmail instead. + + Non-DNS based sites + This version of sendmail always tries to connect to the Domain + Name System (DNS) to resolve names, regardless of the setting + of the `I' option. On most systems that are not running DNS, + this will fail quickly and sendmail will continue, but on some + systems it has a long timeout. If you have this problem, you + will have to recompile without NAMED_BIND. Some people have + claimed that they have successfully used "OI+USEVC" to force + sendmail to use a virtual circuit -- this will always time out + quickly, but also tells sendmail that a failed connection + should requeue the message (probably not what you intended). + A future release of sendmail will correct this problem. + Both NEWDB and NDBM If you use both -DNDBM and -DNEWDB, you must delete the module ndbm.o from libdb.a and delete the file "ndbm.h" from the files *************** *** 434,437 **** Eric Allman ! (Version 8.28, last update 10/8/93 16:01:04) --- 480,483 ---- Eric Allman ! (Version 8.29, last update 10/15/93 08:34:06) *** src/alias.c.OLD Fri Oct 15 05:40:30 1993 --- src/alias.c Fri Oct 15 08:35:20 1993 *************** *** 36,42 **** # include #ifndef lint ! static char sccsid[] = "@(#)alias.c 8.16 (Berkeley) 9/25/93"; #endif /* not lint */ --- 36,42 ---- # include #ifndef lint ! static char sccsid[] = "@(#)alias.c 8.17 (Berkeley) 10/15/93"; #endif /* not lint */ *************** *** 279,289 **** ** ALIASWAIT -- wait for distinguished @:@ token to appear. ** ** This can decide to reopen or rebuild the alias file */ ! aliaswait(map, ext) MAP *map; char *ext; { int atcnt; time_t mtime; --- 279,303 ---- ** ALIASWAIT -- wait for distinguished @:@ token to appear. ** ** This can decide to reopen or rebuild the alias file + ** + ** Parameters: + ** map -- a pointer to the map descriptor for this alias file. + ** ext -- the filename extension (e.g., ".db") for the + ** database file. + ** isopen -- if set, the database is already open, and we + ** should check for validity; otherwise, we are + ** just checking to see if it should be created. + ** + ** Returns: + ** TRUE -- if the database is open when we return. + ** FALSE -- if the database is closed when we return. */ ! bool ! aliaswait(map, ext, isopen) MAP *map; char *ext; + int isopen; { int atcnt; time_t mtime; *************** *** 302,308 **** { auto int st; ! while (atcnt-- >= 0 && map->map_class->map_lookup(map, "@", NULL, &st) == NULL) { /* --- 316,322 ---- { auto int st; ! while (isopen && atcnt-- >= 0 && map->map_class->map_lookup(map, "@", NULL, &st) == NULL) { /* *************** *** 315,321 **** map->map_class->map_close(map); sleep(30); ! map->map_class->map_open(map, O_RDONLY); } } --- 329,335 ---- map->map_class->map_close(map); sleep(30); ! isopen = map->map_class->map_open(map, O_RDONLY); } } *************** *** 325,331 **** if (tTd(27, 3)) printf("aliaswait: not rebuildable\n"); map->map_mflags &= ~MF_ALIASWAIT; ! return; } if (stat(map->map_file, &stb) < 0) { --- 339,345 ---- if (tTd(27, 3)) printf("aliaswait: not rebuildable\n"); map->map_mflags &= ~MF_ALIASWAIT; ! return isopen; } if (stat(map->map_file, &stb) < 0) { *************** *** 332,338 **** if (tTd(27, 3)) printf("aliaswait: no source file\n"); map->map_mflags &= ~MF_ALIASWAIT; ! return; } mtime = stb.st_mtime; (void) strcpy(buf, map->map_file); --- 346,352 ---- if (tTd(27, 3)) printf("aliaswait: no source file\n"); map->map_mflags &= ~MF_ALIASWAIT; ! return isopen; } mtime = stb.st_mtime; (void) strcpy(buf, map->map_file); *************** *** 344,350 **** --- 358,367 ---- if (AutoRebuild && stb.st_ino != 0 && stb.st_uid == geteuid()) { message("auto-rebuilding alias database %s", buf); + if (isopen) + map->map_class->map_close(map); rebuildaliases(map, TRUE); + isopen = map->map_class->map_open(map, O_RDONLY); } else { *************** *** 357,362 **** --- 374,380 ---- } } map->map_mflags &= ~MF_ALIASWAIT; + return isopen; } /* ** REBUILDALIASES -- rebuild the alias database. *** src/collect.c.OLD Thu Oct 14 07:54:22 1993 --- src/collect.c Fri Oct 15 08:35:10 1993 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)collect.c 8.4 (Berkeley) 8/6/93"; #endif /* not lint */ # include --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)collect.c 8.5 (Berkeley) 10/15/93"; #endif /* not lint */ # include *************** *** 72,77 **** --- 72,78 ---- bool ignrdot = smtpmode ? FALSE : IgnrDot; char buf[MAXLINE], buf2[MAXLINE]; register char *workbuf, *freebuf; + bool inputerr = FALSE; extern char *hvalue(); extern bool isheader(), flusheol(); *************** *** 245,251 **** ** Collect the body of the message. */ ! do { register char *bp = buf; --- 246,252 ---- ** Collect the body of the message. */ ! for (;;) { register char *bp = buf; *************** *** 269,278 **** fputs("\n", tf); if (ferror(tf)) tferror(tf, e); ! } while (sfgets(buf, MAXLINE, InChannel, TimeOuts.to_datablock, ! "message body read") != NULL); readerr: if (fflush(tf) != 0) tferror(tf, e); (void) fsync(fileno(tf)); --- 270,286 ---- fputs("\n", tf); if (ferror(tf)) tferror(tf, e); ! if (sfgets(buf, MAXLINE, InChannel, TimeOuts.to_datablock, ! "message body read") == NULL) ! goto readerr; ! } + if (feof(InChannel) || ferror(InChannel)) + { readerr: + inputerr = TRUE; + } + if (fflush(tf) != 0) tferror(tf, e); (void) fsync(fileno(tf)); *************** *** 279,301 **** (void) fclose(tf); /* An EOF when running SMTP is an error */ ! if ((feof(InChannel) || ferror(InChannel)) && OpMode == MD_SMTP) { char *host; host = RealHostName; if (host == NULL) host = "localhost"; # ifdef LOG if (LogLevel > 0 && feof(InChannel)) syslog(LOG_NOTICE, ! "collect: unexpected close on connection from %s, sender=%s: %m\n", ! host, e->e_from.q_paddr); # endif (feof(InChannel) ? usrerr : syserr) ! ("451 collect: unexpected close on connection from %s, from=%s", ! host, e->e_from.q_paddr); /* don't return an error indication */ e->e_to = NULL; --- 287,316 ---- (void) fclose(tf); /* An EOF when running SMTP is an error */ ! if (inputerr && OpMode == MD_SMTP) { char *host; + char *problem; host = RealHostName; if (host == NULL) host = "localhost"; + if (feof(InChannel)) + problem = "unexpected close"; + else if (ferror(InChannel)) + problem = "I/O error"; + else + problem = "read timeout"; # ifdef LOG if (LogLevel > 0 && feof(InChannel)) syslog(LOG_NOTICE, ! "collect: %s on connection from %s, sender=%s: %m\n", ! problem, host, e->e_from.q_paddr); # endif (feof(InChannel) ? usrerr : syserr) ! ("451 collect: %s on connection from %s, from=%s", ! problem, host, e->e_from.q_paddr); /* don't return an error indication */ e->e_to = NULL; *************** *** 303,308 **** --- 318,325 ---- e->e_flags |= EF_CLRQUEUE; /* and don't try to deliver the partial message either */ + if (InChild) + ExitStat = EX_QUIT; finis(); } *** src/conf.c.OLD Tue Oct 12 06:45:47 1993 --- src/conf.c Fri Oct 15 08:35:19 1993 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)conf.c 8.40 (Berkeley) 10/8/93"; #endif /* not lint */ # include "sendmail.h" --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)conf.c 8.41 (Berkeley) 10/15/93"; #endif /* not lint */ # include "sendmail.h" *************** *** 756,761 **** --- 756,777 ---- #else #if LA_TYPE == LA_SUBR + #ifdef DGUX + + #include + + int getla() + { + struct dg_sys_info_load_info load_info; + + dg_sys_info((long *)&load_info, + DG_SYS_INFO_LOAD_INFO_TYPE, DG_SYS_INFO_LOAD_VERSION_0); + + return((int) (load_info.one_minute + 0.5)); + } + + #else + getla() { double avenrun[3]; *************** *** 771,776 **** --- 787,793 ---- return ((int) (avenrun[0] + 0.5)); } + #endif /* DGUX */ #else #if LA_TYPE == LA_MACH *************** *** 1191,1196 **** --- 1208,1235 ---- #endif /* + ** DGUX_INET_ADDR -- inet_addr for DG/UX + ** + ** Data General DG/UX version of inet_addr returns a struct in_addr + ** instead of a long. This patches things. + */ + + #ifdef DGUX + + #undef inet_addr + + long + dgux_inet_addr(host) + char *host; + { + struct in_addr haddr; + + haddr = inet_addr(host); + return haddr.s_addr; + } + + #endif + /* ** GETOPT -- for old systems or systems with bogus implementations */ *************** *** 1341,1347 **** #endif #ifdef HASSTATFS ! # if defined(IRIX) || defined(apollo) || defined(_SCO_unix_) || defined(UMAXV) # include # else # if (defined(sun) && !defined(BSD)) || defined(__hpux) || defined(_CONVEX_SOURCE) || defined(NeXT) || defined(_AUX_SOURCE) --- 1380,1386 ---- #endif #ifdef HASSTATFS ! # if defined(IRIX) || defined(apollo) || defined(_SCO_unix_) || defined(UMAXV) || defined(DGUX) # include # else # if (defined(sun) && !defined(BSD)) || defined(__hpux) || defined(_CONVEX_SOURCE) || defined(NeXT) || defined(_AUX_SOURCE) *************** *** 1381,1387 **** # if defined(HASUSTAT) if (stat(dir, &statbuf) == 0 && ustat(statbuf.st_dev, &fs) == 0) # else ! # if defined(IRIX) || defined(apollo) || defined(UMAXV) if (statfs(dir, &fs, sizeof fs, 0) == 0) # else # if defined(ultrix) --- 1420,1426 ---- # if defined(HASUSTAT) if (stat(dir, &statbuf) == 0 && ustat(statbuf.st_dev, &fs) == 0) # else ! # if defined(IRIX) || defined(apollo) || defined(UMAXV) || defined(DGUX) if (statfs(dir, &fs, sizeof fs, 0) == 0) # else # if defined(ultrix) *************** *** 1686,1689 **** --- 1725,1745 ---- if (ConfFile != NULL) return ConfFile; return _PATH_SENDMAILCF; + } + /* + ** SETVENDOR -- process vendor code from V configuration line + ** + ** Parameters: + ** vendor -- string representation of vendor. + ** + ** Returns: + ** TRUE -- if ok. + ** FALSE -- if vendor code could not be processed. + */ + + bool + setvendor(vendor) + char *vendor; + { + return (strcasecmp(vendor, "Berkeley") == 0); } *** src/conf.h.OLD Tue Oct 12 06:46:10 1993 --- src/conf.h Fri Oct 15 08:35:10 1993 *************** *** 31,37 **** * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ! * @(#)conf.h 8.37 (Berkeley) 10/8/93 */ /* --- 31,37 ---- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ! * @(#)conf.h 8.38 (Berkeley) 10/15/93 */ /* *************** *** 191,197 **** --- 191,216 ---- # endif #endif + /* + ** DG/UX 5.4.2 + */ + #ifdef DGUX + # define SYSTEM5 1 + # define LA_TYPE LA_SUBR + # define HASSTATFS 1 /* has the statfs(2) syscall */ + # define HASSETREUID 1 /* has setreuid(2) call */ + # define HASUNAME 1 /* use System V uname(2) system call */ + # define HASSETSID 1 /* has Posix setsid(2) call */ + # define HASINITGROUPS 1 /* has initgroups(3) call */ + # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ + # undef IDENTPROTO /* TCP/IP implementation is broken */ + # undef SETPROCTITLE + # define inet_addr dgux_inet_addr + extern long dgux_inet_addr(); + #endif + + /* ** Digital Ultrix 4.2A or 4.3 ** *************** *** 302,308 **** # define HASSTATFS 1 /* has the statfs(2) syscall */ # define FORK fork # define MAXPATHLEN PATHSIZE ! # define LA_TYPE LA_ZERO #endif --- 321,327 ---- # define HASSTATFS 1 /* has the statfs(2) syscall */ # define FORK fork # define MAXPATHLEN PATHSIZE ! # define LA_TYPE LA_SHORT #endif *************** *** 385,390 **** --- 404,410 ---- # define HASUSTAT 1 /* use System V ustat(2) syscall */ # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ # define SIGFUNC_DEFINED /* sigfunc_t already defined */ + # undef IDENTPROTO /* TCP/IP implementation is broken */ # define FORK fork # ifndef _PATH_SENDMAILCF # define _PATH_SENDMAILCF "/usr/lib/sendmail.cf" *************** *** 457,464 **** /* general POSIX defines */ #ifdef _POSIX_VERSION ! # define HASSETSID 1 /* has setsid(2) call */ ! # define HASWAITPID 1 /* has waitpid(2) call */ #endif /* --- 477,484 ---- /* general POSIX defines */ #ifdef _POSIX_VERSION ! # define HASSETSID 1 /* has Posix setsid(2) call */ ! # define HASWAITPID 1 /* has Posix waitpid(2) call */ #endif /* *************** *** 497,502 **** --- 517,526 ---- # ifndef EX_CONFIG # define EX_CONFIG 78 /* configuration error */ # endif + + /* pseudo-code used in server SMTP */ + # define EX_QUIT 22 /* drop out of server immediately */ + /* ** These are used in a few cases where we need some special *** src/deliver.c.OLD Sat Oct 9 08:05:12 1993 --- src/deliver.c Fri Oct 15 08:35:18 1993 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)deliver.c 8.30 (Berkeley) 10/8/93"; #endif /* not lint */ #include "sendmail.h" --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)deliver.c 8.31 (Berkeley) 10/15/93"; #endif /* not lint */ #include "sendmail.h" *************** *** 592,597 **** --- 592,598 ---- char rpathbuf[MAXNAME]; /* translated return path */ extern int checkcompat(); extern FILE *fdopen(); + extern char SmtpError[]; errno = 0; if (bitset(QDONTSEND|QBADADDR|QQUEUEUP, to->q_flags)) *************** *** 609,614 **** --- 610,616 ---- host = to->q_host; CurEnv = e; /* just in case */ e->e_statmsg = NULL; + SmtpError[0] = '\0'; if (tTd(10, 1)) printf("\n--deliver, mailer=%d, host=`%s', first user=`%s'\n", *************** *** 719,725 **** *pvp = NULL; # else /* SMTP */ /* oops! we don't implement SMTP */ ! syserr("554 SMTP style mailer"); return (EX_SOFTWARE); # endif /* SMTP */ } --- 721,727 ---- *pvp = NULL; # else /* SMTP */ /* oops! we don't implement SMTP */ ! syserr("554 SMTP style mailer not implemented"); return (EX_SOFTWARE); # endif /* SMTP */ } *************** *** 929,934 **** --- 931,937 ---- curhost = NULL; SmtpPhase = NULL; + mci = NULL; #ifdef XDEBUG { *************** *** 940,946 **** } #endif - /* check for Local Person Communication -- not for mortals!!! */ if (strcmp(m->m_mailer, "[LPC]") == 0) { --- 943,948 ---- *************** *** 971,977 **** if (!clever) { syserr("554 non-clever IPC"); ! rcode = EX_OSERR; goto give_up; } if (pv[2] != NULL) --- 973,979 ---- if (!clever) { syserr("554 non-clever IPC"); ! rcode = EX_CONFIG; goto give_up; } if (pv[2] != NULL) *************** *** 979,996 **** else port = 0; tryhost: - mci = NULL; while (*curhost != '\0') { register char *p; static char hostbuf[MAXNAME]; - mci = NULL; - /* pull the next host from the signature */ p = strchr(curhost, ':'); if (p == NULL) p = &curhost[strlen(curhost)]; strncpy(hostbuf, curhost, p - curhost); hostbuf[p - curhost] = '\0'; if (*p != '\0') --- 981,1000 ---- else port = 0; tryhost: while (*curhost != '\0') { register char *p; static char hostbuf[MAXNAME]; /* pull the next host from the signature */ p = strchr(curhost, ':'); if (p == NULL) p = &curhost[strlen(curhost)]; + if (p == curhost) + { + syserr("deliver: null host name in signature"); + continue; + } strncpy(hostbuf, curhost, p - curhost); hostbuf[p - curhost] = '\0'; if (*p != '\0') *************** *** 1038,1053 **** printf("openmailer: makeconnection => stat=%d, errno=%d\n", i, errno); - /* enter status of this host */ setstat(i); } mci->mci_pid = 0; #else /* no DAEMON */ syserr("554 openmailer: no IPC"); if (tTd(11, 1)) printf("openmailer: NULL\n"); ! return NULL; #endif /* DAEMON */ } else --- 1042,1065 ---- printf("openmailer: makeconnection => stat=%d, errno=%d\n", i, errno); /* enter status of this host */ setstat(i); + + /* should print some message here for -v mode */ } + if (mci == NULL) + { + syserr("deliver: no host name"); + rcode = EX_OSERR; + goto give_up; + } mci->mci_pid = 0; #else /* no DAEMON */ syserr("554 openmailer: no IPC"); if (tTd(11, 1)) printf("openmailer: NULL\n"); ! rcode = EX_UNAVAILABLE; ! goto give_up; #endif /* DAEMON */ } else *************** *** 1388,1394 **** #endif /* arrange a return receipt if requested */ ! if (e->e_receiptto != NULL && bitnset(M_LOCALMAILER, m->m_flags)) { e->e_flags |= EF_SENDRECEIPT; /* do we want to send back more info? */ --- 1400,1407 ---- #endif /* arrange a return receipt if requested */ ! if (rcode == EX_OK && e->e_receiptto != NULL && ! bitnset(M_LOCALMAILER, m->m_flags)) { e->e_flags |= EF_SENDRECEIPT; /* do we want to send back more info? */ *************** *** 1412,1417 **** --- 1425,1436 ---- { to->q_flags |= QSENT; e->e_nsent++; + if (e->e_receiptto != NULL && + bitnset(M_LOCALMAILER, m->m_flags)) + { + fprintf(e->e_xfp, "%s... Successfully delivered\n", + to->q_paddr); + } } } *************** *** 1641,1647 **** --- 1660,1672 ---- */ if (stat == EX_OK || stat == EX_TEMPFAIL) + { + extern char MsgBuf[]; + message(&statmsg[4], errstring(errno)); + if (stat == EX_TEMPFAIL && e->e_xfp != NULL) + fprintf(e->e_xfp, "%s\n", &MsgBuf[4]); + } else { Errors++; *************** *** 1853,1859 **** if (ferror(e->e_dfp)) { ! syserr("putbody: read error"); ExitStat = EX_IOERR; } } --- 1878,1884 ---- if (ferror(e->e_dfp)) { ! syserr("putbody: %s: read error", e->e_df); ExitStat = EX_IOERR; } } *** src/main.c.OLD Tue Oct 12 13:18:02 1993 --- src/main.c Fri Oct 15 08:35:09 1993 *************** *** 39,45 **** #endif /* not lint */ #ifndef lint ! static char sccsid[] = "@(#)main.c 8.29 (Berkeley) 10/8/93"; #endif /* not lint */ #define _DEFINE --- 39,45 ---- #endif /* not lint */ #ifndef lint ! static char sccsid[] = "@(#)main.c 8.30 (Berkeley) 10/15/93"; #endif /* not lint */ #define _DEFINE *************** *** 99,104 **** --- 99,105 ---- /* saved user environment */ char RealUserName[256]; /* the actual user id on this host */ char *CommandLineArgs; /* command line args for pid file */ + bool Warn_Q_option = FALSE; /* warn about Q option use */ /* ** Pointers for setproctitle. *************** *** 136,141 **** --- 137,144 ---- int j; bool queuemode = FALSE; /* process queue requests */ bool safecf = TRUE; + bool warn_C_flag = FALSE; + char warn_f_flag = '\0'; static bool reenter = FALSE; char *argv0 = argv[0]; struct passwd *pw; *************** *** 450,458 **** case 'C': /* select configuration file (already done) */ if (RealUid != 0) ! auth_warning(CurEnv, ! "Processed by %s with -C %s", ! RealUserName, optarg); ConfFile = optarg; (void) setgid(RealGid); (void) setuid(RealUid); --- 453,459 ---- case 'C': /* select configuration file (already done) */ if (RealUid != 0) ! warn_C_flag = TRUE; ConfFile = optarg; (void) setgid(RealGid); (void) setuid(RealUid); *************** *** 472,480 **** } from = newstr(optarg); if (strcmp(RealUserName, from) != 0) ! auth_warning(CurEnv, ! "%s set sender to %s using -%c", ! RealUserName, from, j); break; case 'F': /* set full name */ --- 473,479 ---- } from = newstr(optarg); if (strcmp(RealUserName, from) != 0) ! warn_f_flag = j; break; case 'F': /* set full name */ *************** *** 617,622 **** --- 616,634 ---- xputs(macvalue('k', CurEnv)); printf("\n"); } + + /* + ** Process authorization warnings from command line. + */ + + if (warn_C_flag) + auth_warning(CurEnv, "Processed by %s with -C %s", + RealUserName, ConfFile); + if (warn_f_flag != '\0') + auth_warning(CurEnv, "%s set sender to %s using -%c", + RealUserName, from, warn_f_flag); + if (Warn_Q_option) + auth_warning(CurEnv, "Processed from queue %s", QueueDir); /* Enforce use of local time (null string overrides this) */ if (TimeZoneSpec == NULL) *** src/map.c.OLD Thu Oct 14 19:25:28 1993 --- src/map.c Fri Oct 15 08:35:20 1993 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)map.c 8.16 (Berkeley) 10/1/93"; #endif /* not lint */ #include "sendmail.h" --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)map.c 8.17 (Berkeley) 10/15/93"; #endif /* not lint */ #include "sendmail.h" *************** *** 85,90 **** --- 85,92 ---- */ #define DBMMODE 0644 + + extern bool aliaswait __P((MAP *, char *, int)); /* ** MAP_PARSEARGS -- parse config line arguments for database lookup ** *************** *** 423,428 **** --- 425,434 ---- dbm = dbm_open(map->map_file, mode, DBMMODE); if (dbm == NULL) { + #ifdef MAYBENEXTRELEASE + if (aliaswait(map, ".pag", FALSE)) + return TRUE; + #endif if (!bitset(MF_OPTIONAL, map->map_mflags)) syserr("Cannot open DBM database %s", map->map_file); return FALSE; *************** *** 429,436 **** } map->map_db1 = (void *) dbm; if (mode == O_RDONLY && bitset(MF_ALIAS, map->map_mflags)) ! aliaswait(map, ".pag"); ! if (fstat(dbm_dirfno(dbm), &st) >= 0) map->map_mtime = st.st_mtime; return TRUE; } --- 435,443 ---- } map->map_db1 = (void *) dbm; if (mode == O_RDONLY && bitset(MF_ALIAS, map->map_mflags)) ! if (!aliaswait(map, ".pag", TRUE)) ! return FALSE; ! if (fstat(dbm_dirfno((DBM *) map->map_db1), &st) >= 0) map->map_mtime = st.st_mtime; return TRUE; } *************** *** 621,626 **** --- 628,637 ---- db = dbopen(buf, omode, DBMMODE, DB_BTREE, NULL); if (db == NULL) { + #ifdef MAYBENEXTRELEASE + if (aliaswait(map, ".db", FALSE)) + return TRUE; + #endif if (!bitset(MF_OPTIONAL, map->map_mflags)) syserr("Cannot open BTREE database %s", map->map_file); return FALSE; *************** *** 654,660 **** map->map_db2 = (void *) db; if (mode == O_RDONLY && bitset(MF_ALIAS, map->map_mflags)) ! aliaswait(map, ".db"); return TRUE; } --- 665,672 ---- map->map_db2 = (void *) db; if (mode == O_RDONLY && bitset(MF_ALIAS, map->map_mflags)) ! if (!aliaswait(map, ".db", TRUE)) ! return FALSE; return TRUE; } *************** *** 700,705 **** --- 712,721 ---- db = dbopen(buf, omode, DBMMODE, DB_HASH, NULL); if (db == NULL) { + #ifdef MAYBENEXTRELEASE + if (aliaswait(map, ".db", FALSE)) + return TRUE; + #endif if (!bitset(MF_OPTIONAL, map->map_mflags)) syserr("Cannot open HASH database %s", map->map_file); return FALSE; *************** *** 733,739 **** map->map_db2 = (void *) db; if (mode == O_RDONLY && bitset(MF_ALIAS, map->map_mflags)) ! aliaswait(map, ".db"); return TRUE; } --- 749,756 ---- map->map_db2 = (void *) db; if (mode == O_RDONLY && bitset(MF_ALIAS, map->map_mflags)) ! if (!aliaswait(map, ".db", TRUE)) ! return FALSE; return TRUE; } *************** *** 1185,1195 **** struct stat stb; if (tTd(38, 2)) ! printf("impl_map_open(%s)\n", map->map_file); if (stat(map->map_file, &stb) < 0) { /* no alias file at all */ return FALSE; } --- 1202,1214 ---- struct stat stb; if (tTd(38, 2)) ! printf("impl_map_open(%s, %d)\n", map->map_file, mode); if (stat(map->map_file, &stb) < 0) { /* no alias file at all */ + if (tTd(38, 3)) + printf("no map file\n"); return FALSE; } *** src/readcf.c.OLD Tue Oct 12 14:40:28 1993 --- src/readcf.c Fri Oct 15 08:35:16 1993 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)readcf.c 8.12 (Berkeley) 9/5/93"; #endif /* not lint */ # include "sendmail.h" --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)readcf.c 8.13 (Berkeley) 10/15/93"; #endif /* not lint */ # include "sendmail.h" *************** *** 70,76 **** ** Args specify mailer parameters. ** Oxvalue Set option x to value. ** Pname=value Set precedence name to value. ! ** Vversioncode Version level of configuration syntax. ** Kmapname mapclass arguments.... ** Define keyed lookup of a given class. ** Arguments are class dependent. --- 70,78 ---- ** Args specify mailer parameters. ** Oxvalue Set option x to value. ** Pname=value Set precedence name to value. ! ** Vversioncode[/vendorcode] ! ** Version level/vendor name of ! ** configuration syntax. ** Kmapname mapclass arguments.... ** Define keyed lookup of a given class. ** Arguments are class dependent. *************** *** 98,103 **** --- 100,106 ---- char *q; struct rewrite *rwp = NULL; char *bp; + auto char *ep; int nfuzzy; char *file; bool optional; *************** *** 205,210 **** --- 208,214 ---- } /* interpret this line */ + errno = 0; switch (bp[0]) { case '\0': *************** *** 492,498 **** &bp[1]); break; } ! ConfigLevel = atoi(p); if (ConfigLevel >= 5) { /* level 5 configs have short name in $w */ --- 496,502 ---- &bp[1]); break; } ! ConfigLevel = strtol(p, &ep, 10); if (ConfigLevel >= 5) { /* level 5 configs have short name in $w */ *************** *** 500,505 **** --- 504,520 ---- if (p != NULL && (p = strchr(p, '.')) != NULL) *p = '\0'; } + if (*ep++ == '/') + { + /* extract vendor code */ + for (p = ep; isascii(*p) && isalpha(*p); ) + p++; + *p = '\0'; + + if (!setvendor(ep)) + syserr("invalid V line vendor code: \"%s\"", + ep); + } break; case 'K': *************** *** 1022,1027 **** --- 1037,1043 ---- extern time_t convtime(); extern int QueueLA; extern int RefuseLA; + extern bool Warn_Q_option; extern bool trusteduser(); if (tTd(37, 1)) *************** *** 1334,1340 **** else QueueDir = newstr(val); if (RealUid != 0 && !safe) ! auth_warning(e, "Processed from queue %s", QueueDir); break; case 'R': /* don't prune routes */ --- 1350,1356 ---- else QueueDir = newstr(val); if (RealUid != 0 && !safe) ! Warn_Q_option = TRUE; break; case 'R': /* don't prune routes */ *** src/savemail.c.OLD Wed Oct 13 15:49:35 1993 --- src/savemail.c Fri Oct 15 08:35:15 1993 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)savemail.c 8.13 (Berkeley) 9/26/93"; #endif /* not lint */ # include "sendmail.h" --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)savemail.c 8.14 (Berkeley) 10/15/93"; #endif /* not lint */ # include "sendmail.h" *************** *** 598,604 **** ** Output introductory information. */ ! sprintf(buf, "The original message was received at %s", arpadate(NULL)); putline(buf, fp, m); expand("from \201_", buf, &buf[sizeof buf - 1], e->e_parent); putline(buf, fp, m); --- 598,620 ---- ** Output introductory information. */ ! for (q = e->e_parent->e_sendqueue; q != NULL; q = q->q_next) ! if (bitset(QBADADDR, q->q_flags)) ! break; ! if (q == NULL) ! { ! putline(" **********************************************", ! fp, m); ! putline(" ** THIS IS A WARNING MESSAGE ONLY **", ! fp, m); ! putline(" ** YOU DO NOT NEED TO RESEND YOUR MESSAGE **", ! fp, m); ! putline(" **********************************************", ! fp, m); ! putline("", fp, m); ! } ! sprintf(buf, "The original message was received at %s", ! arpadate(ctime(&e->e_parent->e_ctime))); putline(buf, fp, m); expand("from \201_", buf, &buf[sizeof buf - 1], e->e_parent); putline(buf, fp, m); *** src/sendmail.h.OLD Thu Oct 14 07:55:20 1993 --- src/sendmail.h Fri Oct 15 08:35:14 1993 *************** *** 31,37 **** * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ! * @(#)sendmail.h 8.23 (Berkeley) 9/25/93 */ /* --- 31,37 ---- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ! * @(#)sendmail.h 8.24 (Berkeley) 10/15/93 */ /* *************** *** 41,47 **** # ifdef _DEFINE # define EXTERN # ifndef lint ! static char SmailSccsId[] = "@(#)sendmail.h 8.23 9/25/93"; # endif # else /* _DEFINE */ # define EXTERN extern --- 41,47 ---- # ifdef _DEFINE # define EXTERN # ifndef lint ! static char SmailSccsId[] = "@(#)sendmail.h 8.24 10/15/93"; # endif # else /* _DEFINE */ # define EXTERN extern *************** *** 803,808 **** --- 803,809 ---- EXTERN bool UseErrorsTo; /* use Errors-To: header (back compat) */ EXTERN bool TryNullMXList; /* if we are the best MX, try host directly */ EXTERN bool CheckLoopBack; /* check for loopback on HELO packet */ + EXTERN bool InChild; /* true if running in an SMTP subprocess */ EXTERN char SpaceSub; /* substitution for */ EXTERN int PrivacyFlags; /* privacy flags */ EXTERN char *ConfFile; /* location of configuration file [conf.c] */ *** src/srvrsmtp.c.OLD Tue Oct 12 06:41:24 1993 --- src/srvrsmtp.c Fri Oct 15 08:35:15 1993 *************** *** 36,44 **** #ifndef lint #ifdef SMTP ! static char sccsid[] = "@(#)srvrsmtp.c 8.16 (Berkeley) 9/30/93 (with SMTP)"; #else ! static char sccsid[] = "@(#)srvrsmtp.c 8.16 (Berkeley) 9/30/93 (without SMTP)"; #endif #endif /* not lint */ --- 36,44 ---- #ifndef lint #ifdef SMTP ! static char sccsid[] = "@(#)srvrsmtp.c 8.17 (Berkeley) 10/15/93 (with SMTP)"; #else ! static char sccsid[] = "@(#)srvrsmtp.c 8.17 (Berkeley) 10/15/93 (without SMTP)"; #endif #endif /* not lint */ *************** *** 113,123 **** NULL, CMDERROR, }; - bool InChild = FALSE; /* true if running in a subprocess */ bool OneXact = FALSE; /* one xaction only this run */ - #define EX_QUIT 22 /* special code for QUIT command */ - static char *skipword(); smtp(e) --- 113,120 ---- *************** *** 488,494 **** e->e_to = p; if (!bitset(QBADADDR, a->q_flags)) { ! message("250 Recipient ok"); nrcpts++; } else --- 485,493 ---- e->e_to = p; if (!bitset(QBADADDR, a->q_flags)) { ! message("250 Recipient ok%s", ! bitset(QQUEUEUP, a->q_flags) ? ! " (will queue)" : ""); nrcpts++; } else *************** *** 506,512 **** message("503 Need MAIL command"); break; } ! else if (e->e_nrcpts <= 0) { message("503 Need RCPT (recipient)"); break; --- 505,511 ---- message("503 Need MAIL command"); break; } ! else if (nrcpts <= 0) { message("503 Need RCPT (recipient)"); break; *** src/usersmtp.c.OLD Sat Oct 9 08:04:58 1993 --- src/usersmtp.c Fri Oct 15 08:35:08 1993 *************** *** 36,44 **** #ifndef lint #ifdef SMTP ! static char sccsid[] = "@(#)usersmtp.c 8.10 (Berkeley) 9/25/93 (with SMTP)"; #else ! static char sccsid[] = "@(#)usersmtp.c 8.10 (Berkeley) 9/25/93 (without SMTP)"; #endif #endif /* not lint */ --- 36,44 ---- #ifndef lint #ifdef SMTP ! static char sccsid[] = "@(#)usersmtp.c 8.11 (Berkeley) 10/15/93 (with SMTP)"; #else ! static char sccsid[] = "@(#)usersmtp.c 8.11 (Berkeley) 10/15/93 (without SMTP)"; #endif #endif /* not lint */ *************** *** 523,528 **** --- 523,538 ---- (*e->e_putbody)(mci->mci_out, m, e, NULL); clrevent(ev); + + if (ferror(mci->mci_out)) + { + /* error during processing -- don't send the dot */ + mci->mci_errno = EIO; + mci->mci_exitstat = EX_IOERR; + mci->mci_state = MCIS_ERROR; + smtpquit(m, mci, e); + return EX_IOERR; + } /* terminate the message */ fprintf(mci->mci_out, ".%s", m->m_eol); *** src/version.c.OLD Sat Oct 9 08:08:26 1993 --- src/version.c Fri Oct 15 08:35:11 1993 *************** *** 33,39 **** */ #ifndef lint ! static char sccsid[] = "@(#)version.c 8.6.1.1 (Berkeley) 10/8/93"; #endif /* not lint */ ! char Version[] = "8.6.1"; --- 33,39 ---- */ #ifndef lint ! static char sccsid[] = "@(#)version.c 8.6.1.2 (Berkeley) 10/15/93"; #endif /* not lint */ ! char Version[] = "8.6.2";