diff options
Diffstat (limited to 'contrib/sendmail/src')
-rw-r--r-- | contrib/sendmail/src/aliases.5 | 15 | ||||
-rw-r--r-- | contrib/sendmail/src/conf.c | 277 | ||||
-rw-r--r-- | contrib/sendmail/src/conf.h | 12 | ||||
-rw-r--r-- | contrib/sendmail/src/err.c | 6 | ||||
-rw-r--r-- | contrib/sendmail/src/headers.c | 207 | ||||
-rw-r--r-- | contrib/sendmail/src/mailq.1 | 18 | ||||
-rw-r--r-- | contrib/sendmail/src/mci.c | 17 | ||||
-rw-r--r-- | contrib/sendmail/src/savemail.c | 15 | ||||
-rw-r--r-- | contrib/sendmail/src/sendmail.8 | 29 |
9 files changed, 196 insertions, 400 deletions
diff --git a/contrib/sendmail/src/aliases.5 b/contrib/sendmail/src/aliases.5 index 32fb50c..62b5dfb 100644 --- a/contrib/sendmail/src/aliases.5 +++ b/contrib/sendmail/src/aliases.5 @@ -9,9 +9,9 @@ .\" the sendmail distribution. .\" .\" -.\" $Id: aliases.5,v 8.19 2004/07/12 05:39:21 ca Exp $ +.\" $Id: aliases.5,v 8.17 2000/12/14 23:09:46 gshapiro Exp $ .\" -.TH ALIASES 5 "$Date: 2004/07/12 05:39:21 $" +.TH ALIASES 5 "$Date: 2000/12/14 23:09:46 $" .SH NAME aliases \- aliases file for sendmail @@ -78,17 +78,6 @@ are comments. Aliasing occurs only on local names. Loops can not occur, since no message will be sent to any person more than once. .PP -If an alias is found for -.IR name , -sendmail then checks for an alias for -.IR owner-name . -If it is found and the result of the lookup expands to a single -address, the envelope sender address of the message is rewritten to -that address. -If it is found and the result expands to more than one address, the -envelope sender address is changed to -.IR owner-name . -.PP After aliasing has been done, local and valid recipients who have a ``.forward'' file in their home directory have messages forwarded to the diff --git a/contrib/sendmail/src/conf.c b/contrib/sendmail/src/conf.c index 5f91e45..71c2c7a 100644 --- a/contrib/sendmail/src/conf.c +++ b/contrib/sendmail/src/conf.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2004 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -9,11 +9,12 @@ * forth in the LICENSE file which can be found at the top level of * the sendmail distribution. * + * $FreeBSD$ */ #include <sendmail.h> -SM_RCSID("@(#)$Id: conf.c,v 8.1047 2004/07/14 21:54:23 ca Exp $") +SM_RCSID("@(#)$Id: conf.c,v 8.972.2.54 2004/01/08 21:54:55 ca Exp $") #include <sendmail/pathnames.h> #if NEWDB @@ -81,7 +82,6 @@ struct hdrinfo HdrInfo[] = { "errors-to", H_FROM|H_ERRORSTO, NULL }, { "full-name", H_ACHECK, NULL }, { "return-receipt-to", H_RECEIPTTO, NULL }, - { "delivery-receipt-to", H_RECEIPTTO, NULL }, { "disposition-notification-to", H_FROM, NULL }, /* destination fields */ @@ -260,7 +260,9 @@ setdefaults(e) WkClassFact = 1800L; /* option z */ WkTimeFact = 90000L; /* option Z */ QueueFactor = WkRecipFact * 20; /* option q */ +#if _FFR_QUARANTINE QueueMode = QM_NORMAL; /* what queue items to act upon */ +#endif /* _FFR_QUARANTINE */ FileMode = (RealUid != geteuid()) ? 0644 : 0600; /* option F */ QueueFileMode = (RealUid != geteuid()) ? 0644 : 0600; @@ -337,7 +339,6 @@ setdefaults(e) FastSplit = 1; #if SASL AuthMechanisms = newstr(AUTH_MECHANISMS); - AuthRealm = NULL; MaxSLBits = INT_MAX; #endif /* SASL */ #if STARTTLS @@ -368,11 +369,12 @@ setdefaults(e) #if MILTER InputFilters[0] = NULL; #endif /* MILTER */ +#if _FFR_REJECT_LOG RejectLogInterval = 3 HOURS; -#if REQUIRES_DIR_FSYNC +#endif /* _FFR_REJECT_LOG */ +#if _FFR_REQ_DIR_FSYNC_OPT RequiresDirfsync = true; -#endif /* REQUIRES_DIR_FSYNC */ - ConnectionRateWindowSize = 60; +#endif /* _FFR_REQ_DIR_FSYNC_OPT */ setupmaps(); setupqueues(); setupmailers(); @@ -639,13 +641,6 @@ setupmaps() dequote_init, null_map_open, null_map_close, arith_map_lookup, null_map_store); -#if SOCKETMAP - /* arbitrary daemons */ - MAPDEF("socket", NULL, MCF_ALIASOK, - map_parseargs, socket_map_open, socket_map_close, - socket_map_lookup, null_map_store); -#endif /* SOCKETMAP */ - if (tTd(38, 2)) { /* bogus map -- always return tempfail */ @@ -1498,6 +1493,7 @@ getla() double avenrun[3]; # endif /* LA_TYPE == LA_SHORT */ # endif /* LA_TYPE == LA_INT */ + extern int errno; extern off_t lseek(); if (kmem < 0) @@ -1605,6 +1601,7 @@ getla() int j; static int kmem = -1; long avenrun[3]; + extern int errno; struct mioc_rksym mirk; if (kmem < 0) @@ -1832,12 +1829,6 @@ getla() # include <sys/sysmp.h> -# ifdef _UNICOSMP -# define CAST_SYSMP(x) (x) -# else /* _UNICOSMP */ -# define CAST_SYSMP(x) ((x) & 0x7fffffff) -# endif /* _UNICOSMP */ - int getla(void) { @@ -1867,8 +1858,7 @@ getla(void) } } - if (lseek(kmem, CAST_SYSMP(sysmp(MP_KERNADDR, MPKA_AVENRUN)), SEEK_SET) - == -1 || + if (lseek(kmem, (sysmp(MP_KERNADDR, MPKA_AVENRUN) & 0x7fffffff), SEEK_SET) == -1 || read(kmem, (char *) avenrun, sizeof(avenrun)) < sizeof(avenrun)) { if (tTd(3, 1)) @@ -2204,16 +2194,16 @@ refuseconnections(name, e, d, active) { static time_t lastconn[MAXDAEMONS]; static int conncnt[MAXDAEMONS]; +#if _FFR_REJECT_LOG static time_t firstrejtime[MAXDAEMONS]; static time_t nextlogtime[MAXDAEMONS]; +#endif /* _FFR_REJECT_LOG */ #if XLA if (!xla_smtp_ok()) return true; #endif /* XLA */ - SM_ASSERT(d >= 0); - SM_ASSERT(d < MAXDAEMONS); if (ConnRateThrottle > 0) { time_t now; @@ -2245,13 +2235,16 @@ refuseconnections(name, e, d, active) sm_getla(); if (RefuseLA > 0 && CurrentLA >= RefuseLA) { +# if _FFR_REJECT_LOG time_t now; +# define R2_MSG_LA "have been rejecting connections on daemon %s for %s" +# endif /* _FFR_REJECT_LOG */ # define R_MSG_LA "rejecting connections on daemon %s: load average: %d" -# define R2_MSG_LA "have been rejecting connections on daemon %s for %s" sm_setproctitle(true, e, R_MSG_LA, name, CurrentLA); if (LogLevel > 8) sm_syslog(LOG_NOTICE, NOQID, R_MSG_LA, name, CurrentLA); +# if _FFR_REJECT_LOG now = curtime(); if (firstrejtime[d] == 0) { @@ -2264,10 +2257,13 @@ refuseconnections(name, e, d, active) pintvl(now - firstrejtime[d], true)); nextlogtime[d] = now + RejectLogInterval; } +# endif /* _FFR_REJECT_LOG */ return true; } +# if _FFR_REJECT_LOG else firstrejtime[d] = 0; +# endif /* _FFR_REJECT_LOG */ if (DelayLA > 0 && CurrentLA >= DelayLA) { @@ -3973,7 +3969,6 @@ validate_connection(sap, hostname, e) sm_dprintf("validate_connection(%s, %s)\n", hostname, anynet_ntoa(sap)); - connection_rate_check(sap, e); if (rscheck("check_relay", hostname, anynet_ntoa(sap), e, RSF_RMCOMM|RSF_COUNT, 3, NULL, NOQID) != EX_OK) { @@ -5161,80 +5156,6 @@ get_num_procs_online() return nproc; } /* -** SM_CLOSEFROM -- close file descriptors -** -** Parameters: -** lowest -- first fd to close -** highest -- last fd + 1 to close -** -** Returns: -** none -*/ - -void -sm_closefrom(lowest, highest) - int lowest, highest; -{ -#if HASCLOSEFROM - closefrom(lowest); -#else /* HASCLOSEFROM */ - int i; - - for (i = lowest; i < highest; i++) - (void) close(i); -#endif /* HASCLOSEFROM */ -} -#if HASFDWALK -/* -** CLOSEFD_WALK -- walk fd's arranging to close them -** Callback for fdwalk() -** -** Parameters: -** lowest -- first fd to arrange to be closed -** fd -- fd to arrange to be closed -** -** Returns: -** zero -*/ - -static int -closefd_walk(lowest, fd) - void *lowest; - int fd; -{ - if (fd >= *(int *)lowest) - (void) fcntl(fd, F_SETFD, FD_CLOEXEC); - return 0; -} -#endif /* HASFDWALK */ -/* -** SM_CLOSE_ON_EXEC -- arrange for file descriptors to be closed -** -** Parameters: -** lowest -- first fd to arrange to be closed -** highest -- last fd + 1 to arrange to be closed -** -** Returns: -** none -*/ - -void -sm_close_on_exec(highest, lowest) - int highest, lowest; -{ -#if HASFDWALK - (void) fdwalk(closefd_walk, &lowest); -#else /* HASFDWALK */ - int i, j; - - for (i = lowest; i < highest; i++) - { - if ((j = fcntl(i, F_GETFD, 0)) != -1) - (void) fcntl(i, F_SETFD, j | FD_CLOEXEC); - } -#endif /* HASFDWALK */ -} -/* ** SEED_RANDOM -- seed the random number generator ** ** Parameters: @@ -5616,9 +5537,6 @@ link(source, target) char *CompileOptions[] = { -#if ALLOW_255 - "ALLOW_255", -#endif /* ALLOW_255 */ #if NAMED_BIND # if DNSMAP "DNSMAP", @@ -5721,9 +5639,6 @@ char *CompileOptions[] = #if SMTPDEBUG "SMTPDEBUG", #endif /* SMTPDEBUG */ -#if SOCKETMAP - "SOCKETMAP", -#endif /* SOCKETMAP */ #if STARTTLS "STARTTLS", #endif /* STARTTLS */ @@ -5745,9 +5660,6 @@ char *CompileOptions[] = #if USE_LDAP_INIT "USE_LDAP_INIT", #endif /* USE_LDAP_INIT */ -#if USE_TTYPATH - "USE_TTYPATH", -#endif /* USE_TTYPATH */ #if XDEBUG "XDEBUG", #endif /* XDEBUG */ @@ -5767,6 +5679,9 @@ char *OsCompileOptions[] = #if ADDRCONFIG_IS_BROKEN "ADDRCONFIG_IS_BROKEN", #endif /* ADDRCONFIG_IS_BROKEN */ +#if ALLOW_255 + "ALLOW_255", +#endif /* ALLOW_255 */ #ifdef AUTO_NETINFO_HOSTS "AUTO_NETINFO_HOSTS", #endif /* AUTO_NETINFO_HOSTS */ @@ -5788,18 +5703,12 @@ char *OsCompileOptions[] = #if FAST_PID_RECYCLE "FAST_PID_RECYCLE", #endif /* FAST_PID_RECYCLE */ -#if HASCLOSEFROM - "HASCLOSEFROM", -#endif /* HASCLOSEFROM */ #if HASFCHOWN "HASFCHOWN", #endif /* HASFCHOWN */ #if HASFCHMOD "HASFCHMOD", #endif /* HASFCHMOD */ -#if HASFDWALK - "HASFDWALK", -#endif /* HASFDWALK */ #if HASFLOCK "HASFLOCK", #endif /* HASFLOCK */ @@ -5977,11 +5886,20 @@ char *OsCompileOptions[] = char *FFRCompileOptions[] = { +#if _FFR_ADAPTIVE_EOL + /* tries to be smart about \r\n versus \n from broken clients */ + /* known to be broken, do not use */ + "_FFR_ADAPTIVE_EOL", +#endif /* _FFR_ADAPTIVE_EOL */ #if _FFR_ALLOW_SASLINFO /* DefaultAuthInfo can be specified by user. */ - /* DefaultAuthInfo doesn't really work in 8.13 anymore. */ + /* DefaultAuthInfo doesn't really work in 8.12 anymore. */ "_FFR_ALLOW_SASLINFO", #endif /* _FFR_ALLOW_SASLINFO */ +#if _FFR_ALLOW_S0_ERROR_4XX + /* Allow for tempfail from S0 (ruleset 0). */ + "_FFR_ALLOW_S0_ERROR_4XX", +#endif /* _FFR_ALLOW_S0_ERROR_4XX */ #if _FFR_BESTMX_BETTER_TRUNCATION /* Better truncation of list of MX records for dns map. */ "_FFR_BESTMX_BETTER_TRUNCATION", @@ -5994,10 +5912,19 @@ char *FFRCompileOptions[] = "_FFR_BLOCK_PROXIES", #endif /* _FFR_BLOCK_PROXIES */ +#if _FFR_CACHE_LPC + /* Cache connections to LCP based mailers */ +/* Christophe Wolfhugel of France Telecom Oleane */ + "_FFR_CACHE_LPC", +#endif /* _FFR_CACHE_LPC */ #if _FFR_CATCH_BROKEN_MTAS /* Deal with MTAs that send a reply during the DATA phase. */ "_FFR_CATCH_BROKEN_MTAS", #endif /* _FFR_CATCH_BROKEN_MTAS */ +#if _FFR_CATCH_LONG_STRINGS + /* Report long address strings instead of silently ignoring them. */ + "_FFR_CATCH_LONG_STRINGS", +#endif /* _FFR_CATCH_LONG_STRINGS */ #if _FFR_CHECK_EOM /* Enable check_eom ruleset */ "_FFR_CHECK_EOM", @@ -6014,10 +5941,6 @@ char *FFRCompileOptions[] = /* Extended daemon status. */ "_FFR_CONTROL_MSTAT", #endif /* _FFR_CONTROL_MSTAT */ -#if _FFR_CRLPATH - /* CRLPath; needs documentation; Al Smith */ - "_FFR_CRLPATH", -#endif /* _FFR_CRLPATH */ #if _FFR_DAEMON_NETUNIX /* Allow local (not just TCP) socket connection to server. */ "_FFR_DAEMON_NETUNIX", @@ -6056,6 +5979,11 @@ char *FFRCompileOptions[] = /* Enable DontLockFilesForRead option. */ "_FFR_DONTLOCKFILESFORREAD_OPTION", #endif /* _FFR_DONTLOCKFILESFORREAD_OPTION */ +#if _FFR_DONT_STOP_LOOKING + /* Continue with DNS lookups on ECONNREFUSED and TRY_AGAIN. */ +/* Noted by Neil Rickert of Northern Illinois University */ + "_FFR_DONT_STOP_LOOKING", +#endif /* _FFR_DONT_STOP_LOOKING */ #if _FFR_DOTTED_USERNAMES /* Allow usernames with '.' */ "_FFR_DOTTED_USERNAMES", @@ -6106,10 +6034,6 @@ char *FFRCompileOptions[] = /* Set 'h' in {addr_type} for headers. */ "_FFR_HDR_TYPE", #endif /* _FFR_HDR_TYPE */ -#if _FFR_HELONAME - /* option to set heloname; Nik Clayton of FreeBSD */ - "_FFR_HELONAME", -#endif /* _FFR_HELONAME */ #if _FFR_HPUX_NSSWITCH /* Use nsswitch on HP-UX */ "_FFR_HPUX_NSSWITCH", @@ -6122,16 +6046,19 @@ char *FFRCompileOptions[] = /* Ignore extensions offered in response to HELO */ "_FFR_IGNORE_EXT_ON_HELO", #endif /* _FFR_IGNORE_EXT_ON_HELO */ -#if _FFR_MAXDATASIZE - /* - ** It is possible that a header is larger than MILTER_CHUNK_SIZE, - ** hence this shouldn't be used as limit for milter communication. - ** see also libmilter/comm.c - ** Gurusamy Sarathy of ActiveState - */ - - "_FFR_MAXDATASIZE" -#endif /* _FFR_MAXDATASIZE */ +#if _FFR_LDAP_RECURSION + /* Support LDAP recursion in LDAP responses */ +/* Andrew Baucom */ + "_FFR_LDAP_RECURSION", +#endif /* _FFR_LDAP_RECURSION */ +#if _FFR_LDAP_SETVERSION + /* New LDAP map option for setting LDAP protocol version */ + "_FFR_LDAP_SETVERSION", +#endif /* _FFR_LDAP_SETVERSION */ +#if _FFR_LDAP_URI + /* Support LDAP URI form of specifying host/port (and allows ldaps) */ + "_FFR_LDAP_URI", +#endif /* _FFR_LDAP_URI */ #if _FFR_MAX_FORWARD_ENTRIES /* Try to limit number of .forward entries */ /* (doesn't work) */ @@ -6142,20 +6069,24 @@ char *FFRCompileOptions[] = /* Limit sleep(2) time in libsm/clock.c */ "_FFR_MAX_SLEEP_TIME", #endif /* _FFR_MAX_SLEEP_TIME */ -#if _FFR_MILTER_NAGLE - /* milter: turn off Nagle ("cork" on Linux) */ - /* John Gardiner Myers of Proofpoint */ - "_FFR_MILTER_NAGLE ", -#endif /* _FFR_MILTER_NAGLE */ -#if _FFR_MILTER_NOHDR_RESP - /* milter: no response expected when sending headers */ - /* John Gardiner Myers of Proofpoint */ - "_FFR_MILTER_NOHDR_RESP", -#endif /* _FFR_MILTER_NOHDR_RESP */ -#if _FFR_MIME7TO8_OLD - /* Old mime7to8 code, the new is broken for at least one example. */ - "_FFR_MIME7TO8_OLD", -#endif /* _FFR_MAX_SLEEP_TIME */ +#if _FFR_MESSAGEID_MACRO + /* stick the message ID header's value in a macro */ + "_FFR_MESSAGEID_MACRO", +#endif /* _FFR_MESSAGEID_MACRO */ +#if MILTER +# if _FFR_MILTER_421 + /* If a filter returns 421, close the SMTP connection */ + "_FFR_MILTER_421", +# endif /* _FFR_MILTER_421 */ +# if _FFR_MILTER_MACROS_EOM + /* Add an EOM macro set for milter */ + "_FFR_MILTER_MACROS_EOM", +# endif /* _FFR_MILTER_MACROS_EOM */ +# if _FFR_MILTER_PERDAEMON + /* Per DaemonPortOptions InputMailFilter lists */ + "_FFR_MILTER_PERDAEMON", +# endif /* _FFR_MILTER_PERDAEMON */ +#endif /* MILTER */ #if _FFR_NODELAYDSN_ON_HOLD /* Do not issue a DELAY DSN for mailers that use the hold flag. */ /* Steven Pitzl */ @@ -6165,6 +6096,10 @@ char *FFRCompileOptions[] = /* Disable PIPELINING, delay client if used. */ "_FFR_NO_PIPE", #endif /* _FFR_NO_PIPE */ +#if _FFR_QUARANTINE + /* Quarantine items in the queue */ + "_FFR_QUARANTINE", +#endif /* _FFR_QUARANTINE */ #if _FFR_QUEUEDELAY /* Exponential queue delay; disabled in 8.13 since it isn't used. */ "_FFR_QUEUEDELAY", @@ -6178,6 +6113,16 @@ char *FFRCompileOptions[] = /* Define {queue} macro. */ "_FFR_QUEUE_MACRO", #endif /* _FFR_QUEUE_MACRO */ +#if _FFR_QUEUERETURN_DSN + /* + ** Provide an option for different Timeout.queue{warn,return} for + ** DSN messages. These days, queues are filled with bounces for + ** spam that will never make it to the sender and therefore slow + ** down queue runs until they timeout. + */ + + "_FFR_QUEUERETURN_DSN", +#endif /* _FFR_QUEUERETURN_DSN */ #if _FFR_QUEUE_RUN_PARANOIA /* Additional checks when doing queue runs. */ "_FFR_QUEUE_RUN_PARANOIA", @@ -6195,14 +6140,30 @@ char *FFRCompileOptions[] = "_FFR_REDIRECTEMPTY", #endif /* _FFR_REDIRECTEMPTY */ +#if _FFR_REJECT_LOG + /* Log when we start/stop rejecting connections due to load, etc */ + "_FFR_REJECT_LOG", +#endif /* _FFR_REJECT_LOG */ +#if _FFR_REQ_DIR_FSYNC_OPT + /* Add cf option to fsync() directories */ + "_FFR_REQ_DIR_FSYNC_OPT", +#endif /* _FFR_REQ_DIR_FSYNC_OPT */ #if _FFR_RESET_MACRO_GLOBALS /* Allow macro 'j' to be set dynamically via rulesets. */ "_FFR_RESET_MACRO_GLOBALS", #endif /* _FFR_RESET_MACRO_GLOBALS */ +#if _FFR_RESPOND_ALL + /* in vacation: respond to every message, not just once per interval */ + "_FFR_RESPOND_ALL", +#endif /* _FFR_RESPOND_ALL */ #if _FFR_RHS /* Random shuffle for queue sorting. */ "_FFR_RHS", #endif /* _FFR_RHS */ +#if _FFR_SASL_OPT_M + /* Support SASL's SASL_SEC_MUTUAL_AUTH option */ + "_FFR_SASL_OPT_M", +#endif /* _FFR_SASL_OPT_M */ #if _FFR_SELECT_SHM /* Auto-select of shared memory key */ "_FFR_SELECT_SHM", @@ -6211,14 +6172,18 @@ char *FFRCompileOptions[] = /* Donated code (unused). */ "_FFR_SHM_STATUS", #endif /* _FFR_SHM_STATUS */ -#if _FFR_SKIP_DOMAINS - /* process every N'th domain instead of every N'th message */ - "_FFR_SKIP_DOMAINS" -#endif /* _FFR_SKIP_DOMAINS */ #if _FFR_SLEEP_USE_SELECT /* Use select(2) in libsm/clock.c to emulate sleep(2) */ "_FFR_SLEEP_USE_SELECT ", #endif /* _FFR_SLEEP_USE_SELECT */ +#if _FFR_SMFI_OPENSOCKET + /* libmilter: smfi_opensocket() to force the socket open early */ + "_FFR_SMFI_OPENSOCKET", +#endif /* _FFR_SMFI_OPENSOCKET */ +#if _FFR_SMTP_SSL + /* Support for smtps (SMTP over SSL) */ + "_FFR_SMTP_SSL", +#endif /* _FFR_SMTP_SSL */ #if _FFR_SOFT_BOUNCE /* Turn all errors into temporary errors. */ "_FFR_SOFT_BOUNCE", @@ -6235,6 +6200,14 @@ char *FFRCompileOptions[] = /* Chris Adams of HiWAAY Informations Services */ "_FFR_SPT_ALIGN", #endif /* _FFR_SPT_ALIGN */ +#if _FFR_STRIPBACKSL + /* + ** Strip backslash from addresses (so sender doesn't + ** decide to ignore forward) + */ + + "_FFR_STRIPBACKSL", +#endif /* _FFR_STRIPBACKSL */ #if _FFR_TIMERS /* Donated code (unused). */ "_FFR_TIMERS", diff --git a/contrib/sendmail/src/conf.h b/contrib/sendmail/src/conf.h index 77577c4..0675c2d 100644 --- a/contrib/sendmail/src/conf.h +++ b/contrib/sendmail/src/conf.h @@ -10,7 +10,7 @@ * the sendmail distribution. * * - * $Id: conf.h,v 8.567 2004/07/23 20:45:01 gshapiro Exp $ + * $Id: conf.h,v 8.563.2.3 2002/10/31 03:28:36 ca Exp $ */ /* @@ -145,16 +145,6 @@ struct rusage; /* forward declaration to get gcc to shut up in wait.h */ # define DBMMODE 0640 #endif /* ! DBMMODE */ -/* -** Value which means a uid or gid value should not change -*/ - -#ifndef NO_UID -# define NO_UID -1 -#endif /* ! NO_UID */ -#ifndef NO_GID -# define NO_GID -1 -#endif /* ! NO_GID */ /********************************************************************** ** Compilation options. diff --git a/contrib/sendmail/src/err.c b/contrib/sendmail/src/err.c index 5a0b5b1..484af9e 100644 --- a/contrib/sendmail/src/err.c +++ b/contrib/sendmail/src/err.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -13,7 +13,7 @@ #include <sendmail.h> -SM_RCSID("@(#)$Id: err.c,v 8.191 2003/01/10 02:16:46 ca Exp $") +SM_RCSID("@(#)$Id: err.c,v 8.189 2002/01/09 18:52:30 ca Exp $") #if LDAPMAP # include <lber.h> @@ -238,7 +238,7 @@ syserr(fmt, va_alist) case ESTALE: #endif /* ESTALE */ printopenfds(true); - mci_dump_all(smioout, true); + mci_dump_all(true); break; } if (panic) diff --git a/contrib/sendmail/src/headers.c b/contrib/sendmail/src/headers.c index 12a567d..b7c5ef9 100644 --- a/contrib/sendmail/src/headers.c +++ b/contrib/sendmail/src/headers.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2004 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -9,13 +9,13 @@ * forth in the LICENSE file which can be found at the top level of * the sendmail distribution. * + * $FreeBSD$ */ #include <sendmail.h> -SM_RCSID("@(#)$Id: headers.c,v 8.286 2004/07/08 17:57:32 ca Exp $") +SM_RCSID("@(#)$Id: headers.c,v 8.266.4.9 2003/10/30 00:17:22 gshapiro Exp $") -static HDR *allocheader __P((char *, char *, int, SM_RPOOL_T *)); static size_t fix_mime_header __P((HDR *, ENVELOPE *)); static int priencode __P((char *)); static void put_vanilla_header __P((HDR *, char *, MCI *)); @@ -88,7 +88,7 @@ chompheader(line, pflag, hdrp, e) if (tTd(31, 6)) { sm_dprintf("chompheader: "); - xputs(sm_debug_file(), line); + xputs(line); sm_dprintf("\n"); } @@ -292,12 +292,11 @@ hse: int rscheckflags; char *rs; + /* no ruleset? look for default */ + rs = hi->hi_ruleset; rscheckflags = RSF_COUNT; if (!bitset(hi->hi_flags, H_FROM|H_RCPT)) rscheckflags |= RSF_UNSTRUCTURED; - - /* no ruleset? look for default */ - rs = hi->hi_ruleset; if (rs == NULL) { s = stab("*", ST_HEADER, ST_FIND); @@ -359,10 +358,17 @@ hse: (void) sm_snprintf(qval, sizeof qval, "%d", k); macdefine(&e->e_macro, A_TEMP, macid("{hdrlen}"), qval); #if _FFR_HDR_TYPE - if (bitset(H_FROM, hi->hi_flags)) + /* + ** XXX: h isn't set yet + ** If we really want to be precise then we have + ** to lookup the header (see below). + ** It's probably not worth the effort. + */ + + if (bitset(H_FROM, h->h_flags)) macdefine(&e->e_macro, A_PERM, macid("{addr_type}"), "h s"); - else if (bitset(H_RCPT, hi->hi_flags)) + else if (bitset(H_RCPT, h->h_flags)) macdefine(&e->e_macro, A_PERM, macid("{addr_type}"), "h r"); else @@ -461,44 +467,6 @@ hse: return h->h_flags; } /* -** ALLOCHEADER -- allocate a header entry -** -** Parameters: -** field -- the name of the header field. -** value -- the value of the field. -** flags -- flags to add to h_flags. -** rp -- resource pool for allocations -** -** Returns: -** Pointer to a newly allocated and populated HDR. -*/ - -static HDR * -allocheader(field, value, flags, rp) - char *field; - char *value; - int flags; - SM_RPOOL_T *rp; -{ - HDR *h; - STAB *s; - - /* find info struct */ - s = stab(field, ST_HEADER, ST_FIND); - - /* allocate space for new header */ - h = (HDR *) sm_rpool_malloc_x(rp, sizeof *h); - h->h_field = field; - h->h_value = sm_rpool_strdup_x(rp, value); - h->h_flags = flags; - if (s != NULL) - h->h_flags |= s->s_header.hi_flags; - clrbitmap(h->h_mflags); - h->h_macro = '\0'; - - return h; -} -/* ** ADDHEADER -- add a header entry to the end of the queue. ** ** This bypasses the special checking of chompheader. @@ -524,9 +492,13 @@ addheader(field, value, flags, e) ENVELOPE *e; { register HDR *h; + STAB *s; HDR **hp; HDR **hdrlist = &e->e_header; + /* find info struct */ + s = stab(field, ST_HEADER, ST_FIND); + /* find current place in list -- keep back pointer? */ for (hp = hdrlist; (h = *hp) != NULL; hp = &h->h_link) { @@ -535,65 +507,18 @@ addheader(field, value, flags, e) } /* allocate space for new header */ - h = allocheader(field, value, flags, e->e_rpool); + h = (HDR *) sm_rpool_malloc_x(e->e_rpool, sizeof *h); + h->h_field = field; + h->h_value = sm_rpool_strdup_x(e->e_rpool, value); h->h_link = *hp; + h->h_flags = flags; + if (s != NULL) + h->h_flags |= s->s_header.hi_flags; + clrbitmap(h->h_mflags); + h->h_macro = '\0'; *hp = h; } /* -** INSHEADER -- insert a header entry at the specified index -** -** This bypasses the special checking of chompheader. -** -** Parameters: -** idx -- index into the header list at which to insert -** field -- the name of the header field. -** value -- the value of the field. -** flags -- flags to add to h_flags. -** e -- envelope. -** -** Returns: -** none. -** -** Side Effects: -** inserts the field on the list of headers for this envelope. -*/ - -void -insheader(idx, field, value, flags, e) - int idx; - char *field; - char *value; - int flags; - ENVELOPE *e; -{ - HDR *h, *srch, *last = NULL; - - /* allocate space for new header */ - h = allocheader(field, value, flags, e->e_rpool); - - /* find insertion position */ - for (srch = e->e_header; srch != NULL && idx > 0; - srch = srch->h_link, idx--) - last = srch; - - if (e->e_header == NULL) - { - e->e_header = h; - h->h_link = NULL; - } - else if (srch == NULL) - { - SM_ASSERT(last != NULL); - last->h_link = h; - h->h_link = NULL; - } - else - { - h->h_link = srch->h_link; - srch->h_link = h; - } -} -/* ** HVALUE -- return value of a header. ** ** Only "real" fields (i.e., ones that have not been supplied @@ -749,7 +674,7 @@ eatheader(e, full, log) if (tTd(32, 1)) { sm_dprintf("("); - xputs(sm_debug_file(), h->h_value); + xputs(h->h_value); sm_dprintf(") "); } expand(h->h_value, buf, sizeof buf, e); @@ -764,7 +689,7 @@ eatheader(e, full, log) } if (tTd(32, 1)) { - xputs(sm_debug_file(), h->h_value); + xputs(h->h_value); sm_dprintf("\n"); } @@ -806,8 +731,10 @@ eatheader(e, full, log) e->e_msgid = h->h_value; while (isascii(*e->e_msgid) && isspace(*e->e_msgid)) e->e_msgid++; +#if _FFR_MESSAGEID_MACRO macdefine(&e->e_macro, A_PERM, macid("{msg_id}"), - e->e_msgid); + e->e_msgid); +#endif /* _FFR_MESSAGEID_MACRO */ } } if (tTd(32, 1)) @@ -840,60 +767,6 @@ eatheader(e, full, log) + e->e_nrcpts * WkRecipFact; } - /* check for DSN to properly set e_timeoutclass */ - p = hvalue("content-type", e->e_header); - if (p != NULL) - { - bool oldsupr; - char **pvp; - char pvpbuf[MAXLINE]; - extern unsigned char MimeTokenTab[256]; - - /* tokenize header */ - oldsupr = SuprErrs; - SuprErrs = true; - pvp = prescan(p, '\0', pvpbuf, sizeof pvpbuf, NULL, - MimeTokenTab, false); - SuprErrs = oldsupr; - - /* Check if multipart/report */ - if (pvp != NULL && pvp[0] != NULL && - pvp[1] != NULL && pvp[2] != NULL && - sm_strcasecmp(*pvp++, "multipart") == 0 && - strcmp(*pvp++, "/") == 0 && - sm_strcasecmp(*pvp++, "report") == 0) - { - /* Look for report-type=delivery-status */ - while (*pvp != NULL) - { - /* skip to semicolon separator */ - while (*pvp != NULL && strcmp(*pvp, ";") != 0) - pvp++; - - /* skip semicolon */ - if (*pvp++ == NULL || *pvp == NULL) - break; - - /* look for report-type */ - if (sm_strcasecmp(*pvp++, "report-type") != 0) - continue; - - /* skip equal */ - if (*pvp == NULL || strcmp(*pvp, "=") != 0) - continue; - - /* check value */ - if (*++pvp != NULL && - sm_strcasecmp(*pvp, - "delivery-status") == 0) - e->e_timeoutclass = TOC_DSN; - - /* found report-type, no need to continue */ - break; - } - } - } - /* message timeout priority */ p = hvalue("priority", e->e_header); if (p != NULL) @@ -905,11 +778,15 @@ eatheader(e, full, log) e->e_timeoutclass = TOC_NORMAL; else if (sm_strcasecmp(p, "non-urgent") == 0) e->e_timeoutclass = TOC_NONURGENT; +#if _FFR_QUEUERETURN_DSN else if (bitset(EF_RESPONSE, e->e_flags)) e->e_timeoutclass = TOC_DSN; +#endif /* _FFR_QUEUERETURN_DSN */ } +#if _FFR_QUEUERETURN_DSN else if (bitset(EF_RESPONSE, e->e_flags)) e->e_timeoutclass = TOC_DSN; +#endif /* _FFR_QUEUERETURN_DSN */ /* date message originated */ p = hvalue("posted-date", e->e_header); @@ -1363,8 +1240,12 @@ crackaddr(addr, e) { c = *q++; if (quoteit && c == '"') + { SM_APPEND_CHAR('\\'); - SM_APPEND_CHAR(c); + SM_APPEND_CHAR(c); + } + else + SM_APPEND_CHAR(c); } if (quoteit) { @@ -1526,7 +1407,7 @@ crackaddr(addr, e) if (tTd(33, 1)) { sm_dprintf("crackaddr=>`"); - xputs(sm_debug_file(), buf); + xputs(buf); sm_dprintf("'\n"); } return buf; @@ -1579,7 +1460,7 @@ putheader(mci, hdr, e, flags) if (tTd(34, 11)) { sm_dprintf(" %s: ", h->h_field); - xputs(sm_debug_file(), p); + xputs(p); } /* Skip empty headers */ @@ -1933,7 +1814,7 @@ commaize(h, p, oldstyle, mci, e) char pvpbuf[PSBUFSIZE]; res = prescan(p, oldstyle ? ' ' : ',', pvpbuf, - sizeof pvpbuf, &oldp, NULL, false); + sizeof pvpbuf, &oldp, NULL); p = oldp; #if _FFR_IGNORE_BOGUS_ADDR /* ignore addresses that can't be parsed */ diff --git a/contrib/sendmail/src/mailq.1 b/contrib/sendmail/src/mailq.1 index f67a9dd..1eb234e 100644 --- a/contrib/sendmail/src/mailq.1 +++ b/contrib/sendmail/src/mailq.1 @@ -9,9 +9,9 @@ .\" the sendmail distribution. .\" .\" -.\" $Id: mailq.1,v 8.20 2002/06/27 22:47:34 gshapiro Exp $ +.\" $Id: mailq.1,v 8.19.2.1 2002/09/26 23:03:39 gshapiro Exp $ .\" -.TH MAILQ 1 "$Date: 2002/06/27 22:47:34 $" +.TH MAILQ 1 "$Date: 2002/09/26 23:03:39 $" .SH NAME mailq \- print the mail queue @@ -55,13 +55,6 @@ Show the mail submission queue specified in instead of the MTA queue specified in .IR /etc/mail/sendmail.cf . .TP -.B \-qL -Show the "lost" items in the mail queue instead of the normal queue items. -.TP -.B \-qQ -Show the quarantined items in the mail queue instead of the normal queue -items. -.TP \fB\-q\fR[\fI!\fR]I substr Limit processed jobs to those containing .I substr @@ -69,13 +62,6 @@ as a substring of the queue id or not when .I ! is specified. .TP -\fB\-q\fR[\fI!\fR]Q substr -Limit processed jobs to quarantined jobs containing -.I substr -as a substring of the quarantine reason or not when -.I ! -is specified. -.TP \fB\-q\fR[\fI!\fR]R substr Limit processed jobs to those containing .I substr diff --git a/contrib/sendmail/src/mci.c b/contrib/sendmail/src/mci.c index dd8d7c3..a6b558e 100644 --- a/contrib/sendmail/src/mci.c +++ b/contrib/sendmail/src/mci.c @@ -9,11 +9,12 @@ * forth in the LICENSE file which can be found at the top level of * the sendmail distribution. * + * $FreeBSD$ */ #include <sendmail.h> -SM_RCSID("@(#)$Id: mci.c,v 8.211 2003/03/31 17:35:50 ca Exp $") +SM_RCSID("@(#)$Id: mci.c,v 8.205.2.4 2003/03/31 17:35:27 ca Exp $") #if NETINET || NETINET6 # include <arpa/inet.h> @@ -487,7 +488,6 @@ mci_setstat(mci, xstat, dstat, rstat) ** MCI_DUMP -- dump the contents of an MCI structure. ** ** Parameters: -** fp -- output file pointer ** mci -- the MCI structure to dump. ** ** Returns: @@ -530,8 +530,7 @@ static struct mcifbits MciFlags[] = }; void -mci_dump(fp, mci, logit) - SM_FILE_T *fp; +mci_dump(mci, logit) register MCI *mci; bool logit; { @@ -599,13 +598,12 @@ printit: if (logit) sm_syslog(LOG_DEBUG, CurEnv->e_id, "%.1000s", buf); else - (void) sm_io_fprintf(fp, SM_TIME_DEFAULT, "%s\n", buf); + (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, "%s\n", buf); } /* ** MCI_DUMP_ALL -- print the entire MCI cache ** ** Parameters: -** fp -- output file pointer ** logit -- if set, log the result instead of printing ** to stdout. ** @@ -614,8 +612,7 @@ printit: */ void -mci_dump_all(fp, logit) - SM_FILE_T *fp; +mci_dump_all(logit) bool logit; { register int i; @@ -624,7 +621,7 @@ mci_dump_all(fp, logit) return; for (i = 0; i < MaxMciCache; i++) - mci_dump(fp, MciCache[i], logit); + mci_dump(MciCache[i], logit); } /* ** MCI_LOCK_HOST -- Lock host while sending. @@ -929,7 +926,7 @@ mci_read_persistent(fp, mci) case '.': /* end of file */ if (tTd(56, 93)) - mci_dump(sm_debug_file(), mci, false); + mci_dump(mci, false); return 0; default: diff --git a/contrib/sendmail/src/savemail.c b/contrib/sendmail/src/savemail.c index 231382a..073c31f 100644 --- a/contrib/sendmail/src/savemail.c +++ b/contrib/sendmail/src/savemail.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -13,7 +13,7 @@ #include <sendmail.h> -SM_RCSID("@(#)$Id: savemail.c,v 8.303 2004/01/14 02:56:51 ca Exp $") +SM_RCSID("@(#)$Id: savemail.c,v 8.299.2.1 2002/10/23 15:08:47 ca Exp $") static void errbody __P((MCI *, ENVELOPE *, char *)); static bool pruneroute __P((char *)); @@ -74,7 +74,7 @@ savemail(e, sendbody) sm_dprintf("\nsavemail, errormode = %c, id = %s, ExitStat = %d\n e_from=", e->e_errormode, e->e_id == NULL ? "NONE" : e->e_id, ExitStat); - printaddr(sm_debug_file(), &e->e_from, false); + printaddr(&e->e_from, false); } if (e->e_id == NULL) @@ -178,12 +178,7 @@ savemail(e, sendbody) ** then write the error messages back to hir (sic). */ -#if USE_TTYPATH p = ttypath(); -#else /* USE_TTYPATH */ - p = NULL; -#endif /* USE_TTYPATH */ - if (p == NULL || sm_io_reopen(SmFtStdio, SM_TIME_DEFAULT, p, SM_IO_WRONLY, NULL, @@ -523,11 +518,11 @@ returntosender(msg, returnq, flags, e) { sm_dprintf("\n*** Return To Sender: msg=\"%s\", depth=%d, e=%p, returnq=", msg, returndepth, e); - printaddr(sm_debug_file(), returnq, true); + printaddr(returnq, true); if (tTd(6, 20)) { sm_dprintf("Sendq="); - printaddr(sm_debug_file(), e->e_sendqueue, true); + printaddr(e->e_sendqueue, true); } } diff --git a/contrib/sendmail/src/sendmail.8 b/contrib/sendmail/src/sendmail.8 index 2d0284a..a229aed 100644 --- a/contrib/sendmail/src/sendmail.8 +++ b/contrib/sendmail/src/sendmail.8 @@ -1,4 +1,4 @@ -.\" Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers. +.\" Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers. .\" All rights reserved. .\" Copyright (c) 1983, 1997 Eric P. Allman. All rights reserved. .\" Copyright (c) 1988, 1991, 1993 @@ -9,9 +9,9 @@ .\" the sendmail distribution. .\" .\" -.\" $Id: sendmail.8,v 8.57 2003/12/01 17:02:41 ca Exp $ +.\" $Id: sendmail.8,v 8.51.2.3 2003/12/01 17:02:00 ca Exp $ .\" -.TH SENDMAIL 8 "$Date: 2003/12/01 17:02:41 $" +.TH SENDMAIL 8 "$Date: 2003/12/01 17:02:00 $" .SH NAME sendmail \- an electronic mail transport agent @@ -153,9 +153,6 @@ Use alternate configuration file. gives up any enhanced (set-user-ID or set-group-ID) privileges if an alternate configuration file is specified. .TP -.BI "\-D " logfile -Send debugging output to the indicated log file instead of stdout. -.TP .BI \-d category . level... Set the debugging flag for .I category @@ -326,13 +323,6 @@ as a substring of the queue id or not when .I ! is specified. .TP -\fB\-q\fR[\fI!\fR]Q\fIsubstr\fR -Limit processed jobs to quarantined jobs containing -.I substr -as a substring of the quarantine reason or not when -.I ! -is specified. -.TP \fB\-q\fR[\fI!\fR]R\fIsubstr\fR Limit processed jobs to those containing .I substr @@ -347,12 +337,6 @@ as a substring of the sender or not when .I ! is specified. .TP -\fB\-Q\fR[reason] -Quarantine a normal queue items with the given reason or -unquarantine quarantined queue items if no reason is given. -This should only be used with some sort of item matching using -as described above. -.TP .BI "\-R " return Set the amount of the message to be returned if the message bounces. @@ -724,13 +708,13 @@ collected statistics /var/spool/mqueue/* temp files .SH SEE ALSO -binmail(1), mail(1), -rmail(1), syslog(3), aliases(5), mailaddr(7), -rc(8) +mail.local(8), +rc(8), +rmail(8) .PP DARPA Internet Request For Comments @@ -746,3 +730,4 @@ The .B sendmail command appeared in 4.2BSD. +.\" $FreeBSD$ |