Deleted Added
sdiff udiff text old ( 159613 ) new ( 168520 )
full compact
1/*
2 * Copyright (c) 1998-2007 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
4 * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
5 * Copyright (c) 1988, 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * By using this file, you agree to the terms and conditions set
9 * forth in the LICENSE file which can be found at the top level of
10 * the sendmail distribution.
11 *
12 * $FreeBSD: head/contrib/sendmail/src/conf.c 168520 2007-04-09 01:44:16Z gshapiro $
13 */
14
15#include <sendmail.h>
16
17SM_RCSID("@(#)$Id: conf.c,v 8.1128 2007/04/03 21:32:29 ca Exp $")
18
19#include <sm/sendmail.h>
20#include <sendmail/pathnames.h>
21#if NEWDB
22# include "sm/bdb.h"
23#endif /* NEWDB */
24
25#include <daemon.h>
26#include "map.h"
27
28#ifdef DEC
29# if NETINET6
30/* for the IPv6 device lookup */
31# define _SOCKADDR_LEN
32# include <macros.h>
33# endif /* NETINET6 */
34#endif /* DEC */
35

--- 122 unchanged lines hidden (view full) ---

158 { "restrictmailq", PRIV_RESTRICTMAILQ },
159 { "restrictqrun", PRIV_RESTRICTQRUN },
160 { "noetrn", PRIV_NOETRN },
161 { "noverb", PRIV_NOVERB },
162 { "authwarnings", PRIV_AUTHWARNINGS },
163 { "noreceipts", PRIV_NORECEIPTS },
164 { "nobodyreturn", PRIV_NOBODYRETN },
165 { "goaway", PRIV_GOAWAY },
166 { "noactualrecipient", PRIV_NOACTUALRECIPIENT },
167 { NULL, 0 }
168};
169
170/*
171** DontBlameSendmail values
172*/
173
174struct dbsval DontBlameSendmailValues[] =

--- 201 unchanged lines hidden (view full) ---

376 (void) close(i);
377 }
378 else
379 InetMode = AF_INET;
380#else /* NETINET6 */
381 InetMode = AF_INET;
382#endif /* NETINET6 */
383 ControlSocketName = NULL;
384 memset(&ConnectOnlyTo, '\0', sizeof(ConnectOnlyTo));
385 DataFileBufferSize = 4096;
386 XscriptFileBufferSize = 4096;
387 for (i = 0; i < MAXRWSETS; i++)
388 RuleSetNames[i] = NULL;
389#if MILTER
390 InputFilters[0] = NULL;
391#endif /* MILTER */
392 RejectLogInterval = 3 HOURS;

--- 18 unchanged lines hidden (view full) ---

411 struct passwd *defpwent;
412 static char defuserbuf[40];
413
414 DefUser = defuserbuf;
415 defpwent = sm_getpwuid(DefUid);
416 (void) sm_strlcpy(defuserbuf,
417 (defpwent == NULL || defpwent->pw_name == NULL)
418 ? "nobody" : defpwent->pw_name,
419 sizeof(defuserbuf));
420 if (tTd(37, 4))
421 sm_dprintf("setdefuser: DefUid=%d, DefUser=%s\n",
422 (int) DefUid, DefUser);
423}
424/*
425** SETUPQUEUES -- initialize default queues
426**
427** The mqueue QUEUE structure gets filled in after readcf() but
428** we need something to point to now for the mailer setup,
429** which use "mqueue" as default queue.
430*/
431
432static void
433setupqueues()
434{
435 char buf[100];
436
437 MaxRunnersPerQueue = 1;
438 (void) sm_strlcpy(buf, "mqueue, P=/var/spool/mqueue", sizeof(buf));
439 makequeue(buf, false);
440}
441/*
442** SETUPMAILERS -- initialize default mailers
443*/
444
445static void
446setupmailers()
447{
448 char buf[100];
449
450 (void) sm_strlcpy(buf, "prog, P=/bin/sh, F=lsouDq9, T=X-Unix/X-Unix/X-Unix, A=sh -c \201u",
451 sizeof(buf));
452 makemailer(buf);
453
454 (void) sm_strlcpy(buf, "*file*, P=[FILE], F=lsDFMPEouq9, T=X-Unix/X-Unix/X-Unix, A=FILE \201u",
455 sizeof(buf));
456 makemailer(buf);
457
458 (void) sm_strlcpy(buf, "*include*, P=/dev/null, F=su, A=INCLUDE \201u",
459 sizeof(buf));
460 makemailer(buf);
461 initerrmailers();
462}
463/*
464** SETUPMAPS -- set up map classes
465*/
466
467#define MAPDEF(name, ext, flags, parse, open, close, lookup, store) \

--- 194 unchanged lines hidden (view full) ---

662
663#if SOCKETMAP
664 /* arbitrary daemons */
665 MAPDEF("socket", NULL, MCF_ALIASOK,
666 map_parseargs, socket_map_open, socket_map_close,
667 socket_map_lookup, null_map_store);
668#endif /* SOCKETMAP */
669
670#if _FFR_DPRINTF_MAP
671 /* dprintf map -- logs information to syslog */
672 MAPDEF("dprintf", NULL, 0,
673 dprintf_map_parseargs, null_map_open, null_map_close,
674 dprintf_map_lookup, null_map_store);
675#endif /* _FFR_DPRINTF_MAP */
676
677 if (tTd(38, 2))
678 {
679 /* bogus map -- always return tempfail */
680 MAPDEF("bogus", NULL, MCF_ALIASOK|MCF_OPTFILE,
681 map_parseargs, null_map_open, null_map_close,
682 bogus_map_lookup, null_map_store);
683 }
684}

--- 24 unchanged lines hidden (view full) ---

