head 1.3; access; symbols perseant-exfatfs-base-20250801:1.3 perseant-exfatfs-base-20240630:1.3 perseant-exfatfs:1.3.0.46 perseant-exfatfs-base:1.3 cjep_sun2x:1.3.0.44 cjep_sun2x-base:1.3 cjep_staticlib_x-base1:1.3 cjep_staticlib_x:1.3.0.42 cjep_staticlib_x-base:1.3 phil-wifi-20200421:1.3 phil-wifi-20200411:1.3 phil-wifi-20200406:1.3 pgoyette-compat-merge-20190127:1.3 pgoyette-compat-20190127:1.3 pgoyette-compat-20190118:1.3 pgoyette-compat-1226:1.3 pgoyette-compat-1126:1.3 pgoyette-compat-1020:1.3 pgoyette-compat-0930:1.3 pgoyette-compat-0906:1.3 pgoyette-compat-0728:1.3 pgoyette-compat-0625:1.3 pgoyette-compat-0521:1.3 pgoyette-compat-0502:1.3 pgoyette-compat-0422:1.3 pgoyette-compat-0415:1.3 pgoyette-compat-0407:1.3 pgoyette-compat-0330:1.3 pgoyette-compat-0322:1.3 pgoyette-compat-0315:1.3 pgoyette-compat:1.3.0.40 pgoyette-compat-base:1.3 perseant-stdc-iso10646:1.3.0.38 perseant-stdc-iso10646-base:1.3 prg-localcount2-base3:1.3 prg-localcount2-base2:1.3 prg-localcount2-base1:1.3 prg-localcount2:1.3.0.36 prg-localcount2-base:1.3 pgoyette-localcount-20170426:1.3 bouyer-socketcan-base1:1.3 pgoyette-localcount-20170320:1.3 bouyer-socketcan:1.3.0.34 bouyer-socketcan-base:1.3 pgoyette-localcount-20170107:1.3 pgoyette-localcount-20161104:1.3 localcount-20160914:1.3 pgoyette-localcount-20160806:1.3 pgoyette-localcount-20160726:1.3 pgoyette-localcount:1.3.0.32 pgoyette-localcount-base:1.3 netbsd-5-2-3-RELEASE:1.3 netbsd-5-1-5-RELEASE:1.3 yamt-pagecache-base9:1.3 yamt-pagecache-tag8:1.3 tls-earlyentropy:1.3.0.28 tls-earlyentropy-base:1.3 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.3 riastradh-drm2-base3:1.3 netbsd-5-2-2-RELEASE:1.3 netbsd-5-1-4-RELEASE:1.3 netbsd-5-2-1-RELEASE:1.3 netbsd-5-1-3-RELEASE:1.3 agc-symver:1.3.0.30 agc-symver-base:1.3 tls-maxphys-base:1.3 yamt-pagecache-base8:1.3 netbsd-5-2:1.3.0.26 yamt-pagecache-base7:1.3 netbsd-5-2-RELEASE:1.3 netbsd-5-2-RC1:1.3 yamt-pagecache-base6:1.3 yamt-pagecache-base5:1.3 yamt-pagecache-base4:1.3 netbsd-5-1-2-RELEASE:1.3 netbsd-5-1-1-RELEASE:1.3 yamt-pagecache-base3:1.3 yamt-pagecache-base2:1.3 yamt-pagecache:1.3.0.24 yamt-pagecache-base:1.3 bouyer-quota2-nbase:1.3 bouyer-quota2:1.3.0.22 bouyer-quota2-base:1.3 matt-nb5-pq3:1.3.0.20 matt-nb5-pq3-base:1.3 netbsd-5-1:1.3.0.18 netbsd-5-1-RELEASE:1.3 netbsd-0-9:1.1.0.2 netbsd-5-1-RC4:1.3 netbsd-5-1-RC3:1.3 netbsd-5-1-RC2:1.3 netbsd-5-1-RC1:1.3 netbsd-5-0-2-RELEASE:1.3 netbsd-5-0-1-RELEASE:1.3 jym-xensuspend-nbase:1.3 netbsd-5-0:1.3.0.16 netbsd-5-0-RELEASE:1.3 netbsd-5-0-RC4:1.3 netbsd-5-0-RC3:1.3 netbsd-5-0-RC2:1.3 jym-xensuspend:1.3.0.14 jym-xensuspend-base:1.3 netbsd-5-0-RC1:1.3 netbsd-5:1.3.0.12 netbsd-5-base:1.3 mjf-devfs2:1.3.0.10 mjf-devfs2-base:1.3 yamt-pf42-base4:1.3 yamt-pf42-base3:1.3 hpcarm-cleanup-nbase:1.3 yamt-pf42-base2:1.3 yamt-pf42:1.3.0.8 yamt-pf42-base:1.3 keiichi-mipv6-nbase:1.3 keiichi-mipv6:1.3.0.6 keiichi-mipv6-base:1.3 cube-autoconf:1.3.0.4 cube-autoconf-base:1.3 hpcarm-cleanup:1.3.0.2 hpcarm-cleanup-base:1.3 netbsd-1-4-PATCH003:1.2 netbsd-1-4-PATCH002:1.2 wrstuden-devbsize-19991221:1.2 wrstuden-devbsize:1.2.0.14 wrstuden-devbsize-base:1.2 comdex-fall-1999:1.2.0.12 comdex-fall-1999-base:1.2 netbsd-1-4-PATCH001:1.2 netbsd-1-4-RELEASE:1.2 netbsd-1-4:1.2.0.10 netbsd-1-4-base:1.2 netbsd-1-3-PATCH003:1.2 netbsd-1-3-PATCH003-CANDIDATE2:1.2 netbsd-1-3-PATCH003-CANDIDATE1:1.2 netbsd-1-3-PATCH003-CANDIDATE0:1.2 netbsd-1-3-PATCH002:1.2 netbsd-1-3-PATCH001:1.2 netbsd-1-3-RELEASE:1.2 netbsd-1-3-BETA:1.2 netbsd-1-3:1.2.0.6 netbsd-1-3-base:1.2 netbsd-1-2-PATCH001:1.2 netbsd-1-2-RELEASE:1.2 netbsd-1-2-BETA:1.2 netbsd-1-2:1.2.0.8 netbsd-1-2-base:1.2 netbsd-1-1-PATCH001:1.2 netbsd-1-1-RELEASE:1.2 netbsd-1-1:1.2.0.4 netbsd-1-1-base:1.2 sendmail_8_6_11:1.1.1.1 sendmail_8_6_10:1.1.1.1 netbsd-1-0-PATCH06:1.2 netbsd-1-0-PATCH05:1.2 netbsd-1-0-PATCH04:1.2 netbsd-1-0-PATCH03:1.2 netbsd-1-0-PATCH02:1.2 netbsd-1-0-PATCH1:1.2 netbsd-1-0-PATCH0:1.2 netbsd-1-0-RELEASE:1.2 netbsd-1-0:1.2.0.2 netbsd-1-0-base:1.2 sendmail_8_6_9:1.1.1.1 sendmail_8_6_8:1.1.1.1 sendmail_8_6_7:1.1.1.1 sendmail_8_6_5:1.1.1.1 ALLMAN:1.1.1 v8-6-4+local:1.2 netbsd-0-9-RELEASE:1.1 netbsd-0-9-BETA:1.1 netbsd-0-9-ALPHA2:1.1 netbsd-0-9-ALPHA:1.1 netbsd-0-9-base:1.1 sendmail-v8:1.1; locks; strict; comment @# @; 1.3 date 2000.02.13.00.35.18; author tron; state dead; branches; next 1.2; 1.2 date 93.10.30.00.33.46; author glass; state Exp; branches; next 1.1; 1.1 date 93.06.18.20.42.05; author glass; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 94.01.29.01.35.03; author glass; state Exp; branches; next ; desc @@ 1.3 log @Remove obsolete version 8.8.8 of "sendmail". 8.9.3 is in the main tree now, 8.8.8 is still avaible in "pkgsrc". @ text @Message-ID: Date: Sun, 1 Aug 1993 00:02:57 -0400 (EDT) From: John Gardiner Myers To: sendmail@@cs.berkeley.edu Subject: contrib/rcpt-streaming Beak: Is This patch implements "RCPT streaming" in sendmail version 8. This patch is not an official part of sendmail. Please report all problems with this patch to jgm+@@cmu.edu. RCPT streming avoids network round trips by sending all RCPT commands for a single SMTP transaction together. Sendmail then waits for all the replies, matching them up with the apropriate addresses. Apply to the sendmail src directory (your line numbers may vary) and compile with -DRCPTSTREAM diff -cr ./src/deliver.c /afs/andrew.cmu.edu/system/src/local/../host/oldsmail/016/src/deliver.c *** ./src/deliver.c Thu Jul 22 14:28:19 1993 --- /afs/andrew.cmu.edu/system/src/local/../host/oldsmail/016/src/deliver.c Fri Jul 30 21:11:16 1993 *************** *** 1334,1339 **** --- 1334,1354 ---- register int i; /* send the recipient list */ + #ifdef RCPTSTREAM + /*********************************************************************** + * + * RCPT streaming code by John G Myers, jgm+@@cmu.edu + * This is not supported by the maintainer of sendmail. + * Report all bugs concerning RCPT streaming to jgm+@@cmu.edu + * + *********************************************************************** + */ + for (to = tochain; to != NULL; to = to->q_tchain) + { + smtpstreammessage("RCPT To:<%s>", m, mci, + to->q_user); + } + #endif tobuf[0] = '\0'; for (to = tochain; to != NULL; to = to->q_tchain) { diff -cr ./src/usersmtp.c /afs/andrew.cmu.edu/system/src/local/../host/oldsmail/016/src/usersmtp.c *** ./src/usersmtp.c Mon Jul 19 23:50:43 1993 --- /afs/andrew.cmu.edu/system/src/local/../host/oldsmail/016/src/usersmtp.c Fri Jul 30 21:12:00 1993 *************** *** 44,49 **** --- 44,61 ---- # include # include + #ifdef RCPTSTREAM + /*********************************************************************** + * + * RCPT streaming code by John G Myers, jgm+@@cmu.edu + * This is not supported by the maintainer of sendmail. + * Report all bugs concerning RCPT streaming to jgm+@@cmu.edu + * + *********************************************************************** + */ + # include + # include + #endif # ifdef SMTP *************** *** 62,67 **** --- 74,87 ---- char SmtpError[MAXLINE] = ""; /* save failure error messages */ int SmtpPid; /* pid of mailer */ + #ifdef RCPTSTREAM + char *SmtpStreamBuf; /* buffer for streaming output */ + int SmtpStreamBufSize = 0; /* allocated size of buffer */ + char *SmtpStreamStart; /* pointer to text not yet written */ + int SmtpStreamLen = 0; /* # chars not yet written */ + #endif + + #ifdef __STDC__ extern smtpmessage(char *f, MAILER *m, MCI *mci, ...); #endif *************** *** 404,410 **** --- 424,434 ---- { register int r; + #ifdef RCPTSTREAM + sprintf(SmtpMsgBuffer, "RCPT To:<%s>", to->q_user); + #else smtpmessage("RCPT To:<%s>", m, mci, to->q_user); + #endif SmtpPhase = mci->mci_phase = "client RCPT"; setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase); *************** *** 667,672 **** --- 694,703 ---- bool firstline = TRUE; char junkbuf[MAXLINE]; + #ifdef RCPTSTREAM + extern char MsgBuf[]; /* err.c */ + #endif + if (mci->mci_out != NULL) (void) fflush(mci->mci_out); *************** *** 682,687 **** --- 713,755 ---- register char *p; extern time_t curtime(); + #ifdef RCPTSTREAM + if (SmtpStreamLen > 0) { + int outfd; + + outfd = fileno(mci->mci_out); + + nonblock(outfd, TRUE); + r = write(outfd, SmtpStreamStart, SmtpStreamLen); + nonblock(outfd, FALSE); + if (r == -1 && errno != EAGAIN + #ifdef EWOULDBLOCK + && errno != EWOULDBLOCK + #endif + ) { + + mci->mci_errno = errno; + message("451 streamreply: write error to %s", + mci->mci_host); + + /* if debugging, pause so we can see state */ + if (tTd(18, 100)) + pause(); + # ifdef LOG + if (LogLevel > 0) + syslog(LOG_INFO, "%s", &MsgBuf[4]); + # endif /* LOG */ + /* stop trying to write output */ + SmtpStreamLen = 0; + continue; + } + if (r > 0) { + SmtpStreamStart += r; + SmtpStreamLen -= r; + } + } + #endif /* RCPTSTREAM */ + /* actually do the read */ if (e->e_xfp != NULL) (void) fflush(e->e_xfp); /* for debugging */ *************** *** 792,797 **** --- 860,937 ---- return (r); } + + #ifdef RCPTSTREAM + /* + ** SMTPSTREAMMESSAGE -- buffer message to be streamed to server + ** + ** Parameters: + ** f -- format + ** m -- the mailer to control formatting. + ** a, b, c -- parameters + ** + ** Returns: + ** none. + ** + ** Side Effects: + ** stores message in SmtpStreamBuf + */ + + /*VARARGS1*/ + #ifdef __STDC__ + smtpstreammessage(char *f, MAILER *m, MCI *mci, ...) + #else + smtpstreammessage(f, m, mci, va_alist) + char *f; + MAILER *m; + MCI *mci; + va_dcl + #endif + { + VA_LOCAL_DECL + int len; + + VA_START(mci); + (void) vsprintf(SmtpMsgBuffer, f, ap); + VA_END; + + if (tTd(18, 1) || Verbose) + nmessage(">>> %s", SmtpMsgBuffer); + if (TrafficLogFile != NULL) + fprintf(TrafficLogFile, "%05d >>> %s\n", getpid(), SmtpMsgBuffer); + + if (mci->mci_out == NULL) { + if (tTd(18, 1)) printf("smtpstreammessage: NULL mci_out\n"); + return; + } + + strcat(SmtpMsgBuffer, m == NULL ? "\r\n" : m->m_eol); + len = strlen(SmtpMsgBuffer); + + if (SmtpStreamLen == 0) { + if (SmtpStreamBufSize == 0) { + SmtpStreamBufSize = MAXLINE; + SmtpStreamBuf = xalloc(SmtpStreamBufSize); + } + SmtpStreamStart = SmtpStreamBuf; + } + + if (SmtpStreamBufSize - SmtpStreamLen < len + 1) { + int start = SmtpStreamStart - SmtpStreamBuf; + SmtpStreamBufSize += MAXLINE; + SmtpStreamBuf = realloc(SmtpStreamBuf, SmtpStreamBufSize); + if (!SmtpStreamBuf) { + syserr("Out of memory!!"); + abort(); + /* exit(EX_UNAVAILABLE); */ + } + SmtpStreamStart = SmtpStreamBuf + start; + } + + strcpy(SmtpStreamBuf + SmtpStreamLen, SmtpMsgBuffer); + SmtpStreamLen += len; + } + #endif /* RCPTSTREAM */ /* ** SMTPMESSAGE -- send message to server ** Only in /afs/andrew.cmu.edu/system/src/local/../host/oldsmail/016/src: usersmtp.c~ diff -cr ./src/util.c /afs/andrew.cmu.edu/system/src/local/../host/oldsmail/016/src/util.c *** ./src/util.c Mon Jul 19 23:50:45 1993 --- /afs/andrew.cmu.edu/system/src/local/../host/oldsmail/016/src/util.c Mon Jul 26 17:17:10 1993 *************** *** 1034,1039 **** --- 1034,1091 ---- return (FALSE); return (TRUE); } + + #ifdef RCPTSTREAM + /*********************************************************************** + * + * RCPT streaming code by John G Myers, jgm+@@cmu.edu + * This is not supported by the maintainer of sendmail. + * Report all bugs concerning RCPT streaming to jgm+@@cmu.edu + * + *********************************************************************** + */ + + #include + + /* + ** NONBLOCK -- set or clear non-blocking mode on file descriptor + ** + ** Parameters: + ** fd -- the file descriptor + ** mode -- TRUE to set non-blocking mode + ** FALSE to clear non-blocking mode + ** + ** Returns: + ** none + ** + ** Side Effects: + ** modifies nonblocking status of fd + */ + + nonblock(fd, mode) + int fd; + bool mode; + { + int flags; + + flags = fcntl(fd, F_GETFL, 0); + if (mode) { + #ifdef FNONBIO + flags |= FNONBIO; + #else + flags |= O_NDELAY; + #endif + } + else { + #ifdef FNONBIO + flags &= ~FNONBIO; + #else + flags &= ~O_NDELAY; + #endif + } + fcntl(fd, F_SETFL, flags); + } + #endif /* ** STRCONTAINEDIN -- tell if one string is contained in another ** @ 1.2 log @updated from 8.3 to 8.6.3. known problems: sendmail/cf/cf required 'obj' directory @ text @@ 1.1 log @baseline commit of sendmail release 8 version 8.1B (this is the sendmail stuff as it will appear in 4.4BSD) @ text @d1 4 a4 2 (Message /home/auspex/a/staff/eric/.mh/inbox:2575) From: John Gardiner Myers d6 1 a6 2 Date: Fri, 4 Jun 1993 13:54:06 -0400 (EDT) To: sendmail@@cs.berkeley.edu d8 1 a8 1 This patch implements "RCPT streaming" in sendmail version 6. This d19 3 a21 3 diff -cr src.orig/deliver.c src/deliver.c *** src.orig/deliver.c Thu May 27 14:38:22 1993 --- src/deliver.c Fri Jun 4 13:50:02 1993 d23 2 a24 2 *** 1325,1330 **** --- 1325,1345 ---- d46 3 a48 3 diff -cr src.orig/usersmtp.c src/usersmtp.c *** src.orig/usersmtp.c Thu May 27 14:38:09 1993 --- src/usersmtp.c Fri Jun 4 13:48:24 1993 d89 1 a89 1 --- 424,432 ---- d93 3 a95 1 + #ifndef RCPTSTREAM d99 1 a99 1 SmtpPhase = mci->mci_phase = "RCPT wait"; d102 2 a103 2 *** 626,631 **** --- 648,657 ---- d115 2 a116 2 *** 641,646 **** --- 667,709 ---- d161 2 a162 2 *** 742,747 **** --- 805,880 ---- d203 2 d241 4 a244 6 Only in src: usersmtp.c.orig Only in src: usersmtp.c~ Only in src: usersmtp.o diff -cr src.orig/util.c src/util.c *** src.orig/util.c Thu May 27 14:38:20 1993 --- src/util.c Wed Jun 2 16:39:15 1993 d246 2 a247 2 *** 955,960 **** --- 955,1004 ---- d287 1 d289 3 d294 1 d296 3 a305 3 Only in src: util.c.orig Only in src: util.o Only in src: version.o @ 1.1.1.1 log @an attempt to import sendmail. can unfuck.. @ text @d1 2 a2 4 Message-ID: Date: Sun, 1 Aug 1993 00:02:57 -0400 (EDT) From: John Gardiner Myers To: sendmail@@cs.berkeley.edu d4 2 a5 1 Beak: Is d7 1 a7 1 This patch implements "RCPT streaming" in sendmail version 8. This d18 3 a20 3 diff -cr ./src/deliver.c /afs/andrew.cmu.edu/system/src/local/../host/oldsmail/016/src/deliver.c *** ./src/deliver.c Thu Jul 22 14:28:19 1993 --- /afs/andrew.cmu.edu/system/src/local/../host/oldsmail/016/src/deliver.c Fri Jul 30 21:11:16 1993 d22 2 a23 2 *** 1334,1339 **** --- 1334,1354 ---- d45 3 a47 3 diff -cr ./src/usersmtp.c /afs/andrew.cmu.edu/system/src/local/../host/oldsmail/016/src/usersmtp.c *** ./src/usersmtp.c Mon Jul 19 23:50:43 1993 --- /afs/andrew.cmu.edu/system/src/local/../host/oldsmail/016/src/usersmtp.c Fri Jul 30 21:12:00 1993 d88 1 a88 1 --- 424,434 ---- d92 1 a92 3 + #ifdef RCPTSTREAM + sprintf(SmtpMsgBuffer, "RCPT To:<%s>", to->q_user); + #else d96 1 a96 1 SmtpPhase = mci->mci_phase = "client RCPT"; d99 2 a100 2 *** 667,672 **** --- 694,703 ---- d112 2 a113 2 *** 682,687 **** --- 713,755 ---- d158 2 a159 2 *** 792,797 **** --- 860,937 ---- a199 2 + if (TrafficLogFile != NULL) + fprintf(TrafficLogFile, "%05d >>> %s\n", getpid(), SmtpMsgBuffer); d236 6 a241 4 Only in /afs/andrew.cmu.edu/system/src/local/../host/oldsmail/016/src: usersmtp.c~ diff -cr ./src/util.c /afs/andrew.cmu.edu/system/src/local/../host/oldsmail/016/src/util.c *** ./src/util.c Mon Jul 19 23:50:45 1993 --- /afs/andrew.cmu.edu/system/src/local/../host/oldsmail/016/src/util.c Mon Jul 26 17:17:10 1993 d243 2 a244 2 *** 1034,1039 **** --- 1034,1091 ---- a283 1 + #ifdef FNONBIO a284 3 + #else + flags |= O_NDELAY; + #endif a286 1 + #ifdef FNONBIO a287 3 + #else + flags &= ~O_NDELAY; + #endif d295 3 @