709{
710 register int i;
711 int nmaps;
712 char *maptype[MAXMAPSTACK];
713 short mapreturn[MAXMAPACTIONS];
714 char buf[MAXLINE];
715
716 /*
717 ** Make sure we have a host map.
718 */
719
720 if (stab("host", ST_MAP, ST_FIND) == NULL)
721 {
722 /* user didn't initialize: set up host map */
723 (void) sm_strlcpy(buf, "host host", sizeof(buf));
724#if NAMED_BIND
725 if (ConfigLevel >= 2)
726 (void) sm_strlcat(buf, " -a. -D", sizeof(buf));
727#endif /* NAMED_BIND */
728 (void) makemapentry(buf);
729 }
730
731 /*
732 ** Set up default aliases maps
733 */
734
735 nmaps = switch_map_find("aliases", maptype, mapreturn);
736 for (i = 0; i < nmaps; i++)
737 {
738 if (strcmp(maptype[i], "files") == 0 &&
739 stab("aliases.files", ST_MAP, ST_FIND) == NULL)
740 {
741 (void) sm_strlcpy(buf, "aliases.files null",
742 sizeof(buf));
743 (void) makemapentry(buf);
744 }
745#if NISPLUS
746 else if (strcmp(maptype[i], "nisplus") == 0 &&
747 stab("aliases.nisplus", ST_MAP, ST_FIND) == NULL)
748 {
749 (void) sm_strlcpy(buf, "aliases.nisplus nisplus -kalias -vexpansion mail_aliases.org_dir",
750 sizeof(buf));
751 (void) makemapentry(buf);
752 }
753#endif /* NISPLUS */
754#if NIS
755 else if (strcmp(maptype[i], "nis") == 0 &&
756 stab("aliases.nis", ST_MAP, ST_FIND) == NULL)
757 {
758 (void) sm_strlcpy(buf, "aliases.nis nis mail.aliases",
759 sizeof(buf));
760 (void) makemapentry(buf);
761 }
762#endif /* NIS */
763#if NETINFO
764 else if (strcmp(maptype[i], "netinfo") == 0 &&
765 stab("aliases.netinfo", ST_MAP, ST_FIND) == NULL)
766 {
767 (void) sm_strlcpy(buf, "aliases.netinfo netinfo -z, /aliases",
768 sizeof(buf));
769 (void) makemapentry(buf);
770 }
771#endif /* NETINFO */
772#if HESIOD
773 else if (strcmp(maptype[i], "hesiod") == 0 &&
774 stab("aliases.hesiod", ST_MAP, ST_FIND) == NULL)
775 {
776 (void) sm_strlcpy(buf, "aliases.hesiod hesiod aliases",
777 sizeof(buf));
778 (void) makemapentry(buf);
779 }
780#endif /* HESIOD */
781#if LDAPMAP && defined(SUN_EXTENSIONS) && \
782 defined(SUN_SIMPLIFIED_LDAP) && HASLDAPGETALIASBYNAME
783 else if (strcmp(maptype[i], "ldap") == 0 &&
784 stab("aliases.ldap", ST_MAP, ST_FIND) == NULL)
785 {
786 (void) strlcpy(buf, "aliases.ldap ldap -b . -h localhost -k mail=%0 -v mailgroup",
787 sizeof buf);
788 (void) makemapentry(buf);
789 }
790#endif /* LDAPMAP && defined(SUN_EXTENSIONS) && ... */
791 }
792 if (stab("aliases", ST_MAP, ST_FIND) == NULL)
793 {
794 (void) sm_strlcpy(buf, "aliases switch aliases", sizeof(buf));
795 (void) makemapentry(buf);
796 }
797}
798
799/*
800** SWITCH_MAP_FIND -- find the list of types associated with a map
801**
802** This is the system-dependent interface to the service switch.
803**
804** Parameters:
805** service -- the name of the service of interest.
806** maptype -- an out-array of strings containing the types

--- 150 unchanged lines hidden (view full) ---

957 if (ConfigFileRead)
958 servicecachetime = now;
959 fp = safefopen(ServiceSwitchFile, O_RDONLY, 0, sff);
960 if (fp != NULL)
961 {
962 char buf[MAXLINE];
963
964 while (sm_io_fgets(fp, SM_TIME_DEFAULT, buf,
965 sizeof(buf)) != NULL)
966 {
967 register char *p;
968
969 p = strpbrk(buf, "#\n");
970 if (p != NULL)
971 *p = '\0';
972 p = strpbrk(buf, " \t");
973 if (p != NULL)

--- 266 unchanged lines hidden (view full) ---

1240 usrerr("553 No ARPA mail through this machine: see your system administration");
1241 /* e->e_flags |= EF_NO_BODY_RETN; to suppress body on return */
1242 to->q_status = "5.7.1";
1243 return EX_UNAVAILABLE;
1244 }
1245#endif /* EXAMPLE_CODE */
1246 return EX_OK;
1247}
1248
1249#ifdef SUN_EXTENSIONS
1250static void
1251init_md_sun()
1252{
1253 struct stat sbuf;
1254
1255 /* Check for large file descriptor */
1256 if (fstat(fileno(stdin), &sbuf) < 0)
1257 {
1258 if (errno == EOVERFLOW)
1259 {
1260 perror("stdin");
1261 exit(EX_NOINPUT);
1262 }
1263 }
1264}
1265#endif /* SUN_EXTENSIONS */
1266
1267/*
1268** INIT_MD -- do machine dependent initializations
1269**
1270** Systems that have global modes that should be set should do
1271** them here rather than in main.
1272*/
1273
1274#ifdef _AUX_SOURCE

--- 16 unchanged lines hidden (view full) ---

1291#ifdef SUN_EXTENSIONS
1292 init_md_sun();
1293#endif /* SUN_EXTENSIONS */
1294
1295#if _CONVEX_SOURCE
1296 /* keep gethostby*() from stripping the local domain name */
1297 set_domain_trim_off();
1298#endif /* _CONVEX_SOURCE */
1299#if defined(__QNX__) && !defined(__QNXNTO__)
1300 /*
1301 ** Due to QNX's network distributed nature, you can target a tcpip
1302 ** stack on a different node in the qnx network; this patch lets
1303 ** this feature work. The __sock_locate() must be done before the
1304 ** environment is clear.
1305 */
1306 __sock_locate();
1307#endif /* __QNX__ */

--- 152 unchanged lines hidden (view full) ---

1460# endif /* LA_TYPE == LA_SHORT */
1461# endif /* LA_TYPE == LA_INT */
1462 extern off_t lseek();
1463
1464 if (kmem < 0)
1465 {
1466# ifdef _AUX_SOURCE
1467 (void) sm_strlcpy(Nl[X_AVENRUN].n_name, LA_AVENRUN,
1468 sizeof(Nl[X_AVENRUN].n_name));
1469 Nl[1].n_name[0] = '\0';
1470# endif /* _AUX_SOURCE */
1471
1472# if defined(_AIX3) || defined(_AIX4)
1473 if (knlist(Nl, 1, sizeof(Nl[0])) < 0)
1474# else /* defined(_AIX3) || defined(_AIX4) */
1475 if (nlist(_PATH_UNIX, Nl) < 0)
1476# endif /* defined(_AIX3) || defined(_AIX4) */
1477 {
1478 if (tTd(3, 1))
1479 sm_dprintf("getla: nlist(%s): %s\n", _PATH_UNIX,
1480 sm_errstring(errno));
1481 return -1;

--- 456 unchanged lines hidden (view full) ---

1938 {
1939 sm_syslog(LOG_ERR, NOQID,
1940 "can't open %s: %s",
1941 _PATH_AVENRUN, sm_errstring(errno));
1942 return -1;
1943 }
1944 }
1945
1946 r = read(afd, &avenrun, sizeof(avenrun));
1947
1948 if (tTd(3, 5))
1949 sm_dprintf("getla: avenrun = %d\n", avenrun);
1950 loadav = (int) (avenrun + FSCALE/2) >> FSHIFT;
1951 if (tTd(3, 1))
1952 sm_dprintf("getla: %d\n", loadav);
1953 return loadav;
1954}

--- 130 unchanged lines hidden (view full) ---

2085*/
2086
2087void
2088sm_getla()
2089{
2090 char labuf[8];
2091
2092 CurrentLA = getla();
2093 (void) sm_snprintf(labuf, sizeof(labuf), "%d", CurrentLA);
2094 macdefine(&GlobalMacros, A_TEMP, macid("{load_avg}"), labuf);
2095}
2096/*
2097** SHOULDQUEUE -- should this message be queued or sent?
2098**
2099** Compares the message cost to the load average to decide.
2100**
2101** Note: Do NOT change this API! It is documented in op.me

--- 39 unchanged lines hidden (view full) ---

2141 }
2142#endif /* _FFR_MEMSTAT */
2143 if (CurrentLA < QueueLA)
2144 {
2145 if (tTd(3, 30))
2146 sm_dprintf("false (CurrentLA < QueueLA)\n");
2147 return false;
2148 }
2149 rval = pri > (QueueFactor / (CurrentLA - QueueLA + 1));
2150 if (tTd(3, 30))
2151 sm_dprintf("%s (by calculation)\n", rval ? "true" : "false");
2152 return rval;
2153}
2154
2155/*
2156** REFUSECONNECTIONS -- decide if connections should be refused
2157**
2158** Parameters:
2159** e -- the current envelope.
2160** dn -- number of daemon.
2161** active -- was this daemon actually active?
2162**
2163** Returns:
2164** true if incoming SMTP connections should be refused
2165** (for now).
2166** false if we should accept new work.
2167**
2168** Side Effects:
2169** Sets process title when it is rejecting connections.
2170*/
2171
2172bool
2173refuseconnections(e, dn, active)
2174 ENVELOPE *e;
2175 int dn;
2176 bool active;
2177{
2178 static time_t lastconn[MAXDAEMONS];
2179 static int conncnt[MAXDAEMONS];
2180 static time_t firstrejtime[MAXDAEMONS];
2181 static time_t nextlogtime[MAXDAEMONS];
2182 int limit;
2183#if _FFR_MEMSTAT
2184 long memfree;
2185#endif /* _FFR_MEMSTAT */
2186
2187#if XLA
2188 if (!xla_smtp_ok())
2189 return true;
2190#endif /* XLA */
2191
2192 SM_ASSERT(dn >= 0);
2193 SM_ASSERT(dn < MAXDAEMONS);
2194 if (ConnRateThrottle > 0)
2195 {
2196 time_t now;
2197
2198 now = curtime();
2199 if (active)
2200 {
2201 if (now != lastconn[dn])
2202 {
2203 lastconn[dn] = now;
2204 conncnt[dn] = 1;
2205 }
2206 else if (conncnt[dn]++ > ConnRateThrottle)
2207 {
2208#define D_MSG_CRT "deferring connections on daemon %s: %d per second"
2209 /* sleep to flatten out connection load */
2210 sm_setproctitle(true, e, D_MSG_CRT,
2211 Daemons[dn].d_name,
2212 ConnRateThrottle);
2213 if (LogLevel > 8)
2214 sm_syslog(LOG_INFO, NOQID, D_MSG_CRT,
2215 Daemons[dn].d_name,
2216 ConnRateThrottle);
2217 (void) sleep(1);
2218 }
2219 }
2220 else if (now != lastconn[dn])
2221 conncnt[dn] = 0;
2222 }
2223
2224
2225#if _FFR_MEMSTAT
2226 if (RefuseLowMem > 0 &&
2227 sm_memstat_get(MemoryResource, &memfree) >= 0 &&
2228 memfree < RefuseLowMem)
2229 {
2230# define R_MSG_LM "rejecting connections on daemon %s: free memory: %ld"
2231 sm_setproctitle(true, e, R_MSG_LM, Daemons[dn].d_name, memfree);
2232 if (LogLevel > 8)
2233 sm_syslog(LOG_NOTICE, NOQID, R_MSG_LM,
2234 Daemons[dn].d_name, memfree);
2235 return true;
2236 }
2237#endif /* _FFR_MEMSTAT */
2238 sm_getla();
2239 limit = (Daemons[dn].d_refuseLA != DPO_NOTSET) ?
2240 Daemons[dn].d_refuseLA : RefuseLA;
2241 if (limit > 0 && CurrentLA >= limit)
2242 {
2243 time_t now;
2244
2245# define R_MSG_LA "rejecting connections on daemon %s: load average: %d"
2246# define R2_MSG_LA "have been rejecting connections on daemon %s for %s"
2247 sm_setproctitle(true, e, R_MSG_LA, Daemons[dn].d_name,
2248 CurrentLA);
2249 if (LogLevel > 8)
2250 sm_syslog(LOG_NOTICE, NOQID, R_MSG_LA,
2251 Daemons[dn].d_name, CurrentLA);
2252 now = curtime();
2253 if (firstrejtime[dn] == 0)
2254 {
2255 firstrejtime[dn] = now;
2256 nextlogtime[dn] = now + RejectLogInterval;
2257 }
2258 else if (nextlogtime[dn] < now)
2259 {
2260 sm_syslog(LOG_ERR, NOQID, R2_MSG_LA, Daemons[dn].d_name,
2261 pintvl(now - firstrejtime[dn], true));
2262 nextlogtime[dn] = now + RejectLogInterval;
2263 }
2264 return true;
2265 }
2266 else
2267 firstrejtime[dn] = 0;
2268
2269 limit = (Daemons[dn].d_delayLA != DPO_NOTSET) ?
2270 Daemons[dn].d_delayLA : DelayLA;
2271 if (limit > 0 && CurrentLA >= limit)
2272 {
2273 time_t now;
2274 static time_t log_delay = (time_t) 0;
2275
2276# define MIN_DELAY_LOG 90 /* wait before logging this again */
2277# define D_MSG_LA "delaying connections on daemon %s: load average=%d >= %d"
2278 /* sleep to flatten out connection load */
2279 sm_setproctitle(true, e, D_MSG_LA, Daemons[dn].d_name, limit);
2280 if (LogLevel > 8 && (now = curtime()) > log_delay)
2281 {
2282 sm_syslog(LOG_INFO, NOQID, D_MSG_LA,
2283 Daemons[dn].d_name, CurrentLA, limit);
2284 log_delay = now + MIN_DELAY_LOG;
2285 }
2286 (void) sleep(1);
2287 }
2288
2289 limit = (Daemons[dn].d_maxchildren != DPO_NOTSET) ?
2290 Daemons[dn].d_maxchildren : MaxChildren;
2291 if (limit > 0 && CurChildren >= limit)
2292 {
2293 proc_list_probe();
2294 if (CurChildren >= limit)
2295 {
2296#define R_MSG_CHILD "rejecting connections on daemon %s: %d children, max %d"
2297 sm_setproctitle(true, e, R_MSG_CHILD,
2298 Daemons[dn].d_name, CurChildren,
2299 limit);
2300 if (LogLevel > 8)
2301 sm_syslog(LOG_INFO, NOQID, R_MSG_CHILD,
2302 Daemons[dn].d_name, CurChildren,
2303 limit);
2304 return true;
2305 }
2306 }
2307 return false;
2308}
2309
2310/*
2311** SETPROCTITLE -- set process title for ps
2312**
2313** Parameters:
2314** fmt -- a printf style format string.
2315** a, b, c -- possible parameters to fmt.
2316**
2317** Returns:

--- 112 unchanged lines hidden (view full) ---

2430 ** Move the environment so setproctitle can use the space at
2431 ** the top of memory.
2432 */
2433
2434 if (envp != NULL)
2435 {
2436 for (i = 0; envp[i] != NULL; i++)
2437 continue;
2438 environ = (char **) xalloc(sizeof(char *) * (i + 1));
2439 for (i = 0; envp[i] != NULL; i++)
2440 environ[i] = newstr(envp[i]);
2441 environ[i] = NULL;
2442 }
2443
2444 /*
2445 ** Save start and extent of argv for setproctitle.
2446 */

--- 152 unchanged lines hidden (view full) ---

2599 va_dcl
2600#endif /* __STDC__ */
2601{
2602 char buf[SPT_BUFSIZE];
2603 SM_VA_LOCAL_DECL
2604
2605 /* print the argument string */
2606 SM_VA_START(ap, fmt);
2607 (void) sm_vsnprintf(buf, sizeof(buf), fmt, ap);
2608 SM_VA_END(ap);
2609
2610 if (status)
2611 proc_list_set(CurrentPid, buf);
2612
2613 if (ProcTitlePrefix != NULL)
2614 {
2615 char prefix[SPT_BUFSIZE];
2616
2617 expand(ProcTitlePrefix, prefix, sizeof(prefix), e);
2618 setproctitle("%s: %s", prefix, buf);
2619 }
2620 else
2621 setproctitle("%s", buf);
2622}
2623/*
2624** WAITFOR -- wait for a particular process id.
2625**

--- 201 unchanged lines hidden (view full) ---

2827 /* try /usr/include/whoami.h -- has a #define somewhere */
2828 if ((file = sm_io_open(SmFtStdio, SM_TIME_DEFAULT,
2829 "/usr/include/whoami.h", SM_IO_RDONLY, NULL))
2830 != NULL)
2831 {
2832 char buf[MAXLINE];
2833
2834 while (sm_io_fgets(file, SM_TIME_DEFAULT,
2835 buf, sizeof(buf)) != NULL)
2836 {
2837 if (sm_io_sscanf(buf, "#define sysname \"%*[^\"]\"",
2838 NODE_LENGTH, name->nodename) > 0)
2839 break;
2840 }
2841 (void) sm_io_close(file, SM_TIME_DEFAULT);
2842 if (name->nodename[0] != '\0')
2843 return 0;

--- 357 unchanged lines hidden (view full) ---

3201 for (d = DefaultUserShells; *d != NULL; d++)
3202 {
3203 if (strcmp(shell, *d) == 0)
3204 return true;
3205 }
3206 return false;
3207 }
3208
3209 while (sm_io_fgets(shellf, SM_TIME_DEFAULT, buf, sizeof(buf)) != NULL)
3210 {
3211 register char *p, *q;
3212
3213 p = buf;
3214 while (*p != '\0' && *p != '#' && *p != '/')
3215 p++;
3216 if (*p == '#' || *p == '\0')
3217 continue;

--- 55 unchanged lines hidden (view full) ---

3273# include <sys/mount.h>
3274# endif /* SFS_TYPE == SFS_MOUNT */
3275# if SFS_TYPE == SFS_STATVFS
3276# include <sys/statvfs.h>
3277# endif /* SFS_TYPE == SFS_STATVFS */
3278
3279long
3280freediskspace(dir, bsize)
3281 const char *dir;
3282 long *bsize;
3283{
3284# if SFS_TYPE == SFS_NONE
3285 if (bsize != NULL)
3286 *bsize = 4096L;
3287
3288 /* assume free space is plentiful */
3289 return (long) LONG_MAX;

--- 21 unchanged lines hidden (view full) ---

3311# ifndef SFS_BAVAIL
3312# define SFS_BAVAIL f_bavail
3313# endif /* ! SFS_BAVAIL */
3314
3315# if SFS_TYPE == SFS_USTAT
3316 if (stat(dir, &statbuf) == 0 && ustat(statbuf.st_dev, &fs) == 0)
3317# else /* SFS_TYPE == SFS_USTAT */
3318# if SFS_TYPE == SFS_4ARGS
3319 if (statfs(dir, &fs, sizeof(fs), 0) == 0)
3320# else /* SFS_TYPE == SFS_4ARGS */
3321# if SFS_TYPE == SFS_STATVFS
3322 if (statvfs(dir, &fs) == 0)
3323# else /* SFS_TYPE == SFS_STATVFS */
3324# if defined(ultrix)
3325 if (statfs(dir, &fs) > 0)
3326# else /* defined(ultrix) */
3327 if (statfs(dir, &fs) == 0)

--- 188 unchanged lines hidden (view full) ---

3516 int save_errno;
3517# if !HASFLOCK
3518 int action;
3519 struct flock lfd;
3520
3521 if (ext == NULL)
3522 ext = "";
3523
3524 memset(&lfd, '\0', sizeof(lfd));
3525 if (bitset(LOCK_UN, type))
3526 lfd.l_type = F_UNLCK;
3527 else if (bitset(LOCK_EX, type))
3528 lfd.l_type = F_WRLCK;
3529 else
3530 lfd.l_type = F_RDLCK;
3531
3532 if (bitset(LOCK_NB, type))

--- 348 unchanged lines hidden (view full) ---

3881}
3882
3883
3884void
3885vendor_post_defaults(e)
3886 ENVELOPE *e;
3887{
3888#ifdef __QNX__
3889 /* Makes sure the SOCK environment variable remains */
3890 sm_setuserenv("SOCK", NULL);
3891#endif /* __QNX__ */
3892#if defined(SUN_EXTENSIONS) && defined(SUN_DEFAULT_VALUES)
3893 sun_post_defaults(e);
3894#endif /* defined(SUN_EXTENSIONS) && defined(SUN_DEFAULT_VALUES) */
3895}
3896/*
3897** VENDOR_DAEMON_SETUP -- special vendor setup needed for daemon mode
3898*/

--- 79 unchanged lines hidden (view full) ---

3978#endif /* TCPWRAPPERS */
3979
3980 if (tTd(48, 3))
3981 sm_dprintf("validate_connection(%s, %s)\n",
3982 hostname, anynet_ntoa(sap));
3983
3984 connection_rate_check(sap, e);
3985 if (rscheck("check_relay", hostname, anynet_ntoa(sap),
3986 e, RSF_RMCOMM|RSF_COUNT, 3, NULL, NOQID, NULL) != EX_OK)
3987 {
3988 static char reject[BUFSIZ*2];
3989 extern char MsgBuf[];
3990
3991 if (tTd(48, 4))
3992 sm_dprintf(" ... validate_connection: BAD (rscheck)\n");
3993
3994 if (strlen(MsgBuf) >= 3)
3995 (void) sm_strlcpy(reject, MsgBuf, sizeof(reject));
3996 else
3997 (void) sm_strlcpy(reject, "Access denied", sizeof(reject));
3998
3999 return reject;
4000 }
4001
4002#if TCPWRAPPERS
4003 if (hostname[0] == '[' && hostname[strlen(hostname) - 1] == ']')
4004 host = "unknown";
4005 else

--- 300 unchanged lines hidden (view full) ---

4306 if (strcmp(maptype[nmaps], "nis") == 0 ||
4307 strcmp(maptype[nmaps], "files") == 0)
4308 break;
4309 }
4310
4311 if (nmaps >= 0)
4312 {
4313 /* try short name */
4314 if (strlen(name) > sizeof(hbuf) - 1)
4315 {
4316 errno = save_errno;
4317 return NULL;
4318 }
4319 (void) sm_strlcpy(hbuf, name, sizeof(hbuf));
4320 (void) shorten_hostname(hbuf);
4321
4322 /* if it hasn't been shortened, there's no point */
4323 if (strcmp(hbuf, name) != 0)
4324 {
4325 if (tTd(61, 10))
4326 sm_dprintf("sm_gethostbyname(%s, %d)... ",
4327 hbuf, family);

--- 35 unchanged lines hidden (view full) ---

4363 for (i = 0; h->h_addr_list[i] != NULL; i++)
4364 {
4365 char *addr;
4366
4367#if NETINET6
4368 memmove(&ia6, h->h_addr_list[i],
4369 IN6ADDRSZ);
4370 addr = anynet_ntop(&ia6,
4371 buf6, sizeof(buf6));
4372#else /* NETINET6 */
4373 memmove(&ia, h->h_addr_list[i],
4374 INADDRSZ);
4375 addr = (char *) inet_ntoa(ia);
4376#endif /* NETINET6 */
4377 if (addr != NULL)
4378 sm_dprintf("\taddr: %s\n", addr);
4379 }

--- 222 unchanged lines hidden (view full) ---

4602
4603 /* save its cname */
4604 if (!wordinclass((char *) hp->h_name, 'w'))
4605 {
4606 setclass('w', (char *) hp->h_name);
4607 if (tTd(0, 4))
4608 sm_dprintf("\ta.k.a.: %s\n", hp->h_name);
4609
4610 if (sm_snprintf(hnb, sizeof(hnb), "[%s]", hp->h_name) <
4611 sizeof(hnb)
4612 && !wordinclass((char *) hnb, 'w'))
4613 setclass('w', hnb);
4614 }
4615 else
4616 {
4617 if (tTd(0, 43))
4618 sm_dprintf("\ta.k.a.: %s (already in $=w)\n", hp->h_name);
4619 }
4620
4621 /* save all it aliases name */
4622 for (ha = hp->h_aliases; ha != NULL && *ha != NULL; ha++)
4623 {
4624 if (!wordinclass(*ha, 'w'))
4625 {
4626 setclass('w', *ha);
4627 if (tTd(0, 4))
4628 sm_dprintf("\ta.k.a.: %s\n", *ha);
4629 if (sm_snprintf(hnb, sizeof(hnb),
4630 "[%s]", *ha) < sizeof(hnb) &&
4631 !wordinclass((char *) hnb, 'w'))
4632 setclass('w', hnb);
4633 }
4634 else
4635 {
4636 if (tTd(0, 43))
4637 sm_dprintf("\ta.k.a.: %s (already in $=w)\n",
4638 *ha);

--- 96 unchanged lines hidden (view full) ---

4735 numifs = MAXINTERFACES;
4736
4737 if (numifs <= 0)
4738 {
4739 (void) close(s);
4740 return;
4741 }
4742
4743 len = lifc.lifc_len = numifs * sizeof(struct lifreq);
4744 buf = lifc.lifc_buf = xalloc(lifc.lifc_len);
4745# ifndef __hpux
4746 lifc.lifc_family = AF_UNSPEC;
4747 lifc.lifc_flags = 0;
4748# endif /* ! __hpux */
4749 if (ioctl(s, SIOCGLIFCONF, (char *)&lifc) < 0)
4750 {
4751 if (tTd(0, 4))

--- 40 unchanged lines hidden (view full) ---

4792 return;
4793 }
4794
4795 /*
4796 ** If we don't have a complete ifr structure,
4797 ** don't try to use it.
4798 */
4799
4800 if ((len - i) < sizeof(*ifr))
4801 break;
4802
4803# ifdef BSD4_4_SOCKADDR
4804 if (sa->sa.sa_len > sizeof(ifr->lifr_addr))
4805 i += sizeof(ifr->lifr_name) + sa->sa.sa_len;
4806 else
4807# endif /* BSD4_4_SOCKADDR */
4808# ifdef DEC
4809 /* fix for IPv6 size differences */
4810 i += sizeof(ifr->ifr_name) +
4811 max(sizeof(ifr->ifr_addr), ifr->ifr_addr.sa_len);
4812# else /* DEC */
4813 i += sizeof(*ifr);
4814# endif /* DEC */
4815
4816 if (tTd(0, 20))
4817 sm_dprintf("%s\n", anynet_ntoa(sa));
4818
4819 if (af != AF_INET && af != AF_INET6)
4820 continue;
4821

--- 37 unchanged lines hidden (view full) ---

4859 sa->sin6.sin6_scope_id = ntohs(ia6p->s6_addr[3] |
4860 ((unsigned int)ia6p->s6_addr[2] << 8));
4861 ia6p->s6_addr[2] = ia6p->s6_addr[3] = 0;
4862 }
4863# endif /* __KAME__ */
4864 ia6 = sa->sin6.sin6_addr;
4865 if (IN6_IS_ADDR_UNSPECIFIED(&ia6))
4866 {
4867 addr = anynet_ntop(&ia6, buf6, sizeof(buf6));
4868 message("WARNING: interface %s is UP with %s address",
4869 name, addr == NULL ? "(NULL)" : addr);
4870 continue;
4871 }
4872
4873 /* save IP address in text from */
4874 addr = anynet_ntop(&ia6, buf6, sizeof(buf6));
4875 if (addr != NULL)
4876 (void) sm_snprintf(ip_addr, sizeof(ip_addr),
4877 "[%.*s]",
4878 (int) sizeof(ip_addr) - 3,
4879 addr);
4880 break;
4881
4882 case AF_INET:
4883 ia = sa->sin.sin_addr;
4884 if (ia.s_addr == INADDR_ANY ||
4885 ia.s_addr == INADDR_NONE)
4886 {
4887 message("WARNING: interface %s is UP with %s address",
4888 name, inet_ntoa(ia));
4889 continue;
4890 }
4891
4892 /* save IP address in text from */
4893 (void) sm_snprintf(ip_addr, sizeof(ip_addr), "[%.*s]",
4894 (int) sizeof(ip_addr) - 3, inet_ntoa(ia));
4895 break;
4896 }
4897
4898 if (*ip_addr == '\0')
4899 continue;
4900
4901 if (!wordinclass(ip_addr, 'w'))
4902 {

--- 39 unchanged lines hidden (view full) ---

4942# endif /* defined(SIOCGIFNUM) && !SIOCGIFNUM_IS_BROKEN */
4943 numifs = MAXINTERFACES;
4944
4945 if (numifs <= 0)
4946 {
4947 (void) close(s);
4948 return;
4949 }
4950 ifc.ifc_len = numifs * sizeof(struct ifreq);
4951 ifc.ifc_buf = xalloc(ifc.ifc_len);
4952 if (ioctl(s, SIOCGIFCONF, (char *)&ifc) < 0)
4953 {
4954 if (tTd(0, 4))
4955 sm_dprintf("SIOCGIFCONF failed: %s\n",
4956 sm_errstring(errno));
4957 (void) close(s);
4958 return;

--- 22 unchanged lines hidden (view full) ---

4981 char buf6[INET6_ADDRSTRLEN];
4982# endif /* NETINET6 */
4983
4984 /*
4985 ** If we don't have a complete ifr structure,
4986 ** don't try to use it.
4987 */
4988
4989 if ((ifc.ifc_len - i) < sizeof(*ifr))
4990 break;
4991
4992# ifdef BSD4_4_SOCKADDR
4993 if (sa->sa.sa_len > sizeof(ifr->ifr_addr))
4994 i += sizeof(ifr->ifr_name) + sa->sa.sa_len;
4995 else
4996# endif /* BSD4_4_SOCKADDR */
4997 i += sizeof(*ifr);
4998
4999 if (tTd(0, 20))
5000 sm_dprintf("%s\n", anynet_ntoa(sa));
5001
5002 af = ifr->ifr_addr.sa_family;
5003 if (af != AF_INET
5004# if NETINET6
5005 && af != AF_INET6

--- 28 unchanged lines hidden (view full) ---

5034 ia.s_addr == INADDR_NONE)
5035 {
5036 message("WARNING: interface %s is UP with %s address",
5037 ifr->ifr_name, inet_ntoa(ia));
5038 continue;
5039 }
5040
5041 /* save IP address in text from */
5042 (void) sm_snprintf(ip_addr, sizeof(ip_addr), "[%.*s]",
5043 (int) sizeof(ip_addr) - 3,
5044 inet_ntoa(ia));
5045 break;
5046
5047# if NETINET6
5048 case AF_INET6:
5049# ifdef __KAME__
5050 /* convert into proper scoped address */
5051 if ((IN6_IS_ADDR_LINKLOCAL(&sa->sin6.sin6_addr) ||

--- 6 unchanged lines hidden (view full) ---

5058 sa->sin6.sin6_scope_id = ntohs(ia6p->s6_addr[3] |
5059 ((unsigned int)ia6p->s6_addr[2] << 8));
5060 ia6p->s6_addr[2] = ia6p->s6_addr[3] = 0;
5061 }
5062# endif /* __KAME__ */
5063 ia6 = sa->sin6.sin6_addr;
5064 if (IN6_IS_ADDR_UNSPECIFIED(&ia6))
5065 {
5066 addr = anynet_ntop(&ia6, buf6, sizeof(buf6));
5067 message("WARNING: interface %s is UP with %s address",
5068 ifr->ifr_name,
5069 addr == NULL ? "(NULL)" : addr);
5070 continue;
5071 }
5072
5073 /* save IP address in text from */
5074 addr = anynet_ntop(&ia6, buf6, sizeof(buf6));
5075 if (addr != NULL)
5076 (void) sm_snprintf(ip_addr, sizeof(ip_addr),
5077 "[%.*s]",
5078 (int) sizeof(ip_addr) - 3,
5079 addr);
5080 break;
5081
5082# endif /* NETINET6 */
5083 }
5084
5085 if (ip_addr[0] == '\0')
5086 continue;

--- 62 unchanged lines hidden (view full) ---

5149
5150#ifdef USESYSCTL
5151# if defined(CTL_HW) && defined(HW_NCPU)
5152 size_t sz;
5153 int mib[2];
5154
5155 mib[0] = CTL_HW;
5156 mib[1] = HW_NCPU;
5157 sz = (size_t) sizeof(nproc);
5158 (void) sysctl(mib, 2, &nproc, &sz, NULL, 0);
5159# endif /* defined(CTL_HW) && defined(HW_NCPU) */
5160#else /* USESYSCTL */
5161# ifdef _SC_NPROCESSORS_ONLN
5162 nproc = (int) sysconf(_SC_NPROCESSORS_ONLN);
5163# else /* _SC_NPROCESSORS_ONLN */
5164# ifdef __hpux
5165# include <sys/pstat.h>

--- 159 unchanged lines hidden (view full) ---

5325 {
5326 id = "";
5327 idlen = SyslogPrefixLen;
5328 }
5329 else
5330 idlen = strlen(id) + SyslogPrefixLen;
5331
5332 buf = buf0;
5333 bufsize = sizeof(buf0);
5334
5335 for (;;)
5336 {
5337 int n;
5338
5339 /* print log message into buf */
5340 SM_VA_START(ap, fmt);
5341 n = sm_vsnprintf(buf, bufsize, fmt, ap);

--- 13 unchanged lines hidden (view full) ---

5355 }
5356
5357 /* clean up buf after it has been expanded with args */
5358 newstring = str2prt(buf);
5359 if ((strlen(newstring) + idlen + 1) < SYSLOG_BUFSIZE)
5360 {
5361#if LOG
5362 if (*id == '\0')
5363 {
5364 if (tTd(89, 8))
5365 sm_dprintf("%s\n", newstring);
5366 else
5367 syslog(level, "%s", newstring);
5368 }
5369 else
5370 {
5371 if (tTd(89, 8))
5372 sm_dprintf("%s: %s\n", id, newstring);
5373 else
5374 syslog(level, "%s: %s", id, newstring);
5375 }
5376#else /* LOG */
5377 /*XXX should do something more sensible */
5378 if (*id == '\0')
5379 (void) sm_io_fprintf(smioerr, SM_TIME_DEFAULT, "%s\n",
5380 newstring);
5381 else
5382 (void) sm_io_fprintf(smioerr, SM_TIME_DEFAULT,
5383 "%s: %s\n", id, newstring);

--- 35 unchanged lines hidden (view full) ---

5419 end--;
5420 }
5421 /* No separator, break midstring... */
5422 if (end == begin)
5423 end = begin + SYSLOG_BUFSIZE - idlen - SL_SPLIT;
5424 save = *end;
5425 *end = 0;
5426#if LOG
5427 if (tTd(89, 8))
5428 sm_dprintf("%s[%d]: %s ...\n", id, seq++, begin);
5429 else
5430 syslog(level, "%s[%d]: %s ...", id, seq++, begin);
5431#else /* LOG */
5432 (void) sm_io_fprintf(smioerr, SM_TIME_DEFAULT,
5433 "%s[%d]: %s ...\n", id, seq++, begin);
5434#endif /* LOG */
5435 *end = save;
5436 begin = end;
5437 }
5438 if (seq >= 999)
5439 {
5440#if LOG
5441 if (tTd(89, 8))
5442 sm_dprintf("%s[%d]: log terminated, too many parts\n",
5443 id, seq);
5444 else
5445 syslog(level, "%s[%d]: log terminated, too many parts",
5446 id, seq);
5447#else /* LOG */
5448 (void) sm_io_fprintf(smioerr, SM_TIME_DEFAULT,
5449 "%s[%d]: log terminated, too many parts\n", id, seq);
5450#endif /* LOG */
5451 }
5452 else if (*begin != '\0')
5453 {
5454#if LOG
5455 if (tTd(89, 8))
5456 sm_dprintf("%s[%d]: %s\n", id, seq, begin);
5457 else
5458 syslog(level, "%s[%d]: %s", id, seq, begin);
5459#else /* LOG */
5460 (void) sm_io_fprintf(smioerr, SM_TIME_DEFAULT,
5461 "%s[%d]: %s\n", id, seq, begin);
5462#endif /* LOG */
5463 }
5464 if (buf != buf0)
5465 sm_free(buf);
5466 errno = save_errno;
5467}
5468/*
5469** HARD_SYSLOG -- call syslog repeatedly until it works
5470**
5471** Needed on HP-UX, which apparently doesn't guarantee that

--- 22 unchanged lines hidden (view full) ---

5494 va_dcl
5495# endif /* __STDC__ */
5496{
5497 int i;
5498 char buf[SYSLOG_BUFSIZE];
5499 SM_VA_LOCAL_DECL
5500
5501 SM_VA_START(ap, msg);
5502 (void) sm_vsnprintf(buf, sizeof(buf), msg, ap);
5503 SM_VA_END(ap);
5504
5505 for (i = MAXSYSLOGTRIES; --i >= 0 && syslog(pri, CAST "%s", buf) < 0; )
5506 continue;
5507}
5508
5509# undef CAST
5510#endif /* defined(__hpux) && !defined(HPUX11) */

--- 241 unchanged lines hidden (view full) ---

5752 "SASLv2",
5753# else /* SASL >= 20000 */
5754 "SASL",
5755# endif /* SASL >= 20000 */
5756#endif /* SASL */
5757#if SCANF
5758 "SCANF",
5759#endif /* SCANF */
5760#if SM_LDAP_ERROR_ON_MISSING_ARGS
5761 "SM_LDAP_ERROR_ON_MISSING_ARGS",
5762#endif /* SM_LDAP_ERROR_ON_MISSING_ARGS */
5763#if SMTPDEBUG
5764 "SMTPDEBUG",
5765#endif /* SMTPDEBUG */
5766#if SOCKETMAP
5767 "SOCKETMAP",
5768#endif /* SOCKETMAP */
5769#if STARTTLS
5770 "STARTTLS",

--- 78 unchanged lines hidden (view full) ---

5849 "HASGETDTABLESIZE",
5850#endif /* HASGETDTABLESIZE */
5851#if HASGETUSERSHELL
5852 "HASGETUSERSHELL",
5853#endif /* HASGETUSERSHELL */
5854#if HASINITGROUPS
5855 "HASINITGROUPS",
5856#endif /* HASINITGROUPS */
5857#if HASLDAPGETALIASBYNAME
5858 "HASLDAPGETALIASBYNAME",
5859#endif /* HASLDAPGETALIASBYNAME */
5860#if HASLSTAT
5861 "HASLSTAT",
5862#endif /* HASLSTAT */
5863#if HASNICE
5864 "HASNICE",
5865#endif /* HASNICE */
5866#if HASRANDOM
5867 "HASRANDOM",

--- 56 unchanged lines hidden (view full) ---

5924 "IDENTPROTO",
5925#endif /* IDENTPROTO */
5926#if IP_SRCROUTE
5927 "IP_SRCROUTE",
5928#endif /* IP_SRCROUTE */
5929#if O_EXLOCK && HASFLOCK && !BOGUS_O_EXCL
5930 "LOCK_ON_OPEN",
5931#endif /* O_EXLOCK && HASFLOCK && !BOGUS_O_EXCL */
5932#if MILTER_NO_NAGLE
5933 "MILTER_NO_NAGLE ",
5934#endif /* MILTER_NO_NAGLE */
5935#if NEEDFSYNC
5936 "NEEDFSYNC",
5937#endif /* NEEDFSYNC */
5938#if NEEDLINK
5939 "NEEDLINK",
5940#endif /* NEEDLINK */
5941#if NEEDLOCAL_HOSTNAME_LENGTH
5942 "NEEDLOCAL_HOSTNAME_LENGTH",

--- 86 unchanged lines hidden (view full) ---

6029 /* DefaultAuthInfo can be specified by user. */
6030 /* DefaultAuthInfo doesn't really work in 8.13 anymore. */
6031 "_FFR_ALLOW_SASLINFO",
6032#endif /* _FFR_ALLOW_SASLINFO */
6033#if _FFR_BESTMX_BETTER_TRUNCATION
6034 /* Better truncation of list of MX records for dns map. */
6035 "_FFR_BESTMX_BETTER_TRUNCATION",
6036#endif /* _FFR_BESTMX_BETTER_TRUNCATION */
6037#if _FFR_CATCH_BROKEN_MTAS
6038 /* Deal with MTAs that send a reply during the DATA phase. */
6039 "_FFR_CATCH_BROKEN_MTAS",
6040#endif /* _FFR_CATCH_BROKEN_MTAS */
6041#if _FFR_CHK_QUEUE
6042 /* Stricter checks about queue directory permissions. */
6043 "_FFR_CHK_QUEUE",
6044#endif /* _FFR_CHK_QUEUE */
6045#if _FFR_CLIENT_SIZE
6046 /* Don't try to send mail if its size exceeds SIZE= of server. */
6047 "_FFR_CLIENT_SIZE",
6048#endif /* _FFR_CLIENT_SIZE */
6049#if _FFR_CRLPATH
6050 /* CRLPath; needs documentation; Al Smith */
6051 "_FFR_CRLPATH",
6052#endif /* _FFR_CRLPATH */
6053#if _FFR_DAEMON_NETUNIX
6054 /* Allow local (not just TCP) socket connection to server. */
6055 "_FFR_DAEMON_NETUNIX",
6056#endif /* _FFR_DAEMON_NETUNIX */

--- 5 unchanged lines hidden (view full) ---

6062 /* deliver first TA in background, then queue */
6063 "_FFR_DM_ONE",
6064#endif /* _FFR_DM_ONE */
6065#if _FFR_DIGUNIX_SAFECHOWN
6066 /* Properly set SAFECHOWN (include/sm/conf.h) for Digital UNIX */
6067/* Problem noted by Anne Bennett of Concordia University */
6068 "_FFR_DIGUNIX_SAFECHOWN",
6069#endif /* _FFR_DIGUNIX_SAFECHOWN */
6070#if _FFR_DNSMAP_ALIASABLE
6071 /* Allow dns map type to be used for aliases. */
6072/* Don Lewis of TDK */
6073 "_FFR_DNSMAP_ALIASABLE",
6074#endif /* _FFR_DNSMAP_ALIASABLE */
6075#if _FFR_DONTLOCKFILESFORREAD_OPTION
6076 /* Enable DontLockFilesForRead option. */
6077 "_FFR_DONTLOCKFILESFORREAD_OPTION",
6078#endif /* _FFR_DONTLOCKFILESFORREAD_OPTION */
6079#if _FFR_DOTTED_USERNAMES
6080 /* Allow usernames with '.' */
6081 "_FFR_DOTTED_USERNAMES",
6082#endif /* _FFR_DOTTED_USERNAMES */
6083#if _FFR_DPO_CS
6084 /*
6085 ** Make DaemonPortOptions case sensitive.
6086 ** For some unknown reasons the code converted every option
6087 ** to uppercase (first letter only, as that's the only one that
6088 ** is actually checked). This prevented all new lower case options
6089 ** from working...
6090 ** The documentation doesn't say anything about case (in)sensitivity,
6091 ** which means it should be case sensitive by default,
6092 ** but it's not a good idea to change this within a patch release,
6093 ** so let's delay this to 8.15.
6094 */
6095
6096 "_FFR_DPO_CS",
6097#endif /* _FFR_DPO_CS */
6098#if _FFR_DROP_TRUSTUSER_WARNING
6099 /*
6100 ** Don't issue this warning:
6101 ** "readcf: option TrustedUser may cause problems on systems
6102 ** which do not support fchown() if UseMSP is not set.
6103 */
6104
6105 "_FFR_DROP_TRUSTUSER_WARNING",
6106#endif /* _FFR_DROP_TRUSTUSER_WARNING */
6107#if _FFR_EIGHT_BIT_ADDR_OK
6108 /* EightBitAddrOK: allow 8-bit e-mail addresses */
6109 "_FFR_EIGHT_BIT_ADDR_OK",
6110#endif /* _FFR_EIGHT_BIT_ADDR_OK */
6111#if _FFR_EXTRA_MAP_CHECK
6112 /* perform extra checks on $( $) in R lines */
6113 "_FFR_EXTRA_MAP_CHECK",
6114#endif /* _FFR_EXTRA_MAP_CHECK */
6115#if _FFR_GETHBN_ExFILE
6116 /*
6117 ** According to Motonori Nakamura some gethostbyname()
6118 ** implementations (TurboLinux?) may (temporarily) fail
6119 ** due to a lack of file discriptors. Enabling this FFR
6120 ** will check errno for EMFILE and ENFILE and in case of a match
6121 ** cause a temporary error instead of a permanent error.
6122 ** The right solution is of course to file a bug against those
6123 ** systems such that they actually set h_errno = TRY_AGAIN.
6124 */
6125
6126 "_FFR_GETHBN_ExFILE",
6127#endif /* _FFR_GETHBN_ExFILE */
6128#if _FFR_FIX_DASHT
6129 /*
6130 ** If using -t, force not sending to argv recipients, even
6131 ** if they are mentioned in the headers.
6132 */
6133
6134 "_FFR_FIX_DASHT",
6135#endif /* _FFR_FIX_DASHT */
6136#if _FFR_FORWARD_SYSERR
6137 /* Cause a "syserr" if forward file isn't "safe". */
6138 "_FFR_FORWARD_SYSERR",
6139#endif /* _FFR_FORWARD_SYSERR */
6140#if _FFR_GEN_ORCPT
6141 /* Generate a ORCPT DSN arg if not already provided */
6142 "_FFR_GEN_ORCPT",
6143#endif /* _FFR_GEN_ORCPT */
6144#if _FFR_GROUPREADABLEAUTHINFOFILE
6145 /* Allow group readable DefaultAuthInfo file. */
6146 "_FFR_GROUPREADABLEAUTHINFOFILE",
6147#endif /* _FFR_GROUPREADABLEAUTHINFOFILE */
6148#if _FFR_HANDLE_ISO8859_GECOS
6149 /*
6150 ** Allow ISO 8859 characters in GECOS field: replace them
6151 ** ith ASCII "equivalent".
6152 */
6153
6154/* Peter Eriksson of Linkopings universitet */
6155 "_FFR_HANDLE_ISO8859_GECOS",
6156#endif /* _FFR_HANDLE_ISO8859_GECOS */
6157#if _FFR_HPUX_NSSWITCH
6158 /* Use nsswitch on HP-UX */
6159 "_FFR_HPUX_NSSWITCH",
6160#endif /* _FFR_HPUX_NSSWITCH */
6161#if _FFR_IGNORE_BOGUS_ADDR
6162 /* Ignore addresses for which prescan() failed */
6163 "_FFR_IGNORE_BOGUS_ADDR",
6164#endif /* _FFR_IGNORE_BOGUS_ADDR */

--- 12 unchanged lines hidden (view full) ---

6177 "_FFR_MAXDATASIZE",
6178#endif /* _FFR_MAXDATASIZE */
6179#if _FFR_MAX_FORWARD_ENTRIES
6180 /* Try to limit number of .forward entries */
6181 /* (doesn't work) */
6182/* Randall S. Winchester of the University of Maryland */
6183 "_FFR_MAX_FORWARD_ENTRIES",
6184#endif /* _FFR_MAX_FORWARD_ENTRIES */
6185#if _FFR_MAX_SLEEP_TIME
6186 /* Limit sleep(2) time in libsm/clock.c */
6187 "_FFR_MAX_SLEEP_TIME",
6188#endif /* _FFR_MAX_SLEEP_TIME */
6189#if _FFR_MEMSTAT
6190 /* Check free memory */
6191 "_FFR_MEMSTAT",
6192#endif /* _FFR_MEMSTAT */
6193#if _FFR_MILTER_CHECK
6194 "_FFR_MILTER_CHECK",
6195#endif /* _FFR_MILTER_CHECK */
6196#if _FFR_MILTER_CONVERT_ALL_LF_TO_CRLF
6197 /*
6198 ** milter_body() uses the same conversion algorithm as putbody()
6199 ** to translate the "local" df format (\n) to SMTP format (\r\n).
6200 ** However, putbody() and mime8to7() use different conversion
6201 ** algorithms.
6202 ** If the input date does not follow the SMTP standard
6203 ** (e.g., if it has "naked \r"s), then the output from putbody()
6204 ** and mime8to7() will most likely be different.
6205 ** By turning on this FFR milter_body() will try to "imitate"
6206 ** mime8to7().
6207 ** Note: there is no (simple) way to deal with both conversions
6208 ** in a consistent manner. Moreover, as the "GiGo" principle applies,
6209 ** it's not really worth to fix it.
6210 */
6211
6212 "_FFR_MILTER_CONVERT_ALL_LF_TO_CRLF",
6213#endif /* _FFR_MILTER_CONVERT_ALL_LF_TO_CRLF */
6214#if _FFR_MILTER_CHECK_REJECTIONS_TOO
6215 /*
6216 ** Also send RCPTs that are rejected by check_rcpt to a milter
6217 ** (if requested during option negotiation).
6218 */
6219
6220 "_FFR_MILTER_CHECK_REJECTIONS_TOO",
6221#endif /* _FFR_MILTER_CHECK_REJECTIONS_TOO */
6222#if _FFR_MIME7TO8_OLD
6223 /* Old mime7to8 code, the new is broken for at least one example. */
6224 "_FFR_MIME7TO8_OLD",
6225#endif /* _FFR_MAX_SLEEP_TIME */
6226#if _FFR_MSG_ACCEPT
6227 /* allow to override "Message accepted for delivery" */
6228 "_FFR_MSG_ACCEPT",
6229#endif /* _FFR_MSG_ACCEPT */

--- 5 unchanged lines hidden (view full) ---

6235#if _FFR_NO_PIPE
6236 /* Disable PIPELINING, delay client if used. */
6237 "_FFR_NO_PIPE",
6238#endif /* _FFR_NO_PIPE */
6239#if _FFR_LOG_NTRIES
6240 /* log ntries=, from Nik Clayton of FreeBSD */
6241 "_FFR_LOG_NTRIES",
6242#endif /* _FFR_LOG_NTRIES */
6243#if _FFR_QF_PARANOIA
6244 "_FFR_QF_PARANOIA",
6245#endif /* _FFR_QF_PARANOIA */
6246#if _FFR_QUEUEDELAY
6247 /* Exponential queue delay; disabled in 8.13 since it isn't used. */
6248 "_FFR_QUEUEDELAY",
6249#endif /* _FFR_QUEUEDELAY */
6250#if _FFR_QUEUE_GROUP_SORTORDER
6251 /* Allow QueueSortOrder per queue group. */
6252/* XXX: Still need to actually use qgrp->qg_sortorder */
6253 "_FFR_QUEUE_GROUP_SORTORDER",

--- 22 unchanged lines hidden (view full) ---

6276#if _FFR_RESET_MACRO_GLOBALS
6277 /* Allow macro 'j' to be set dynamically via rulesets. */
6278 "_FFR_RESET_MACRO_GLOBALS",
6279#endif /* _FFR_RESET_MACRO_GLOBALS */
6280#if _FFR_RHS
6281 /* Random shuffle for queue sorting. */
6282 "_FFR_RHS",
6283#endif /* _FFR_RHS */
6284#if _FFR_SHM_STATUS
6285 /* Donated code (unused). */
6286 "_FFR_SHM_STATUS",
6287#endif /* _FFR_SHM_STATUS */
6288#if _FFR_LDAP_SINGLEDN
6289 /*
6290 ** The LDAP database map code in Sendmail 8.12.10, when
6291 ** given the -1 switch, would match only a single DN,

--- 15 unchanged lines hidden (view full) ---

6307#if _FFR_SKIP_DOMAINS
6308 /* process every N'th domain instead of every N'th message */
6309 "_FFR_SKIP_DOMAINS",
6310#endif /* _FFR_SKIP_DOMAINS */
6311#if _FFR_SLEEP_USE_SELECT
6312 /* Use select(2) in libsm/clock.c to emulate sleep(2) */
6313 "_FFR_SLEEP_USE_SELECT ",
6314#endif /* _FFR_SLEEP_USE_SELECT */
6315#if _FFR_SPT_ALIGN
6316 /*
6317 ** It looks like the Compaq Tru64 5.1A now aligns argv and envp to 64
6318 ** bit alignment, so unless each piece of argv and envp is a multiple
6319 ** of 8 bytes (including terminating NULL), initsetproctitle() won't
6320 ** use any of the space beyond argv[0]. Be sure to set SPT_ALIGN_SIZE
6321 ** if you use this FFR.
6322 */

--- 36 unchanged lines hidden ---