aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/Makefile10
-rw-r--r--usr.sbin/arp/arp.c2
-rw-r--r--usr.sbin/chroot/chroot.c3
-rw-r--r--usr.sbin/config/config.y9
-rw-r--r--usr.sbin/config/mkioconf.c34
-rw-r--r--usr.sbin/config/mkswapconf.c16
-rw-r--r--usr.sbin/cron/CHANGES155
-rw-r--r--usr.sbin/cron/FEATURES84
-rw-r--r--usr.sbin/cron/Makefile7
-rw-r--r--usr.sbin/cron/Makefile.vixie128
-rw-r--r--usr.sbin/cron/README25
-rw-r--r--usr.sbin/cron/README.vixie72
-rw-r--r--usr.sbin/cron/THANKS29
-rw-r--r--usr.sbin/cron/compat.c234
-rw-r--r--usr.sbin/cron/compat.h138
-rw-r--r--usr.sbin/cron/config.h87
-rw-r--r--usr.sbin/cron/cron.863
-rw-r--r--usr.sbin/cron/cron.c302
-rw-r--r--usr.sbin/cron/cron.h278
-rw-r--r--usr.sbin/cron/database.c262
-rw-r--r--usr.sbin/cron/do_command.c502
-rw-r--r--usr.sbin/cron/entry.c508
-rw-r--r--usr.sbin/cron/env.c180
-rw-r--r--usr.sbin/cron/externs.h145
-rw-r--r--usr.sbin/cron/job.c75
-rw-r--r--usr.sbin/cron/misc.c665
-rw-r--r--usr.sbin/cron/pathnames.h82
-rw-r--r--usr.sbin/cron/popen.c167
-rw-r--r--usr.sbin/cron/user.c103
-rw-r--r--usr.sbin/dbsym/dbsym.c7
-rw-r--r--usr.sbin/dev_mkdb/dev_mkdb.c2
-rw-r--r--usr.sbin/diskless_cfg/Makefile8
-rw-r--r--usr.sbin/diskless_cfg/diskless.h171
-rw-r--r--usr.sbin/diskless_cfg/diskless_cfg.c305
-rw-r--r--usr.sbin/diskless_cfg/nfsdiskless.h (renamed from usr.sbin/update/update.c)72
-rw-r--r--usr.sbin/fdformat/Makefile32
-rw-r--r--usr.sbin/fdformat/fdformat.1133
-rw-r--r--usr.sbin/fdformat/fdformat.c355
-rw-r--r--usr.sbin/ftinfo/Makefile7
-rw-r--r--usr.sbin/ftinfo/ftinfo.8 (renamed from usr.sbin/update/update.8)59
-rw-r--r--usr.sbin/ftinfo/ftinfo.c89
-rw-r--r--usr.sbin/inetd/Makefile6
-rw-r--r--usr.sbin/inetd/inetd.c132
-rw-r--r--usr.sbin/iostat/iostat.c4
-rw-r--r--usr.sbin/lpr/common_source/common.c9
-rw-r--r--usr.sbin/lpr/common_source/printcap.c4
-rw-r--r--usr.sbin/lpr/lpc/lpc.84
-rw-r--r--usr.sbin/lpr/lpd/lpd.82
-rw-r--r--usr.sbin/lpr/lpd/lpd.c1
-rw-r--r--usr.sbin/lpr/lpr/lpr.c11
-rw-r--r--usr.sbin/named/named.82
-rw-r--r--usr.sbin/named/storage.c2
-rw-r--r--usr.sbin/named/tools/nslookup/commands.l2
-rw-r--r--usr.sbin/portmap/Makefile4
-rw-r--r--usr.sbin/rwhod/rwhod.c11
-rw-r--r--usr.sbin/sendmail/CHANGES-R5-R8219
-rw-r--r--usr.sbin/sendmail/FAQ333
-rw-r--r--usr.sbin/sendmail/KNOWNBUGS131
-rw-r--r--usr.sbin/sendmail/Makefile21
-rw-r--r--usr.sbin/sendmail/READ_ME134
-rw-r--r--usr.sbin/sendmail/RELEASE_NOTES1153
-rw-r--r--usr.sbin/sendmail/cf/README514
-rw-r--r--usr.sbin/sendmail/cf/cf/Makefile44
-rw-r--r--usr.sbin/sendmail/cf/cf/Makefile.dist85
-rw-r--r--usr.sbin/sendmail/cf/cf/clientproto.mc49
-rw-r--r--usr.sbin/sendmail/cf/cf/mail.cs.mc5
-rw-r--r--usr.sbin/sendmail/cf/cf/osf1-cs-exposed.mc41
-rw-r--r--usr.sbin/sendmail/cf/cf/osf1-cs-hidden.mc41
-rw-r--r--usr.sbin/sendmail/cf/cf/tcpproto.mc12
-rw-r--r--usr.sbin/sendmail/cf/cf/uucpproto.mc12
-rw-r--r--usr.sbin/sendmail/cf/cf/vangogh.mc5
-rw-r--r--usr.sbin/sendmail/cf/cf/whisker.mc42
-rw-r--r--usr.sbin/sendmail/cf/domain/Berkeley.m48
-rw-r--r--usr.sbin/sendmail/cf/feature/allmasquerade.m44
-rw-r--r--usr.sbin/sendmail/cf/feature/bitdomain.m46
-rw-r--r--usr.sbin/sendmail/cf/feature/domaintable.m44
-rw-r--r--usr.sbin/sendmail/cf/feature/mailertable.m44
-rw-r--r--usr.sbin/sendmail/cf/feature/nodns.m440
-rw-r--r--usr.sbin/sendmail/cf/feature/nullclient.m461
-rw-r--r--usr.sbin/sendmail/cf/feature/redirect.m44
-rw-r--r--usr.sbin/sendmail/cf/feature/uucpdomain.m46
-rw-r--r--usr.sbin/sendmail/cf/m4/cf.m46
-rw-r--r--usr.sbin/sendmail/cf/m4/nullrelay.m4302
-rw-r--r--usr.sbin/sendmail/cf/m4/proto.m4389
-rw-r--r--usr.sbin/sendmail/cf/m4/version.m44
-rw-r--r--usr.sbin/sendmail/cf/mailer/fax.m46
-rw-r--r--usr.sbin/sendmail/cf/mailer/local.m416
-rw-r--r--usr.sbin/sendmail/cf/mailer/pop.m453
-rw-r--r--usr.sbin/sendmail/cf/mailer/smtp.m498
-rw-r--r--usr.sbin/sendmail/cf/mailer/usenet.m48
-rw-r--r--usr.sbin/sendmail/cf/mailer/uucp.m490
-rw-r--r--usr.sbin/sendmail/cf/ostype/aix3.m44
-rw-r--r--usr.sbin/sendmail/cf/ostype/aux.m443
-rw-r--r--usr.sbin/sendmail/cf/ostype/bsd4.3.m43
-rw-r--r--usr.sbin/sendmail/cf/ostype/bsd4.4.m43
-rw-r--r--usr.sbin/sendmail/cf/ostype/bsdi1.0.m438
-rw-r--r--usr.sbin/sendmail/cf/ostype/dgux.m439
-rw-r--r--usr.sbin/sendmail/cf/ostype/dynix3.2.m439
-rw-r--r--usr.sbin/sendmail/cf/ostype/hpux.m411
-rw-r--r--usr.sbin/sendmail/cf/ostype/irix.m47
-rw-r--r--usr.sbin/sendmail/cf/ostype/linux.m438
-rw-r--r--usr.sbin/sendmail/cf/ostype/nextstep.m444
-rw-r--r--usr.sbin/sendmail/cf/ostype/riscos4.5.m47
-rw-r--r--usr.sbin/sendmail/cf/ostype/sco3.2.m445
-rw-r--r--usr.sbin/sendmail/cf/ostype/solaris2.1.m417
-rw-r--r--usr.sbin/sendmail/cf/ostype/solaris2.m443
-rw-r--r--usr.sbin/sendmail/cf/ostype/svr4.m445
-rw-r--r--usr.sbin/sendmail/cf/sh/makeinfo.sh44
-rw-r--r--usr.sbin/sendmail/contrib/converting.sun.configs446
-rw-r--r--usr.sbin/sendmail/contrib/expn.pl228
-rw-r--r--usr.sbin/sendmail/contrib/mail.local.linux205
-rw-r--r--usr.sbin/sendmail/contrib/mh.patch193
-rw-r--r--usr.sbin/sendmail/contrib/mmuegel196
-rw-r--r--usr.sbin/sendmail/contrib/oldbind.compat.c79
-rw-r--r--usr.sbin/sendmail/contrib/rcpt-streaming74
-rw-r--r--usr.sbin/sendmail/doc/intro/Makefile14
-rw-r--r--usr.sbin/sendmail/doc/intro/intro.me6
-rw-r--r--usr.sbin/sendmail/doc/intro/intro.ps1295
-rw-r--r--usr.sbin/sendmail/doc/op/Makefile14
-rw-r--r--usr.sbin/sendmail/doc/op/op.me910
-rw-r--r--usr.sbin/sendmail/doc/op/op.ps5173
-rw-r--r--usr.sbin/sendmail/doc/usenix/Makefile13
-rw-r--r--usr.sbin/sendmail/doc/usenix/usenix.me6
-rw-r--r--usr.sbin/sendmail/doc/usenix/usenix.ps1004
-rw-r--r--usr.sbin/sendmail/mailstats/mailstats.c11
-rw-r--r--usr.sbin/sendmail/makemap/Makefile2
-rw-r--r--usr.sbin/sendmail/makemap/Makefile.dist81
-rw-r--r--usr.sbin/sendmail/makemap/makemap.811
-rw-r--r--usr.sbin/sendmail/makemap/makemap.c45
-rw-r--r--usr.sbin/sendmail/praliases/Makefile.dist81
-rw-r--r--usr.sbin/sendmail/praliases/praliases.c22
-rw-r--r--usr.sbin/sendmail/src/Makefile15
-rw-r--r--usr.sbin/sendmail/src/Makefile.AIX99
-rw-r--r--usr.sbin/sendmail/src/Makefile.HPUX107
-rw-r--r--usr.sbin/sendmail/src/Makefile.IRIX101
-rw-r--r--usr.sbin/sendmail/src/Makefile.OSF199
-rw-r--r--usr.sbin/sendmail/src/Makefile.Solaris103
-rw-r--r--usr.sbin/sendmail/src/Makefile.SunOS36
-rw-r--r--usr.sbin/sendmail/src/Makefile.ULTRIX34
-rw-r--r--usr.sbin/sendmail/src/Makefile.Utah42
-rw-r--r--usr.sbin/sendmail/src/Makefile.dist56
-rw-r--r--usr.sbin/sendmail/src/READ_ME773
-rw-r--r--usr.sbin/sendmail/src/TRACEFLAGS5
-rw-r--r--usr.sbin/sendmail/src/alias.c175
-rw-r--r--usr.sbin/sendmail/src/aliases3
-rw-r--r--usr.sbin/sendmail/src/aliases.56
-rw-r--r--usr.sbin/sendmail/src/cdefs.h66
-rw-r--r--usr.sbin/sendmail/src/clock.c62
-rw-r--r--usr.sbin/sendmail/src/collect.c65
-rw-r--r--usr.sbin/sendmail/src/conf.c1239
-rw-r--r--usr.sbin/sendmail/src/conf.h933
-rw-r--r--usr.sbin/sendmail/src/daemon.c292
-rw-r--r--usr.sbin/sendmail/src/deliver.c814
-rw-r--r--usr.sbin/sendmail/src/domain.c269
-rw-r--r--usr.sbin/sendmail/src/envelope.c182
-rw-r--r--usr.sbin/sendmail/src/err.c166
-rw-r--r--usr.sbin/sendmail/src/headers.c350
-rw-r--r--usr.sbin/sendmail/src/macro.c18
-rw-r--r--usr.sbin/sendmail/src/mailq.188
-rw-r--r--usr.sbin/sendmail/src/main.c659
-rwxr-xr-xusr.sbin/sendmail/src/makesendmail113
-rw-r--r--usr.sbin/sendmail/src/map.c241
-rw-r--r--usr.sbin/sendmail/src/mci.c99
-rw-r--r--usr.sbin/sendmail/src/newaliases.123
-rw-r--r--usr.sbin/sendmail/src/parseaddr.c427
-rw-r--r--usr.sbin/sendmail/src/pathnames.h6
-rw-r--r--usr.sbin/sendmail/src/queue.c296
-rw-r--r--usr.sbin/sendmail/src/readcf.c204
-rw-r--r--usr.sbin/sendmail/src/recipient.c460
-rw-r--r--usr.sbin/sendmail/src/savemail.c230
-rw-r--r--usr.sbin/sendmail/src/sendmail.814
-rw-r--r--usr.sbin/sendmail/src/sendmail.h194
-rw-r--r--usr.sbin/sendmail/src/sendmail.hf5
-rw-r--r--usr.sbin/sendmail/src/srvrsmtp.c183
-rw-r--r--usr.sbin/sendmail/src/stats.c5
-rw-r--r--usr.sbin/sendmail/src/trace.c6
-rw-r--r--usr.sbin/sendmail/src/udb.c54
-rw-r--r--usr.sbin/sendmail/src/useful.h10
-rw-r--r--usr.sbin/sendmail/src/usersmtp.c103
-rw-r--r--usr.sbin/sendmail/src/util.c433
-rw-r--r--usr.sbin/sendmail/src/version.c4
-rw-r--r--usr.sbin/spkrtest/Makefile9
-rw-r--r--usr.sbin/spkrtest/spkrtest.sh38
-rw-r--r--usr.sbin/swapinfo/swapinfo.c3
-rw-r--r--usr.sbin/timed/timed/timed.c1
-rw-r--r--usr.sbin/timed/timedc/timedc.c2
-rw-r--r--usr.sbin/trpt/trpt.c7
-rw-r--r--usr.sbin/update/Makefile7
-rw-r--r--usr.sbin/yp/Makefile10
-rw-r--r--usr.sbin/yp/yp.873
-rw-r--r--usr.sbin/yp/ypbind/Makefile9
-rw-r--r--usr.sbin/yp/ypbind/ypbind.c672
-rw-r--r--usr.sbin/yp/ypcat/Makefile7
-rw-r--r--usr.sbin/yp/ypcat/ypcat.170
-rw-r--r--usr.sbin/yp/ypcat/ypcat.c143
-rw-r--r--usr.sbin/yp/ypmatch/Makefile7
-rw-r--r--usr.sbin/yp/ypmatch/ypmatch.171
-rw-r--r--usr.sbin/yp/ypmatch/ypmatch.c134
-rw-r--r--usr.sbin/yp/yppoll/Makefile8
-rw-r--r--usr.sbin/yp/yppoll/yppoll.c101
-rw-r--r--usr.sbin/yp/ypset/Makefile8
-rw-r--r--usr.sbin/yp/ypset/ypset.c154
-rw-r--r--usr.sbin/yp/ypwhich/Makefile8
-rw-r--r--usr.sbin/yp/ypwhich/ypwhich.c249
204 files changed, 20524 insertions, 11562 deletions
diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile
index c5525dabfaf2..c625fea95cad 100644
--- a/usr.sbin/Makefile
+++ b/usr.sbin/Makefile
@@ -1,10 +1,10 @@
# @(#)Makefile 5.6.1.2 (Berkeley) 5/8/91
-SUBDIR= accton arp chown chroot config dbsym dev_mkdb diskpart \
- edquota flcopy gettable htable inetd iostat kgmon kvm_mkdb lpr \
- mtree named portmap pppstats pwd_mkdb quotaon repquota rmt rwhod\
- sendmail sliplogin swapinfo syslogd timed traceroute trpt trsp \
- update vipw
+SUBDIR= accton arp chown chroot config cron dbsym dev_mkdb diskpart \
+ edquota fdformat flcopy ftinfo gettable htable inetd iostat kgmon \
+ kvm_mkdb lpr mtree named portmap pppstats pwd_mkdb quotaon repquota \
+ rmt rwhod sendmail sliplogin spkrtest swapinfo syslogd timed \
+ traceroute trpt trsp vipw yp
.if make(clean) || make(cleandir)
SUBDIR+=bad144
diff --git a/usr.sbin/arp/arp.c b/usr.sbin/arp/arp.c
index 8529b7745a36..2eb5244b247d 100644
--- a/usr.sbin/arp/arp.c
+++ b/usr.sbin/arp/arp.c
@@ -55,6 +55,7 @@ static char sccsid[] = "@(#)arp.c 5.11.1.1 (Berkeley) 7/22/91";
#include <netdb.h>
#include <netinet/in.h>
+#include <arpa/inet.h>
#include <net/if.h>
#include <netinet/if_ether.h>
@@ -210,7 +211,6 @@ get(host)
struct sockaddr_in *sin;
u_char *ea;
int s;
- char *inet_ntoa();
bzero((caddr_t)&ar, sizeof ar);
ar.arp_pa.sa_family = AF_INET;
diff --git a/usr.sbin/chroot/chroot.c b/usr.sbin/chroot/chroot.c
index 7b803946f50d..e38b595294ac 100644
--- a/usr.sbin/chroot/chroot.c
+++ b/usr.sbin/chroot/chroot.c
@@ -43,13 +43,14 @@ static char sccsid[] = "@(#)chroot.c 5.8 (Berkeley) 6/1/90";
#include <stdio.h>
#include <paths.h>
+extern char *getenv(), *strerror();
main(argc, argv)
int argc;
char **argv;
{
extern int errno;
- char *shell, *getenv(), *strerror();
+ char *shell;
if (argc < 2) {
(void)fprintf(stderr, "usage: chroot newroot [command]\n");
diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y
index 31a584db8224..85b2896ef7ae 100644
--- a/usr.sbin/config/config.y
+++ b/usr.sbin/config/config.y
@@ -253,7 +253,7 @@ swap_device_spec:
= {
struct file_list *fl = newswap();
- if (eq($1, "generic"))
+ if (eq($1, "generic") || eq($1,"nfs"))
fl->f_fn = $1;
else {
fl->f_swapdev = nametodev($1, 0, 'b');
@@ -650,7 +650,7 @@ mkswap(system, fl, size)
*/
if (system->f_fn)
return;
- if (eq(fl->f_fn, "generic"))
+ if (eq(fl->f_fn, "generic") || eq(fl->f_fn, "nfs"))
system->f_fn = ns(fl->f_fn);
else
system->f_fn = ns(system->f_needs);
@@ -821,7 +821,7 @@ checksystemspec(fl)
{
char buf[BUFSIZ];
register struct file_list *swap;
- int generic;
+ int generic, nfs;
if (fl == 0 || fl->f_type != SYSTEMSPEC) {
yyerror("internal error, bad system specification");
@@ -829,7 +829,8 @@ checksystemspec(fl)
}
swap = fl->f_next;
generic = swap && swap->f_type == SWAPSPEC && eq(swap->f_fn, "generic");
- if (fl->f_rootdev == NODEV && !generic) {
+ nfs = swap && swap->f_type == SWAPSPEC && eq(swap->f_fn, "nfs");
+ if (fl->f_rootdev == NODEV && !generic && !nfs) {
yyerror("no root device specified");
exit(1);
}
diff --git a/usr.sbin/config/mkioconf.c b/usr.sbin/config/mkioconf.c
index 1ec61d6cee7f..333207211927 100644
--- a/usr.sbin/config/mkioconf.c
+++ b/usr.sbin/config/mkioconf.c
@@ -631,6 +631,7 @@ i386_ioconf()
* First print the isa initialization structures
*/
if (seen_isa) {
+ int seen_wdc = 0, seen_fdc = 0;
fprintf(fp, "/*\n");
fprintf(fp, " * ISA devices\n");
@@ -646,22 +647,53 @@ i386_ioconf()
continue;
fprintf(fp, "extern struct isa_driver %3.3sdriver;",
dp->d_name);
+ if(eq(dp->d_name, "wdc")) seen_wdc++;
+ if(eq(dp->d_name, "fdc")) seen_fdc++;
if (dp->d_irq == 2)
{
fprintf(stderr, "remapped irq 2 to irq 9, please update your config file\n");
dp->d_irq = 9;
}
if (dp->d_irq != -1)
- fprintf(fp, " extern %s();", shandler(dp));
+ fprintf(fp, " extern void %s();", shandler(dp));
fprintf(fp, "\n");
}
isa_devtab(fp, "bio");
+ if(seen_wdc)
+ isa_biotab(fp, "wdc");
+ if(seen_fdc)
+ isa_biotab(fp, "fdc");
isa_devtab(fp, "tty");
isa_devtab(fp, "net");
isa_devtab(fp, "null");
}
(void) fclose(fp);
}
+
+isa_biotab(fp, table)
+ FILE *fp;
+ char *table;
+{
+ register struct device *dp, *mp;
+
+ fprintf(fp, "\n\nstruct isa_device isa_biotab_%s[] = {\n", table);
+ fprintf(fp, "\
+/* driver iobase irq drq maddr msiz intr unit flags drive*/\n");
+ for (dp = dtab; dp != 0; dp = dp->d_next) {
+ mp = dp->d_conn;
+ if (dp->d_unit == QUES || mp == 0 ||
+ mp == TO_NEXUS || !eq(mp->d_name, table))
+ continue;
+ fprintf(fp, "{ &%3.3sdriver, %8.8s,",
+ mp->d_name, mp->d_port);
+ fprintf(fp, "%6.6s, %2d, C 0x%05X, %5d, %8.8s, %2d, 0x%04X, %2d },\n",
+ sirq(mp->d_irq), mp->d_drq, mp->d_maddr,
+ mp->d_msize, shandler(mp), dp->d_unit,
+ dp->d_flags, dp->d_drive);
+ }
+ fprintf(fp, "0\n};\n");
+}
+
/*
* Generized routine for isa bus device table, instead of repeating
* all this 4 times, call this with the table argument.
diff --git a/usr.sbin/config/mkswapconf.c b/usr.sbin/config/mkswapconf.c
index f6a237cb06f8..c1f89ce42657 100644
--- a/usr.sbin/config/mkswapconf.c
+++ b/usr.sbin/config/mkswapconf.c
@@ -79,6 +79,18 @@ do_swap(fl)
}
fprintf(fp, "#include \"sys/param.h\"\n");
fprintf(fp, "#include \"sys/conf.h\"\n");
+ if (eq(fl->f_fn, "nfs")) {
+ fprintf(fp, "#include \"../sys/socket.h\"\n");
+ fprintf(fp, "#include \"../sys/mount.h\"\n");
+ fprintf(fp, "#include \"../net/if.h\"\n");
+ fprintf(fp, "#include \"../nfs/nfsv2.h\"\n");
+ fprintf(fp, "#include \"../nfs/nfsdiskless.h\"\n");
+ fprintf(fp, "\nextern int nfs_mountroot();\n");
+ fprintf(fp, "int (*mountroot)() = nfs_mountroot;\n");
+ } else {
+ fprintf(fp, "\nextern int ufs_mountroot();\n");
+ fprintf(fp, "int (*mountroot)() = ufs_mountroot;\n");
+ }
fprintf(fp, "\n");
/*
* If there aren't any swap devices
@@ -105,6 +117,10 @@ do_swap(fl)
} while (swap && swap->f_type == SWAPSPEC);
fprintf(fp, "\t{ 0, 0, 0 }\n");
fprintf(fp, "};\n");
+ if (eq(fl->f_fn, "nfs")) {
+ fprintf(fp, "struct nfs_diskless nfs_diskless = {0};\n");
+ fprintf(fp, "int nfs_diskless_size = sizeof(struct nfs_diskless);\n");
+ }
fclose(fp);
return (swap);
}
diff --git a/usr.sbin/cron/CHANGES b/usr.sbin/cron/CHANGES
new file mode 100644
index 000000000000..59f6803dbc01
--- /dev/null
+++ b/usr.sbin/cron/CHANGES
@@ -0,0 +1,155 @@
+Vixie Cron Changes from V2 to V3
+Paul Vixie
+29-Dec-1993
+
+The crontab command now conforms to POSIX 1003.2. This means that when you
+install it, if you have any "crontab" command lines floating around in shell
+scripts (such as /etc/rc or /etc/rc.local), you will need to change them.
+
+I have integrated several changes made by BSDi for their BSD/386 operating
+system; these were offerred to me before I started consulting for them, so
+it is safe to say that they were intended for publication. Most notably,
+the name of the cron daemon has changed from "crond" to "cron". This was
+done for compatibility with 4.3BSD. Another change made for the same reason
+is the ability to read in an /etc/crontab file which has an extra field in
+each entry, between the time fields and the command. This field is a user
+name, and it permits the /etc/crontab command to contain commands which are
+to be run by any user on the system. /etc/crontab is not "installed" via
+the crontab(1) command; it is automatically read at startup time and it will
+be reread whenever it changes.
+
+I also added a "-e" option to crontab(1). Nine people also sent me diffs
+to add this option, but I had already implemented it on my own. I actually
+released an interrim version (V2.2, I think) for limited testing, and got a
+chance to fix a bad security bug in the "-e" option thanks to XXX.
+
+The daemon used to be extraordinarily sloppy in its use of file descriptors.
+A heck of a lot of them were left open in spawned jobs, which caused problems
+for the daemon and also caused problems with the spawned jobs if they were
+shell scripts since "sh" and "csh" have traditionally used hidden file
+descriptors to pass information to subshells, and cron was causing them to
+think they were subshells. If you had trouble with "sh" or "csh" scripts in
+V2, chances are good that V3 will fix your problems.
+
+About a dozen people have reminded me that I forgot to initialize
+"crontab_fd" in database.c. Keith Cantrell was the first, so he gets the
+point.
+
+Steve Simmons reminded me that once an account has been deleted from the
+system, "crontab -u USER -d" will not work. My solution is to suggest to
+all of you that before you delete a user's account, you first delete that
+user's crontab file if any. From cron's point of view, usernames can never
+be treated as arbitrary strings. Either they are valid user names, or they
+are not. I will not make an exception for the "-d" case, for security
+reasons that I consider reasonable. It is trivial for a root user to delete
+the entry by hand if necessary.
+
+Dan O'Neil reminded me that I forgot to reset "log_fd" in misc.c. A lot of
+others also reminded me of this, but Dan gets the point. I didn't fix it
+there, since the real bug was that it should have been open in the parent.
+
+Peter Kabal reminded me that I forgot to "#ifdef DEBUGGING" some code in
+misc.c. Hans Trompert actually told me first, but Peter sent the patch so
+he gets the point.
+
+Russell Nelson told me that I'd forgotten to "#include <syslog.h>" in misc.c,
+which explains why a lot of other people complained that it wasn't using
+syslog even when they configured it that way :-). Steve Simmons told me
+first, though, so he gets the point.
+
+An interrim version of the daemon tried to "stat" every file before
+executing it; this turned out to be a horribly bad idea since finding the
+name of a file from a shell command is a hard job (that's why we have
+shells, right?) I removed this bogus code. Dave Burgess gets the point.
+
+Dennis R. Conley sent a suggestion for MMDF systems, which I've added to the
+comments in cron.h.
+
+Mike Heisler noted that I use comments in the CONVERSION file which are
+documented as illegal in the man pages. Thanks, Mike.
+
+Irving Wolfe sent me some very cheerful changes for a NeXT system, but I
+consider the system itself broken and I can't bring myself to #ifdef for
+something as screwed up as this system seems to be. However, various others
+did send me smaller patches which appear to have cause cron to build and run
+correctly on (the latest) NeXT machines, with or without the "-posix" CFLAG.
+Irving also asked for a per-job MAILTO, and this was finally added later when
+I integrated the BSD/386 changes contributed by BSDi, and generalized some of
+the parsing.
+
+Lots of folks complained that the autogenerated "Date:" header wasn't in
+ARPA format. I didn't understand this -- either folks will use Sendmail and
+not generate a Date: at all (since Sendmail will do it), or folks will use
+something other than Sendmail which won't care about Date: formats. But
+I've "fixed" it anyway...
+
+Several people suggested that "*" should be able to take a "/step". One person
+suggested that "N/step" ought to mean "N-last/step", but that's stretching things
+a bit far. "*/step" seems quite intuitive to me, so I've added it. Colin Plumb
+sent in the first and most polite request for this feature.
+
+As with every release of Cron, BIND, and seemingly everything else I do, one
+user stands out with the most critical but also the most useful analysis.
+Cron V3's high score belongs to Peter Holzer, who sent in the nicest looking
+patch for the "%" interpretation problem and also helped me understand a
+tricky bit of badness in the "log_fd" problem.
+
+agulbra@flode.nvg.unit.no wins the honors for being the first to point out the
+nasty security hole in "crontab -r". 'Nuff said.
+
+Several folks pointed out that log_it() needed to exist even if logging was
+disabled. Some day I will create a tool that will compile a subsystem with
+every possible combination and permutation of #ifdef options, but meanwhile
+thanks to everybody.
+
+job_runqueue() was using storage after freeing it, since Jordan told me back
+in 1983 that C let you do that, and I believed him in 1986 when I wrote all
+this junk. Linux was the first to die from this error, and the Linux people
+sent me the most amazing, um, collection of patches for this problem. Thanks
+for all the fish.
+
+Jeremy Bettis reminded me that popen() isn't safe. I grabbed Ken Arnold's
+version of popen/pclose from the ftpd and hacked it to taste. We're safe now,
+from this at least.
+
+Branko Lankester sent me a very timely and helpful fix for a looming security
+problem in my "crontab -e" implementation.
+
+--------
+
+Vixie Cron Changes from V1 to V2
+Paul Vixie
+8-Feb-1988
+
+Many changes were made in a rash of activity about six months ago, the exact
+list of which is no longer clear in my memory. I know that V1 used a file
+called POKECRON in /usr/spool/cron to tell it that it was time to re-read
+all the crontab files; V2 uses the modtime the crontab directory as a flag to
+check out the crontab files; those whose modtime has changed will be re-read,
+and the others left alone. Note that the crontab(1) command will do a utimes
+call to make sure the mtime of the dir changes, since the filename/inode will
+often remain the same after a replacement and the mtime wouldn't change in
+that case.
+
+8-Feb-88: made it possible to use much larger environment variable strings.
+ V1 allowed 100 characters; V2 allows 1000. This was needed for PATH
+ variables on some systems. Thanks to Toerless Eckert for this idea.
+ E-mail: UUCP: ...pyramid!fauern!faui10!eckert
+
+16-Feb-88: added allow/deny, moved /usr/spool/cron/crontabs to
+ /usr/lib/cron/tabs. allow and deny are /usr/lib/cron/{allow,deny},
+ since the sysv naming for this depends on 'at' using the same
+ dir, which would be stupid (hint: use /usr/{lib,spool}/at).
+
+22-Feb-88: made it read the spool directory for crontabs and look each one
+ up using getpwnam() rather than reading all passwds with getpwent()
+ and trying to open each crontab.
+
+9-Dec-88: made it sync to :00 after the minute, makes cron predictable.
+ added logging to /var/cron/log.
+
+14-Apr-90: (actually, changes since December 1989)
+ fixed a number of bugs reported from the net and from John Gilmore.
+ added syslog per Keith Bostic. security features including not
+ being willing to run a command owned or writable by other than
+ the owner of the crontab 9not working well yet)
diff --git a/usr.sbin/cron/FEATURES b/usr.sbin/cron/FEATURES
new file mode 100644
index 000000000000..516a7e21e374
--- /dev/null
+++ b/usr.sbin/cron/FEATURES
@@ -0,0 +1,84 @@
+$Id: FEATURES,v 1.1 1994/01/27 19:18:57 nate Exp $
+
+Features of Vixie's cron relative to BSD 4.[23] and SysV crons:
+
+-- Environment variables can be set in each crontab. SHELL, USER,
+ LOGNAME, and HOME are set from the user's passwd entry; all except
+ USER can be changed in the crontab. PATH is especially useful to
+ set there. TZ can be set, but cron ignores it other than passing
+ it on through to the commands it runs. Format is
+
+ variable=value
+
+ Blanks surrounding the '=' will be eaten; other blanks in value are
+ okay. Leading or trailing blanks can be preserved by quoting, single
+ or double quotes are okay, just so they match.
+
+ PATH=.:/bin:/usr/bin
+ SHELL=/bin/sh
+ FOOBAR = this is a long blanky example
+
+ Above, FOOBAR would get "this is a long blanky example" as its value.
+
+ SHELL and HOME will be used when it's time to run a command; if
+ you don't set them, HOME defaults to your /etc/passwd entry
+ and SHELL defaults to /bin/sh.
+
+ MAILTO, if set to the login name of a user on your system, will be the
+ person that cron mails the output of commands in that crontab. This is
+ useful if you decide on BINMAIL when configuring cron.h, since binmail
+ doesn't know anything about aliasing.
+
+-- Weekdays can be specified by name. Case is not significant, but only
+ the first three letters should be specified.
+
+-- Months can likewise be specified by name. Three letters only.
+
+-- Ranges and lists can be mixed. Standard crons won't allow '1,3-5'.
+
+-- Ranges can specify 'step' values. '10-16/2' is like '10,12,14,16'.
+
+-- Sunday is both day 0 and day 7 -- apparently BSD and ATT disagree
+ about this.
+
+-- Each user gets their own crontab file. This is a win over BSD 4.2,
+ where only root has one, and over BSD 4.3, where they made the crontab
+ format incompatible and although the commands can be run by non-root
+ uid's, root is still the only one who can edit the crontab file. This
+ feature mimics the SysV cron.
+
+-- The 'crontab' command is loosely compatible with SysV, but has more
+ options which just generally make more sense. Running crontab with
+ no arguments will print a cute little summary of the command syntax.
+
+-- Comments and blank lines are allowed in the crontab file. Comments
+ must be on a line by themselves; leading whitespace is ignored, and
+ a '#' introduces the comment.
+
+-- (big win) If the `crontab' command changes anything in any crontab,
+ the 'cron' daemon will reload all the tables before running the
+ next iteration. In some crons, you have to kill and restart the
+ daemon whenever you change a crontab. In other crons, the crontab
+ file is reread and reparsed every minute even if it didn't change.
+
+-- In order to support the automatic reload, the crontab files are not
+ readable or writable except by 'crontab' or 'cron'. This is not a
+ problem, since 'crontab' will let you do pretty much whatever you
+ want to your own crontab, or if you are root, to anybody's crontab.
+
+-- If any output is generated by a command (on stdout OR stderr), it will
+ be mailed to the owner of the crontab that contained the command (or
+ MAILTO, see discussion of environment variables, above). The headers
+ of the mail message will include the command that was run, and a
+ complete list of the environment that was passed to it, which will
+ contain (at least) the USER (LOGNAME on SysV), HOME, and SHELL.
+
+-- the dom/dow situation is odd. '* * 1,15 * Sun' will run on the
+ first and fifteenth AND every Sunday; '* * * * Sun' will run *only*
+ on Sundays; '* * 1,15 * *' will run *only* the 1st and 15th. this
+ is why we keep 'e->dow_star' and 'e->dom_star'. I didn't think up
+ this behaviour; it's how cron has always worked but the documentation
+ hasn't been very clear. I have been told that some AT&T crons do not
+ act this way and do the more reasonable thing, which is (IMHO) to "or"
+ the various field-matches together. In that sense this cron may not
+ be completely similar to some AT&T crons.
diff --git a/usr.sbin/cron/Makefile b/usr.sbin/cron/Makefile
new file mode 100644
index 000000000000..55503f5a9ca6
--- /dev/null
+++ b/usr.sbin/cron/Makefile
@@ -0,0 +1,7 @@
+PROG= cron
+SRCS= compat.c cron.c database.c do_command.c entry.c env.c job.c \
+ misc.c popen.c user.c
+#CFLAGS+=-I${.CURDIR}
+MAN8= cron.8
+
+.include <bsd.prog.mk>
diff --git a/usr.sbin/cron/Makefile.vixie b/usr.sbin/cron/Makefile.vixie
new file mode 100644
index 000000000000..46c7a101be1f
--- /dev/null
+++ b/usr.sbin/cron/Makefile.vixie
@@ -0,0 +1,128 @@
+#/* Copyright 1988,1990,1993 by Paul Vixie
+# * All rights reserved
+# *
+# * Distribute freely, except: don't remove my name from the source or
+# * documentation (don't take credit for my work), mark your changes (don't
+# * get me blamed for your possible bugs), don't alter or remove this
+# * notice. May be sold if buildable source is provided to buyer. No
+# * warrantee of any kind, express or implied, is included with this
+# * software; use at your own risk, responsibility for damages (if any) to
+# * anyone resulting from the use of this software rests entirely with the
+# * user.
+# *
+# * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
+# * I'll try to keep a version up to date. I can be reached as follows:
+# * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
+# */
+
+# Makefile for vixie's cron
+#
+# From Id: Makefile,v 2.4 1993/12/28 08:34:43 vixie Exp
+#
+# vix 03mar88 [moved to RCS, rest of log is in there]
+# vix 30mar87 [goodbye, time.c; hello, getopt]
+# vix 12feb87 [cleanup for distribution]
+# vix 30dec86 [written]
+
+# NOTES:
+# 'make' can be done by anyone
+# 'make install' must be done by root
+#
+# this package needs getopt(3), bitstring(3), and BSD install(8).
+#
+# the configurable stuff in this makefile consists of compilation
+# options (use -O, cron runs forever) and destination directories.
+# SHELL is for the 'augumented make' systems where 'make' imports
+# SHELL from the environment and then uses it to run its commands.
+# if your environment SHELL variable is /bin/csh, make goes real
+# slow and sometimes does the wrong thing.
+#
+# this package needs the 'bitstring macros' library, which is
+# available from me or from the comp.sources.unix archive. if you
+# put 'bitstring.h' in a non-standard place (i.e., not intuited by
+# cc(1)), you will have to define INCLUDE to set the include
+# directory for cc. INCLUDE should be `-Isomethingorother'.
+#
+# there's more configuration info in config.h; edit that first!
+
+#################################### begin configurable stuff
+#<<DESTROOT is assumed to have ./etc, ./bin, and ./man subdirectories>>
+DESTROOT = $(DESTDIR)/usr
+DESTSBIN = $(DESTROOT)/sbin
+DESTBIN = $(DESTROOT)/bin
+DESTMAN = $(DESTROOT)/share/man
+#<<need bitstring.h>>
+INCLUDE = -I.
+#INCLUDE =
+#<<need getopt()>>
+LIBS =
+#<<optimize or debug?>>
+#OPTIM = -O
+OPTIM = -g
+#<<ATT or BSD or POSIX?>>
+# (ATT untested)
+#COMPAT = -DATT
+#(BSD is only needed if <sys/params.h> does not define it, as on ULTRIX)
+#COMPAT = -DBSD
+# (POSIX)
+#COMPAT = -DPOSIX
+#<<lint flags of choice?>>
+LINTFLAGS = -hbxa $(INCLUDE) $(COMPAT) $(DEBUGGING)
+#<<want to use a nonstandard CC?>>
+#CC = vcc
+#<<manifest defines>>
+DEFS =
+#(SGI IRIX systems need this)
+#DEFS = -D_BSD_SIGNALS -Dconst=
+#<<the name of the BSD-like install program>>
+#INSTALL = installbsd
+INSTALL = install
+#<<any special load flags>>
+LDFLAGS =
+#################################### end configurable stuff
+
+SHELL = /bin/sh
+CFLAGS = $(OPTIM) $(INCLUDE) $(COMPAT) $(DEFS)
+
+INFOS = README CHANGES FEATURES INSTALL CONVERSION THANKS MAIL
+MANPAGES = bitstring.3 crontab.5 crontab.1 cron.8 putman.sh
+HEADERS = bitstring.h cron.h config.h pathnames.h \
+ externs.h compat.h
+SOURCES = cron.c crontab.c database.c do_command.c entry.c \
+ env.c job.c user.c popen.c misc.c compat.c
+SHAR_SOURCE = $(INFOS) $(MANPAGES) Makefile $(HEADERS) $(SOURCES)
+LINT_CRON = cron.c database.c user.c entry.c compat.c \
+ misc.c job.c do_command.c env.c popen.c
+LINT_CRONTAB = crontab.c misc.c entry.c env.c compat.c
+CRON_OBJ = cron.o database.o user.o entry.o job.o do_command.o \
+ misc.o env.o popen.o compat.o
+CRONTAB_OBJ = crontab.o misc.o entry.o env.o compat.o
+
+all : cron crontab
+
+lint :
+ lint $(LINTFLAGS) $(LINT_CRON) $(LIBS) \
+ |grep -v "constant argument to NOT" 2>&1
+ lint $(LINTFLAGS) $(LINT_CRONTAB) $(LIBS) \
+ |grep -v "constant argument to NOT" 2>&1
+
+cron : $(CRON_OBJ)
+ $(CC) $(LDFLAGS) -o cron $(CRON_OBJ) $(LIBS)
+
+crontab : $(CRONTAB_OBJ)
+ $(CC) $(LDFLAGS) -o crontab $(CRONTAB_OBJ) $(LIBS)
+
+install : all
+ $(INSTALL) -c -m 111 -o root -s cron $(DESTSBIN)/
+ $(INSTALL) -c -m 4111 -o root -s crontab $(DESTBIN)/
+ sh putman.sh crontab.1 $(DESTMAN)
+ sh putman.sh cron.8 $(DESTMAN)
+ sh putman.sh crontab.5 $(DESTMAN)
+
+clean :; rm -f *.o cron crontab a.out core tags *~ #*
+
+kit : $(SHAR_SOURCE)
+ makekit -m -s99k $(SHAR_SOURCE)
+
+$(CRON_OBJ) : cron.h compat.h config.h externs.h pathnames.h Makefile
+$(CRONTAB_OBJ) : cron.h compat.h config.h externs.h pathnames.h Makefile
diff --git a/usr.sbin/cron/README b/usr.sbin/cron/README
new file mode 100644
index 000000000000..a4746c7efb8c
--- /dev/null
+++ b/usr.sbin/cron/README
@@ -0,0 +1,25 @@
+This is Vixie cron 3.0. This version fixes all known security bugs.
+Further it implements crontab -e.
+I moved cron from /usr/libexec to /usr/sbin where most daemons are
+that are run from rc. That also gets rid of the ugly path crond
+used to have in ps(1) outputs. Further I renamed it to cron, as
+Paul Vixie likes it and is done by NetBSD.
+
+NOTE VERY WELL THE FOLLOWING:
+
+1) Systems crontab changed. Every users crontab resides in /var/cron
+ *EXCEPT* root's. This is a special crontab as it resides in
+ /etc. Further it is the *ONLY* crontab file in which you specify
+ usernames. See /usr/src/etc/crontab. This is also done by BSDI's
+ BSD/386 as far as I know (they provided the patches for it anyway)
+2) So you *must* delete root's crontab and reinstall the copy
+ in /etc from /usr/src/etc.
+ 'Must' is to much: the old installed crontab will work but cron
+ will also try to 'run' /etc/crontab.
+3) Last but not least: cron's logging is now done via syslog. Note
+ that logging by cron is done lowercase when it logs about itsself
+ and uppercase when it logs user events, like installing a new crontab.
+ The default logfile file is the same as before:
+ syslog.conf:cron.* /var/cron/log
+
+-Guido
diff --git a/usr.sbin/cron/README.vixie b/usr.sbin/cron/README.vixie
new file mode 100644
index 000000000000..1f9e467a9817
--- /dev/null
+++ b/usr.sbin/cron/README.vixie
@@ -0,0 +1,72 @@
+#/* Copyright 1988,1990,1993 by Paul Vixie
+# * All rights reserved
+# *
+# * Distribute freely, except: don't remove my name from the source or
+# * documentation (don't take credit for my work), mark your changes (don't
+# * get me blamed for your possible bugs), don't alter or remove this
+# * notice. May be sold if buildable source is provided to buyer. No
+# * warrantee of any kind, express or implied, is included with this
+# * software; use at your own risk, responsibility for damages (if any) to
+# * anyone resulting from the use of this software rests entirely with the
+# * user.
+# *
+# * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
+# * I'll try to keep a version up to date. I can be reached as follows:
+# * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
+# */
+
+Vixie Cron V3.0
+December 27, 1993
+[V2.2 was some time in 1992]
+[V2.1 was May 29, 1991]
+[V2.0 was July 5, 1990]
+[V2.0-beta was December 9, 1988]
+[V1.0 was May 6, 1987]
+Paul Vixie
+
+This is a version of 'cron' that is known to run on BSD 4.[23] systems. It
+is functionally based on the SysV cron, which means that each user can have
+their own crontab file (all crontab files are stored in a read-protected
+directory, usually /var/cron/tabs). No direct support is provided for
+'at'; you can continue to run 'atrun' from the crontab as you have been
+doing. If you don't have atrun (i.e., System V) you are in trouble.
+
+A messages is logged each time a command is executed; also, the files
+"allow" and "deny" in /var/cron can be used to control access to the
+"crontab" command (which installs crontabs). It hasn't been tested on
+SysV, although some effort has gone into making the port an easy one.
+
+This is more or less the copyright that USENET contributed software usually
+has. Since ATT couldn't use this version if they had to freely distribute
+source, and since I'd love to see them use it, I'll offer some rediculously
+low license fee just to have them take it. In the unlikely event that they
+do this, I will continue to support and distribute the pseudo-PD version, so
+please, don't flame me for wanting my work to see a wider distribution.
+
+To use this: Sorry, folks, there is no cutesy 'Configure' script. You'll
+have to go edit a couple of files... So, here's the checklist:
+
+ Read all the FEATURES, INSTALL, and CONVERSION files
+ Edit config.h
+ Edit Makefile
+ (both of these files have instructions inside; note that
+ some things in config.h are definable in Makefile and are
+ therefore surrounded by #ifndef...#endif)
+ 'make'
+ 'su' and 'make install'
+ (you may have to install the man pages by hand)
+ kill your existing cron process
+ (actually you can run your existing cron if you want, but why?)
+ build new crontabs using /usr/lib/{crontab,crontab.local}
+ (either put them all in "root"'s crontab, or divide it up
+ and rip out all the 'su' commands, collapse the lengthy
+ lists into ranges with steps -- basically, this step is
+ as much work as you want to make it)
+ start up the new cron
+ (must be done as root)
+ watch it. test it with 'crontab -r' and watch the daemon track your
+ changes.
+ if you like it, change your /etc/{rc,rc.local} to use it instead of
+ the old one.
+
+From Id: README,v 2.3 1993/12/28 08:34:43 vixie Exp
diff --git a/usr.sbin/cron/THANKS b/usr.sbin/cron/THANKS
new file mode 100644
index 000000000000..3787c2943d7a
--- /dev/null
+++ b/usr.sbin/cron/THANKS
@@ -0,0 +1,29 @@
+15 January 1990
+Paul Vixie
+
+Many people have contributed to cron. Many more than I can remember, in fact.
+Rich Salz and Carl Gutekunst were each of enormous help to me in V1; Carl for
+helping me understand UNIX well enough to write it, and Rich for helping me
+get the features right.
+
+John Gilmore wrote me a wonderful review of V2, which took me a whole year to
+answer even though it made me clean up some really awful things in the code.
+(According to John the most awful things are still in here, of course.)
+
+Paul Close made a suggestion which led to /etc/crond.pid and the mutex locking
+on it. Kevin Braunsdorf of Purdue made a suggestion that led to @reboot and
+its brothers and sisters; he also sent some diffs that lead cron toward compil-
+ability with System V, though without at(1) capabilities, this cron isn't going
+to be that useful on System V. Bob Alverson fixed a silly bug in the line
+number counting. Brian Reid made suggestions which led to the run queue and
+the source-file labelling in installed crontabs.
+
+Scott Narveson ported V2 to a Sequent, and sent in the most useful single batch
+of diffs I got from anybody. Changes attributable to Scott are:
+ -> sendmail won't time out if the command is slow to generate output
+ -> day-of-week names aren't off by one anymore
+ -> crontab says the right thing if you do something you shouldn't do
+ -> crontab(5) man page is longer and more informative
+ -> misc changes related to the side effects of fclose()
+ -> Sequent "universe" support added (may also help on Pyramids)
+ -> null pw_shell is dealt with now; default is /bin/sh
diff --git a/usr.sbin/cron/compat.c b/usr.sbin/cron/compat.c
new file mode 100644
index 000000000000..691e9f5f65de
--- /dev/null
+++ b/usr.sbin/cron/compat.c
@@ -0,0 +1,234 @@
+/* Copyright 1988,1990,1993,1994 by Paul Vixie
+ * All rights reserved
+ *
+ * Distribute freely, except: don't remove my name from the source or
+ * documentation (don't take credit for my work), mark your changes (don't
+ * get me blamed for your possible bugs), don't alter or remove this
+ * notice. May be sold if buildable source is provided to buyer. No
+ * warrantee of any kind, express or implied, is included with this
+ * software; use at your own risk, responsibility for damages (if any) to
+ * anyone resulting from the use of this software rests entirely with the
+ * user.
+ *
+ * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
+ * I'll try to keep a version up to date. I can be reached as follows:
+ * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
+ * From Id: compat.c,v 1.6 1994/01/15 20:43:43 vixie Exp
+ */
+
+#if !defined(lint) && !defined(LINT)
+static char rcsid[] = "$Header: /home/cvs/386BSD/src/usr.sbin/cron/compat.c,v 1.1 1994/01/22 20:38:56 guido Exp $";
+#endif
+
+/* vix 30dec93 [broke this out of misc.c - see RCS log for history]
+ * vix 15jan87 [added TIOCNOTTY, thanks csg@pyramid]
+ */
+
+
+#include "cron.h"
+#ifdef NEED_GETDTABLESIZE
+# include <limits.h>
+#endif
+#if defined(NEED_SETSID) && defined(BSD)
+# include <sys/ioctl.h>
+#endif
+#include <errno.h>
+
+
+/* the code does not depend on any of vfork's
+ * side-effects; it just uses it as a quick
+ * fork-and-exec.
+ */
+#ifdef NEED_VFORK
+PID_T
+vfork() {
+ return (fork());
+}
+#endif
+
+
+#ifdef NEED_STRDUP
+char *
+strdup(str)
+ char *str;
+{
+ char *temp;
+
+ temp = malloc(strlen(str) + 1);
+ (void) strcpy(temp, str);
+ return temp;
+}
+#endif
+
+
+#ifdef NEED_STRERROR
+char *
+strerror(error)
+ int error;
+{
+ extern char *sys_errlist[];
+ extern int sys_nerr;
+ static char buf[32];
+
+ if ((error <= sys_nerr) && (error > 0)) {
+ return sys_errlist[error];
+ }
+
+ sprintf(buf, "Unknown error: %d", error);
+ return buf;
+}
+#endif
+
+
+#ifdef NEED_STRCASECMP
+int
+strcasecmp(left, right)
+ char *left;
+ char *right;
+{
+ while (*left && (MkLower(*left) == MkLower(*right))) {
+ left++;
+ right++;
+ }
+ return MkLower(*left) - MkLower(*right);
+}
+#endif
+
+
+#ifdef NEED_SETSID
+int
+setsid()
+{
+ int newpgrp;
+# if defined(BSD)
+ int fd;
+# if defined(POSIX)
+ newpgrp = setpgid((pid_t)0, getpid());
+# else
+ newpgrp = setpgrp(0, getpid());
+# endif
+ if ((fd = open("/dev/tty", 2)) >= 0)
+ {
+ (void) ioctl(fd, TIOCNOTTY, (char*)0);
+ (void) close(fd);
+ }
+# else /*BSD*/
+ newpgrp = setpgrp();
+
+ (void) close(STDIN); (void) open("/dev/null", 0);
+ (void) close(STDOUT); (void) open("/dev/null", 1);
+ (void) close(STDERR); (void) open("/dev/null", 2);
+# endif /*BSD*/
+ return newpgrp;
+}
+#endif /*NEED_SETSID*/
+
+
+#ifdef NEED_GETDTABLESIZE
+int
+getdtablesize() {
+#ifdef _SC_OPEN_MAX
+ return sysconf(_SC_OPEN_MAX);
+#else
+ return _POSIX_OPEN_MAX;
+#endif
+}
+#endif
+
+
+#ifdef NEED_FLOCK
+/* The following flock() emulation snarfed intact *) from the HP-UX
+ * "BSD to HP-UX porting tricks" maintained by
+ * system@alchemy.chem.utoronto.ca (System Admin (Mike Peterson))
+ * from the version "last updated: 11-Jan-1993"
+ * Snarfage done by Jarkko Hietaniemi <Jarkko.Hietaniemi@hut.fi>
+ * *) well, almost, had to K&R the function entry, HPUX "cc"
+ * does not grok ANSI function prototypes */
+
+/*
+ * flock (fd, operation)
+ *
+ * This routine performs some file locking like the BSD 'flock'
+ * on the object described by the int file descriptor 'fd',
+ * which must already be open.
+ *
+ * The operations that are available are:
+ *
+ * LOCK_SH - get a shared lock.
+ * LOCK_EX - get an exclusive lock.
+ * LOCK_NB - don't block (must be ORed with LOCK_SH or LOCK_EX).
+ * LOCK_UN - release a lock.
+ *
+ * Return value: 0 if lock successful, -1 if failed.
+ *
+ * Note that whether the locks are enforced or advisory is
+ * controlled by the presence or absence of the SETGID bit on
+ * the executable.
+ *
+ * Note that there is no difference between shared and exclusive
+ * locks, since the 'lockf' system call in SYSV doesn't make any
+ * distinction.
+ *
+ * The file "<sys/file.h>" should be modified to contain the definitions
+ * of the available operations, which must be added manually (see below
+ * for the values).
+ */
+
+/* this code has been reformatted by vixie */
+
+int
+flock(fd, operation)
+ int fd;
+ int operation;
+{
+ int i;
+
+ switch (operation) {
+ case LOCK_SH: /* get a shared lock */
+ case LOCK_EX: /* get an exclusive lock */
+ i = lockf (fd, F_LOCK, 0);
+ break;
+
+ case LOCK_SH|LOCK_NB: /* get a non-blocking shared lock */
+ case LOCK_EX|LOCK_NB: /* get a non-blocking exclusive lock */
+ i = lockf (fd, F_TLOCK, 0);
+ if (i == -1)
+ if ((errno == EAGAIN) || (errno == EACCES))
+ errno = EWOULDBLOCK;
+ break;
+
+ case LOCK_UN: /* unlock */
+ i = lockf (fd, F_ULOCK, 0);
+ break;
+
+ default: /* can't decipher operation */
+ i = -1;
+ errno = EINVAL;
+ break;
+ }
+
+ return (i);
+}
+#endif /*NEED_FLOCK*/
+
+
+#ifdef NEED_SETENV
+int
+setenv(name, value, overwrite)
+ char *name, *value;
+ int overwrite;
+{
+ char *tmp;
+
+ if (overwrite && getenv(name))
+ return -1;
+
+ if (!(tmp = malloc(strlen(name) + strlen(value) + 2))) {
+ errno = ENOMEM;
+ return -1;
+ }
+
+ sprintf("%s=%s", name, value);
+ return putenv(tmp); /* intentionally orphan 'tmp' storage */
+}
+#endif
diff --git a/usr.sbin/cron/compat.h b/usr.sbin/cron/compat.h
new file mode 100644
index 000000000000..8e2f19581cc8
--- /dev/null
+++ b/usr.sbin/cron/compat.h
@@ -0,0 +1,138 @@
+/* Copyright 1993,1994 by Paul Vixie
+ * All rights reserved
+ *
+ * Distribute freely, except: don't remove my name from the source or
+ * documentation (don't take credit for my work), mark your changes (don't
+ * get me blamed for your possible bugs), don't alter or remove this
+ * notice. May be sold if buildable source is provided to buyer. No
+ * warrantee of any kind, express or implied, is included with this
+ * software; use at your own risk, responsibility for damages (if any) to
+ * anyone resulting from the use of this software rests entirely with the
+ * user.
+ *
+ * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
+ * I'll try to keep a version up to date. I can be reached as follows:
+ * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
+ */
+
+/*
+ * From Id: compat.h,v 1.8 1994/01/15 20:43:43 vixie Exp
+ * $Header: /home/cvs/386BSD/src/usr.sbin/cron/compat.h,v 1.1 1994/01/22 20:38:56 guido Exp $
+ */
+
+#ifndef __P
+# ifdef __STDC__
+# define __P(x) x
+# else
+# define __P(x) ()
+# define const
+# endif
+#endif
+
+#if defined(UNIXPC) || defined(unixpc)
+# define UNIXPC 1
+# define ATT 1
+#endif
+
+#if defined(hpux) || defined(_hpux) || defined(__hpux)
+# define HPUX 1
+# define seteuid(e) setresuid(-1,e,-1)
+# define setreuid(r,e) setresuid(r,e,-1)
+#endif
+
+#if defined(_IBMR2)
+# define AIX 1
+#endif
+
+#if defined(__convex__)
+# define CONVEX 1
+#endif
+
+#if defined(sgi) || defined(_sgi) || defined(__sgi)
+# define IRIX 1
+/* IRIX 4 hdrs are broken: one cannot #include both <stdio.h>
+ * and <stdlib.h> because they disagree on system(), perror().
+ * Therefore we must zap the "const" keyword BEFORE including
+ * either of them.
+ */
+# define const
+#endif
+
+#if defined(_UNICOS)
+# define UNICOS 1
+#endif
+
+#ifndef POSIX
+# if (BSD >= 199103) || defined(__linux) || defined(ultrix) || defined(AIX) ||\
+ defined(HPUX) || defined(CONVEX) || defined(IRIX)
+# define POSIX
+# endif
+#endif
+
+#ifndef BSD
+# if defined(ultrix)
+# define BSD 198902
+# endif
+#endif
+
+/*****************************************************************/
+
+#if !defined(BSD) && !defined(HPUX) && !defined(CONVEX) && !defined(__linux)
+# define NEED_VFORK
+#endif
+
+#if (!defined(BSD) || (BSD < 198902)) && !defined(__linux) && \
+ !defined(IRIX) && !defined(NeXT) && !defined(HPUX)
+# define NEED_STRCASECMP
+#endif
+
+#if (!defined(BSD) || (BSD < 198911)) && !defined(__linux) &&\
+ !defined(IRIX) && !defined(UNICOS) && !defined(HPUX)
+# define NEED_STRDUP
+#endif
+
+#if (!defined(BSD) || (BSD < 198911)) && !defined(POSIX) && !defined(NeXT)
+# define NEED_STRERROR
+#endif
+
+#if defined(HPUX) || defined(AIX) || defined(UNIXPC)
+# define NEED_FLOCK
+#endif
+
+#ifndef POSIX
+# define NEED_SETSID
+#endif
+
+#if (defined(POSIX) && !defined(BSD)) && !defined(__linux)
+# define NEED_GETDTABLESIZE
+#endif
+
+#if (BSD >= 199103)
+# define HAVE_SAVED_UIDS
+#endif
+
+#if !defined(ATT) && !defined(__linux) && !defined(IRIX) && !defined(UNICOS)
+# define USE_SIGCHLD
+#endif
+
+#if !defined(AIX) && !defined(UNICOS)
+# define SYS_TIME_H 1
+#else
+# define SYS_TIME_H 0
+#endif
+
+#if defined(BSD) && !defined(POSIX)
+# define USE_UTIMES
+#endif
+
+#if defined(AIX) || defined(HPUX) || defined(IRIX)
+# define NEED_SETENV
+#endif
+
+#if !defined(UNICOS) && !defined(UNIXPC)
+# define HAS_FCHOWN
+#endif
+
+#if !defined(UNICOS) && !defined(UNIXPC)
+# define HAS_FCHMOD
+#endif
diff --git a/usr.sbin/cron/config.h b/usr.sbin/cron/config.h
new file mode 100644
index 000000000000..e4caff88a248
--- /dev/null
+++ b/usr.sbin/cron/config.h
@@ -0,0 +1,87 @@
+/* Copyright 1988,1990,1993,1994 by Paul Vixie
+ * All rights reserved
+ *
+ * Distribute freely, except: don't remove my name from the source or
+ * documentation (don't take credit for my work), mark your changes (don't
+ * get me blamed for your possible bugs), don't alter or remove this
+ * notice. May be sold if buildable source is provided to buyer. No
+ * warrantee of any kind, express or implied, is included with this
+ * software; use at your own risk, responsibility for damages (if any) to
+ * anyone resulting from the use of this software rests entirely with the
+ * user.
+ *
+ * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
+ * I'll try to keep a version up to date. I can be reached as follows:
+ * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
+ */
+
+/* config.h - configurables for Vixie Cron
+ *
+ * From Id: config.h,v 2.6 1994/01/15 20:43:43 vixie Exp
+ * $Header: /home/cvs/386BSD/src/usr.sbin/cron/config.h,v 1.1 1994/01/22 20:38:57 guido Exp $
+ */
+
+#if !defined(_PATH_SENDMAIL)
+# define _PATH_SENDMAIL "/usr/lib/sendmail"
+#endif /*SENDMAIL*/
+
+/*
+ * these are site-dependent
+ */
+
+#ifndef DEBUGGING
+#define DEBUGGING 1 /* 1 or 0 -- do you want debugging code built in? */
+#endif
+
+ /*
+ * choose one of these MAILCMD commands. I use
+ * /bin/mail for speed; it makes biff bark but doesn't
+ * do aliasing. /usr/lib/sendmail does aliasing but is
+ * a hog for short messages. aliasing is not needed
+ * if you make use of the MAILTO= feature in crontabs.
+ * (hint: MAILTO= was added for this reason).
+ */
+
+#define MAILCMD _PATH_SENDMAIL /*-*/
+#define MAILARGS "%s -FCronDaemon -odi -oem -or0s %s" /*-*/
+ /* -Fx = set full-name of sender
+ * -odi = Option Deliverymode Interactive
+ * -oem = Option Errors Mailedtosender
+ * -or0s = Option Readtimeout -- don't time out
+ */
+
+/* #define MAILCMD "/bin/mail" /*-*/
+/* #define MAILARGS "%s -d %s" /*-*/
+ /* -d = undocumented but common flag: deliver locally?
+ */
+
+/* #define MAILCMD "/usr/mmdf/bin/submit" /*-*/
+/* #define MAILARGS "%s -mlrxto %s" /*-*/
+
+/* #define MAIL_DATE /*-*/
+ /* should we include an ersatz Date: header in
+ * generated mail? if you are using sendmail
+ * for MAILCMD, it is better to let sendmail
+ * generate the Date: header.
+ */
+
+ /* if ALLOW_FILE and DENY_FILE are not defined or are
+ * defined but neither exists, should crontab(1) be
+ * usable only by root?
+ */
+/*#define ALLOW_ONLY_ROOT /*-*/
+
+ /* if you want to use syslog(3) instead of appending
+ * to CRONDIR/LOG_FILE (/var/cron/log, e.g.), define
+ * SYSLOG here. Note that quite a bit of logging
+ * info is written, and that you probably don't want
+ * to use this on 4.2bsd since everything goes in
+ * /usr/spool/mqueue/syslog. On 4.[34]bsd you can
+ * tell /etc/syslog.conf to send cron's logging to
+ * a separate file.
+ *
+ * Note that if this and LOG_FILE in "pathnames.h"
+ * are both defined, then logging will go to both
+ * places.
+ */
+#define SYSLOG /*-*/
diff --git a/usr.sbin/cron/cron.8 b/usr.sbin/cron/cron.8
new file mode 100644
index 000000000000..c89398663e0c
--- /dev/null
+++ b/usr.sbin/cron/cron.8
@@ -0,0 +1,63 @@
+.\"/* Copyright 1988,1990,1993 by Paul Vixie
+.\" * All rights reserved
+.\" *
+.\" * Distribute freely, except: don't remove my name from the source or
+.\" * documentation (don't take credit for my work), mark your changes (don't
+.\" * get me blamed for your possible bugs), don't alter or remove this
+.\" * notice. May be sold if buildable source is provided to buyer. No
+.\" * warrantee of any kind, express or implied, is included with this
+.\" * software; use at your own risk, responsibility for damages (if any) to
+.\" * anyone resulting from the use of this software rests entirely with the
+.\" * user.
+.\" *
+.\" * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
+.\" * I'll try to keep a version up to date. I can be reached as follows:
+.\" * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
+.\" */
+.\"
+.\" $Header: /home/cvs/386BSD/src/usr.sbin/cron/cron.8,v 1.1.2.1 1994/05/01 16:09:33 jkh Exp $
+.\"
+.\" From Id: cron.8,v 2.2 1993/12/28 08:34:43 vixie Exp
+.\"
+.TH CRON 8 "20 December 1993"
+.UC 4
+.SH NAME
+cron \- daemon to execute scheduled commands (Vixie Cron)
+.SH SYNOPSIS
+cron
+.SH DESCRIPTION
+.I Cron
+should be started from /etc/rc or /etc/rc.local. It will return immediately,
+so you don't need to start it with '&'.
+.PP
+.I Cron
+searches /var/cron/tabs for crontab files which are named after accounts in
+/etc/passwd; crontabs found are loaded into memory.
+.I Cron
+also searches for /etc/crontab which is in a different format (see
+.IR crontab(5)).
+.I Cron
+then wakes up every minute, examining all stored crontabs, checking each
+command to see if it should be run in the current minute. When executing
+commands, any output is mailed to the owner of the crontab (or to the user
+named in the MAILTO environment variable in the crontab, if such exists).
+.PP
+Additionally,
+.I cron
+checks each minute to see if its spool directory's modtime (or the modtime
+on
+.IR /etc/crontab)
+has changed, and if it has,
+.I cron
+will then examine the modtime on all crontabs and reload those which have
+changed. Thus
+.I cron
+need not be restarted whenever a crontab file is modified. Note that the
+.IR Crontab (1)
+command updates the modtime of the spool directory whenever it changes a
+crontab.
+.SH "SEE ALSO"
+crontab(1), crontab(5)
+.SH AUTHOR
+.nf
+Paul Vixie <paul@vix.com>
diff --git a/usr.sbin/cron/cron.c b/usr.sbin/cron/cron.c
new file mode 100644
index 000000000000..3a3c34ef98a0
--- /dev/null
+++ b/usr.sbin/cron/cron.c
@@ -0,0 +1,302 @@
+/* Copyright 1988,1990,1993,1994 by Paul Vixie
+ * All rights reserved
+ *
+ * Distribute freely, except: don't remove my name from the source or
+ * documentation (don't take credit for my work), mark your changes (don't
+ * get me blamed for your possible bugs), don't alter or remove this
+ * notice. May be sold if buildable source is provided to buyer. No
+ * warrantee of any kind, express or implied, is included with this
+ * software; use at your own risk, responsibility for damages (if any) to
+ * anyone resulting from the use of this software rests entirely with the
+ * user.
+ *
+ * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
+ * I'll try to keep a version up to date. I can be reached as follows:
+ * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
+ * From Id: cron.c,v 2.11 1994/01/15 20:43:43 vixie Exp
+ */
+
+#if !defined(lint) && !defined(LINT)
+static char rcsid[] = "$Header: /home/cvs/386BSD/src/usr.sbin/cron/cron.c,v 1.1 1994/01/22 20:38:59 guido Exp $";
+#endif
+
+
+#define MAIN_PROGRAM
+
+
+#include "cron.h"
+#include <sys/signal.h>
+#if SYS_TIME_H
+# include <sys/time.h>
+#else
+# include <time.h>
+#endif
+
+
+static void usage __P((void)),
+ run_reboot_jobs __P((cron_db *)),
+ cron_tick __P((cron_db *)),
+ cron_sync __P((void)),
+ cron_sleep __P((void)),
+#ifdef USE_SIGCHLD
+ sigchld_handler __P((int)),
+#endif
+ sighup_handler __P((int)),
+ parse_args __P((int c, char *v[]));
+
+
+static void
+usage() {
+ fprintf(stderr, "usage: %s [-x debugflag[,...]]\n", ProgramName);
+ exit(ERROR_EXIT);
+}
+
+
+int
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ cron_db database;
+
+ ProgramName = argv[0];
+
+#if defined(BSD)
+ setlinebuf(stdout);
+ setlinebuf(stderr);
+#endif
+
+ parse_args(argc, argv);
+
+#ifdef USE_SIGCHLD
+ (void) signal(SIGCHLD, sigchld_handler);
+#else
+ (void) signal(SIGCLD, SIG_IGN);
+#endif
+ (void) signal(SIGHUP, sighup_handler);
+
+ acquire_daemonlock(0);
+ set_cron_uid();
+ set_cron_cwd();
+
+#if defined(POSIX)
+ setenv("PATH", _PATH_DEFPATH, 1);
+#endif
+
+ /* if there are no debug flags turned on, fork as a daemon should.
+ */
+# if DEBUGGING
+ if (DebugFlags) {
+# else
+ if (0) {
+# endif
+ (void) fprintf(stderr, "[%d] cron started\n", getpid());
+ } else {
+ switch (fork()) {
+ case -1:
+ log_it("CRON",getpid(),"DEATH","can't fork");
+ exit(0);
+ break;
+ case 0:
+ /* child process */
+ log_it("CRON",getpid(),"STARTUP","fork ok");
+ (void) setsid();
+ break;
+ default:
+ /* parent process should just die */
+ _exit(0);
+ }
+ }
+
+ acquire_daemonlock(0);
+ database.head = NULL;
+ database.tail = NULL;
+ database.mtime = (time_t) 0;
+ load_database(&database);
+ run_reboot_jobs(&database);
+ cron_sync();
+ while (TRUE) {
+# if DEBUGGING
+ if (!(DebugFlags & DTEST))
+# endif /*DEBUGGING*/
+ cron_sleep();
+
+ load_database(&database);
+
+ /* do this iteration
+ */
+ cron_tick(&database);
+
+ /* sleep 1 minute
+ */
+ TargetTime += 60;
+ }
+}
+
+
+static void
+run_reboot_jobs(db)
+ cron_db *db;
+{
+ register user *u;
+ register entry *e;
+
+ for (u = db->head; u != NULL; u = u->next) {
+ for (e = u->crontab; e != NULL; e = e->next) {
+ if (e->flags & WHEN_REBOOT) {
+ job_add(e, u);
+ }
+ }
+ }
+ (void) job_runqueue();
+}
+
+
+static void
+cron_tick(db)
+ cron_db *db;
+{
+ register struct tm *tm = localtime(&TargetTime);
+ register int minute, hour, dom, month, dow;
+ register user *u;
+ register entry *e;
+
+ /* make 0-based values out of these so we can use them as indicies
+ */
+ minute = tm->tm_min -FIRST_MINUTE;
+ hour = tm->tm_hour -FIRST_HOUR;
+ dom = tm->tm_mday -FIRST_DOM;
+ month = tm->tm_mon +1 /* 0..11 -> 1..12 */ -FIRST_MONTH;
+ dow = tm->tm_wday -FIRST_DOW;
+
+ Debug(DSCH, ("[%d] tick(%d,%d,%d,%d,%d)\n",
+ getpid(), minute, hour, dom, month, dow))
+
+ /* the dom/dow situation is odd. '* * 1,15 * Sun' will run on the
+ * first and fifteenth AND every Sunday; '* * * * Sun' will run *only*
+ * on Sundays; '* * 1,15 * *' will run *only* the 1st and 15th. this
+ * is why we keep 'e->dow_star' and 'e->dom_star'. yes, it's bizarre.
+ * like many bizarre things, it's the standard.
+ */
+ for (u = db->head; u != NULL; u = u->next) {
+ for (e = u->crontab; e != NULL; e = e->next) {
+ Debug(DSCH|DEXT, ("user [%s:%d:%d:...] cmd=\"%s\"\n",
+ env_get("LOGNAME", e->envp),
+ e->uid, e->gid, e->cmd))
+ if (bit_test(e->minute, minute)
+ && bit_test(e->hour, hour)
+ && bit_test(e->month, month)
+ && ( ((e->flags & DOM_STAR) || (e->flags & DOW_STAR))
+ ? (bit_test(e->dow,dow) && bit_test(e->dom,dom))
+ : (bit_test(e->dow,dow) || bit_test(e->dom,dom))
+ )
+ ) {
+ job_add(e, u);
+ }
+ }
+ }
+}
+
+
+/* the task here is to figure out how long it's going to be until :00 of the
+ * following minute and initialize TargetTime to this value. TargetTime
+ * will subsequently slide 60 seconds at a time, with correction applied
+ * implicitly in cron_sleep(). it would be nice to let cron execute in
+ * the "current minute" before going to sleep, but by restarting cron you
+ * could then get it to execute a given minute's jobs more than once.
+ * instead we have the chance of missing a minute's jobs completely, but
+ * that's something sysadmin's know to expect what with crashing computers..
+ */
+static void
+cron_sync() {
+ register struct tm *tm;
+
+ TargetTime = time((time_t*)0);
+ tm = localtime(&TargetTime);
+ TargetTime += (60 - tm->tm_sec);
+}
+
+
+static void
+cron_sleep() {
+ register int seconds_to_wait;
+
+ do {
+ seconds_to_wait = (int) (TargetTime - time((time_t*)0));
+ Debug(DSCH, ("[%d] TargetTime=%ld, sec-to-wait=%d\n",
+ getpid(), TargetTime, seconds_to_wait))
+
+ /* if we intend to sleep, this means that it's finally
+ * time to empty the job queue (execute it).
+ *
+ * if we run any jobs, we'll probably screw up our timing,
+ * so go recompute.
+ *
+ * note that we depend here on the left-to-right nature
+ * of &&, and the short-circuiting.
+ */
+ } while (seconds_to_wait > 0 && job_runqueue());
+
+ while (seconds_to_wait > 0) {
+ Debug(DSCH, ("[%d] sleeping for %d seconds\n",
+ getpid(), seconds_to_wait))
+ seconds_to_wait = (int) sleep((unsigned int) seconds_to_wait);
+ }
+}
+
+
+#ifdef USE_SIGCHLD
+static void
+sigchld_handler(x) {
+ WAIT_T waiter;
+ PID_T pid;
+
+ for (;;) {
+#ifdef POSIX
+ pid = waitpid(-1, &waiter, WNOHANG);
+#else
+ pid = wait3(&waiter, WNOHANG, (struct rusage *)0);
+#endif
+ switch (pid) {
+ case -1:
+ Debug(DPROC,
+ ("[%d] sigchld...no children\n", getpid()))
+ return;
+ case 0:
+ Debug(DPROC,
+ ("[%d] sigchld...no dead kids\n", getpid()))
+ return;
+ default:
+ Debug(DPROC,
+ ("[%d] sigchld...pid #%d died, stat=%d\n",
+ getpid(), pid, WEXITSTATUS(waiter)))
+ }
+ }
+}
+#endif /*USE_SIGCHLD*/
+
+
+static void
+sighup_handler(x) {
+ log_close();
+}
+
+
+static void
+parse_args(argc, argv)
+ int argc;
+ char *argv[];
+{
+ int argch;
+
+ while (EOF != (argch = getopt(argc, argv, "x:"))) {
+ switch (argch) {
+ default:
+ usage();
+ case 'x':
+ if (!set_debug_flags(optarg))
+ usage();
+ break;
+ }
+ }
+}
diff --git a/usr.sbin/cron/cron.h b/usr.sbin/cron/cron.h
new file mode 100644
index 000000000000..b6d1503143b0
--- /dev/null
+++ b/usr.sbin/cron/cron.h
@@ -0,0 +1,278 @@
+/* Copyright 1988,1990,1993,1994 by Paul Vixie
+ * All rights reserved
+ *
+ * Distribute freely, except: don't remove my name from the source or
+ * documentation (don't take credit for my work), mark your changes (don't
+ * get me blamed for your possible bugs), don't alter or remove this
+ * notice. May be sold if buildable source is provided to buyer. No
+ * warrantee of any kind, express or implied, is included with this
+ * software; use at your own risk, responsibility for damages (if any) to
+ * anyone resulting from the use of this software rests entirely with the
+ * user.
+ *
+ * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
+ * I'll try to keep a version up to date. I can be reached as follows:
+ * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
+ */
+
+/* cron.h - header for vixie's cron
+ *
+ * From Id: cron.h,v 2.10 1994/01/15 20:43:43 vixie Exp
+ * $Header: /home/cvs/386BSD/src/usr.sbin/cron/cron.h,v 1.1 1994/01/22 20:39:00 guido Exp $
+ *
+ * vix 14nov88 [rest of log is in RCS]
+ * vix 14jan87 [0 or 7 can be sunday; thanks, mwm@berkeley]
+ * vix 30dec86 [written]
+ */
+
+/* reorder these #include's at your peril */
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include "compat.h"
+
+#include <stdio.h>
+#include <ctype.h>
+#include <bitstring.h>
+#include <pwd.h>
+#include <sys/wait.h>
+
+#include "pathnames.h"
+#include "config.h"
+#include "externs.h"
+
+ /* these are really immutable, and are
+ * defined for symbolic convenience only
+ * TRUE, FALSE, and ERR must be distinct
+ * ERR must be < OK.
+ */
+#define TRUE 1
+#define FALSE 0
+ /* system calls return this on success */
+#define OK 0
+ /* or this on error */
+#define ERR (-1)
+
+ /* turn this on to get '-x' code */
+#ifndef DEBUGGING
+#define DEBUGGING FALSE
+#endif
+
+#define READ_PIPE 0 /* which end of a pipe pair do you read? */
+#define WRITE_PIPE 1 /* or write to? */
+#define STDIN 0 /* what is stdin's file descriptor? */
+#define STDOUT 1 /* stdout's? */
+#define STDERR 2 /* stderr's? */
+#define ERROR_EXIT 1 /* exit() with this will scare the shell */
+#define OK_EXIT 0 /* exit() with this is considered 'normal' */
+#define MAX_FNAME 100 /* max length of internally generated fn */
+#define MAX_COMMAND 1000 /* max length of internally generated cmd */
+#define MAX_ENVSTR 1000 /* max length of envvar=value\0 strings */
+#define MAX_TEMPSTR 100 /* obvious */
+#define MAX_UNAME 20 /* max length of username, should be overkill */
+#define ROOT_UID 0 /* don't change this, it really must be root */
+#define ROOT_USER "root" /* ditto */
+
+ /* NOTE: these correspond to DebugFlagNames,
+ * defined below.
+ */
+#define DEXT 0x0001 /* extend flag for other debug masks */
+#define DSCH 0x0002 /* scheduling debug mask */
+#define DPROC 0x0004 /* process control debug mask */
+#define DPARS 0x0008 /* parsing debug mask */
+#define DLOAD 0x0010 /* database loading debug mask */
+#define DMISC 0x0020 /* misc debug mask */
+#define DTEST 0x0040 /* test mode: don't execute any commands */
+#define DBIT 0x0080 /* bit twiddling shown (long) */
+
+#define CRON_TAB(u) "%s/%s", SPOOL_DIR, u
+#define REG register
+#define PPC_NULL ((char **)NULL)
+
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 64
+#endif
+
+#define Skip_Blanks(c, f) \
+ while (c == '\t' || c == ' ') \
+ c = get_char(f);
+
+#define Skip_Nonblanks(c, f) \
+ while (c!='\t' && c!=' ' && c!='\n' && c != EOF) \
+ c = get_char(f);
+
+#define Skip_Line(c, f) \
+ do {c = get_char(f);} while (c != '\n' && c != EOF);
+
+#if DEBUGGING
+# define Debug(mask, message) \
+ if ( (DebugFlags & (mask) ) == (mask) ) \
+ printf message;
+#else /* !DEBUGGING */
+# define Debug(mask, message) \
+ ;
+#endif /* DEBUGGING */
+
+#define MkLower(ch) (isupper(ch) ? tolower(ch) : ch)
+#define MkUpper(ch) (islower(ch) ? toupper(ch) : ch)
+#define Set_LineNum(ln) {Debug(DPARS|DEXT,("linenum=%d\n",ln)); \
+ LineNumber = ln; \
+ }
+
+#define FIRST_MINUTE 0
+#define LAST_MINUTE 59
+#define MINUTE_COUNT (LAST_MINUTE - FIRST_MINUTE + 1)
+
+#define FIRST_HOUR 0
+#define LAST_HOUR 23
+#define HOUR_COUNT (LAST_HOUR - FIRST_HOUR + 1)
+
+#define FIRST_DOM 1
+#define LAST_DOM 31
+#define DOM_COUNT (LAST_DOM - FIRST_DOM + 1)
+
+#define FIRST_MONTH 1
+#define LAST_MONTH 12
+#define MONTH_COUNT (LAST_MONTH - FIRST_MONTH + 1)
+
+/* note on DOW: 0 and 7 are both Sunday, for compatibility reasons. */
+#define FIRST_DOW 0
+#define LAST_DOW 7
+#define DOW_COUNT (LAST_DOW - FIRST_DOW + 1)
+
+ /* each user's crontab will be held as a list of
+ * the following structure.
+ *
+ * These are the cron commands.
+ */
+
+typedef struct _entry {
+ struct _entry *next;
+ uid_t uid;
+ gid_t gid;
+ char **envp;
+ char *cmd;
+ bitstr_t bit_decl(minute, MINUTE_COUNT);
+ bitstr_t bit_decl(hour, HOUR_COUNT);
+ bitstr_t bit_decl(dom, DOM_COUNT);
+ bitstr_t bit_decl(month, MONTH_COUNT);
+ bitstr_t bit_decl(dow, DOW_COUNT);
+ int flags;
+#define DOM_STAR 0x01
+#define DOW_STAR 0x02
+#define WHEN_REBOOT 0x04
+} entry;
+
+ /* the crontab database will be a list of the
+ * following structure, one element per user
+ * plus one for the system.
+ *
+ * These are the crontabs.
+ */
+
+typedef struct _user {
+ struct _user *next, *prev; /* links */
+ char *name;
+ time_t mtime; /* last modtime of crontab */
+ entry *crontab; /* this person's crontab */
+} user;
+
+typedef struct _cron_db {
+ user *head, *tail; /* links */
+ time_t mtime; /* last modtime on spooldir */
+} cron_db;
+
+
+void set_cron_uid __P((void)),
+ set_cron_cwd __P((void)),
+ load_database __P((cron_db *)),
+ open_logfile __P((void)),
+ sigpipe_func __P((void)),
+ job_add __P((entry *, user *)),
+ do_command __P((entry *, user *)),
+ link_user __P((cron_db *, user *)),
+ unlink_user __P((cron_db *, user *)),
+ free_user __P((user *)),
+ env_free __P((char **)),
+ unget_char __P((int, FILE *)),
+ free_entry __P((entry *)),
+ acquire_daemonlock __P((int)),
+ skip_comments __P((FILE *)),
+ log_it __P((char *, int, char *, char *)),
+ log_close __P((void));
+
+int job_runqueue __P((void)),
+ set_debug_flags __P((char *)),
+ get_char __P((FILE *)),
+ get_string __P((char *, int, FILE *, char *)),
+ swap_uids __P((void)),
+ load_env __P((char *, FILE *)),
+ cron_pclose __P((FILE *)),
+ strcmp_until __P((char *, char *, int)),
+ allowed __P((char *)),
+ strdtb __P((char *));
+
+char *env_get __P((char *, char **)),
+ *arpadate __P((time_t *)),
+ *mkprints __P((unsigned char *, unsigned int)),
+ *first_word __P((char *, char *)),
+ **env_init __P((void)),
+ **env_copy __P((char **)),
+ **env_set __P((char **, char *));
+
+user *load_user __P((int, struct passwd *, char *)),
+ *find_user __P((cron_db *, char *));
+
+entry *load_entry __P((FILE *, void (*)(),
+ struct passwd *, char **));
+
+FILE *cron_popen __P((char *, char *));
+
+
+ /* in the C tradition, we only create
+ * variables for the main program, just
+ * extern them elsewhere.
+ */
+
+#ifdef MAIN_PROGRAM
+# if !defined(LINT) && !defined(lint)
+char *copyright[] = {
+ "@(#) Copyright 1988,1989,1990,1993,1994 by Paul Vixie",
+ "@(#) All rights reserved"
+ };
+# endif
+
+char *MonthNames[] = {
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
+ NULL
+ };
+
+char *DowNames[] = {
+ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun",
+ NULL
+ };
+
+char *ProgramName;
+int LineNumber;
+time_t TargetTime;
+
+# if DEBUGGING
+int DebugFlags;
+char *DebugFlagNames[] = { /* sync with #defines */
+ "ext", "sch", "proc", "pars", "load", "misc", "test", "bit",
+ NULL /* NULL must be last element */
+ };
+# endif /* DEBUGGING */
+#else /*MAIN_PROGRAM*/
+extern char *copyright[],
+ *MonthNames[],
+ *DowNames[],
+ *ProgramName;
+extern int LineNumber;
+extern time_t TargetTime;
+# if DEBUGGING
+extern int DebugFlags;
+extern char *DebugFlagNames[];
+# endif /* DEBUGGING */
+#endif /*MAIN_PROGRAM*/
diff --git a/usr.sbin/cron/database.c b/usr.sbin/cron/database.c
new file mode 100644
index 000000000000..33421829b06a
--- /dev/null
+++ b/usr.sbin/cron/database.c
@@ -0,0 +1,262 @@
+/* Copyright 1988,1990,1993,1994 by Paul Vixie
+ * All rights reserved
+ *
+ * Distribute freely, except: don't remove my name from the source or
+ * documentation (don't take credit for my work), mark your changes (don't
+ * get me blamed for your possible bugs), don't alter or remove this
+ * notice. May be sold if buildable source is provided to buyer. No
+ * warrantee of any kind, express or implied, is included with this
+ * software; use at your own risk, responsibility for damages (if any) to
+ * anyone resulting from the use of this software rests entirely with the
+ * user.
+ *
+ * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
+ * I'll try to keep a version up to date. I can be reached as follows:
+ * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
+ * From Id: database.c,v 2.8 1994/01/15 20:43:43 vixie Exp
+ */
+
+#if !defined(lint) && !defined(LINT)
+static char rcsid[] = "$Header: /home/cvs/386BSD/src/usr.sbin/cron/database.c,v 1.1 1994/01/22 20:39:01 guido Exp $";
+#endif
+
+/* vix 26jan87 [RCS has the log]
+ */
+
+
+#include "cron.h"
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/file.h>
+
+
+#define TMAX(a,b) ((a)>(b)?(a):(b))
+
+
+static void process_crontab __P((char *, char *, char *,
+ struct stat *,
+ cron_db *, cron_db *));
+
+
+void
+load_database(old_db)
+ cron_db *old_db;
+{
+ DIR *dir;
+ struct stat statbuf;
+ struct stat syscron_stat;
+ DIR_T *dp;
+ cron_db new_db;
+ user *u, *nu;
+
+ Debug(DLOAD, ("[%d] load_database()\n", getpid()))
+
+ /* before we start loading any data, do a stat on SPOOL_DIR
+ * so that if anything changes as of this moment (i.e., before we've
+ * cached any of the database), we'll see the changes next time.
+ */
+ if (stat(SPOOL_DIR, &statbuf) < OK) {
+ log_it("CRON", getpid(), "STAT FAILED", SPOOL_DIR);
+ (void) exit(ERROR_EXIT);
+ }
+
+ /* track system crontab file
+ */
+ if (stat(SYSCRONTAB, &syscron_stat) < OK)
+ syscron_stat.st_mtime = 0;
+
+ /* if spooldir's mtime has not changed, we don't need to fiddle with
+ * the database.
+ *
+ * Note that old_db->mtime is initialized to 0 in main(), and
+ * so is guaranteed to be different than the stat() mtime the first
+ * time this function is called.
+ */
+ if (old_db->mtime == TMAX(statbuf.st_mtime, syscron_stat.st_mtime)) {
+ Debug(DLOAD, ("[%d] spool dir mtime unch, no load needed.\n",
+ getpid()))
+ return;
+ }
+
+ /* something's different. make a new database, moving unchanged
+ * elements from the old database, reloading elements that have
+ * actually changed. Whatever is left in the old database when
+ * we're done is chaff -- crontabs that disappeared.
+ */
+ new_db.mtime = TMAX(statbuf.st_mtime, syscron_stat.st_mtime);
+ new_db.head = new_db.tail = NULL;
+
+ if (syscron_stat.st_mtime) {
+ process_crontab("root", "*system*",
+ SYSCRONTAB, &syscron_stat,
+ &new_db, old_db);
+ }
+
+ /* we used to keep this dir open all the time, for the sake of
+ * efficiency. however, we need to close it in every fork, and
+ * we fork a lot more often than the mtime of the dir changes.
+ */
+ if (!(dir = opendir(SPOOL_DIR))) {
+ log_it("CRON", getpid(), "OPENDIR FAILED", SPOOL_DIR);
+ (void) exit(ERROR_EXIT);
+ }
+
+ while (NULL != (dp = readdir(dir))) {
+ char fname[MAXNAMLEN+1],
+ tabname[MAXNAMLEN+1];
+
+ /* avoid file names beginning with ".". this is good
+ * because we would otherwise waste two guaranteed calls
+ * to getpwnam() for . and .., and also because user names
+ * starting with a period are just too nasty to consider.
+ */
+ if (dp->d_name[0] == '.')
+ continue;
+
+ (void) strcpy(fname, dp->d_name);
+ sprintf(tabname, CRON_TAB(fname));
+
+ process_crontab(fname, fname, tabname,
+ &statbuf, &new_db, old_db);
+ }
+ closedir(dir);
+
+ /* if we don't do this, then when our children eventually call
+ * getpwnam() in do_command.c's child_process to verify MAILTO=,
+ * they will screw us up (and v-v).
+ */
+ endpwent();
+
+ /* whatever's left in the old database is now junk.
+ */
+ Debug(DLOAD, ("unlinking old database:\n"))
+ for (u = old_db->head; u != NULL; u = nu) {
+ Debug(DLOAD, ("\t%s\n", u->name))
+ nu = u->next;
+ unlink_user(old_db, u);
+ free_user(u);
+ }
+
+ /* overwrite the database control block with the new one.
+ */
+ *old_db = new_db;
+ Debug(DLOAD, ("load_database is done\n"))
+}
+
+
+void
+link_user(db, u)
+ cron_db *db;
+ user *u;
+{
+ if (db->head == NULL)
+ db->head = u;
+ if (db->tail)
+ db->tail->next = u;
+ u->prev = db->tail;
+ u->next = NULL;
+ db->tail = u;
+}
+
+
+void
+unlink_user(db, u)
+ cron_db *db;
+ user *u;
+{
+ if (u->prev == NULL)
+ db->head = u->next;
+ else
+ u->prev->next = u->next;
+
+ if (u->next == NULL)
+ db->tail = u->prev;
+ else
+ u->next->prev = u->prev;
+}
+
+
+user *
+find_user(db, name)
+ cron_db *db;
+ char *name;
+{
+ char *env_get();
+ user *u;
+
+ for (u = db->head; u != NULL; u = u->next)
+ if (!strcmp(u->name, name))
+ break;
+ return u;
+}
+
+
+static void
+process_crontab(uname, fname, tabname, statbuf, new_db, old_db)
+ char *uname;
+ char *fname;
+ char *tabname;
+ struct stat *statbuf;
+ cron_db *new_db;
+ cron_db *old_db;
+{
+ struct passwd *pw = NULL;
+ int crontab_fd = OK - 1;
+ user *u;
+
+ if (strcmp(fname, "*system*") && !(pw = getpwnam(uname))) {
+ /* file doesn't have a user in passwd file.
+ */
+ log_it(fname, getpid(), "ORPHAN", "no passwd entry");
+ goto next_crontab;
+ }
+
+ if ((crontab_fd = open(tabname, O_RDONLY, 0)) < OK) {
+ /* crontab not accessible?
+ */
+ log_it(fname, getpid(), "CAN'T OPEN", tabname);
+ goto next_crontab;
+ }
+
+ if (fstat(crontab_fd, statbuf) < OK) {
+ log_it(fname, getpid(), "FSTAT FAILED", tabname);
+ goto next_crontab;
+ }
+
+ Debug(DLOAD, ("\t%s:", fname))
+ u = find_user(old_db, fname);
+ if (u != NULL) {
+ /* if crontab has not changed since we last read it
+ * in, then we can just use our existing entry.
+ */
+ if (u->mtime == statbuf->st_mtime) {
+ Debug(DLOAD, (" [no change, using old data]"))
+ unlink_user(old_db, u);
+ link_user(new_db, u);
+ goto next_crontab;
+ }
+
+ /* before we fall through to the code that will reload
+ * the user, let's deallocate and unlink the user in
+ * the old database. This is more a point of memory
+ * efficiency than anything else, since all leftover
+ * users will be deleted from the old database when
+ * we finish with the crontab...
+ */
+ Debug(DLOAD, (" [delete old data]"))
+ unlink_user(old_db, u);
+ free_user(u);
+ log_it(fname, getpid(), "RELOAD", tabname);
+ }
+ u = load_user(crontab_fd, pw, fname);
+ if (u != NULL) {
+ u->mtime = statbuf->st_mtime;
+ link_user(new_db, u);
+ }
+
+next_crontab:
+ if (crontab_fd >= OK) {
+ Debug(DLOAD, (" [done]\n"))
+ close(crontab_fd);
+ }
+}
diff --git a/usr.sbin/cron/do_command.c b/usr.sbin/cron/do_command.c
new file mode 100644
index 000000000000..51a5dba919af
--- /dev/null
+++ b/usr.sbin/cron/do_command.c
@@ -0,0 +1,502 @@
+/* Copyright 1988,1990,1993,1994 by Paul Vixie
+ * All rights reserved
+ *
+ * Distribute freely, except: don't remove my name from the source or
+ * documentation (don't take credit for my work), mark your changes (don't
+ * get me blamed for your possible bugs), don't alter or remove this
+ * notice. May be sold if buildable source is provided to buyer. No
+ * warrantee of any kind, express or implied, is included with this
+ * software; use at your own risk, responsibility for damages (if any) to
+ * anyone resulting from the use of this software rests entirely with the
+ * user.
+ *
+ * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
+ * I'll try to keep a version up to date. I can be reached as follows:
+ * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
+ * from Id: do_command.c,v 2.12 1994/01/15 20:43:43 vixie Exp
+ */
+
+#if !defined(lint) && !defined(LINT)
+static char rcsid[] = "$Header: /home/cvs/386BSD/src/usr.sbin/cron/do_command.c,v 1.1 1994/01/22 20:39:02 guido Exp $";
+#endif
+
+
+#include "cron.h"
+#include <sys/signal.h>
+#if defined(sequent)
+# include <sys/universe.h>
+#endif
+#if defined(SYSLOG)
+# include <syslog.h>
+#endif
+
+
+static void child_process __P((entry *, user *)),
+ do_univ __P((user *));
+
+
+void
+do_command(e, u)
+ entry *e;
+ user *u;
+{
+ Debug(DPROC, ("[%d] do_command(%s, (%s,%d,%d))\n",
+ getpid(), e->cmd, u->name, e->uid, e->gid))
+
+ /* fork to become asynchronous -- parent process is done immediately,
+ * and continues to run the normal cron code, which means return to
+ * tick(). the child and grandchild don't leave this function, alive.
+ *
+ * vfork() is unsuitable, since we have much to do, and the parent
+ * needs to be able to run off and fork other processes.
+ */
+ switch (fork()) {
+ case -1:
+ log_it("CRON",getpid(),"error","can't fork");
+ break;
+ case 0:
+ /* child process */
+ acquire_daemonlock(1);
+ child_process(e, u);
+ Debug(DPROC, ("[%d] child process done, exiting\n", getpid()))
+ _exit(OK_EXIT);
+ break;
+ default:
+ /* parent process */
+ break;
+ }
+ Debug(DPROC, ("[%d] main process returning to work\n", getpid()))
+}
+
+
+static void
+child_process(e, u)
+ entry *e;
+ user *u;
+{
+ int stdin_pipe[2], stdout_pipe[2];
+ register char *input_data;
+ char *usernm, *mailto;
+ int children = 0;
+
+ Debug(DPROC, ("[%d] child_process('%s')\n", getpid(), e->cmd))
+
+ /* mark ourselves as different to PS command watchers by upshifting
+ * our program name. This has no effect on some kernels.
+ */
+ /*local*/{
+ register char *pch;
+
+ for (pch = ProgramName; *pch; pch++)
+ *pch = MkUpper(*pch);
+ }
+
+ /* discover some useful and important environment settings
+ */
+ usernm = env_get("LOGNAME", e->envp);
+ mailto = env_get("MAILTO", e->envp);
+
+#ifdef USE_SIGCHLD
+ /* our parent is watching for our death by catching SIGCHLD. we
+ * do not care to watch for our children's deaths this way -- we
+ * use wait() explictly. so we have to disable the signal (which
+ * was inherited from the parent).
+ */
+ (void) signal(SIGCHLD, SIG_IGN);
+#else
+ /* on system-V systems, we are ignoring SIGCLD. we have to stop
+ * ignoring it now or the wait() in cron_pclose() won't work.
+ * because of this, we have to wait() for our children here, as well.
+ */
+ (void) signal(SIGCLD, SIG_DFL);
+#endif /*BSD*/
+
+ /* create some pipes to talk to our future child
+ */
+ pipe(stdin_pipe); /* child's stdin */
+ pipe(stdout_pipe); /* child's stdout */
+
+ /* since we are a forked process, we can diddle the command string
+ * we were passed -- nobody else is going to use it again, right?
+ *
+ * if a % is present in the command, previous characters are the
+ * command, and subsequent characters are the additional input to
+ * the command. Subsequent %'s will be transformed into newlines,
+ * but that happens later.
+ */
+ /*local*/{
+ register int escaped = FALSE;
+ register int ch;
+
+ for (input_data = e->cmd; ch = *input_data; input_data++) {
+ if (escaped) {
+ escaped = FALSE;
+ continue;
+ }
+ if (ch == '\\') {
+ escaped = TRUE;
+ continue;
+ }
+ if (ch == '%') {
+ *input_data++ = '\0';
+ break;
+ }
+ }
+ }
+
+ /* fork again, this time so we can exec the user's command.
+ */
+ switch (vfork()) {
+ case -1:
+ log_it("CRON",getpid(),"error","can't vfork");
+ exit(ERROR_EXIT);
+ /*NOTREACHED*/
+ case 0:
+ Debug(DPROC, ("[%d] grandchild process Vfork()'ed\n",
+ getpid()))
+
+ /* write a log message. we've waited this long to do it
+ * because it was not until now that we knew the PID that
+ * the actual user command shell was going to get and the
+ * PID is part of the log message.
+ */
+ /*local*/{
+ char *x = mkprints((u_char *)e->cmd, strlen(e->cmd));
+
+ log_it(usernm, getpid(), "CMD", x);
+ free(x);
+ }
+
+ /* that's the last thing we'll log. close the log files.
+ */
+#ifdef SYSLOG
+ closelog();
+#endif
+
+ /* get new pgrp, void tty, etc.
+ */
+ (void) setsid();
+
+ /* close the pipe ends that we won't use. this doesn't affect
+ * the parent, who has to read and write them; it keeps the
+ * kernel from recording us as a potential client TWICE --
+ * which would keep it from sending SIGPIPE in otherwise
+ * appropriate circumstances.
+ */
+ close(stdin_pipe[WRITE_PIPE]);
+ close(stdout_pipe[READ_PIPE]);
+
+ /* grandchild process. make std{in,out} be the ends of
+ * pipes opened by our daddy; make stderr go to stdout.
+ */
+ close(STDIN); dup2(stdin_pipe[READ_PIPE], STDIN);
+ close(STDOUT); dup2(stdout_pipe[WRITE_PIPE], STDOUT);
+ close(STDERR); dup2(STDOUT, STDERR);
+
+ /* close the pipes we just dup'ed. The resources will remain.
+ */
+ close(stdin_pipe[READ_PIPE]);
+ close(stdout_pipe[WRITE_PIPE]);
+
+ /* set our login universe. Do this in the grandchild
+ * so that the child can invoke /usr/lib/sendmail
+ * without surprises.
+ */
+ do_univ(u);
+
+ /* set our directory, uid and gid. Set gid first, since once
+ * we set uid, we've lost root privledges.
+ */
+ setgid(e->gid);
+# if defined(BSD)
+ initgroups(env_get("LOGNAME", e->envp), e->gid);
+# endif
+ setuid(e->uid); /* we aren't root after this... */
+ chdir(env_get("HOME", e->envp));
+
+ /* exec the command.
+ */
+ {
+ char *shell = env_get("SHELL", e->envp);
+
+# if DEBUGGING
+ if (DebugFlags & DTEST) {
+ fprintf(stderr,
+ "debug DTEST is on, not exec'ing command.\n");
+ fprintf(stderr,
+ "\tcmd='%s' shell='%s'\n", e->cmd, shell);
+ _exit(OK_EXIT);
+ }
+# endif /*DEBUGGING*/
+ execle(shell, shell, "-c", e->cmd, (char *)0, e->envp);
+ fprintf(stderr, "execl: couldn't exec `%s'\n", shell);
+ perror("execl");
+ _exit(ERROR_EXIT);
+ }
+ break;
+ default:
+ /* parent process */
+ break;
+ }
+
+ children++;
+
+ /* middle process, child of original cron, parent of process running
+ * the user's command.
+ */
+
+ Debug(DPROC, ("[%d] child continues, closing pipes\n", getpid()))
+
+ /* close the ends of the pipe that will only be referenced in the
+ * grandchild process...
+ */
+ close(stdin_pipe[READ_PIPE]);
+ close(stdout_pipe[WRITE_PIPE]);
+
+ /*
+ * write, to the pipe connected to child's stdin, any input specified
+ * after a % in the crontab entry. while we copy, convert any
+ * additional %'s to newlines. when done, if some characters were
+ * written and the last one wasn't a newline, write a newline.
+ *
+ * Note that if the input data won't fit into one pipe buffer (2K
+ * or 4K on most BSD systems), and the child doesn't read its stdin,
+ * we would block here. thus we must fork again.
+ */
+
+ if (*input_data && fork() == 0) {
+ register FILE *out = fdopen(stdin_pipe[WRITE_PIPE], "w");
+ register int need_newline = FALSE;
+ register int escaped = FALSE;
+ register int ch;
+
+ Debug(DPROC, ("[%d] child2 sending data to grandchild\n", getpid()))
+
+ /* close the pipe we don't use, since we inherited it and
+ * are part of its reference count now.
+ */
+ close(stdout_pipe[READ_PIPE]);
+
+ /* translation:
+ * \% -> %
+ * % -> \n
+ * \x -> \x for all x != %
+ */
+ while (ch = *input_data++) {
+ if (escaped) {
+ if (ch != '%')
+ putc('\\', out);
+ } else {
+ if (ch == '%')
+ ch = '\n';
+ }
+
+ if (!(escaped = (ch == '\\'))) {
+ putc(ch, out);
+ need_newline = (ch != '\n');
+ }
+ }
+ if (escaped)
+ putc('\\', out);
+ if (need_newline)
+ putc('\n', out);
+
+ /* close the pipe, causing an EOF condition. fclose causes
+ * stdin_pipe[WRITE_PIPE] to be closed, too.
+ */
+ fclose(out);
+
+ Debug(DPROC, ("[%d] child2 done sending to grandchild\n", getpid()))
+ exit(0);
+ }
+
+ /* close the pipe to the grandkiddie's stdin, since its wicked uncle
+ * ernie back there has it open and will close it when he's done.
+ */
+ close(stdin_pipe[WRITE_PIPE]);
+
+ children++;
+
+ /*
+ * read output from the grandchild. it's stderr has been redirected to
+ * it's stdout, which has been redirected to our pipe. if there is any
+ * output, we'll be mailing it to the user whose crontab this is...
+ * when the grandchild exits, we'll get EOF.
+ */
+
+ Debug(DPROC, ("[%d] child reading output from grandchild\n", getpid()))
+
+ /*local*/{
+ register FILE *in = fdopen(stdout_pipe[READ_PIPE], "r");
+ register int ch = getc(in);
+
+ if (ch != EOF) {
+ register FILE *mail;
+ register int bytes = 1;
+ int status = 0;
+
+ Debug(DPROC|DEXT,
+ ("[%d] got data (%x:%c) from grandchild\n",
+ getpid(), ch, ch))
+
+ /* get name of recipient. this is MAILTO if set to a
+ * valid local username; USER otherwise.
+ */
+ if (mailto) {
+ /* MAILTO was present in the environment
+ */
+ if (!*mailto) {
+ /* ... but it's empty. set to NULL
+ */
+ mailto = NULL;
+ }
+ } else {
+ /* MAILTO not present, set to USER.
+ */
+ mailto = usernm;
+ }
+
+ /* if we are supposed to be mailing, MAILTO will
+ * be non-NULL. only in this case should we set
+ * up the mail command and subjects and stuff...
+ */
+
+ if (mailto) {
+ register char **env;
+ auto char mailcmd[MAX_COMMAND];
+ auto char hostname[MAXHOSTNAMELEN];
+
+ (void) gethostname(hostname, MAXHOSTNAMELEN);
+ (void) sprintf(mailcmd, MAILARGS,
+ MAILCMD, mailto);
+ if (!(mail = cron_popen(mailcmd, "w"))) {
+ perror(MAILCMD);
+ (void) _exit(ERROR_EXIT);
+ }
+ fprintf(mail, "From: root (Cron Daemon)\n");
+ fprintf(mail, "To: %s\n", mailto);
+ fprintf(mail, "Subject: Cron <%s@%s> %s\n",
+ usernm, first_word(hostname, "."),
+ e->cmd);
+# if defined(MAIL_DATE)
+ fprintf(mail, "Date: %s\n",
+ arpadate(&TargetTime));
+# endif /* MAIL_DATE */
+ for (env = e->envp; *env; env++)
+ fprintf(mail, "X-Cron-Env: <%s>\n",
+ *env);
+ fprintf(mail, "\n");
+
+ /* this was the first char from the pipe
+ */
+ putc(ch, mail);
+ }
+
+ /* we have to read the input pipe no matter whether
+ * we mail or not, but obviously we only write to
+ * mail pipe if we ARE mailing.
+ */
+
+ while (EOF != (ch = getc(in))) {
+ bytes++;
+ if (mailto)
+ putc(ch, mail);
+ }
+
+ /* only close pipe if we opened it -- i.e., we're
+ * mailing...
+ */
+
+ if (mailto) {
+ Debug(DPROC, ("[%d] closing pipe to mail\n",
+ getpid()))
+ /* Note: the pclose will probably see
+ * the termination of the grandchild
+ * in addition to the mail process, since
+ * it (the grandchild) is likely to exit
+ * after closing its stdout.
+ */
+ status = cron_pclose(mail);
+ }
+
+ /* if there was output and we could not mail it,
+ * log the facts so the poor user can figure out
+ * what's going on.
+ */
+ if (mailto && status) {
+ char buf[MAX_TEMPSTR];
+
+ sprintf(buf,
+ "mailed %d byte%s of output but got status 0x%04x\n",
+ bytes, (bytes==1)?"":"s",
+ status);
+ log_it(usernm, getpid(), "MAIL", buf);
+ }
+
+ } /*if data from grandchild*/
+
+ Debug(DPROC, ("[%d] got EOF from grandchild\n", getpid()))
+
+ fclose(in); /* also closes stdout_pipe[READ_PIPE] */
+ }
+
+ /* wait for children to die.
+ */
+ for (; children > 0; children--)
+ {
+ WAIT_T waiter;
+ PID_T pid;
+
+ Debug(DPROC, ("[%d] waiting for grandchild #%d to finish\n",
+ getpid(), children))
+ pid = wait(&waiter);
+ if (pid < OK) {
+ Debug(DPROC, ("[%d] no more grandchildren--mail written?\n",
+ getpid()))
+ break;
+ }
+ Debug(DPROC, ("[%d] grandchild #%d finished, status=%04x",
+ getpid(), pid, WEXITSTATUS(waiter)))
+ if (WIFSIGNALED(waiter) && WCOREDUMP(waiter))
+ Debug(DPROC, (", dumped core"))
+ Debug(DPROC, ("\n"))
+ }
+}
+
+
+static void
+do_univ(u)
+ user *u;
+{
+#if defined(sequent)
+/* Dynix (Sequent) hack to put the user associated with
+ * the passed user structure into the ATT universe if
+ * necessary. We have to dig the gecos info out of
+ * the user's password entry to see if the magic
+ * "universe(att)" string is present.
+ */
+
+ struct passwd *p;
+ char *s;
+ int i;
+
+ p = getpwuid(u->uid);
+ (void) endpwent();
+
+ if (p == NULL)
+ return;
+
+ s = p->pw_gecos;
+
+ for (i = 0; i < 4; i++)
+ {
+ if ((s = strchr(s, ',')) == NULL)
+ return;
+ s++;
+ }
+ if (strcmp(s, "universe(att)"))
+ return;
+
+ (void) universe(U_ATT);
+#endif
+}
diff --git a/usr.sbin/cron/entry.c b/usr.sbin/cron/entry.c
new file mode 100644
index 000000000000..cdccd0defe44
--- /dev/null
+++ b/usr.sbin/cron/entry.c
@@ -0,0 +1,508 @@
+/* Copyright 1988,1990,1993,1994 by Paul Vixie
+ * All rights reserved
+ *
+ * Distribute freely, except: don't remove my name from the source or
+ * documentation (don't take credit for my work), mark your changes (don't
+ * get me blamed for your possible bugs), don't alter or remove this
+ * notice. May be sold if buildable source is provided to buyer. No
+ * warrantee of any kind, express or implied, is included with this
+ * software; use at your own risk, responsibility for damages (if any) to
+ * anyone resulting from the use of this software rests entirely with the
+ * user.
+ *
+ * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
+ * I'll try to keep a version up to date. I can be reached as follows:
+ * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
+ * From Id: entry.c,v 2.12 1994/01/17 03:20:37 vixie Exp
+ */
+
+#if !defined(lint) && !defined(LINT)
+static char rcsid[] = "$Header: /home/cvs/386BSD/src/usr.sbin/cron/entry.c,v 1.1 1994/01/22 20:39:02 guido Exp $";
+#endif
+
+/* vix 26jan87 [RCS'd; rest of log is in RCS file]
+ * vix 01jan87 [added line-level error recovery]
+ * vix 31dec86 [added /step to the from-to range, per bob@acornrc]
+ * vix 30dec86 [written]
+ */
+
+
+#include "cron.h"
+
+
+typedef enum ecode {
+ e_none, e_minute, e_hour, e_dom, e_month, e_dow,
+ e_cmd, e_timespec, e_username
+} ecode_e;
+
+static char get_list __P((bitstr_t *, int, int, char *[], int, FILE *)),
+ get_range __P((bitstr_t *, int, int, char *[], int, FILE *)),
+ get_number __P((int *, int, char *[], int, FILE *));
+static int set_element __P((bitstr_t *, int, int, int));
+
+static char *ecodes[] =
+ {
+ "no error",
+ "bad minute",
+ "bad hour",
+ "bad day-of-month",
+ "bad month",
+ "bad day-of-week",
+ "bad command",
+ "bad time specifier",
+ "bad username",
+ };
+
+
+void
+free_entry(e)
+ entry *e;
+{
+ free(e->cmd);
+ env_free(e->envp);
+ free(e);
+}
+
+
+/* return NULL if eof or syntax error occurs;
+ * otherwise return a pointer to a new entry.
+ */
+entry *
+load_entry(file, error_func, pw, envp)
+ FILE *file;
+ void (*error_func)();
+ struct passwd *pw;
+ char **envp;
+{
+ /* this function reads one crontab entry -- the next -- from a file.
+ * it skips any leading blank lines, ignores comments, and returns
+ * EOF if for any reason the entry can't be read and parsed.
+ *
+ * the entry is also parsed here.
+ *
+ * syntax:
+ * user crontab:
+ * minutes hours doms months dows cmd\n
+ * system crontab (/etc/crontab):
+ * minutes hours doms months dows USERNAME cmd\n
+ */
+
+ ecode_e ecode = e_none;
+ entry *e;
+ int ch;
+ char cmd[MAX_COMMAND];
+ char envstr[MAX_ENVSTR];
+
+ Debug(DPARS, ("load_entry()...about to eat comments\n"))
+
+ skip_comments(file);
+
+ ch = get_char(file);
+ if (ch == EOF)
+ return NULL;
+
+ /* ch is now the first useful character of a useful line.
+ * it may be an @special or it may be the first character
+ * of a list of minutes.
+ */
+
+ e = (entry *) calloc(sizeof(entry), sizeof(char));
+
+ if (ch == '@') {
+ /* all of these should be flagged and load-limited; i.e.,
+ * instead of @hourly meaning "0 * * * *" it should mean
+ * "close to the front of every hour but not 'til the
+ * system load is low". Problems are: how do you know
+ * what "low" means? (save me from /etc/cron.conf!) and:
+ * how to guarantee low variance (how low is low?), which
+ * means how to we run roughly every hour -- seems like
+ * we need to keep a history or let the first hour set
+ * the schedule, which means we aren't load-limited
+ * anymore. too much for my overloaded brain. (vix, jan90)
+ * HINT
+ */
+ ch = get_string(cmd, MAX_COMMAND, file, " \t\n");
+ if (!strcmp("reboot", cmd)) {
+ e->flags |= WHEN_REBOOT;
+ } else if (!strcmp("yearly", cmd) || !strcmp("annually", cmd)){
+ bit_set(e->minute, 0);
+ bit_set(e->hour, 0);
+ bit_set(e->dom, 0);
+ bit_set(e->month, 0);
+ bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1));
+ } else if (!strcmp("monthly", cmd)) {
+ bit_set(e->minute, 0);
+ bit_set(e->hour, 0);
+ bit_set(e->dom, 0);
+ bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1));
+ bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1));
+ } else if (!strcmp("weekly", cmd)) {
+ bit_set(e->minute, 0);
+ bit_set(e->hour, 0);
+ bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1));
+ bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1));
+ bit_set(e->dow, 0);
+ } else if (!strcmp("daily", cmd) || !strcmp("midnight", cmd)) {
+ bit_set(e->minute, 0);
+ bit_set(e->hour, 0);
+ bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1));
+ bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1));
+ bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1));
+ } else if (!strcmp("hourly", cmd)) {
+ bit_set(e->minute, 0);
+ bit_set(e->hour, (LAST_HOUR-FIRST_HOUR+1));
+ bit_nset(e->dom, 0, (LAST_DOM-FIRST_DOM+1));
+ bit_nset(e->month, 0, (LAST_MONTH-FIRST_MONTH+1));
+ bit_nset(e->dow, 0, (LAST_DOW-FIRST_DOW+1));
+ } else {
+ ecode = e_timespec;
+ goto eof;
+ }
+ } else {
+ Debug(DPARS, ("load_entry()...about to parse numerics\n"))
+
+ ch = get_list(e->minute, FIRST_MINUTE, LAST_MINUTE,
+ PPC_NULL, ch, file);
+ if (ch == EOF) {
+ ecode = e_minute;
+ goto eof;
+ }
+
+ /* hours
+ */
+
+ ch = get_list(e->hour, FIRST_HOUR, LAST_HOUR,
+ PPC_NULL, ch, file);
+ if (ch == EOF) {
+ ecode = e_hour;
+ goto eof;
+ }
+
+ /* DOM (days of month)
+ */
+
+ if (ch == '*')
+ e->flags |= DOM_STAR;
+ ch = get_list(e->dom, FIRST_DOM, LAST_DOM,
+ PPC_NULL, ch, file);
+ if (ch == EOF) {
+ ecode = e_dom;
+ goto eof;
+ }
+
+ /* month
+ */
+
+ ch = get_list(e->month, FIRST_MONTH, LAST_MONTH,
+ MonthNames, ch, file);
+ if (ch == EOF) {
+ ecode = e_month;
+ goto eof;
+ }
+
+ /* DOW (days of week)
+ */
+
+ if (ch == '*')
+ e->flags |= DOW_STAR;
+ ch = get_list(e->dow, FIRST_DOW, LAST_DOW,
+ DowNames, ch, file);
+ if (ch == EOF) {
+ ecode = e_dow;
+ goto eof;
+ }
+ }
+
+ /* make sundays equivilent */
+ if (bit_test(e->dow, 0) || bit_test(e->dow, 7)) {
+ bit_set(e->dow, 0);
+ bit_set(e->dow, 7);
+ }
+
+ /* ch is the first character of a command, or a username */
+ unget_char(ch, file);
+
+ if (!pw) {
+ char *username = cmd; /* temp buffer */
+
+ Debug(DPARS, ("load_entry()...about to parse username\n"))
+ ch = get_string(username, MAX_COMMAND, file, " \t");
+
+ Debug(DPARS, ("load_entry()...got %s\n",username))
+ if (ch == EOF) {
+ ecode = e_cmd;
+ goto eof;
+ }
+
+ pw = getpwnam(username);
+ if (pw == NULL) {
+ ecode = e_username;
+ goto eof;
+ }
+ Debug(DPARS, ("load_entry()...uid %d, gid %d\n",e->uid,e->gid))
+ }
+
+ e->uid = pw->pw_uid;
+ e->gid = pw->pw_gid;
+
+ /* copy and fix up environment. some variables are just defaults and
+ * others are overrides.
+ */
+ e->envp = env_copy(envp);
+ if (!env_get("SHELL", e->envp)) {
+ sprintf(envstr, "SHELL=%s", _PATH_BSHELL);
+ e->envp = env_set(e->envp, envstr);
+ }
+ if (!env_get("HOME", e->envp)) {
+ sprintf(envstr, "HOME=%s", pw->pw_dir);
+ e->envp = env_set(e->envp, envstr);
+ }
+ if (!env_get("PATH", e->envp)) {
+ sprintf(envstr, "PATH=%s", _PATH_DEFPATH);
+ e->envp = env_set(e->envp, envstr);
+ }
+ sprintf(envstr, "%s=%s", "LOGNAME", pw->pw_name);
+ e->envp = env_set(e->envp, envstr);
+#if defined(BSD)
+ sprintf(envstr, "%s=%s", "USER", pw->pw_name);
+ e->envp = env_set(e->envp, envstr);
+#endif
+
+ Debug(DPARS, ("load_entry()...about to parse command\n"))
+
+ /* Everything up to the next \n or EOF is part of the command...
+ * too bad we don't know in advance how long it will be, since we
+ * need to malloc a string for it... so, we limit it to MAX_COMMAND.
+ * XXX - should use realloc().
+ */
+ ch = get_string(cmd, MAX_COMMAND, file, "\n");
+
+ /* a file without a \n before the EOF is rude, so we'll complain...
+ */
+ if (ch == EOF) {
+ ecode = e_cmd;
+ goto eof;
+ }
+
+ /* got the command in the 'cmd' string; save it in *e.
+ */
+ e->cmd = strdup(cmd);
+
+ Debug(DPARS, ("load_entry()...returning successfully\n"))
+
+ /* success, fini, return pointer to the entry we just created...
+ */
+ return e;
+
+ eof:
+ free(e);
+ if (ecode != e_none && error_func)
+ (*error_func)(ecodes[(int)ecode]);
+ while (ch != EOF && ch != '\n')
+ ch = get_char(file);
+ return NULL;
+}
+
+
+static char
+get_list(bits, low, high, names, ch, file)
+ bitstr_t *bits; /* one bit per flag, default=FALSE */
+ int low, high; /* bounds, impl. offset for bitstr */
+ char *names[]; /* NULL or *[] of names for these elements */
+ int ch; /* current character being processed */
+ FILE *file; /* file being read */
+{
+ register int done;
+
+ /* we know that we point to a non-blank character here;
+ * must do a Skip_Blanks before we exit, so that the
+ * next call (or the code that picks up the cmd) can
+ * assume the same thing.
+ */
+
+ Debug(DPARS|DEXT, ("get_list()...entered\n"))
+
+ /* list = range {"," range}
+ */
+
+ /* clear the bit string, since the default is 'off'.
+ */
+ bit_nclear(bits, 0, (high-low+1));
+
+ /* process all ranges
+ */
+ done = FALSE;
+ while (!done) {
+ ch = get_range(bits, low, high, names, ch, file);
+ if (ch == ',')
+ ch = get_char(file);
+ else
+ done = TRUE;
+ }
+
+ /* exiting. skip to some blanks, then skip over the blanks.
+ */
+ Skip_Nonblanks(ch, file)
+ Skip_Blanks(ch, file)
+
+ Debug(DPARS|DEXT, ("get_list()...exiting w/ %02x\n", ch))
+
+ return ch;
+}
+
+
+static char
+get_range(bits, low, high, names, ch, file)
+ bitstr_t *bits; /* one bit per flag, default=FALSE */
+ int low, high; /* bounds, impl. offset for bitstr */
+ char *names[]; /* NULL or names of elements */
+ int ch; /* current character being processed */
+ FILE *file; /* file being read */
+{
+ /* range = number | number "-" number [ "/" number ]
+ */
+
+ register int i;
+ auto int num1, num2, num3;
+
+ Debug(DPARS|DEXT, ("get_range()...entering, exit won't show\n"))
+
+ if (ch == '*') {
+ /* '*' means "first-last" but can still be modified by /step
+ */
+ num1 = low;
+ num2 = high;
+ ch = get_char(file);
+ if (ch == EOF)
+ return EOF;
+ } else {
+ if (EOF == (ch = get_number(&num1, low, names, ch, file)))
+ return EOF;
+
+ if (ch != '-') {
+ /* not a range, it's a single number.
+ */
+ if (EOF == set_element(bits, low, high, num1))
+ return EOF;
+ return ch;
+ } else {
+ /* eat the dash
+ */
+ ch = get_char(file);
+ if (ch == EOF)
+ return EOF;
+
+ /* get the number following the dash
+ */
+ ch = get_number(&num2, low, names, ch, file);
+ if (ch == EOF)
+ return EOF;
+ }
+ }
+
+ /* check for step size
+ */
+ if (ch == '/') {
+ /* eat the slash
+ */
+ ch = get_char(file);
+ if (ch == EOF)
+ return EOF;
+
+ /* get the step size -- note: we don't pass the
+ * names here, because the number is not an
+ * element id, it's a step size. 'low' is
+ * sent as a 0 since there is no offset either.
+ */
+ ch = get_number(&num3, 0, PPC_NULL, ch, file);
+ if (ch == EOF)
+ return EOF;
+ } else {
+ /* no step. default==1.
+ */
+ num3 = 1;
+ }
+
+ /* range. set all elements from num1 to num2, stepping
+ * by num3. (the step is a downward-compatible extension
+ * proposed conceptually by bob@acornrc, syntactically
+ * designed then implmented by paul vixie).
+ */
+ for (i = num1; i <= num2; i += num3)
+ if (EOF == set_element(bits, low, high, i))
+ return EOF;
+
+ return ch;
+}
+
+
+static char
+get_number(numptr, low, names, ch, file)
+ int *numptr; /* where does the result go? */
+ int low; /* offset applied to result if symbolic enum used */
+ char *names[]; /* symbolic names, if any, for enums */
+ int ch; /* current character */
+ FILE *file; /* source */
+{
+ char temp[MAX_TEMPSTR], *pc;
+ int len, i, all_digits;
+
+ /* collect alphanumerics into our fixed-size temp array
+ */
+ pc = temp;
+ len = 0;
+ all_digits = TRUE;
+ while (isalnum(ch)) {
+ if (++len >= MAX_TEMPSTR)
+ return EOF;
+
+ *pc++ = ch;
+
+ if (!isdigit(ch))
+ all_digits = FALSE;
+
+ ch = get_char(file);
+ }
+ *pc = '\0';
+
+ /* try to find the name in the name list
+ */
+ if (names) {
+ for (i = 0; names[i] != NULL; i++) {
+ Debug(DPARS|DEXT,
+ ("get_num, compare(%s,%s)\n", names[i], temp))
+ if (!strcasecmp(names[i], temp)) {
+ *numptr = i+low;
+ return ch;
+ }
+ }
+ }
+
+ /* no name list specified, or there is one and our string isn't
+ * in it. either way: if it's all digits, use its magnitude.
+ * otherwise, it's an error.
+ */
+ if (all_digits) {
+ *numptr = atoi(temp);
+ return ch;
+ }
+
+ return EOF;
+}
+
+
+static int
+set_element(bits, low, high, number)
+ bitstr_t *bits; /* one bit per flag, default=FALSE */
+ int low;
+ int high;
+ int number;
+{
+ Debug(DPARS|DEXT, ("set_element(?,%d,%d,%d)\n", low, high, number))
+
+ if (number < low || number > high)
+ return EOF;
+
+ bit_set(bits, (number-low));
+ return OK;
+}
diff --git a/usr.sbin/cron/env.c b/usr.sbin/cron/env.c
new file mode 100644
index 000000000000..08dd87407b14
--- /dev/null
+++ b/usr.sbin/cron/env.c
@@ -0,0 +1,180 @@
+/* Copyright 1988,1990,1993,1994 by Paul Vixie
+ * All rights reserved
+ *
+ * Distribute freely, except: don't remove my name from the source or
+ * documentation (don't take credit for my work), mark your changes (don't
+ * get me blamed for your possible bugs), don't alter or remove this
+ * notice. May be sold if buildable source is provided to buyer. No
+ * warrantee of any kind, express or implied, is included with this
+ * software; use at your own risk, responsibility for damages (if any) to
+ * anyone resulting from the use of this software rests entirely with the
+ * user.
+ *
+ * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
+ * I'll try to keep a version up to date. I can be reached as follows:
+ * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
+ * From Id: env.c,v 2.6 1994/01/15 20:43:43 vixie Exp
+ */
+
+#if !defined(lint) && !defined(LINT)
+static char netid[] = "From Id: env.c,v 2.7 1994/01/26 02:25:50 vixie Exp vixie $";
+static char rcsid[] = "$Id: env.c,v 1.2 1994/01/27 19:18:58 nate Exp $";
+#endif
+
+
+#include "cron.h"
+
+
+char **
+env_init()
+{
+ register char **p = (char **) malloc(sizeof(char **));
+
+ p[0] = NULL;
+ return (p);
+}
+
+
+void
+env_free(envp)
+ char **envp;
+{
+ char **p;
+
+ for (p = envp; *p; p++)
+ free(*p);
+ free(envp);
+}
+
+
+char **
+env_copy(envp)
+ register char **envp;
+{
+ register int count, i;
+ register char **p;
+
+ for (count = 0; envp[count] != NULL; count++)
+ ;
+ p = (char **) malloc((count+1) * sizeof(char *)); /* 1 for the NULL */
+ for (i = 0; i < count; i++)
+ p[i] = strdup(envp[i]);
+ p[count] = NULL;
+ return (p);
+}
+
+
+char **
+env_set(envp, envstr)
+ char **envp;
+ char *envstr;
+{
+ register int count, found;
+ register char **p;
+
+ /*
+ * count the number of elements, including the null pointer;
+ * also set 'found' to -1 or index of entry if already in here.
+ */
+ found = -1;
+ for (count = 0; envp[count] != NULL; count++) {
+ if (!strcmp_until(envp[count], envstr, '='))
+ found = count;
+ }
+ count++; /* for the NULL */
+
+ if (found != -1) {
+ /*
+ * it exists already, so just free the existing setting,
+ * save our new one there, and return the existing array.
+ */
+ free(envp[found]);
+ envp[found] = strdup(envstr);
+ return (envp);
+ }
+
+ /*
+ * it doesn't exist yet, so resize the array, move null pointer over
+ * one, save our string over the old null pointer, and return resized
+ * array.
+ */
+ p = (char **) realloc((void *) envp,
+ (unsigned) ((count+1) * sizeof(char **)));
+ p[count] = p[count-1];
+ p[count-1] = strdup(envstr);
+ return (p);
+}
+
+
+/* return ERR = end of file
+ * FALSE = not an env setting (file was repositioned)
+ * TRUE = was an env setting
+ */
+int
+load_env(envstr, f)
+ char *envstr;
+ FILE *f;
+{
+ long filepos;
+ int fileline;
+ char name[MAX_TEMPSTR], val[MAX_ENVSTR];
+ int fields;
+
+ filepos = ftell(f);
+ fileline = LineNumber;
+ skip_comments(f);
+ if (EOF == get_string(envstr, MAX_ENVSTR, f, "\n"))
+ return (ERR);
+
+ Debug(DPARS, ("load_env, read <%s>\n", envstr))
+
+ name[0] = val[0] = '\0';
+ fields = sscanf(envstr, "%[^ =] = %[^\n#]", name, val);
+ if (fields != 2) {
+ Debug(DPARS, ("load_env, not 2 fields (%d)\n", fields))
+ fseek(f, filepos, 0);
+ Set_LineNum(fileline);
+ return (FALSE);
+ }
+
+ /* 2 fields from scanf; looks like an env setting
+ */
+
+ /*
+ * process value string
+ */
+ /*local*/{
+ int len = strdtb(val);
+
+ if (len >= 2) {
+ if (val[0] == '\'' || val[0] == '"') {
+ if (val[len-1] == val[0]) {
+ val[len-1] = '\0';
+ (void) strcpy(val, val+1);
+ }
+ }
+ }
+ }
+
+ (void) sprintf(envstr, "%s=%s", name, val);
+ Debug(DPARS, ("load_env, <%s> <%s> -> <%s>\n", name, val, envstr))
+ return (TRUE);
+}
+
+
+char *
+env_get(name, envp)
+ register char *name;
+ register char **envp;
+{
+ register int len = strlen(name);
+ register char *p, *q;
+
+ while (p = *envp++) {
+ if (!(q = strchr(p, '=')))
+ continue;
+ if ((q - p) == len && !strncmp(p, name, len))
+ return (q+1);
+ }
+ return (NULL);
+}
diff --git a/usr.sbin/cron/externs.h b/usr.sbin/cron/externs.h
new file mode 100644
index 000000000000..3efe605897ec
--- /dev/null
+++ b/usr.sbin/cron/externs.h
@@ -0,0 +1,145 @@
+/* Copyright 1993,1994 by Paul Vixie
+ * All rights reserved
+ *
+ * Distribute freely, except: don't remove my name from the source or
+ * documentation (don't take credit for my work), mark your changes (don't
+ * get me blamed for your possible bugs), don't alter or remove this
+ * notice. May be sold if buildable source is provided to buyer. No
+ * warrantee of any kind, express or implied, is included with this
+ * software; use at your own risk, responsibility for damages (if any) to
+ * anyone resulting from the use of this software rests entirely with the
+ * user.
+ *
+ * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
+ * I'll try to keep a version up to date. I can be reached as follows:
+ * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
+ */
+
+#if defined(POSIX) || defined(ATT)
+# include <stdlib.h>
+# include <unistd.h>
+# include <string.h>
+# include <dirent.h>
+# define DIR_T struct dirent
+# define WAIT_T int
+# define WAIT_IS_INT 1
+extern char *tzname[2];
+# define TZONE(tm) tzname[(tm).tm_isdst]
+#endif
+
+#if defined(UNIXPC)
+# undef WAIT_T
+# undef WAIT_IS_INT
+# define WAIT_T union wait
+#endif
+
+#if defined(POSIX)
+# define SIG_T sig_t
+# define TIME_T time_t
+# define PID_T pid_t
+#endif
+
+#if defined(ATT)
+# define SIG_T void
+# define TIME_T long
+# define PID_T int
+#endif
+
+#if !defined(POSIX) && !defined(ATT)
+/* classic BSD */
+extern time_t time();
+extern unsigned sleep();
+extern struct tm *localtime();
+extern struct passwd *getpwnam();
+extern int errno;
+extern void perror(), exit(), free();
+extern char *getenv(), *strcpy(), *strchr(), *strtok();
+extern void *malloc(), *realloc();
+# define SIG_T void
+# define TIME_T long
+# define PID_T int
+# define WAIT_T union wait
+# define DIR_T struct direct
+# include <sys/dir.h>
+# define TZONE(tm) (tm).tm_zone
+#endif
+
+/* getopt() isn't part of POSIX. some systems define it in <stdlib.h> anyway.
+ * of those that do, some complain that our definition is different and some
+ * do not. to add to the misery and confusion, some systems define getopt()
+ * in ways that we cannot predict or comprehend, yet do not define the adjunct
+ * external variables needed for the interface.
+ */
+#if (!defined(BSD) || (BSD < 198911)) && !defined(ATT) && !defined(UNICOS)
+int getopt __P((int, char * const *, const char *));
+#endif
+
+#if (!defined(BSD) || (BSD < 199103))
+extern char *optarg;
+extern int optind, opterr, optopt;
+#endif
+
+#if WAIT_IS_INT
+# ifndef WEXITSTATUS
+# define WEXITSTATUS(x) (((x) >> 8) & 0xff)
+# endif
+# ifndef WTERMSIG
+# define WTERMSIG(x) ((x) & 0x7f)
+# endif
+# ifndef WCOREDUMP
+# define WCOREDUMP(x) ((x) & 0x80)
+# endif
+#else /*WAIT_IS_INT*/
+# ifndef WEXITSTATUS
+# define WEXITSTATUS(x) ((x).w_retcode)
+# endif
+# ifndef WTERMSIG
+# define WTERMSIG(x) ((x).w_termsig)
+# endif
+# ifndef WCOREDUMP
+# define WCOREDUMP(x) ((x).w_coredump)
+# endif
+#endif /*WAIT_IS_INT*/
+
+#ifndef WIFSIGNALED
+#define WIFSIGNALED(x) (WTERMSIG(x) != 0)
+#endif
+#ifndef WIFEXITED
+#define WIFEXITED(x) (WTERMSIG(x) == 0)
+#endif
+
+#ifdef NEED_STRCASECMP
+extern int strcasecmp __P((char *, char *));
+#endif
+
+#ifdef NEED_STRDUP
+extern char *strdup __P((char *));
+#endif
+
+#ifdef NEED_STRERROR
+extern char *strerror __P((int));
+#endif
+
+#ifdef NEED_FLOCK
+extern int flock __P((int, int));
+# define LOCK_SH 1
+# define LOCK_EX 2
+# define LOCK_NB 4
+# define LOCK_UN 8
+#endif
+
+#ifdef NEED_SETSID
+extern int setsid __P((void));
+#endif
+
+#ifdef NEED_GETDTABLESIZE
+extern int getdtablesize __P((void));
+#endif
+
+#ifdef NEED_SETENV
+extern int setenv __P((char *, char *, int));
+#endif
+
+#ifdef NEED_VFORK
+extern PID_T vfork __P((void));
+#endif
diff --git a/usr.sbin/cron/job.c b/usr.sbin/cron/job.c
new file mode 100644
index 000000000000..80a2b57f21e5
--- /dev/null
+++ b/usr.sbin/cron/job.c
@@ -0,0 +1,75 @@
+/* Copyright 1988,1990,1993,1994 by Paul Vixie
+ * All rights reserved
+ *
+ * Distribute freely, except: don't remove my name from the source or
+ * documentation (don't take credit for my work), mark your changes (don't
+ * get me blamed for your possible bugs), don't alter or remove this
+ * notice. May be sold if buildable source is provided to buyer. No
+ * warrantee of any kind, express or implied, is included with this
+ * software; use at your own risk, responsibility for damages (if any) to
+ * anyone resulting from the use of this software rests entirely with the
+ * user.
+ *
+ * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
+ * I'll try to keep a version up to date. I can be reached as follows:
+ * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
+ * From Id: job.c,v 1.6 1994/01/15 20:43:43 vixie Exp
+ */
+
+#if !defined(lint) && !defined(LINT)
+static char rcsid[] = "$Header: /home/cvs/386BSD/src/usr.sbin/cron/job.c,v 1.1 1994/01/22 20:39:05 guido Exp $";
+#endif
+
+
+#include "cron.h"
+
+
+typedef struct _job {
+ struct _job *next;
+ entry *e;
+ user *u;
+} job;
+
+
+static job *jhead = NULL, *jtail = NULL;
+
+
+void
+job_add(e, u)
+ register entry *e;
+ register user *u;
+{
+ register job *j;
+
+ /* if already on queue, keep going */
+ for (j=jhead; j; j=j->next)
+ if (j->e == e && j->u == u) { return; }
+
+ /* build a job queue element */
+ j = (job*)malloc(sizeof(job));
+ j->next = (job*) NULL;
+ j->e = e;
+ j->u = u;
+
+ /* add it to the tail */
+ if (!jhead) { jhead=j; }
+ else { jtail->next=j; }
+ jtail = j;
+}
+
+
+int
+job_runqueue()
+{
+ register job *j, *jn;
+ register int run = 0;
+
+ for (j=jhead; j; j=jn) {
+ do_command(j->e, j->u);
+ jn = j->next;
+ free(j);
+ run++;
+ }
+ jhead = jtail = NULL;
+ return run;
+}
diff --git a/usr.sbin/cron/misc.c b/usr.sbin/cron/misc.c
new file mode 100644
index 000000000000..6f9398e43f91
--- /dev/null
+++ b/usr.sbin/cron/misc.c
@@ -0,0 +1,665 @@
+/* Copyright 1988,1990,1993,1994 by Paul Vixie
+ * All rights reserved
+ *
+ * Distribute freely, except: don't remove my name from the source or
+ * documentation (don't take credit for my work), mark your changes (don't
+ * get me blamed for your possible bugs), don't alter or remove this
+ * notice. May be sold if buildable source is provided to buyer. No
+ * warrantee of any kind, express or implied, is included with this
+ * software; use at your own risk, responsibility for damages (if any) to
+ * anyone resulting from the use of this software rests entirely with the
+ * user.
+ *
+ * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
+ * I'll try to keep a version up to date. I can be reached as follows:
+ * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
+ * From Id: misc.c,v 2.9 1994/01/15 20:43:43 vixie Exp
+ */
+
+#if !defined(lint) && !defined(LINT)
+static char rcsid[] = "$Header: /home/cvs/386BSD/src/usr.sbin/cron/misc.c,v 1.1 1994/01/22 20:39:06 guido Exp $";
+#endif
+
+/* vix 26jan87 [RCS has the rest of the log]
+ * vix 30dec86 [written]
+ */
+
+
+#include "cron.h"
+#if SYS_TIME_H
+# include <sys/time.h>
+#else
+# include <time.h>
+#endif
+#include <sys/file.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <string.h>
+#include <fcntl.h>
+#if defined(SYSLOG)
+# include <syslog.h>
+#endif
+
+
+#if defined(LOG_DAEMON) && !defined(LOG_CRON)
+#define LOG_CRON LOG_DAEMON
+#endif
+
+
+static int LogFD = ERR;
+
+
+int
+strcmp_until(left, right, until)
+ char *left;
+ char *right;
+ int until;
+{
+ register int diff;
+
+ while (*left && *left != until && *left == *right) {
+ left++;
+ right++;
+ }
+
+ if ((*left=='\0' || *left == until) &&
+ (*right=='\0' || *right == until)) {
+ diff = 0;
+ } else {
+ diff = *left - *right;
+ }
+
+ return diff;
+}
+
+
+/* strdtb(s) - delete trailing blanks in string 's' and return new length
+ */
+int
+strdtb(s)
+ char *s;
+{
+ char *x = s;
+
+ /* scan forward to the null
+ */
+ while (*x)
+ x++;
+
+ /* scan backward to either the first character before the string,
+ * or the last non-blank in the string, whichever comes first.
+ */
+ do {x--;}
+ while (x >= s && isspace(*x));
+
+ /* one character beyond where we stopped above is where the null
+ * goes.
+ */
+ *++x = '\0';
+
+ /* the difference between the position of the null character and
+ * the position of the first character of the string is the length.
+ */
+ return x - s;
+}
+
+
+int
+set_debug_flags(flags)
+ char *flags;
+{
+ /* debug flags are of the form flag[,flag ...]
+ *
+ * if an error occurs, print a message to stdout and return FALSE.
+ * otherwise return TRUE after setting ERROR_FLAGS.
+ */
+
+#if !DEBUGGING
+
+ printf("this program was compiled without debugging enabled\n");
+ return FALSE;
+
+#else /* DEBUGGING */
+
+ char *pc = flags;
+
+ DebugFlags = 0;
+
+ while (*pc) {
+ char **test;
+ int mask;
+
+ /* try to find debug flag name in our list.
+ */
+ for ( test = DebugFlagNames, mask = 1;
+ *test && strcmp_until(*test, pc, ',');
+ test++, mask <<= 1
+ )
+ ;
+
+ if (!*test) {
+ fprintf(stderr,
+ "unrecognized debug flag <%s> <%s>\n",
+ flags, pc);
+ return FALSE;
+ }
+
+ DebugFlags |= mask;
+
+ /* skip to the next flag
+ */
+ while (*pc && *pc != ',')
+ pc++;
+ if (*pc == ',')
+ pc++;
+ }
+
+ if (DebugFlags) {
+ int flag;
+
+ fprintf(stderr, "debug flags enabled:");
+
+ for (flag = 0; DebugFlagNames[flag]; flag++)
+ if (DebugFlags & (1 << flag))
+ fprintf(stderr, " %s", DebugFlagNames[flag]);
+ fprintf(stderr, "\n");
+ }
+
+ return TRUE;
+
+#endif /* DEBUGGING */
+}
+
+
+void
+set_cron_uid()
+{
+#if defined(BSD) || defined(POSIX)
+ if (seteuid(ROOT_UID) < OK) {
+ perror("seteuid");
+ exit(ERROR_EXIT);
+ }
+#else
+ if (setuid(ROOT_UID) < OK) {
+ perror("setuid");
+ exit(ERROR_EXIT);
+ }
+#endif
+}
+
+
+void
+set_cron_cwd()
+{
+ struct stat sb;
+
+ /* first check for CRONDIR ("/var/cron" or some such)
+ */
+ if (stat(CRONDIR, &sb) < OK && errno == ENOENT) {
+ perror(CRONDIR);
+ if (OK == mkdir(CRONDIR, 0700)) {
+ fprintf(stderr, "%s: created\n", CRONDIR);
+ stat(CRONDIR, &sb);
+ } else {
+ fprintf(stderr, "%s: ", CRONDIR);
+ perror("mkdir");
+ exit(ERROR_EXIT);
+ }
+ }
+ if (!(sb.st_mode & S_IFDIR)) {
+ fprintf(stderr, "'%s' is not a directory, bailing out.\n",
+ CRONDIR);
+ exit(ERROR_EXIT);
+ }
+ if (chdir(CRONDIR) < OK) {
+ fprintf(stderr, "cannot chdir(%s), bailing out.\n", CRONDIR);
+ perror(CRONDIR);
+ exit(ERROR_EXIT);
+ }
+
+ /* CRONDIR okay (now==CWD), now look at SPOOL_DIR ("tabs" or some such)
+ */
+ if (stat(SPOOL_DIR, &sb) < OK && errno == ENOENT) {
+ perror(SPOOL_DIR);
+ if (OK == mkdir(SPOOL_DIR, 0700)) {
+ fprintf(stderr, "%s: created\n", SPOOL_DIR);
+ stat(SPOOL_DIR, &sb);
+ } else {
+ fprintf(stderr, "%s: ", SPOOL_DIR);
+ perror("mkdir");
+ exit(ERROR_EXIT);
+ }
+ }
+ if (!(sb.st_mode & S_IFDIR)) {
+ fprintf(stderr, "'%s' is not a directory, bailing out.\n",
+ SPOOL_DIR);
+ exit(ERROR_EXIT);
+ }
+}
+
+
+/* acquire_daemonlock() - write our PID into /etc/cron.pid, unless
+ * another daemon is already running, which we detect here.
+ *
+ * note: main() calls us twice; once before forking, once after.
+ * we maintain static storage of the file pointer so that we
+ * can rewrite our PID into the PIDFILE after the fork.
+ *
+ * it would be great if fflush() disassociated the file buffer.
+ */
+void
+acquire_daemonlock(closeflag)
+ int closeflag;
+{
+ static FILE *fp = NULL;
+
+ if (closeflag && fp) {
+ fclose(fp);
+ fp = NULL;
+ return;
+ }
+
+ if (!fp) {
+ char pidfile[MAX_FNAME];
+ char buf[MAX_TEMPSTR];
+ int fd, otherpid;
+
+ (void) sprintf(pidfile, PIDFILE, PIDDIR);
+ if ((-1 == (fd = open(pidfile, O_RDWR|O_CREAT, 0644)))
+ || (NULL == (fp = fdopen(fd, "r+")))
+ ) {
+ sprintf(buf, "can't open or create %s: %s",
+ pidfile, strerror(errno));
+ fprintf(stderr, "%s: %s\n", ProgramName, buf);
+ log_it("CRON", getpid(), "DEATH", buf);
+ exit(ERROR_EXIT);
+ }
+
+ if (flock(fd, LOCK_EX|LOCK_NB) < OK) {
+ int save_errno = errno;
+
+ fscanf(fp, "%d", &otherpid);
+ sprintf(buf, "can't lock %s, otherpid may be %d: %s",
+ pidfile, otherpid, strerror(save_errno));
+ fprintf(stderr, "%s: %s\n", ProgramName, buf);
+ log_it("CRON", getpid(), "DEATH", buf);
+ exit(ERROR_EXIT);
+ }
+
+ (void) fcntl(fd, F_SETFD, 1);
+ }
+
+ rewind(fp);
+ fprintf(fp, "%d\n", getpid());
+ fflush(fp);
+ (void) ftruncate(fileno(fp), ftell(fp));
+
+ /* abandon fd and fp even though the file is open. we need to
+ * keep it open and locked, but we don't need the handles elsewhere.
+ */
+}
+
+/* get_char(file) : like getc() but increment LineNumber on newlines
+ */
+int
+get_char(file)
+ FILE *file;
+{
+ int ch;
+
+ ch = getc(file);
+ if (ch == '\n')
+ Set_LineNum(LineNumber + 1)
+ return ch;
+}
+
+
+/* unget_char(ch, file) : like ungetc but do LineNumber processing
+ */
+void
+unget_char(ch, file)
+ int ch;
+ FILE *file;
+{
+ ungetc(ch, file);
+ if (ch == '\n')
+ Set_LineNum(LineNumber - 1)
+}
+
+
+/* get_string(str, max, file, termstr) : like fgets() but
+ * (1) has terminator string which should include \n
+ * (2) will always leave room for the null
+ * (3) uses get_char() so LineNumber will be accurate
+ * (4) returns EOF or terminating character, whichever
+ */
+int
+get_string(string, size, file, terms)
+ char *string;
+ int size;
+ FILE *file;
+ char *terms;
+{
+ int ch;
+
+ while (EOF != (ch = get_char(file)) && !strchr(terms, ch)) {
+ if (size > 1) {
+ *string++ = (char) ch;
+ size--;
+ }
+ }
+
+ if (size > 0)
+ *string = '\0';
+
+ return ch;
+}
+
+
+/* skip_comments(file) : read past comment (if any)
+ */
+void
+skip_comments(file)
+ FILE *file;
+{
+ int ch;
+
+ while (EOF != (ch = get_char(file))) {
+ /* ch is now the first character of a line.
+ */
+
+ while (ch == ' ' || ch == '\t')
+ ch = get_char(file);
+
+ if (ch == EOF)
+ break;
+
+ /* ch is now the first non-blank character of a line.
+ */
+
+ if (ch != '\n' && ch != '#')
+ break;
+
+ /* ch must be a newline or comment as first non-blank
+ * character on a line.
+ */
+
+ while (ch != '\n' && ch != EOF)
+ ch = get_char(file);
+
+ /* ch is now the newline of a line which we're going to
+ * ignore.
+ */
+ }
+ if (ch != EOF)
+ unget_char(ch, file);
+}
+
+
+/* int in_file(char *string, FILE *file)
+ * return TRUE if one of the lines in file matches string exactly,
+ * FALSE otherwise.
+ */
+static int
+in_file(string, file)
+ char *string;
+ FILE *file;
+{
+ char line[MAX_TEMPSTR];
+
+ rewind(file);
+ while (fgets(line, MAX_TEMPSTR, file)) {
+ if (line[0] != '\0')
+ line[strlen(line)-1] = '\0';
+ if (0 == strcmp(line, string))
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+/* int allowed(char *username)
+ * returns TRUE if (ALLOW_FILE exists and user is listed)
+ * or (DENY_FILE exists and user is NOT listed)
+ * or (neither file exists but user=="root" so it's okay)
+ */
+int
+allowed(username)
+ char *username;
+{
+ static int init = FALSE;
+ static FILE *allow, *deny;
+
+ if (!init) {
+ init = TRUE;
+#if defined(ALLOW_FILE) && defined(DENY_FILE)
+ allow = fopen(ALLOW_FILE, "r");
+ deny = fopen(DENY_FILE, "r");
+ Debug(DMISC, ("allow/deny enabled, %d/%d\n", !!allow, !!deny))
+#else
+ allow = NULL;
+ deny = NULL;
+#endif
+ }
+
+ if (allow)
+ return (in_file(username, allow));
+ if (deny)
+ return (!in_file(username, deny));
+
+#if defined(ALLOW_ONLY_ROOT)
+ return (strcmp(username, ROOT_USER) == 0);
+#else
+ return TRUE;
+#endif
+}
+
+
+void
+log_it(username, xpid, event, detail)
+ char *username;
+ int xpid;
+ char *event;
+ char *detail;
+{
+ PID_T pid = xpid;
+#if defined(LOG_FILE)
+ char *msg;
+ TIME_T now = time((TIME_T) 0);
+ register struct tm *t = localtime(&now);
+#endif /*LOG_FILE*/
+
+#if defined(SYSLOG)
+ static int syslog_open = 0;
+#endif
+
+#if defined(LOG_FILE)
+ /* we assume that MAX_TEMPSTR will hold the date, time, &punctuation.
+ */
+ msg = malloc(strlen(username)
+ + strlen(event)
+ + strlen(detail)
+ + MAX_TEMPSTR);
+
+ if (LogFD < OK) {
+ LogFD = open(LOG_FILE, O_WRONLY|O_APPEND|O_CREAT, 0600);
+ if (LogFD < OK) {
+ fprintf(stderr, "%s: can't open log file\n",
+ ProgramName);
+ perror(LOG_FILE);
+ } else {
+ (void) fcntl(LogFD, F_SETFD, 1);
+ }
+ }
+
+ /* we have to sprintf() it because fprintf() doesn't always write
+ * everything out in one chunk and this has to be atomically appended
+ * to the log file.
+ */
+ sprintf(msg, "%s (%02d/%02d-%02d:%02d:%02d-%d) %s (%s)\n",
+ username,
+ t->tm_mon+1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec, pid,
+ event, detail);
+
+ /* we have to run strlen() because sprintf() returns (char*) on old BSD
+ */
+ if (LogFD < OK || write(LogFD, msg, strlen(msg)) < OK) {
+ if (LogFD >= OK)
+ perror(LOG_FILE);
+ fprintf(stderr, "%s: can't write to log file\n", ProgramName);
+ write(STDERR, msg, strlen(msg));
+ }
+
+ free(msg);
+#endif /*LOG_FILE*/
+
+#if defined(SYSLOG)
+ if (!syslog_open) {
+ /* we don't use LOG_PID since the pid passed to us by
+ * our client may not be our own. therefore we want to
+ * print the pid ourselves.
+ */
+# ifdef LOG_DAEMON
+ openlog(ProgramName, LOG_PID, LOG_CRON);
+# else
+ openlog(ProgramName, LOG_PID);
+# endif
+ syslog_open = TRUE; /* assume openlog success */
+ }
+
+ syslog(LOG_INFO, "(%s) %s (%s)\n", username, event, detail);
+
+#endif /*SYSLOG*/
+
+#if DEBUGGING
+ if (DebugFlags) {
+ fprintf(stderr, "log_it: (%s %d) %s (%s)\n",
+ username, pid, event, detail);
+ }
+#endif
+}
+
+
+void
+log_close() {
+ if (LogFD != ERR) {
+ close(LogFD);
+ LogFD = ERR;
+ }
+}
+
+
+/* two warnings:
+ * (1) this routine is fairly slow
+ * (2) it returns a pointer to static storage
+ */
+char *
+first_word(s, t)
+ register char *s; /* string we want the first word of */
+ register char *t; /* terminators, implicitly including \0 */
+{
+ static char retbuf[2][MAX_TEMPSTR + 1]; /* sure wish C had GC */
+ static int retsel = 0;
+ register char *rb, *rp;
+
+ /* select a return buffer */
+ retsel = 1-retsel;
+ rb = &retbuf[retsel][0];
+ rp = rb;
+
+ /* skip any leading terminators */
+ while (*s && (NULL != strchr(t, *s))) {
+ s++;
+ }
+
+ /* copy until next terminator or full buffer */
+ while (*s && (NULL == strchr(t, *s)) && (rp < &rb[MAX_TEMPSTR])) {
+ *rp++ = *s++;
+ }
+
+ /* finish the return-string and return it */
+ *rp = '\0';
+ return rb;
+}
+
+
+/* warning:
+ * heavily ascii-dependent.
+ */
+void
+mkprint(dst, src, len)
+ register char *dst;
+ register unsigned char *src;
+ register int len;
+{
+ while (len-- > 0)
+ {
+ register unsigned char ch = *src++;
+
+ if (ch < ' ') { /* control character */
+ *dst++ = '^';
+ *dst++ = ch + '@';
+ } else if (ch < 0177) { /* printable */
+ *dst++ = ch;
+ } else if (ch == 0177) { /* delete/rubout */
+ *dst++ = '^';
+ *dst++ = '?';
+ } else { /* parity character */
+ sprintf(dst, "\\%03o", ch);
+ dst += 4;
+ }
+ }
+ *dst = '\0';
+}
+
+
+/* warning:
+ * returns a pointer to malloc'd storage, you must call free yourself.
+ */
+char *
+mkprints(src, len)
+ register unsigned char *src;
+ register unsigned int len;
+{
+ register char *dst = malloc(len*4 + 1);
+
+ mkprint(dst, src, len);
+
+ return dst;
+}
+
+
+#ifdef MAIL_DATE
+/* Sat, 27 Feb 93 11:44:51 CST
+ * 123456789012345678901234567
+ */
+char *
+arpadate(clock)
+ time_t *clock;
+{
+ time_t t = clock ?*clock :time(0L);
+ struct tm *tm = localtime(&t);
+ static char ret[30]; /* zone name might be >3 chars */
+
+ (void) sprintf(ret, "%s, %2d %s %2d %02d:%02d:%02d %s",
+ DowNames[tm->tm_wday],
+ tm->tm_mday,
+ MonthNames[tm->tm_mon],
+ tm->tm_year,
+ tm->tm_hour,
+ tm->tm_min,
+ tm->tm_sec,
+ TZONE(*tm));
+ return ret;
+}
+#endif /*MAIL_DATE*/
+
+
+#ifdef HAVE_SAVED_SUIDS
+static int save_euid;
+int swap_uids() { save_euid = geteuid(); return seteuid(getuid()); }
+int swap_uids_back() { return seteuid(save_euid); }
+#else /*HAVE_SAVED_UIDS*/
+int swap_uids() { return setreuid(geteuid(), getuid()); }
+int swap_uids_back() { return swap_uids(); }
+#endif /*HAVE_SAVED_UIDS*/
diff --git a/usr.sbin/cron/pathnames.h b/usr.sbin/cron/pathnames.h
new file mode 100644
index 000000000000..93159bb99007
--- /dev/null
+++ b/usr.sbin/cron/pathnames.h
@@ -0,0 +1,82 @@
+/* Copyright 1993,1994 by Paul Vixie
+ * All rights reserved
+ *
+ * Distribute freely, except: don't remove my name from the source or
+ * documentation (don't take credit for my work), mark your changes (don't
+ * get me blamed for your possible bugs), don't alter or remove this
+ * notice. May be sold if buildable source is provided to buyer. No
+ * warrantee of any kind, express or implied, is included with this
+ * software; use at your own risk, responsibility for damages (if any) to
+ * anyone resulting from the use of this software rests entirely with the
+ * user.
+ *
+ * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
+ * I'll try to keep a version up to date. I can be reached as follows:
+ * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
+ */
+
+/*
+ * From Id: pathnames.h,v 1.3 1994/01/15 20:43:43 vixie Exp
+ * $Header: /home/cvs/386BSD/src/usr.sbin/cron/pathnames.h,v 1.1 1994/01/22 20:39:08 guido Exp $
+ */
+
+#if (defined(BSD)) && (BSD >= 199103) || defined(__linux) || defined(AIX)
+# include <paths.h>
+#endif /*BSD*/
+
+#ifndef CRONDIR
+ /* CRONDIR is where crond(8) and crontab(1) both chdir
+ * to; SPOOL_DIR, ALLOW_FILE, DENY_FILE, and LOG_FILE
+ * are all relative to this directory.
+ */
+#define CRONDIR "/var/cron"
+#endif
+
+ /* SPOOLDIR is where the crontabs live.
+ * This directory will have its modtime updated
+ * whenever crontab(1) changes a crontab; this is
+ * the signal for crond(8) to look at each individual
+ * crontab file and reload those whose modtimes are
+ * newer than they were last time around (or which
+ * didn't exist last time around...)
+ */
+#define SPOOL_DIR "tabs"
+
+ /* undefining these turns off their features. note
+ * that ALLOW_FILE and DENY_FILE must both be defined
+ * in order to enable the allow/deny code. If neither
+ * LOG_FILE or SYSLOG is defined, we don't log. If
+ * both are defined, we log both ways.
+ */
+#define ALLOW_FILE "allow" /*-*/
+#define DENY_FILE "deny" /*-*/
+/*#define LOG_FILE "log" /*-*/
+
+ /* where should the daemon stick its PID?
+ */
+#ifdef _PATH_VARRUN
+# define PIDDIR _PATH_VARRUN
+#else
+# define PIDDIR "/etc/"
+#endif
+#define PIDFILE "%scron.pid"
+
+ /* 4.3BSD-style crontab */
+#define SYSCRONTAB "/etc/crontab"
+
+ /* what editor to use if no EDITOR or VISUAL
+ * environment variable specified.
+ */
+#if defined(_PATH_VI)
+# define EDITOR _PATH_VI
+#else
+# define EDITOR "/usr/ucb/vi"
+#endif
+
+#ifndef _PATH_BSHELL
+# define _PATH_BSHELL "/bin/sh"
+#endif
+
+#ifndef _PATH_DEFPATH
+# define _PATH_DEFPATH "/usr/bin:/bin"
+#endif
diff --git a/usr.sbin/cron/popen.c b/usr.sbin/cron/popen.c
new file mode 100644
index 000000000000..f890596a2f84
--- /dev/null
+++ b/usr.sbin/cron/popen.c
@@ -0,0 +1,167 @@
+/*
+ * Copyright (c) 1988 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Ken Arnold and
+ * published in UNIX Review, Vol. 6, No. 8.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley. The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * From Id: popen.c,v 1.5 1994/01/15 20:43:43 vixie Exp
+ */
+
+/* this came out of the ftpd sources; it's been modified to avoid the
+ * globbing stuff since we don't need it. also execvp instead of execv.
+ */
+
+#ifndef lint
+static char rcsid[] = "$Header: /home/cvs/386BSD/src/usr.sbin/cron/popen.c,v 1.1 1994/01/22 20:39:09 guido Exp $";
+static char sccsid[] = "@(#)popen.c 5.7 (Berkeley) 2/14/89";
+#endif /* not lint */
+
+#include "cron.h"
+#include <sys/signal.h>
+
+
+#define WANT_GLOBBING 0
+
+/*
+ * Special version of popen which avoids call to shell. This insures noone
+ * may create a pipe to a hidden program as a side effect of a list or dir
+ * command.
+ */
+static PID_T *pids;
+static int fds;
+
+FILE *
+cron_popen(program, type)
+ char *program, *type;
+{
+ register char *cp;
+ FILE *iop;
+ int argc, pdes[2];
+ PID_T pid;
+ char *argv[100];
+#if WANT_GLOBBING
+ char **pop, *vv[2];
+ int gargc;
+ char *gargv[1000];
+ extern char **glob(), **copyblk();
+#endif
+
+ if (*type != 'r' && *type != 'w' || type[1])
+ return(NULL);
+
+ if (!pids) {
+ if ((fds = getdtablesize()) <= 0)
+ return(NULL);
+ if (!(pids = (PID_T *)malloc((u_int)(fds * sizeof(PID_T)))))
+ return(NULL);
+ bzero((char *)pids, fds * sizeof(PID_T));
+ }
+ if (pipe(pdes) < 0)
+ return(NULL);
+
+ /* break up string into pieces */
+ for (argc = 0, cp = program;; cp = NULL)
+ if (!(argv[argc++] = strtok(cp, " \t\n")))
+ break;
+
+#if WANT_GLOBBING
+ /* glob each piece */
+ gargv[0] = argv[0];
+ for (gargc = argc = 1; argv[argc]; argc++) {
+ if (!(pop = glob(argv[argc]))) { /* globbing failed */
+ vv[0] = argv[argc];
+ vv[1] = NULL;
+ pop = copyblk(vv);
+ }
+ argv[argc] = (char *)pop; /* save to free later */
+ while (*pop && gargc < 1000)
+ gargv[gargc++] = *pop++;
+ }
+ gargv[gargc] = NULL;
+#endif
+
+ iop = NULL;
+ switch(pid = vfork()) {
+ case -1: /* error */
+ (void)close(pdes[0]);
+ (void)close(pdes[1]);
+ goto pfree;
+ /* NOTREACHED */
+ case 0: /* child */
+ if (*type == 'r') {
+ if (pdes[1] != 1) {
+ dup2(pdes[1], 1);
+ dup2(pdes[1], 2); /* stderr, too! */
+ (void)close(pdes[1]);
+ }
+ (void)close(pdes[0]);
+ } else {
+ if (pdes[0] != 0) {
+ dup2(pdes[0], 0);
+ (void)close(pdes[0]);
+ }
+ (void)close(pdes[1]);
+ }
+#if WANT_GLOBBING
+ execvp(gargv[0], gargv);
+#else
+ execvp(argv[0], argv);
+#endif
+ _exit(1);
+ }
+ /* parent; assume fdopen can't fail... */
+ if (*type == 'r') {
+ iop = fdopen(pdes[0], type);
+ (void)close(pdes[1]);
+ } else {
+ iop = fdopen(pdes[1], type);
+ (void)close(pdes[0]);
+ }
+ pids[fileno(iop)] = pid;
+
+pfree:
+#if WANT_GLOBBING
+ for (argc = 1; argv[argc] != NULL; argc++) {
+/* blkfree((char **)argv[argc]); */
+ free((char *)argv[argc]);
+ }
+#endif
+ return(iop);
+}
+
+int
+cron_pclose(iop)
+ FILE *iop;
+{
+ register int fdes;
+ int omask;
+ WAIT_T stat_loc;
+ PID_T pid;
+
+ /*
+ * pclose returns -1 if stream is not associated with a
+ * `popened' command, or, if already `pclosed'.
+ */
+ if (pids == 0 || pids[fdes = fileno(iop)] == 0)
+ return(-1);
+ (void)fclose(iop);
+ omask = sigblock(sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGHUP));
+ while ((pid = wait(&stat_loc)) != pids[fdes] && pid != -1)
+ ;
+ (void)sigsetmask(omask);
+ pids[fdes] = 0;
+ return (pid == -1 ? -1 : WEXITSTATUS(stat_loc));
+}
diff --git a/usr.sbin/cron/user.c b/usr.sbin/cron/user.c
new file mode 100644
index 000000000000..39c7a967a998
--- /dev/null
+++ b/usr.sbin/cron/user.c
@@ -0,0 +1,103 @@
+/* Copyright 1988,1990,1993,1994 by Paul Vixie
+ * All rights reserved
+ *
+ * Distribute freely, except: don't remove my name from the source or
+ * documentation (don't take credit for my work), mark your changes (don't
+ * get me blamed for your possible bugs), don't alter or remove this
+ * notice. May be sold if buildable source is provided to buyer. No
+ * warrantee of any kind, express or implied, is included with this
+ * software; use at your own risk, responsibility for damages (if any) to
+ * anyone resulting from the use of this software rests entirely with the
+ * user.
+ *
+ * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
+ * I'll try to keep a version up to date. I can be reached as follows:
+ * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
+ * From Id: user.c,v 2.8 1994/01/15 20:43:43 vixie Exp
+ */
+
+#if !defined(lint) && !defined(LINT)
+static char rcsid[] = "$Header: /home/cvs/386BSD/src/usr.sbin/cron/user.c,v 1.1 1994/01/22 20:39:10 guido Exp $";
+#endif
+
+/* vix 26jan87 [log is in RCS file]
+ */
+
+
+#include "cron.h"
+
+
+void
+free_user(u)
+ user *u;
+{
+ entry *e, *ne;
+
+ free(u->name);
+ for (e = u->crontab; e != NULL; e = ne) {
+ ne = e->next;
+ free_entry(e);
+ }
+ free(u);
+}
+
+
+user *
+load_user(crontab_fd, pw, name)
+ int crontab_fd;
+ struct passwd *pw; /* NULL implies syscrontab */
+ char *name;
+{
+ char envstr[MAX_ENVSTR];
+ FILE *file;
+ user *u;
+ entry *e;
+ int status;
+ char **envp;
+
+ if (!(file = fdopen(crontab_fd, "r"))) {
+ perror("fdopen on crontab_fd in load_user");
+ return NULL;
+ }
+
+ Debug(DPARS, ("load_user()\n"))
+
+ /* file is open. build user entry, then read the crontab file.
+ */
+ u = (user *) malloc(sizeof(user));
+ u->name = strdup(name);
+ u->crontab = NULL;
+
+ /*
+ * init environment. this will be copied/augmented for each entry.
+ */
+ envp = env_init();
+
+ /*
+ * load the crontab
+ */
+ while ((status = load_env(envstr, file)) >= OK) {
+ switch (status) {
+ case ERR:
+ free_user(u);
+ u = NULL;
+ goto done;
+ case FALSE:
+ e = load_entry(file, NULL, pw, envp);
+ if (e) {
+ e->next = u->crontab;
+ u->crontab = e;
+ }
+ break;
+ case TRUE:
+ envp = env_set(envp, envstr);
+ break;
+ }
+ }
+
+ done:
+ env_free(envp);
+ fclose(file);
+ Debug(DPARS, ("...load_user() done\n"))
+ return u;
+}
diff --git a/usr.sbin/dbsym/dbsym.c b/usr.sbin/dbsym/dbsym.c
index 46105818751f..727cb20a17fb 100644
--- a/usr.sbin/dbsym/dbsym.c
+++ b/usr.sbin/dbsym/dbsym.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: dbsym.c,v 1.2 1993/09/26 16:40:41 rgrimes Exp $";
+static char rcsid[] = "$Id: dbsym.c,v 1.3 1994/01/19 03:52:25 nate Exp $";
#endif /* not lint */
#include <stdio.h>
@@ -11,6 +11,11 @@ static char rcsid[] = "$Id: dbsym.c,v 1.2 1993/09/26 16:40:41 rgrimes Exp $";
#include <a.out.h>
#include <stab.h>
#include <machine/param.h>
+#include <vm/vm_param.h>
+#include <vm/lock.h>
+#include <vm/vm_statistics.h>
+#include <machine/pmap.h>
+#include <machine/vmparam.h>
#define FILE_OFFSET(vadr) (((vadr) - text_adr) - N_DATADDR(hdr) + \
N_DATOFF(hdr) + N_TXTADDR(hdr))
diff --git a/usr.sbin/dev_mkdb/dev_mkdb.c b/usr.sbin/dev_mkdb/dev_mkdb.c
index 46f9cf7ab274..fb4c40fd4176 100644
--- a/usr.sbin/dev_mkdb/dev_mkdb.c
+++ b/usr.sbin/dev_mkdb/dev_mkdb.c
@@ -105,7 +105,7 @@ main(argc, argv)
key.size = sizeof(bkey);
data.data = buf;
while (dp = readdir(dirp)) {
- if (stat(dp->d_name, &sb)) {
+ if (lstat(dp->d_name, &sb)) {
(void)fprintf(stderr, "dev_mkdb: can't stat %s\n",
dp->d_name);
continue;
diff --git a/usr.sbin/diskless_cfg/Makefile b/usr.sbin/diskless_cfg/Makefile
new file mode 100644
index 000000000000..082137f5a442
--- /dev/null
+++ b/usr.sbin/diskless_cfg/Makefile
@@ -0,0 +1,8 @@
+# @(#)Makefile 5.12 (Berkeley) 1/16/91
+
+PROG= diskless_cfg
+CFLAGS+=-DNFS
+MAN8=
+SRCS= diskless_cfg.c
+
+.include <bsd.prog.mk>
diff --git a/usr.sbin/diskless_cfg/diskless.h b/usr.sbin/diskless_cfg/diskless.h
new file mode 100644
index 000000000000..96d2a2d043e5
--- /dev/null
+++ b/usr.sbin/diskless_cfg/diskless.h
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 1982,1985,1986,1988 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)socket.h 7.13 (Berkeley) 4/20/91
+ */
+
+/*
+ * Definitions related to sockets: types, address families, options.
+ */
+
+/*
+ * Types
+ */
+#define SOCK_STREAM 1 /* stream socket */
+#define SOCK_DGRAM 2 /* datagram socket */
+#define SOCK_RAW 3 /* raw-protocol interface */
+#define SOCK_RDM 4 /* reliably-delivered message */
+#define SOCK_SEQPACKET 5 /* sequenced packet stream */
+
+/*
+ * Option flags per-socket.
+ */
+#define SO_DEBUG 0x0001 /* turn on debugging info recording */
+#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
+#define SO_REUSEADDR 0x0004 /* allow local address reuse */
+#define SO_KEEPALIVE 0x0008 /* keep connections alive */
+#define SO_DONTROUTE 0x0010 /* just use interface addresses */
+#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
+#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
+#define SO_LINGER 0x0080 /* linger on close if data present */
+#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
+
+/*
+ * Additional options, not kept in so_options.
+ */
+#define SO_SNDBUF 0x1001 /* send buffer size */
+#define SO_RCVBUF 0x1002 /* receive buffer size */
+#define SO_SNDLOWAT 0x1003 /* send low-water mark */
+#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
+#define SO_SNDTIMEO 0x1005 /* send timeout */
+#define SO_RCVTIMEO 0x1006 /* receive timeout */
+#define SO_ERROR 0x1007 /* get error status and clear */
+#define SO_TYPE 0x1008 /* get socket type */
+
+/*
+ * Structure used for manipulating linger option.
+ */
+struct linger {
+ int l_onoff; /* option on/off */
+ int l_linger; /* linger time */
+};
+
+/*
+ * Level number for (get/set)sockopt() to apply to socket itself.
+ */
+#define SOL_SOCKET 0xffff /* options for socket level */
+
+/*
+ * Address families.
+ */
+#define AF_UNSPEC 0 /* unspecified */
+#define AF_UNIX 1 /* local to host (pipes, portals) */
+#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
+#define AF_IMPLINK 3 /* arpanet imp addresses */
+#define AF_PUP 4 /* pup protocols: e.g. BSP */
+#define AF_CHAOS 5 /* mit CHAOS protocols */
+#define AF_NS 6 /* XEROX NS protocols */
+#define AF_ISO 7 /* ISO protocols */
+#define AF_OSI AF_ISO
+#define AF_ECMA 8 /* european computer manufacturers */
+#define AF_DATAKIT 9 /* datakit protocols */
+#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
+#define AF_SNA 11 /* IBM SNA */
+#define AF_DECnet 12 /* DECnet */
+#define AF_DLI 13 /* DEC Direct data link interface */
+#define AF_LAT 14 /* LAT */
+#define AF_HYLINK 15 /* NSC Hyperchannel */
+#define AF_APPLETALK 16 /* Apple Talk */
+#define AF_ROUTE 17 /* Internal Routing Protocol */
+#define AF_LINK 18 /* Link layer interface */
+#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */
+
+#define AF_MAX 20
+
+/*
+ * Structure used by kernel to store most
+ * addresses.
+ */
+struct sockaddr {
+ u_char sa_len; /* total length */
+ u_char sa_family; /* address family */
+ char sa_data[14]; /* actually longer; address value */
+};
+
+#define IFNAMSIZ 16
+
+struct ifaliasreq {
+ char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */
+ struct sockaddr ifra_addr;
+ struct sockaddr ifra_broadaddr;
+ struct sockaddr ifra_mask;
+};
+
+
+/*
+ * File Handle (32 bytes for version 2), variable up to 1024 for version 3
+ */
+
+#define NFS_FHSIZE 32
+typedef struct { u_char f[NFS_FHSIZE] } nfsv2fh_t;
+/*
+ * Arguments to mount NFS
+ */
+struct nfs_args {
+ struct sockaddr *addr; /* file server address */
+ int sotype; /* Socket type */
+ int proto; /* and Protocol */
+ nfsv2fh_t *fh; /* File handle to be mounted */
+ int flags; /* flags */
+ int wsize; /* write size in bytes */
+ int rsize; /* read size in bytes */
+ int timeo; /* initial timeout in .1 secs */
+ int retrans; /* times to retry send */
+ char *hostname; /* server's name */
+};
+/*
+ * NFS mount option flags
+ */
+#define NFSMNT_SOFT 0x0001 /* soft mount (hard is default) */
+#define NFSMNT_WSIZE 0x0002 /* set write size */
+#define NFSMNT_RSIZE 0x0004 /* set read size */
+#define NFSMNT_TIMEO 0x0008 /* set initial timeout */
+#define NFSMNT_RETRANS 0x0010 /* set number of request retrys */
+#define NFSMNT_HOSTNAME 0x0020 /* set hostname for error printf */
+#define NFSMNT_INT 0x0040 /* allow interrupts on hard mount */
+#define NFSMNT_NOCONN 0x0080 /* Don't Connect the socket */
+#define NFSMNT_SCKLOCK 0x0100 /* Lock socket against others */
+#define NFSMNT_WANTSCK 0x0200 /* Want a socket lock */
+#define NFSMNT_SPONGY 0x0400 /* spongy mount (soft for stat and lookup) */
+#define NFSMNT_COMPRESS 0x0800 /* Compress nfs rpc xdr */
+#define NFSMNT_LOCKBITS (NFSMNT_SCKLOCK | NFSMNT_WANTSCK)
+
diff --git a/usr.sbin/diskless_cfg/diskless_cfg.c b/usr.sbin/diskless_cfg/diskless_cfg.c
new file mode 100644
index 000000000000..3cf21379470f
--- /dev/null
+++ b/usr.sbin/diskless_cfg/diskless_cfg.c
@@ -0,0 +1,305 @@
+/*************************************************************************
+
+Diskless Configuration Program
+
+Based loosely on the 4.4BSD diskless setup code
+
+*************************************************************************/
+#include <stdio.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <netdb.h>
+
+#ifdef hpux
+#define fhandle_t char
+#endif
+
+#ifdef sun
+#include <rpc/types.h>
+#include <sys/errno.h>
+#include <nfs/nfs.h>
+#endif
+
+#ifdef i386 /* Native 386bsd system */
+#include <sys/param.h>
+#include <sys/socket.h>
+#include <sys/mount.h>
+#include <net/if.h>
+#include <nfs/nfsv2.h>
+#include <nfs/nfsdiskless.h>
+#else /* Other Host system */
+#include "diskless.h"
+#include "nfsdiskless.h"
+#endif
+
+#ifndef i386 /* Most other systems BIG ENDIAN */
+#define BIG_ENDIAN
+#endif
+
+struct nfs_diskless nfs_diskless;
+
+#define NFS_SOCKET 2049
+
+#define KW_HELP 0
+#define KW_INTERFACE 1
+#define KW_ROOTFS 2
+#define KW_SWAP 3
+#define KW_RSIZE 4
+#define KW_WSIZE 5
+#define KW_NETMASK 6
+#define KW_HOSTNAME 7
+#define KW_KERNEL 8
+#define KW_GATEWAY 9
+
+struct {
+ char *name;
+ int keyval;
+} keywords[] = {
+ { "-intf", KW_INTERFACE },
+ { "-rootfs", KW_ROOTFS },
+ { "-swap", KW_SWAP },
+ { "-netmask", KW_NETMASK },
+ { "-rsize", KW_RSIZE },
+ { "-wsize", KW_WSIZE },
+ { "-hostname", KW_HOSTNAME },
+ { "-gateway", KW_GATEWAY },
+ { NULL, KW_HELP }
+};
+
+char *hostname = "386bsd";
+char *gateway = NULL;
+char cfg[64];
+char *rootpath = "/var/386bsd";
+char *swappath = "/var/swap/386bsd";
+char servername[256];
+int rsize = 8192;
+int wsize = 8192;
+
+main(argc, argv)
+ int argc; char *argv[];
+{
+ int fd,i,j,cmd;
+ unsigned int broadcast, netmask, myip;
+ struct hostent *hp;
+ struct stat statbuf;
+ char buf[1024];
+ char *p, *q;
+
+ netmask = 0;
+ bzero(&nfs_diskless, 0, sizeof(struct nfs_diskless));
+ strcpy(nfs_diskless.myif.ifra_name,"ed0");
+ nfs_diskless.myif.ifra_addr.sa_len = sizeof(struct sockaddr);
+ nfs_diskless.myif.ifra_addr.sa_family = AF_INET;
+ nfs_diskless.myif.ifra_broadaddr.sa_len = sizeof(struct sockaddr);
+ nfs_diskless.myif.ifra_broadaddr.sa_family = AF_INET;
+ nfs_diskless.myif.ifra_mask.sa_len = sizeof(struct sockaddr);
+ nfs_diskless.myif.ifra_mask.sa_family = AF_UNSPEC;
+ nfs_diskless.swap_args.sotype = i386order(SOCK_DGRAM);
+ nfs_diskless.swap_args.flags = i386order(NFSMNT_WSIZE | NFSMNT_RSIZE);
+ nfs_diskless.swap_args.timeo = i386order(10);
+ nfs_diskless.swap_args.retrans = i386order(100);
+ nfs_diskless.swap_saddr.sa_len = sizeof(struct sockaddr);
+ nfs_diskless.swap_saddr.sa_family = AF_INET;
+ nfs_diskless.root_args.sotype = i386order(SOCK_DGRAM);
+ nfs_diskless.root_args.flags = i386order(NFSMNT_WSIZE | NFSMNT_RSIZE);
+ nfs_diskless.root_args.timeo = i386order(10);
+ nfs_diskless.root_args.retrans = i386order(100);
+ nfs_diskless.root_saddr.sa_len = sizeof(struct sockaddr);
+ nfs_diskless.root_saddr.sa_family = AF_INET;
+
+ if (gethostname(servername, 256) < 0) {
+ fprintf(stderr,"%s: unable to get host server name\n",argv[0]);
+ exit(2);
+ }
+ if ((hp = gethostbyname(servername)) == NULL) {
+ fprintf(stderr,"%s: unable to get host address\n",argv[0]);
+ exit(2);
+ }
+ p = servername;
+ while (*p && (*p != '.')) p++;
+ *p = 0;
+ nfs_diskless.swap_saddr.sa_data[0] = nfs_diskless.root_saddr.sa_data[0]
+ = NFS_SOCKET >> 8;
+ nfs_diskless.swap_saddr.sa_data[1] = nfs_diskless.root_saddr.sa_data[1]
+ = NFS_SOCKET & 0x00FF;
+ bcopy(*hp->h_addr_list, &nfs_diskless.swap_saddr.sa_data[2], 4);
+ bcopy(*hp->h_addr_list, &nfs_diskless.root_saddr.sa_data[2], 4);
+
+ i = 1;
+ while (i < argc) {
+ cmd = KW_HELP;
+ for (j=0; keywords[j].name; j++) {
+ if (!strcmp(keywords[j].name, argv[i])) {
+ if ((i+1) < argc) {
+ cmd = keywords[j].keyval;
+ break;
+ }
+ }
+ }
+ switch(cmd) {
+ case KW_HELP:
+ help(argv[0], argv[i]);
+ exit(2);
+ case KW_INTERFACE:
+ if (strlen(argv[i+1]) >= IFNAMSIZ) {
+ fprintf(stderr,
+ "%s: interface name '%s' too long.\n",
+ argv[0], argv[i+1]);
+ exit(2);
+ }
+ strcpy(nfs_diskless.myif.ifra_name, argv[i+1]);
+ i += 2;
+ break;
+ case KW_ROOTFS:
+ rootpath = argv[i+1];
+ i += 2;
+ break;
+ case KW_SWAP:
+ swappath = argv[i+1];
+ i += 2;
+ break;
+ case KW_RSIZE:
+ rsize = atoi(argv[i+1]);
+ i += 2;
+ break;
+ case KW_WSIZE:
+ wsize = atoi(argv[i+1]);
+ i += 2;
+ break;
+ case KW_NETMASK:
+ netmask = inet_addr(argv[i+1]);
+ i +=2;
+ break;
+ case KW_HOSTNAME:
+ hostname = argv[i+1];
+ i += 2;
+ break;
+ case KW_GATEWAY:
+ gateway = argv[i+1];
+ i += 2;
+ break;
+ }
+ }
+ if(gateway)
+ {
+ if (gethostname(gateway, 256) < 0) {
+ fprintf(stderr,"%s: unable to get gateway host name\n",argv[0]);
+ exit(2);
+ }
+ if ((hp = gethostbyname(gateway)) == NULL) {
+ fprintf(stderr,"%s: unable to get gateway host address\n",argv[0]);
+ exit(2);
+ }
+ nfs_diskless.mygateway.sa_len = sizeof(struct sockaddr);
+ nfs_diskless.mygateway.sa_family = AF_INET;
+ nfs_diskless.mygateway.sa_data[0] = NFS_SOCKET >> 8;
+ nfs_diskless.mygateway.sa_data[1] = NFS_SOCKET & 0x00FF;
+ bcopy(*hp->h_addr_list, &nfs_diskless.mygateway.sa_data[2], 4);
+ }
+ nfs_diskless.swap_args.rsize = i386order(rsize);
+ nfs_diskless.swap_args.wsize = i386order(wsize);
+ nfs_diskless.root_args.rsize = i386order(rsize);
+ nfs_diskless.root_args.wsize = i386order(wsize);
+ if ((hp = gethostbyname(hostname)) == NULL) {
+ fprintf(stderr,"%s: unable to get diskless address\n",argv[0]);
+ exit(2);
+ }
+ bcopy(*hp->h_addr_list, &nfs_diskless.myif.ifra_addr.sa_data[2], 4);
+ if (!netmask) {
+ unsigned char net;
+ net = nfs_diskless.myif.ifra_addr.sa_data[2];
+ if (net <= 127)
+ netmask = inet_addr("255.0.0.0");
+ else if (net < 192)
+ netmask = inet_addr("255.255.0.0");
+ else netmask = inet_addr("255.255.255.0");
+ }
+ bcopy(*hp->h_addr_list, &myip, 4);
+ broadcast = (myip & netmask) | ~netmask;
+ bcopy(&broadcast, &nfs_diskless.myif.ifra_broadaddr.sa_data[2], 4);
+ bcopy(&netmask, &nfs_diskless.myif.ifra_mask.sa_data[2], 4);
+ if (stat(rootpath, &statbuf) < 0) {
+ fprintf(stderr,"%s: unable to stat '%s'\n",
+ argv[0],rootpath);
+ exit(2);
+ }
+ if (!S_ISDIR(statbuf.st_mode)) {
+ fprintf(stderr,"%s: '%s' is not a directory\n",
+ argv[0],rootpath);
+ exit(2);
+ }
+ if (getfh(rootpath, (fhandle_t *)nfs_diskless.root_fh) < 0) {
+ fprintf(stderr,"%s: unable to get handle for '%s'\n",
+ argv[0],rootpath);
+ exit(2);
+ }
+ sprintf(buf,"%s:%s",servername, rootpath);
+ buf[NFSMNAMELEN-1] = 0;
+ strcpy(nfs_diskless.root_hostnam,buf);
+ printf("root is on %s\n",nfs_diskless.root_hostnam);
+ if (stat(swappath, &statbuf) < 0) {
+ fprintf(stderr,"%s: unable to stat '%s'\n",
+ argv[0],swappath);
+ exit(2);
+ }
+ if (!S_ISREG(statbuf.st_mode)) {
+ fprintf(stderr,"%s: '%s' is not a regular file\n",
+ argv[0],swappath);
+ exit(2);
+ }
+ if (getfh(swappath, (fhandle_t *)nfs_diskless.swap_fh) < 0) {
+ fprintf(stderr,"%s: unable to get handle for '%s'\n",
+ argv[0],swappath);
+ exit(2);
+ }
+ sprintf(buf,"%s:%s",servername, swappath);
+ buf[NFSMNAMELEN-1] = 0;
+ strcpy(nfs_diskless.swap_hostnam,buf);
+ printf("swap is on %s\n",nfs_diskless.swap_hostnam);
+ sprintf(cfg,"cfg.%d.%d.%d.%d",
+ ((int)nfs_diskless.myif.ifra_addr.sa_data[2]) & 0x00FF,
+ ((int)nfs_diskless.myif.ifra_addr.sa_data[3]) & 0x00FF,
+ ((int)nfs_diskless.myif.ifra_addr.sa_data[4]) & 0x00FF,
+ ((int)nfs_diskless.myif.ifra_addr.sa_data[5]) & 0x00FF);
+ if ((fd = open(cfg, O_WRONLY | O_CREAT | O_TRUNC, 0644)) < 0) {
+ fprintf(stderr,"%s: unable to open/create %s\n",
+ argv[0],cfg);
+ exit(2);
+ }
+ if (write(fd, &nfs_diskless, sizeof(struct nfs_diskless)) !=
+ sizeof(struct nfs_diskless)) {
+ fprintf(stderr,"%s: unable to write to '%s'\n",
+ argv[0],cfg);
+ exit(2);
+ }
+ close(fd);
+}
+
+/********************************************************************
+HELP - Print help message
+********************************************************************/
+help(prog, keywd)
+ char *prog, *keywd;
+{
+ int i;
+ fprintf(stderr,"%s: invalid keyword '%s' or not enough parameters\n",prog,keywd);
+ fprintf(stderr," valid keywords: ");
+ for (i=0; keywords[i].name; i++) fprintf(stderr,"%s ", keywords[i].name);
+ fprintf(stderr,"\n");
+}
+
+/*********************************************************************
+I386ORDER - Byte swap
+*********************************************************************/
+i386order(i)
+ unsigned int i;
+{
+#ifndef i386
+ return( ((i >> 24) & 0x000000FF) |
+ ((i >> 8) & 0x0000FF00) |
+ ((i << 8) & 0x00FF0000) |
+ ((i << 24) & 0xFF000000));
+#else
+ return(i);
+#endif
+}
diff --git a/usr.sbin/update/update.c b/usr.sbin/diskless_cfg/nfsdiskless.h
index 8d6ddda7f4c2..13961b2b32cf 100644
--- a/usr.sbin/update/update.c
+++ b/usr.sbin/diskless_cfg/nfsdiskless.h
@@ -1,7 +1,10 @@
-/*-
- * Copyright (c) 1987, 1990 The Regents of the University of California.
+/*
+ * Copyright (c) 1991 The Regents of the University of California.
* All rights reserved.
*
+ * This code is derived from software contributed to Berkeley by
+ * Rick Macklem at The University of Guelph.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -29,47 +32,28 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
+ *
+ * @(#)nfsdiskless.h 7.1 (Berkeley) 3/4/91
*/
-#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1987, 1990 The Regents of the University of California.\n\
- All rights reserved.\n";
-#endif /* not lint */
-
-#ifndef lint
-static char sccsid[] = "@(#)update.c 5.1 (Berkeley) 6/6/91";
-#endif /* not lint */
-
-#include <sys/time.h>
-#include <signal.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-
-main()
-{
- struct itimerval value;
- void mysync();
-
- daemon(0, 0);
-
- (void)signal(SIGALRM, mysync);
-
- value.it_interval.tv_sec = 30;
- value.it_interval.tv_usec = 0;
- value.it_value = value.it_interval;
- if (setitimer(ITIMER_REAL, &value, NULL)) {
- perror("update: setitimer");
- exit(1);
- }
- for (;;)
- sigpause(sigblock(0L));
- /* NOTREACHED */
-}
-
-void
-mysync()
-{
- (void)sync();
-}
+/*
+ * Structure that must be initialized for a diskless nfs client.
+ * This structure is used by nfs_mountroot() to set up the root and swap
+ * vnodes plus do a partial ifconfig(8) and route(8) so that the critical net
+ * interface can communicate with the server.
+ * For now it is statically initialized in swapvmunix.c, but someday a primary
+ * bootstrap should fill it in.
+ */
+#define NFSMNAMELEN 64
+struct nfs_diskless {
+ struct ifaliasreq myif; /* Info. for partial ifconfig */
+ struct sockaddr mygateway; /* Default gateway for "route add" */
+ struct nfs_args swap_args; /* Mount args for swap file */
+ u_char swap_fh[NFS_FHSIZE]; /* Swap file's file handle */
+ struct sockaddr swap_saddr; /* Address of swap server */
+ char swap_hostnam[NFSMNAMELEN]; /* Host name for mount pt */
+ struct nfs_args root_args; /* Mount args for root fs */
+ u_char root_fh[NFS_FHSIZE]; /* File handle of root dir */
+ struct sockaddr root_saddr; /* Address of root server */
+ char root_hostnam[NFSMNAMELEN]; /* Host name for mount pt */
+};
diff --git a/usr.sbin/fdformat/Makefile b/usr.sbin/fdformat/Makefile
new file mode 100644
index 000000000000..209af72d124d
--- /dev/null
+++ b/usr.sbin/fdformat/Makefile
@@ -0,0 +1,32 @@
+# Copyright (C) 1993 by Joerg Wunsch, Dresden
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+PROG = fdformat
+
+# the -I's seem to be confusing, but necessery this way
+# (so the right <unistd.h> will be found in /usr/include, and the
+# "../i386/isa/ic/nec765.h" included from fdreg.h is accessible, too)
+CFLAGS+=-Wall -I/usr/include -I/sys/sys
+
+.include <bsd.prog.mk>
diff --git a/usr.sbin/fdformat/fdformat.1 b/usr.sbin/fdformat/fdformat.1
new file mode 100644
index 000000000000..78a6b133340c
--- /dev/null
+++ b/usr.sbin/fdformat/fdformat.1
@@ -0,0 +1,133 @@
+.\" Copyright (C) 1993 by Joerg Wunsch, Dresden
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.Dd September 16, 1993
+.Os FreeBSD
+.Dt FDFORMAT 1
+.Sh NAME
+.Nm fdformat
+.Nd format floppy disks
+.Sh SYNOPSIS
+.Nm fdformat
+.Bq Fl q
+.Bq Fl v
+.Bq Fl n
+.Bq Fl f Ar capacity
+.Bq Fl c Ar cyls
+.Bq Fl s Ar secs
+.Bq Fl h Ar heads
+.br
+.Bq Fl r Ar rate
+.Bq Fl g Ar gap3len
+.Bq Fl i Ar intleave
+.Bq Fl S Ar secshft
+.Bq Fl F Ar fillbyte
+.Bq Fl t Ar steps_per_track
+.Ar device_name
+.Sh DESCRIPTION
+.Nm Fdformat
+formats a floppy disk at device
+.Ar device_name .
+.Ar Device_name
+should be a character device; it may be given either with a full path
+name of a raw device node for a floppy disk drive
+.Pq e.\ g. Pa /dev/rfd0 ,
+or default name in an abbreviated form
+.Pq e.\ g. Em fd0 .
+In the latter case, the name is constructed by prepending
+.Pa /dev/r
+and appending an
+.Em .capacity
+to the
+.Ar device_name .
+Note that any geometry constraints of the device node
+.Pq minor device number
+are meaningless, since they're overridden by
+.Nm fdformat .
+.Pp
+The options are as follows:
+.Bl -tag -width 10n -offset indent
+.It Fl q
+supress any normal output from the command, and don't ask the
+user for a confirmation whether to format the floppy disk at
+.Ar device_name .
+.It Fl f Ar capacity
+The normal way to specify the desired formatting parameters.
+.Ar Capacity
+is the number of kilobytes to format.
+.It Fl n
+Don't verify floppy after formatting.
+.It Fl v
+Don't format, verify only.
+.It Fl c Ar cyls
+.It Fl s Ar secs
+.It Fl h Ar heads
+.It Fl r Ar rate
+.It Fl g Ar gap3len
+.It Fl i Ar intleave
+.It Fl S Ar secshft
+.It Fl F Ar fillbyte
+.It Fl t Ar steps_per_track
+An alternate method to specify the geometry data to write to the floppy disk.
+.El
+
+If the
+.Fl q
+flag has not been specified, the user is asked for a confirmation
+of the intended formatting process. In order to continue, an answer
+of
+.Dq y
+must be given.
+.Sh DIAGNOSTICS
+Unless
+.Fl q
+has been specified, a single letter is printed to standard output
+to inform the user about the progress of work.
+First, an
+.Sq Em F
+is printed when the track(s) is being formatted, then a
+.Sq Em V
+while it's being verified, and if an error has been detected, it
+will finally change to
+.Sq Em E .
+.Pp
+An exit status of 0 is returned upon successful operation. Exit status
+1 is returned on any errors during floppy formatting, and an exit status
+of 2 reflects invalid arguments given to the program (along with an
+appropriate information written to diagnostic output).
+.Sh SEE ALSO
+.Xr fd 4 .
+.Sh HISTORY
+.Nm Fdformat
+has been developed for 386BSD 0.1
+and upgraded to the new
+.Xr fd 4
+floppy disk driver. It later became part of the
+.Em FreeBSD
+system, release 1.1.
+.Sh AUTHOR
+The program has been contributed by
+.if n Joerg Wunsch,
+.if t J\(:org Wunsch,
+Dresden, with changes by Serge Vakulenko and Andrew A. Chernov, Moscow.
diff --git a/usr.sbin/fdformat/fdformat.c b/usr.sbin/fdformat/fdformat.c
new file mode 100644
index 000000000000..b88a8ea7618d
--- /dev/null
+++ b/usr.sbin/fdformat/fdformat.c
@@ -0,0 +1,355 @@
+/*
+ * Copyright (C) 1992-1993 by Joerg Wunsch, Dresden
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * FreeBSD:
+ * format a floppy disk
+ *
+ * Added FD_GTYPE ioctl, verifying, proportional indicators.
+ * Serge Vakulenko, vak@zebub.msk.su
+ * Sat Dec 18 17:45:47 MSK 1993
+ *
+ * Final adaptation, change format/verify logic, add separate
+ * format gap/interleave values
+ * Andrew A. Chernov, ache@astral.msk.su
+ * Thu Jan 27 00:47:24 MSK 1994
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <strings.h>
+#include <ctype.h>
+
+#include <errno.h>
+#include <machine/ioctl_fd.h>
+#include <../i386/isa/fdreg.h> /* XXX should be in <machine> dir */
+
+static void
+format_track(int fd, int cyl, int secs, int head, int rate,
+ int gaplen, int secsize, int fill,int interleave)
+{
+ struct fd_formb f;
+ register int i,j;
+ int il[FD_MAX_NSEC + 1];
+
+ memset(il,0,sizeof il);
+ for(j = 0, i = 1; i <= secs; i++) {
+ while(il[(j%secs)+1]) j++;
+ il[(j%secs)+1] = i;
+ j += interleave;
+ }
+
+ f.format_version = FD_FORMAT_VERSION;
+ f.head = head;
+ f.cyl = cyl;
+ f.transfer_rate = rate;
+
+ f.fd_formb_secshift = secsize;
+ f.fd_formb_nsecs = secs;
+ f.fd_formb_gaplen = gaplen;
+ f.fd_formb_fillbyte = fill;
+ for(i = 0; i < secs; i++) {
+ f.fd_formb_cylno(i) = cyl;
+ f.fd_formb_headno(i) = head;
+ f.fd_formb_secno(i) = il[i+1];
+ f.fd_formb_secsize(i) = secsize;
+ }
+ if(ioctl(fd, FD_FORM, (caddr_t)&f) < 0) {
+ perror("\nfdformat: ioctl(FD_FORM)");
+ exit(1);
+ }
+}
+
+static int
+verify_track(int fd, int track, int tracksize)
+{
+ static char *buf = 0;
+ static int bufsz = 0;
+
+ if (bufsz < tracksize) {
+ if (buf)
+ free (buf);
+ bufsz = tracksize;
+ buf = 0;
+ }
+ if (! buf)
+ buf = malloc (bufsz);
+ if (! buf) {
+ fprintf (stderr, "\nfdformat: out of memory\n");
+ exit (2);
+ }
+ if (lseek (fd, (long) track*tracksize, 0) < 0)
+ return (-1);
+ if (read (fd, buf, tracksize) != tracksize)
+ return (-1);
+ return (0);
+}
+
+static const char *
+makename(const char *arg, const char *suffix)
+{
+ static char namebuff[20]; /* big enough for "/dev/rfd0a"... */
+
+ memset(namebuff, 0, 20);
+ if(*arg == '\0') /* ??? */
+ return arg;
+ if(*arg == '/') /* do not convert absolute pathnames */
+ return arg;
+ strcpy(namebuff, "/dev/r");
+ strncat(namebuff, arg, 3);
+ strcat(namebuff, suffix);
+ return namebuff;
+}
+
+static void
+usage ()
+{
+ printf("Usage:\n\tfdformat [-q] [-n | -v] [-f #] [-c #] [-s #] [-h #]\n");
+ printf("\t\t [-r #] [-g #] [-i #] [-S #] [-F #] [-t #] devname\n");
+ printf("Options:\n");
+ printf("\t-q\tsupress any normal output, don't ask for confirmation\n");
+ printf("\t-n\tdon't verify floppy after formatting\n");
+ printf("\t-v\tdon't format, verify only\n");
+ printf("\t-f #\tspecify desired floppy capacity, in kilobytes;\n");
+ printf("\t\tvalid choices are 360, 720, 800, 820, 1200, 1440, 1480, 1720\n");
+ printf("\tdevname\tthe full name of floppy device or in short form fd0, fd1\n");
+ printf("Obscure options:\n");
+ printf("\t-c #\tspecify number of cylinders, 40 or 80\n");
+ printf("\t-s #\tspecify number of sectors per track, 9, 10, 15 or 18\n");
+ printf("\t-h #\tspecify number of floppy heads, 1 or 2\n");
+ printf("\t-r #\tspecify data rate, 250, 300 or 500 kbps\n");
+ printf("\t-g #\tspecify gap length\n");
+ printf("\t-i #\tspecify interleave factor\n");
+ printf("\t-S #\tspecify sector size, 0=128, 1=256, 2=512 bytes\n");
+ printf("\t-F #\tspecify fill byte\n");
+ printf("\t-t #\tnumber of steps per track\n");
+ exit(2);
+}
+
+static int
+yes ()
+{
+ char reply [256], *p;
+
+ reply[sizeof(reply)-1] = 0;
+ for (;;) {
+ fflush(stdout);
+ if (! fgets (reply, sizeof(reply)-1, stdin))
+ return (0);
+ for (p=reply; *p==' ' || *p=='\t'; ++p)
+ continue;
+ if (*p=='y' || *p=='Y')
+ return (1);
+ if (*p=='n' || *p=='N' || *p=='\n' || *p=='\r')
+ return (0);
+ printf("Answer `yes' or `no': ");
+ }
+}
+
+int
+main(int argc, char **argv)
+{
+ int format = -1, cyls = -1, secs = -1, heads = -1, intleave = -1;
+ int rate = -1, gaplen = -1, secsize = -1, steps = -1;
+ int fill = 0xf6, quiet = 0, verify = 1, verify_only = 0;
+ int fd, c, track, error, tracks_per_dot, bytes_per_track, errs;
+ const char *devname, *suffix;
+ struct fd_type fdt;
+
+ while((c = getopt(argc, argv, "f:c:s:h:r:g:S:F:t:i:qvn")) != -1)
+ switch(c) {
+ case 'f': /* format in kilobytes */
+ format = atoi(optarg);
+ break;
+
+ case 'c': /* # of cyls */
+ cyls = atoi(optarg);
+ break;
+
+ case 's': /* # of secs per track */
+ secs = atoi(optarg);
+ break;
+
+ case 'h': /* # of heads */
+ heads = atoi(optarg);
+ break;
+
+ case 'r': /* transfer rate, kilobyte/sec */
+ rate = atoi(optarg);
+ break;
+
+ case 'g': /* length of GAP3 to format with */
+ gaplen = atoi(optarg);
+ break;
+
+ case 'S': /* sector size shift factor (1 << S)*128 */
+ secsize = atoi(optarg);
+ break;
+
+ case 'F': /* fill byte, C-like notation allowed */
+ fill = (int)strtol(optarg, (char **)0, 0);
+ break;
+
+ case 't': /* steps per track */
+ steps = atoi(optarg);
+ break;
+
+ case 'i': /* interleave factor */
+ intleave = atoi(optarg);
+ break;
+
+ case 'q':
+ quiet = 1;
+ break;
+
+ case 'n':
+ verify = 0;
+ break;
+
+ case 'v':
+ verify = 1;
+ verify_only = 1;
+ break;
+
+ case '?': default:
+ usage();
+ }
+
+ if(optind != argc - 1)
+ usage();
+
+ switch(format) {
+ default:
+ fprintf(stderr, "fdformat: bad floppy size: %dK\n", format);
+ exit(2);
+ case -1: suffix = ""; break;
+ case 360: suffix = ".360"; break;
+ case 720: suffix = ".720"; break;
+ case 800: suffix = ".800"; break;
+ case 820: suffix = ".820"; break;
+ case 1200: suffix = ".1200"; break;
+ case 1440: suffix = ".1440"; break;
+ case 1480: suffix = ".1480"; break;
+ case 1720: suffix = ".1720"; break;
+ }
+
+ devname = makename(argv[optind], suffix);
+
+ if((fd = open(devname, O_RDWR)) < 0) {
+ perror(devname);
+ exit(1);
+ }
+
+ if(ioctl(fd, FD_GTYPE, &fdt) < 0) {
+ fprintf(stderr, "fdformat: not a floppy disk: %s\n", devname);
+ exit(1);
+ }
+
+ switch(rate) {
+ case -1: break;
+ case 250: fdt.trans = FDC_250KBPS; break;
+ case 300: fdt.trans = FDC_300KBPS; break;
+ case 500: fdt.trans = FDC_500KBPS; break;
+ default:
+ fprintf(stderr, "fdformat: invalid transfer rate: %d\n", rate);
+ exit(2);
+ }
+
+ if (cyls >= 0) fdt.tracks = cyls;
+ if (secs >= 0) fdt.sectrac = secs;
+ if (fdt.sectrac > FD_MAX_NSEC) {
+ fprintf(stderr, "fdformat: too many sectors per track, max value is %d\n", FD_MAX_NSEC);
+ exit(2);
+ }
+ if (heads >= 0) fdt.heads = heads;
+ if (gaplen >= 0) fdt.f_gap = gaplen;
+ if (secsize >= 0) fdt.secsize = secsize;
+ if (steps >= 0) fdt.steptrac = steps;
+ if (intleave >= 0) fdt.f_inter = intleave;
+
+ bytes_per_track = fdt.sectrac * (1<<fdt.secsize) * 128;
+ tracks_per_dot = fdt.tracks * fdt.heads / 40;
+
+ if (verify_only) {
+ if(!quiet)
+ printf("Verify %dK floppy `%s'.\n",
+ fdt.tracks * fdt.heads * bytes_per_track / 1024,
+ devname);
+ }
+ else if(!quiet) {
+ printf("Format %dK floppy `%s'? (y/n): ",
+ fdt.tracks * fdt.heads * bytes_per_track / 1024,
+ devname);
+ if(! yes ()) {
+ printf("Not confirmed.\n");
+ return 0;
+ }
+ }
+
+ /*
+ * Formatting.
+ */
+ if(!quiet) {
+ printf("Processing ----------------------------------------\r");
+ printf("Processing ");
+ fflush(stdout);
+ }
+
+ error = errs = 0;
+
+ for (track = 0; track < fdt.tracks * fdt.heads; track++) {
+ if (!verify_only) {
+ format_track(fd, track / fdt.heads, fdt.sectrac,
+ track % fdt.heads, fdt.trans, fdt.f_gap,
+ fdt.secsize, fill, fdt.f_inter);
+ if(!quiet && !((track + 1) % tracks_per_dot)) {
+ putchar('F');
+ fflush(stdout);
+ }
+ }
+ if (verify) {
+ if (verify_track(fd, track, bytes_per_track) < 0)
+ error = errs = 1;
+ if(!quiet && !((track + 1) % tracks_per_dot)) {
+ if (!verify_only)
+ putchar('\b');
+ if (error) {
+ putchar('E');
+ error = 0;
+ }
+ else
+ putchar('V');
+ fflush(stdout);
+ }
+ }
+ }
+ if(!quiet)
+ printf(" done.\n");
+
+ return errs;
+}
diff --git a/usr.sbin/ftinfo/Makefile b/usr.sbin/ftinfo/Makefile
new file mode 100644
index 000000000000..c680a53330b2
--- /dev/null
+++ b/usr.sbin/ftinfo/Makefile
@@ -0,0 +1,7 @@
+# $Id: Makefile,v 1.2 1994/02/07 09:20:38 rgrimes Exp $
+
+PROG= ftinfo
+MAN8= ftinfo.8
+#SRCS= ftinfo.c
+
+.include <bsd.prog.mk>
diff --git a/usr.sbin/update/update.8 b/usr.sbin/ftinfo/ftinfo.8
index 2d0dd5b57ce6..1780c4013105 100644
--- a/usr.sbin/update/update.8
+++ b/usr.sbin/ftinfo/ftinfo.8
@@ -1,4 +1,4 @@
-.\" Copyright (c) 1991 The Regents of the University of California.
+.\" Copyright (c) 1980, 1989, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -29,46 +29,23 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)update.8 6.5 (Berkeley) 8/5/91
+.\" @(#)ftinfo.8
.\"
-.Dd August 5, 1991
-.Dt UPDATE 8
-.Os
+.Dd February 7, 1994
+.Dt FTINFO 8
+.Os BSD 4
.Sh NAME
-.Nm update
-.Nd flush internal filesystem caches to disk frequently
+.Nm ftinfo
+.Nd display QIC 40/80 drive and tape status
.Sh SYNOPSIS
-.Nm update
-.Sh DESCRIPTION
-The
-.Nm update
-command helps protect the integrity of disk volumes
-by flushing
-voliatile cached filesystem data
-to disk at thirty second intervals.
-.Nm Update
-uses the
-.Xr sync 2
-function call to do the task.
-.Pp
-.Nm Update
-is commonly invoked at startup time by
-.Xr rc 8
-when the system goes multi-user.
-.Sh SEE ALSO
-.Xr sync 2 ,
-.Xr fsck 8 ,
-.Xr init 8 ,
-.Xr rc 8 ,
-.Xr sync 8
-.Sh BUGS
-It is possible on some systems, that a
-.Xr syn
-occuring simultaneously with a crash may cause
-file system damage. See
-.Xr fsck 8 .
-.Sh HISTORY
-An
-.Nm update
-command appeared in
-.At v6 .
+.Nm ftinfo
+.Op Fl f Ar tape
+.Sh NOTES
+Please mail the author (see address below) a copy of
+.Nm ftinfo's
+output along with
+the exact manufacturer and model name of your tape drive to the address
+listed below. In particular, I am looking at the vendor and rom-id's to
+try and build a table of models.
+.Sh AUTHOR
+Steve Gerakines <steve2@genesis.nred.ma.us>
diff --git a/usr.sbin/ftinfo/ftinfo.c b/usr.sbin/ftinfo/ftinfo.c
new file mode 100644
index 000000000000..520f3117bf99
--- /dev/null
+++ b/usr.sbin/ftinfo/ftinfo.c
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 1993 Steve Gerakines
+ *
+ * This is freely redistributable software. You may do anything you
+ * wish with it, so long as the above notice stays intact.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * ftinfo.c - display tape drive status
+ * 10/30/93 v0.3
+ * Initial revision.
+ *
+ * usage: ftinfo [ -f tape ]
+ */
+#include <stdio.h>
+#include <sys/ftape.h>
+
+#define DEFQIC "/dev/rft0"
+#define equal(s1,s2) (strcmp(s1, s2) == 0)
+QIC_HWInfo hw;
+QIC_Geom g;
+
+main(int argc, char *argv[])
+{
+ int ft;
+ int gotgeom;
+ int s;
+ char *tape, *getenv();
+
+ if (argc > 2 && (equal(argv[1], "-t") || equal(argv[1], "-f"))) {
+ argc -= 2;
+ tape = argv[2];
+ argv += 2;
+ } else
+ if ((tape = getenv("TAPE")) == NULL)
+ tape = DEFQIC;
+ if (argc > 1) {
+ fprintf(stderr, "usage: ftinfo [ -f tape ]\n");
+ exit(1);
+ }
+
+ if ((ft = open(tape, 2)) < 0) {
+ fprintf(stderr, "ftinfo: couldn't open tape device %s\n", tape);
+ exit(2);
+ }
+
+ if (ioctl(ft, QIOSTATUS, &s) < 0) {
+ fprintf(stderr, "ftinfo: couldn't get tape drive status\n");
+ exit(2);
+ }
+
+ if ((s & QS_CART) && (s & QS_FMTOK)) {
+ if (ioctl(ft, QIOGEOM, &g) < 0)
+ fprintf(stderr, "ftinfo: warning: get tape geometry failed\n");
+ }
+
+ if (ioctl(ft, QIOHWINFO, &hw) < 0)
+ fprintf(stderr, "ftinfo: warning: get hardware info failed\n");
+
+ close(ft);
+
+ printf("drive status: %s\n", (s & QS_READY) ? "Ready" : "Not Ready");
+ if (s & QS_CART) {
+ if (s & QS_FMTOK) {
+ printf("tape type: %s %s\n",
+ g.g_fmtdesc, (s & QS_RDONLY) ? "(Write-Protect)" : "");
+ printf("tape length: %s\n", g.g_lendesc);
+ } else
+ printf("tape type: Unformatted %s\n",
+ (s & QS_RDONLY) ? "(Write-Protect)" : "");
+ } else
+ printf("tape type: No tape in drive\n");
+ printf("drive make: 0x%04x\n", hw.hw_make);
+ printf("drive model: 0x%02x\n", hw.hw_model);
+ printf("drive rom-id: 0x%02x\n", hw.hw_romid);
+ printf("beta roms: %s\n", hw.hw_rombeta ? "Yes" : "No");
+
+ exit(0);
+}
diff --git a/usr.sbin/inetd/Makefile b/usr.sbin/inetd/Makefile
index 79956f5cf336..1333680b29b8 100644
--- a/usr.sbin/inetd/Makefile
+++ b/usr.sbin/inetd/Makefile
@@ -1,11 +1,11 @@
# from: @(#)Makefile 5.5 (Berkeley) 6/29/90
-# $Id: Makefile,v 1.5 1993/09/25 12:14:32 rgrimes Exp $
+# $Id: Makefile,v 1.6 1993/11/10 03:43:57 smace Exp $
PROG= inetd
MAN8= inetd.8
MLINKS= inetd.8 inetd.5
-DPADD= ${LIBUTIL} ${LIBRPC}
-LDADD= -lutil -lrpc
+DPADD= ${LIBUTIL}
+LDADD= -lutil
.include <bsd.prog.mk>
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c
index 2d6c0ee741f8..6dac72a0fc57 100644
--- a/usr.sbin/inetd/inetd.c
+++ b/usr.sbin/inetd/inetd.c
@@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)inetd.c 5.30 (Berkeley) 6/3/91";*/
-static char rcsid[] = "$Id: inetd.c,v 1.4 1993/10/18 23:03:20 rgrimes Exp $";
+static char rcsid[] = "$Id: inetd.c,v 1.7 1994/02/05 09:46:42 wollman Exp $";
#endif /* not lint */
/*
@@ -110,7 +110,7 @@ static char rcsid[] = "$Id: inetd.c,v 1.4 1993/10/18 23:03:20 rgrimes Exp $";
#include <rpc/rpc.h>
#include "pathnames.h"
-#define TOOMANY 40 /* don't start more than TOOMANY */
+#define TOOMANY 256 /* don't start more than TOOMANY */
#define CNT_INTVL 60 /* servers in CNT_INTVL sec. */
#define RETRYTIME (60*10) /* retry after bind or server fail */
@@ -155,6 +155,10 @@ int pmap_set(u_long prognum,u_long versnum,int protocol,u_short port);
/* comes from -lutil ?? */
void daemon();
+char * config_open(const char *filename,int contlines);
+void config_close();
+char * config_next();
+char * config_skip(char **p);
/* Prototypes */
void reapchild();
@@ -163,12 +167,8 @@ void unregisterrpc(struct servtab *sep);
void retry();
void setup(struct servtab *sep);
struct servtab * enter(struct servtab *cp);
-int setconfig();
-void endconfig();
struct servtab * getconfigent();
void freeconfig(struct servtab *cp);
-char * skip(char **cpp);
-char * nextline(FILE *fd);
char * newstr(char *cp);
void setproctitle(char *a, int s);
void echo_stream(int s,struct servtab *sep);
@@ -249,7 +249,7 @@ main(int argc, char **argv, char **envp)
break;
case '?':
default:
- fprintf(stderr, "usage: inetd [-d]");
+ fprintf(stderr, "usage: inetd [-dl]");
exit(1);
}
argc -= optind;
@@ -359,6 +359,11 @@ main(int argc, char **argv, char **envp)
timingout = 1;
alarm(RETRYTIME);
}
+ /*
+ * DON'T fork!
+ */
+ sigsetmask(0L);
+ continue;
}
}
pid = fork();
@@ -456,9 +461,11 @@ config()
{
struct servtab *sep, *cp, **sepp;
long omask;
+ char *p;
- if (!setconfig()) {
- syslog(LOG_ERR, "%s: %m", CONFIG);
+ p = config_open(CONFIG,1); /* 1 means allow continuation lines */
+ if(p) {
+ syslog(LOG_ERR, "%s on %s: %m", p, CONFIG);
return;
}
for (sep = servtab; sep; sep = sep->se_next)
@@ -538,7 +545,7 @@ config()
if (sep->se_fd == -1)
setup(sep);
}
- endconfig();
+ config_close();
/*
* Purge anything not looked at above.
*/
@@ -634,7 +641,8 @@ setsockopt(fd, SOL_SOCKET, opt, (char *)&on, sizeof (on))
return;
}
if (sep->se_rpc) {
- int i, len;
+ int i, len = sizeof(struct sockaddr);
+
if (getsockname(sep->se_fd, (struct sockaddr *)&sep->se_ctrladdr,
&len) < 0) {
syslog(LOG_ERR, "%s/%s: getsockname: %m",
@@ -682,30 +690,7 @@ enter(struct servtab *cp)
return (sep);
}
-FILE *fconfig = NULL;
struct servtab serv;
-char line[256];
-
-int
-setconfig()
-{
-
- if (fconfig != NULL) {
- fseek(fconfig, 0L, L_SET);
- return (1);
- }
- fconfig = fopen(CONFIG, "r");
- return (fconfig != NULL);
-}
-
-void
-endconfig()
-{
- if (fconfig) {
- (void) fclose(fconfig);
- fconfig = NULL;
- }
-}
struct servtab *
getconfigent()
@@ -715,16 +700,13 @@ getconfigent()
char *cp, *arg;
char *versp;
-more:
- while ((cp = nextline(fconfig)) && *cp == '#')
- ;
- if (cp == NULL)
- return ((struct servtab *)0);
- arg = skip(&cp);
- if (arg == NULL)
- goto more;
- sep->se_service = newstr(arg);
- arg = skip(&cp);
+ more:
+ cp = config_next();
+ if(!cp)
+ return 0;
+ fprintf(stderr,"<%s>\n",cp);
+ sep->se_service = newstr(config_skip(&cp));
+ arg = config_skip(&cp);
if (strcmp(arg, "stream") == 0)
sep->se_socktype = SOCK_STREAM;
else if (strcmp(arg, "dgram") == 0)
@@ -737,7 +719,7 @@ more:
sep->se_socktype = SOCK_RAW;
else
sep->se_socktype = -1;
- sep->se_proto = newstr(skip(&cp));
+ sep->se_proto = newstr(config_skip(&cp));
sep->se_rpc = 0;
if (strncmp(sep->se_proto, "rpc/", 4) == 0) {
sep->se_proto += 4;
@@ -768,10 +750,18 @@ more:
sep->se_rpc_highvers = 1;
}
}
- arg = skip(&cp);
- sep->se_wait = strcmp(arg, "wait") == 0;
- sep->se_user = newstr(skip(&cp));
- sep->se_server = newstr(skip(&cp));
+ arg = config_skip(&cp);
+ if(!strcmp(arg,"wait"))
+ sep->se_wait = 1;
+ else if(!strcmp(arg,"nowait"))
+ sep->se_wait = 0;
+ else {
+ syslog(LOG_ERR, "should be wait or nowait: %s unknown\n", arg);
+ goto more;
+ }
+
+ sep->se_user = newstr(config_skip(&cp));
+ sep->se_server = newstr(config_skip(&cp));
if (strcmp(sep->se_server, "internal") == 0) {
struct biltin *bi;
@@ -789,7 +779,7 @@ more:
} else
sep->se_bi = NULL;
argc = 0;
- for (arg = skip(&cp); cp; arg = skip(&cp))
+ for (arg = config_skip(&cp); arg; arg = config_skip(&cp))
if (argc < MAXARGV)
sep->se_argv[argc++] = newstr(arg);
while (argc <= MAXARGV)
@@ -816,48 +806,6 @@ freeconfig(struct servtab *cp)
}
char *
-skip(char **cpp)
-{
- char *cp = *cpp;
- char *start;
-
-again:
- while (*cp == ' ' || *cp == '\t')
- cp++;
- if (*cp == '\0') {
- int c;
-
- c = getc(fconfig);
- (void) ungetc(c, fconfig);
- if (c == ' ' || c == '\t')
- if ((cp = nextline(fconfig)))
- goto again;
- *cpp = (char *)0;
- return ((char *)0);
- }
- start = cp;
- while (*cp && *cp != ' ' && *cp != '\t')
- cp++;
- if (*cp != '\0')
- *cp++ = '\0';
- *cpp = cp;
- return (start);
-}
-
-char *
-nextline(FILE *fd)
-{
- char *cp;
-
- if (fgets(line, sizeof (line), fd) == NULL)
- return ((char *)0);
- cp = index(line, '\n');
- if (cp)
- *cp = '\0';
- return (line);
-}
-
-char *
newstr(char *cp)
{
if ((cp = strdup(cp ? cp : "")))
diff --git a/usr.sbin/iostat/iostat.c b/usr.sbin/iostat/iostat.c
index a47a3ee7bdc6..9dc0400102d6 100644
--- a/usr.sbin/iostat/iostat.c
+++ b/usr.sbin/iostat/iostat.c
@@ -93,10 +93,10 @@ struct nlist nl[] = {
{ "_ubdinit" },
#define X_UBDINIT (X_END+2)
#endif
-#ifdef __386BSD__
+#ifdef __FreeBSD__
#define X_ISA_BIO (X_END+1)
{ "_isa_devtab_bio" },
-#endif /* __386BSD__ */
+#endif /* __FreeBSD__ */
{ NULL },
};
diff --git a/usr.sbin/lpr/common_source/common.c b/usr.sbin/lpr/common_source/common.c
index d7b97cd429d1..0fe755dec16f 100644
--- a/usr.sbin/lpr/common_source/common.c
+++ b/usr.sbin/lpr/common_source/common.c
@@ -1,4 +1,13 @@
/*
+ * Copyright (c) UNIX System Laboratories, Inc. All or some portions
+ * of this file are derived from material licensed to the
+ * University of California by American Telephone and Telegraph Co.
+ * or UNIX System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * $Id: common.c,v 1.1.1.1.2.1 1994/05/04 08:01:55 rgrimes Exp $
+ */
+/*
* Copyright (c) 1983 Regents of the University of California.
* All rights reserved.
*
diff --git a/usr.sbin/lpr/common_source/printcap.c b/usr.sbin/lpr/common_source/printcap.c
index 47b1b80c49dd..0cdbef9ec678 100644
--- a/usr.sbin/lpr/common_source/printcap.c
+++ b/usr.sbin/lpr/common_source/printcap.c
@@ -76,9 +76,9 @@ static char sccsid[] = "@(#)printcap.c 5.7 (Berkeley) 3/4/91";
static FILE *pfp = NULL; /* printcap data base file pointer */
static char *tbuf;
static int hopcount; /* detect infinite loops in termcap, init 0 */
-char *tskip();
+static char *tskip();
char *tgetstr();
-char *tdecode();
+static char *tdecode();
char *getenv();
/*
diff --git a/usr.sbin/lpr/lpc/lpc.8 b/usr.sbin/lpr/lpc/lpc.8
index f69169ac4e0f..9d4a41c64af6 100644
--- a/usr.sbin/lpr/lpc/lpc.8
+++ b/usr.sbin/lpr/lpc/lpc.8
@@ -73,7 +73,7 @@ arguments as parameters to the command. The standard input
may be redirected causing
.Nm lpc
to read commands from file.
-Commands may be abreviated;
+Commands may be abbreviated;
the following is the list of recognized commands.
.Pp
.Bl -tag -width Ds -compact
@@ -161,7 +161,7 @@ lock file for queue control
.Sh DIAGNOSTICS
.Bl -tag -width Ds
.It Sy "?Ambiguous command"
-abreviation matches more than one command
+abbreviation matches more than one command
.It Sy "?Invalid command"
no match was found
.It Sy "?Privileged command"
diff --git a/usr.sbin/lpr/lpd/lpd.8 b/usr.sbin/lpr/lpd/lpd.8
index e4a96dd661ce..edb2c025dda5 100644
--- a/usr.sbin/lpr/lpd/lpd.8
+++ b/usr.sbin/lpr/lpd/lpd.8
@@ -100,7 +100,7 @@ file can be edited with your favorite text editor.
.Pp
The daemon begins processing files
after it has successfully set the lock for exclusive
-access (descibed a bit later),
+access (described a bit later),
and scans the spool directory
for files beginning with
.Em cf .
diff --git a/usr.sbin/lpr/lpd/lpd.c b/usr.sbin/lpr/lpd/lpd.c
index edfda933296c..844316797c75 100644
--- a/usr.sbin/lpr/lpd/lpd.c
+++ b/usr.sbin/lpr/lpd/lpd.c
@@ -174,6 +174,7 @@ main(argc, argv)
syslog(LOG_ERR, "printer/tcp: unknown service");
mcleanup();
}
+ sin.sin_addr.s_addr=INADDR_ANY;
sin.sin_family = AF_INET;
sin.sin_port = sp->s_port;
if (bind(finet, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
diff --git a/usr.sbin/lpr/lpr/lpr.c b/usr.sbin/lpr/lpr/lpr.c
index f8133db5373b..eca1fb43e2db 100644
--- a/usr.sbin/lpr/lpr/lpr.c
+++ b/usr.sbin/lpr/lpr/lpr.c
@@ -1,4 +1,13 @@
/*
+ * Copyright (c) UNIX System Laboratories, Inc. All or some portions
+ * of this file are derived from material licensed to the
+ * University of California by American Telephone and Telegraph Co.
+ * or UNIX System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * $Id: lpr.c,v 1.1.1.1.2.2 1994/05/04 08:02:12 rgrimes Exp $
+ */
+/*
* Copyright (c) 1983 Regents of the University of California.
* All rights reserved.
*
@@ -483,7 +492,7 @@ nfile(n)
register f;
int oldumask = umask(0); /* should block signals */
- f = creat(n, FILMOD);
+ f = open(n, O_WRONLY|O_EXCL|O_CREAT, FILMOD);
(void) umask(oldumask);
if (f < 0) {
printf("%s: cannot create %s\n", name, n);
diff --git a/usr.sbin/named/named.8 b/usr.sbin/named/named.8
index 2d506c4fdb6b..7c419dadc32c 100644
--- a/usr.sbin/named/named.8
+++ b/usr.sbin/named/named.8
@@ -182,7 +182,7 @@ at 128.32.137.8. If the transfer fails it will try 128.32.137.3 and
continue trying the addresses, up to 10, listed on this line.
The secondary copy is also authoritative for the specified domain.
The first non-dotted-quad address on this line will be taken
-as a filename in which to backup the transfered zone.
+as a filename in which to backup the transferred zone.
The name server will load the zone from this backup file if it exists
when it boots, providing a complete copy even if the master servers
are unreachable.
diff --git a/usr.sbin/named/storage.c b/usr.sbin/named/storage.c
index 2a00ac9f573d..49cf611e6102 100644
--- a/usr.sbin/named/storage.c
+++ b/usr.sbin/named/storage.c
@@ -22,7 +22,7 @@
* All rights reserved.
*/
#ifndef lint
-static char RCSstorage[] = "@(#)$Header: /a/cvs/386BSD/src/usr.sbin/named/storage.c,v 1.1.1.1 1993/06/12 14:46:17 rgrimes Exp $";
+static char RCSstorage[] = "@(#)$Header: /home/cvs/386BSD/src/usr.sbin/named/storage.c,v 1.1.1.1 1993/06/12 14:46:17 rgrimes Exp $";
#endif
#include <sys/param.h>
diff --git a/usr.sbin/named/tools/nslookup/commands.l b/usr.sbin/named/tools/nslookup/commands.l
index 29942ea1c690..f649b0eb870d 100644
--- a/usr.sbin/named/tools/nslookup/commands.l
+++ b/usr.sbin/named/tools/nslookup/commands.l
@@ -75,6 +75,7 @@ static char sccsid[] = "@(#)commands.l 5.13 (Berkeley) 7/24/90";
#include "res.h"
extern char rootServerName[];
+extern void PrintHelp();
%}
WS [ \t]
@@ -151,7 +152,6 @@ NAME [A-Za-z0-9.*=_/-]
return(1);
}
^{WS}*help{WS}*$ {
- extern void PrintHelp();
PrintHelp();
return(1);
diff --git a/usr.sbin/portmap/Makefile b/usr.sbin/portmap/Makefile
index d47fb0a0c551..2b60cc956983 100644
--- a/usr.sbin/portmap/Makefile
+++ b/usr.sbin/portmap/Makefile
@@ -1,8 +1,8 @@
# @(#)Makefile 5.2 (Berkeley) 9/27/90
PROG= portmap
-DPADD= ${LIBRPC} ${LIBUTIL}
-LDADD= -lrpc -lutil
+DPADD= ${LIBUTIL}
+LDADD= -lutil
MAN8= portmap.8
.include <bsd.prog.mk>
diff --git a/usr.sbin/rwhod/rwhod.c b/usr.sbin/rwhod/rwhod.c
index 0cf0ec39d92f..49e032ecda1b 100644
--- a/usr.sbin/rwhod/rwhod.c
+++ b/usr.sbin/rwhod/rwhod.c
@@ -271,6 +271,9 @@ onalrm()
utmptime = stb.st_mtime;
if (stb.st_size > utmpsize) {
utmpsize = stb.st_size + 10 * sizeof(struct utmp);
+/* Commented out the following line, because it disturbs many people
+ that are booting/rebooting their machines often */
+/* syslog(LOG_WARNING, "utmpsize(%d)", utmpsize); */
if (utmp)
utmp = (struct utmp *)realloc(utmp, utmpsize);
else
@@ -428,11 +431,15 @@ configure(s)
bcopy((char *)&ifr->ifr_addr, np->n_addr, np->n_addrlen);
if (ioctl(s, SIOCGIFFLAGS, (char *)&ifreq) < 0) {
syslog(LOG_ERR, "ioctl (get interface flags)");
+ free(np->n_addr);
+ free(np->n_name);
free((char *)np);
continue;
}
if ((ifreq.ifr_flags & IFF_UP) == 0 ||
(ifreq.ifr_flags & (IFF_BROADCAST|IFF_POINTOPOINT)) == 0) {
+ free(np->n_addr);
+ free(np->n_name);
free((char *)np);
continue;
}
@@ -440,6 +447,8 @@ configure(s)
if (np->n_flags & IFF_POINTOPOINT) {
if (ioctl(s, SIOCGIFDSTADDR, (char *)&ifreq) < 0) {
syslog(LOG_ERR, "ioctl (get dstaddr)");
+ free(np->n_addr);
+ free(np->n_name);
free((char *)np);
continue;
}
@@ -450,6 +459,8 @@ configure(s)
if (np->n_flags & IFF_BROADCAST) {
if (ioctl(s, SIOCGIFBRDADDR, (char *)&ifreq) < 0) {
syslog(LOG_ERR, "ioctl (get broadaddr)");
+ free(np->n_addr);
+ free(np->n_name);
free((char *)np);
continue;
}
diff --git a/usr.sbin/sendmail/CHANGES-R5-R8 b/usr.sbin/sendmail/CHANGES-R5-R8
index c62aba74853e..722dcc7b5a47 100644
--- a/usr.sbin/sendmail/CHANGES-R5-R8
+++ b/usr.sbin/sendmail/CHANGES-R5-R8
@@ -1,16 +1,25 @@
SUMMARY OF CHANGES BETWEEN SENDMAIL V5 and V8
+ @(#)CHANGES-R5-R8 8.1 (Berkeley) 2/26/94
The following is a summary of the changes between the last commonly
available version of sendmail from Berkeley (5.67) and the latest
-version (8.1). I can't guarantee that it is complete.
+version (8.6). I can't guarantee that it is complete.
+
+Many of these are ideas that had been tried in IDA, albeit many of
+them with a more general syntax.
Connection Caching
- Instead of closing SMTP connections immediately, those connections
- are cached for possible future use. The advent of MX records made
- this effective for mailing lists; in addition, substantial performance
- improvements can be expected for queue processing.
+ Instead of closing SMTP connections immediately, open connections are
+ cached for possible future use. There is a limit to the number of
+ simultaneous open connections and the idle time of any individual
+ connection.
+
+ This is of best help during queue processing (since there is the
+ potential of many different messages going to one site), although
+ it can also help when processing MX records which aren't handled
+ by MX Piggybacking.
MX Piggybacking
@@ -18,6 +27,11 @@ MX Piggybacking
have the same set of MX hosts, they can be sent in the same
transaction. Version 8 notices this and tries to batch the messages.
+ For example, if two sites ``foo.com'' and ``bar.com'' are both
+ served by UUNET, they will have the same set of MX hosts and will
+ be sent in one transaction. UUNET will then split the message
+ and send it to the two individual hosts.
+
RFC 1123 Changes
A number of changes have been made to make sendmail ``conditionally
@@ -26,23 +40,59 @@ RFC 1123 Changes
The major areas of change are (numbers are RFC 1123 section numbers):
- 5.2.7 Response to RCPT command is fast.
+ 5.2.7 Response to RCPT command is fast. Previously, sendmail
+ expanded all aliases as far as it could -- this could
+ take a very long time, particularly if there were
+ name server delays. Version 8 only checks for the
+ existence of an alias and does the expansion later.
5.2.8 Numeric IP addresses are logged in Received: lines.
- 5.2.17 Self domain literal is properly handled.
- 5.3.2 Better control over individual timeouts.
- 5.3.3 Error messages are sent as From:<>.
- 5.3.3 Error messages are never sent to <>.
- 5.3.3 Route-addrs are pruned.
+ This helps tracing spoofed messages.
+ 5.2.17 Self domain literal is properly handled. Previously,
+ if someone sent to user@[a.b.c.d], where a.b.c.d is
+ your IP address, the mail would probably be rejected.
+ Version 8 special cases these addresses.
+ 5.3.2 Better control over individual timeouts. RFC 821 specified
+ no timeouts. Older versions of sendmail had a single
+ timeout, typically set to two hours. Version 8 allows
+ the configuration file to set timeouts for various
+ SMTP commands individually.
+ 5.3.3 Error messages are sent as From:<>. This was urged by
+ RFC 821 and reiterated by RFC 1123, but older versions
+ of sendmail never really did it properly. Version 8
+ does. However, some systems cannot handle this
+ perfectly legal address; if necessary, you can create
+ a special mailer that uses the `g' flag to disable this.
+ 5.3.3 Error messages are never sent to <>. Previously,
+ sendmail was happy to send responses-to-responses which
+ sometimes resulted in responses-to-responses-to-responses
+ which resulted in .... you get the idea.
+ 5.3.3 Route-addrs (the ugly ``<@hosta,@hostb:user@hostc>''
+ syntax) are pruned. RFC 821 urged the use of this
+ bletcherous syntax. RFC 1123 has seen the light and
+ officially deprecates them, further urging that you
+ eliminate all but ``user@hostc'' should you receive
+ one of these things. Version 8 is slightly more generous
+ than the standards suggest; instead of stripping off all
+ the route addressees, it only strips hosts off up to
+ the one before the last one known to DNS, thus allowing
+ you to have pseudo-hosts such as foo.BITNET. The 'R'
+ option will turn this off.
The areas in which sendmail is not ``unconditionally compliant'' are:
5.2.6 Sendmail does do header munging.
5.2.10 Sendmail doesn't always use the exact SMTP message
- text from RFC 821.
+ text from RFC 821. This is a rather silly requirement.
5.3.1.1 Sendmail doesn't guarantee only one connect for each
- host on queue runs.
+ host on queue runs. Connection caching gives you most
+ of this, but it does not provide a guarantee.
5.3.1.1 Sendmail doesn't always provide an adequate limit
- on concurrency.
+ on concurrency. That is, there can be several
+ independent sendmails running at once. My feeling
+ is that doing an absolute limit would be a mistake
+ (it might result in lost mail). However, if you use
+ the XLA contributed software, most of this will be
+ guaranteed (but I don't guarantee the guarantee).
Extended SMTP Support
@@ -65,6 +115,10 @@ User Database
unified large-site name support. We are installing it at Berkeley;
future versions may show significant modifications.
+ The user database allows you to map both incoming and outgoing
+ addresses, much like IDA. However, the interface set is still
+ better with IDA.
+
Improved BIND Support
The BIND support, particularly for MX records, had a number of
@@ -73,15 +127,19 @@ Improved BIND Support
to sendmail, so that the name server resolution rules are incorporated
directly into sendmail.
+ The major change has been that the $[ ... $] operator didn't fully
+ qualify names that were in DNS as A or MX records. Version 8 does
+ this qualification.
+
Keyed Files
Generalized keyed files is an idea taken directly from IDA sendmail
(albeit with a completely different implementation). They can be
useful on large sites.
- Version 8 also understands YP.
+ Version 8 includes an "NIS" map class to support NIS/YP maps.
-Multi-Word Classes
+Multi-Word Classes & Macros in Classes
Classes can now be multiple words. For example,
@@ -90,9 +148,15 @@ Multi-Word Classes
allows you to match the entire string ``hofmann.CS.Berkeley.EDU''
using the single construct ``$=S''.
+ Class definitions are now allowed to include macros -- for example:
+
+ Cw$k
+
+ is legal.
+
Deferred Macro Expansion
- The $&x construct has been adopted from IDA .
+ The $&x construct has been adopted from IDA.
IDENT Protocol Support
@@ -161,21 +225,28 @@ New Options
b Insist on a minimum number of disk blocks.
- C Delivery checkpoint interval.
+ C Delivery checkpoint interval. Checkpoint the queue (to avoid
+ duplicate deliveries) every C addresses.
- E Default error message.
+ E Default error message. This message (or the contents of the
+ indicated file) are prepended to error messages.
- G Enable GECOS matching.
+ G Enable GECOS matching. If you can't find a local user name
+ and this option is enabled, do a sequential scan of the passwd
+ file to match against full names. Previously a compile option.
- h Maximum hop count.
+ h Maximum hop count. Previously this was compiled in.
j Send errors in MIME-encapsulated format.
- J Forward file path.
+ J Forward file path. Where to search for .forward files -- defaults
+ to $HOME/.forward.
- k Connection cache size
+ k Connection cache size. The total number of connections that will
+ be kept open at any time.
- K Connection cache lifetime.
+ K Connection cache lifetime. The amount of time any connection
+ will be permitted to sit idle.
l Enable Errors-To: header. These headers violate RFC 1123;
this option is included to provide back compatibility with
@@ -183,15 +254,27 @@ New Options
O Incoming daemon options (e.g., use alternate SMTP port).
- p Privacy options.
+ p Privacy options. These can be used to make your SMTP server
+ less friendly.
+
+ R Don't prune route-addrs. Normally, if version 8 sees an address
+ like "<@hostA,@hostB:user@hostC>, sendmail will try to strip off
+ as much as it can (up to user@hostC) as suggested by RFC 1123.
+ This option disables that behaviour.
- R Don't prune route-addrs.
+ U User database spec. This is still experimental.
- U User database spec.
+ V Fallback ``MX'' host. This can be thought of as an MX host
+ that applies to all addresses that has a very high preference
+ value (that is, use it only if everything else fails).
- V Fallback ``MX'' host.
+ w If set, assume that if you are the best MX host for a host,
+ you should send directly to that host. This is intended
+ for compatibility with UIUC sendmail, and may have some
+ use on firewalls.
- 7 Do not run eight bit clean.
+ 7 Do not run eight bit clean. Technically, you have to assert
+ this option to be RFC 821 compatible.
Extended Options
@@ -201,22 +284,35 @@ Extended Options
The `A' (alias file) option has been extended to allow multiple
alias files of different types.
+New Mailer Keyletters
+
+ L= Set the allowable line length. In V5, the L mailer flag implied
+ a line length limit of 990 characters; this is now settable to
+ an arbitrary value.
+
New Mailer Flags
- a Try to use ESMTP. It will fall back to SMTP if the initial
+ F=a Try to use ESMTP. It will fall back to SMTP if the initial
EHLO packet is rejected.
- b Ensure a blank line at the end of messages.
+ F=b Ensure a blank line at the end of messages. Useful on the
+ *file* mailer.
- c Strip all comments from addresses; this should only be used as
+ F=c Strip all comments from addresses; this should only be used as
a last resort when dealing with cranky mailers.
- g Never use the null sender as the envelope sender, even when
+ F=g Never use the null sender as the envelope sender, even when
running SMTP. This violates RFC 1123.
- 7 Strip all output to this mailer to 7 bits.
+ F=7 Strip all output to this mailer to 7 bits.
+
+Changed Mailer Flags
-New Pre-Defined Macros
+ F=L Used to set the line limit to 990 bytes for SMTP compatibility.
+ It now does that only if the L= keyletter is not specified.
+ This flag is obsolete and should not be used.
+
+New or Changed Pre-Defined Macros
$k UUCP node name from uname(2).
@@ -224,6 +320,18 @@ New Pre-Defined Macros
$_ RFC 1413-provided sender address.
+ $w Previously was sometimes the full domain name, sometimes
+ just the first word. Now guaranteed to be the first word
+ of the domain name (i.e., the host name).
+
+ $j Previously had to be defined -- it is now predefined to be
+ the full domain name, if that can be determined. That is,
+ it is equivalent to $w.$m.
+
+New Classes
+
+ $=k Initialized to contain $k.
+
New LHS Token
Version 8 allows `$@' on the Left Hand Side of an `R' line to match
@@ -257,7 +365,15 @@ Auto-Quoting in Addresses
Symbolic Names On Error Mailer
Several names have been built in to the $@ portion of the $#error
- mailer.
+ mailer. For example:
+
+ $#error $@NOHOST $: Host unknown
+
+New Built-In Mailers
+
+ Two new mailers, *file* and *include*, are included to define options
+ when mailing to a file or a :include: file respectively. Previously
+ these were overloaded on the local mailer.
SMTP VRFY Doesn't Expand
@@ -267,6 +383,7 @@ SMTP VRFY Doesn't Expand
As an optimization, if you run with your default delivery mode
being queue-only, the RCPT command will also not chase aliases and
.forward files. It will chase them when it processes the queue.
+ This speeds up RCPT processing.
[IPC] Mailers Allow Multiple Hosts
@@ -281,7 +398,10 @@ SMTP VRFY Doesn't Expand
Aliases Extended
The implementation has been merged with maps. Among other things,
- this supports NIS-based aliases.
+ this supports multiple alias files and NIS-based aliases. For
+ example:
+
+ OA/etc/aliases,nis:mail.aliases
Portability and Security Enhancements
@@ -289,13 +409,34 @@ Portability and Security Enhancements
Several fixes have been made to increase the paranoia factor.
+ In particular, the permissions required for .forward and :include:
+ files have been tightened up considerably. V5 would pretty much
+ read any file it could get to as root, which exposed some security
+ holes. V8 insists that all directories leading up to the .forward
+ or :include: file be searchable ("x" permission) by the controlling
+ user" (defined below), that the file itself be readable by the
+ controlling user, and that .forward files be owned by the user
+ who is being forwarded to or root.
+
+ The "controlling user" is the user on whose behalf the mail is
+ being delivered. For example, if you mail to "user1" then the
+ controlling user for ~user1/.forward and any mailers invoked
+ by that .forward file, including :include: files.
+
+ Previously, anyone who had a home directory could create a .forward
+ could forward to a program. Now, sendmail checks to make sure
+ that they have an "approved shell", that is, a shell listed in
+ the /etc/shells file.
+
Miscellaneous Enhancements
- Sendmail writes a /etc/sendmail.pid file with the current process id.
+ Sendmail writes a /etc/sendmail.pid file with the current process id
+ and the current invocation flags.
Two people using the same program (e.g., submit) are considered
"different" so that duplicate elimination doesn't delete one of
- them.
+ them. For example, two people forwarding their email to
+ |submit will be treated as two recipients.
The mailstats program prints mailer names and gets the location of
the sendmail.st file from /etc/sendmail.cf.
diff --git a/usr.sbin/sendmail/FAQ b/usr.sbin/sendmail/FAQ
new file mode 100644
index 000000000000..dac985347413
--- /dev/null
+++ b/usr.sbin/sendmail/FAQ
@@ -0,0 +1,333 @@
+ Sendmail Version 8
+ Frequently Asked Questions
+ Version 8.2 of 2/28/94
+
+
+This FAQ is specific to Version 8 of sendmail.
+
+----------------------------------------------------------------------
+ * What are the differences between Version 8 and other versions?
+
+ See CHANGES-R5-R8 in the anonymous FTP directory.
+----------------------------------------------------------------------
+ * What happened to sendmail 6.x and 7.x?
+
+ When I released a new version of sendmail, I changed it to
+ Release 6. Development continued in that tree until 4.4BSD
+ was released, when everything on the 4.4 tape was set to be
+ version 8.1. Version 7.x never existed.
+----------------------------------------------------------------------
+ * Where can I get Version 8?
+
+ Via anonymous FTP from FTP.CS.Berkeley.EDU in /ucb/sendmail.
+----------------------------------------------------------------------
+ * Version 8 requires a new version of "make". Where can I get this?
+
+ Actually, Version 8 does not require a new version of "make".
+ It includes a collection of Makefiles for different architectures,
+ only one or two of which require the new "make". If you are
+ porting to a new architecture, start with Makefile.dist.
+
+ If you really do want the new make, it is available on any of
+ the BSD Net2 distribution sites. These include:
+
+ ftp.uu.net /systems/unix/bsd-sources
+ gatekeeper.dec.com /.0/BSD/net2
+ ucquais.cba.uc.edu /pub/net2
+ ftp.luth.se /pub/unix/4.3bsd/net2
+
+ Diffs and instructions for building this version of make under
+ SunOS 4.1.x are available on ftp.css.itd.umich.edu in
+ /pub/systems/sun/Net2-make.sun4.diff.Z.
+----------------------------------------------------------------------
+ * What macro package do I use to format the V8 man pages?
+
+ The BSD group switched over the the ``mandoc'' macros for
+ the 4.4 release. These include more hooks designed for
+ hypertext handling. However, new man pages won't format
+ under the old man macros. Fortunately, old man pages will
+ format under the new mandoc macros.
+
+ Get the new macros with the BSD Net2 release.
+
+ This macro set is also available with newer versions of groff.
+----------------------------------------------------------------------
+ * What books are available describing sendmail?
+
+ There is one book available devoted to sendmail, and
+ several books that have sendmail chapters.
+
+ Nemeth, Snyder, and Seebass, _Unix System Administration
+ Handbook_. Prentice-Hall.
+ Carl-Mitchell and Quarterman, _Practical Internetworking with
+ TCP/IP and UNIX_. Addison-Wesley.
+ Hunt, _TCP/IP Network Administration_. O'Reilly & Associates.
+ Costales, Allman, and Rickert, _Sendmail_. O'Reilly &
+ Associates.
+
+ Another book is due out "soon":
+
+ Avolio & Vixie, _Sendmail Theory and Practice_. Digital
+ Press (release date unknown).
+----------------------------------------------------------------------
+ * How do I make all my addresses appear to be from a single host?
+
+ Using the V8 configuration macros, use:
+
+ MASQUERADE_AS(my.dom.ain)
+
+ This will cause all addresses to be sent out as being from
+ the indicated domain.
+----------------------------------------------------------------------
+ * How do I rewrite my From: lines to read ``First_Last@My.Domain''?
+
+ There are a couple of ways of doing this. This describes using
+ the "user database" code. This is still experimental, and was
+ intended for a different purpose -- however, it does work
+ with a bit of care. It does require that you have the Berkeley
+ "db" package installed (it won't work with DBM).
+
+ First, create your input file. This should have lines like:
+
+ loginname:mailname First_Last
+ First_Last:maildrop loginname
+
+ Install it in (say) /etc/userdb. Create the database:
+
+ makemap btree /etc/userdb.db < /etc/userdb
+
+ You can then create a config file that uses this. You will
+ have to include the following in your .mc file:
+
+ define(confUSERDB_SPEC, /etc/userdb.db)
+ FEATURE(notsticky)
+----------------------------------------------------------------------
+ * So what was the user database feature intended for?
+
+ The intent was to have all information for a given user (where
+ the user is the unique login name, not an inherently non-unique
+ full name) in one place. This would include phone numbers,
+ addresses, and so forth. The "maildrop" feature is because
+ Berkeley does not use a centralized mail server (there are a
+ number of reasons for this that are mostly historic), and so
+ we need to know where each user gets his or her mail delivered --
+ i.e., the mail drop.
+
+ We are in the process of setting up our environment so that
+ mail sent to an unqualified "name" goes to that person's
+ preferred maildrop; mail sent to "name@host" goes to that
+ host. The purpose of "FEATURE(notsticky)" is to cause
+ "name@host" to be looked up in the user database for delivery
+ to the maildrop.
+----------------------------------------------------------------------
+ * Why are you so hostile to using full names for e-mail addresses?
+
+ Because full names are not unique. For example, the computer
+ community has two Andy Tannenbaums and two Peter Deutsches.
+ At one time, Bell Labs had two Stephen R. Bournes with offices
+ a few doors apart. You can create alternative addresses
+ (e.g., Stephen_R_Bourne_2), but that's even worse -- which
+ one of them has to have their name desecrated in this way?
+ And you can bet that they will get most of the other person's
+ email.
+
+ So called "full names" are just longer versions of unique
+ names. Rather that lulling people into a sense of security,
+ I'd rather that it be clear that these handles are arbitrary.
+ People should use good user agents that have alias mappings
+ so that they can attach arbitrary names for their personal
+ use to those with whom they correspond.
+
+ Even worse is fuzzy matching in e-mail -- this can make good
+ addresses turn bad. For example, I'm currently (to the best
+ of my knowledge) the only ``Allman'' at Berkeley, so mail
+ sent to "Allman@Berkeley.EDU" should get to me. But if
+ another Allman ever appears, this address could suddenly
+ become ambiguous. I've been the only Allman at Berkeley for
+ over fifteen years -- to suddenly have this "good address"
+ bounce mail because it is ambiguous would be a heinous wrong.
+
+ Finger services should be as fuzzy as possible. Mail services
+ should be unique.
+----------------------------------------------------------------------
+ * When I use sendmail V8 with a Sun config file I get lines like:
+
+ /etc/sendmail.cf: line 273: replacement $3 out of bounds
+
+ the line in question reads:
+
+ R$*<@$%y>$* $1<@$2.LOCAL>$3 user@ether
+
+ what does this mean? How do I fix it?
+
+ V8 doesn't recognize the Sun "$%y" syntax, so as far as it
+ is concerned, there is only a $1 and a $2 (but no $3) in this
+ line. Read Rick McCarty's paper on "Converting Standard Sun
+ Config Files to Sendmail Version 8", in the contrib directory
+ (file "converting.sun.configs") on the sendmail distribution
+ for a full discussion of how to do this.
+----------------------------------------------------------------------
+ * Should I use a wildcard MX for my domain?
+
+ If at all possible, no.
+
+ Wildcard MX records have lots of semantic "gotcha"s. For
+ example, they will match a host "unknown.your.domain" -- if
+ you don't explicitly test for unknown hosts in your domain,
+ you will get "config error: mail loops back to myself"
+ errors.
+----------------------------------------------------------------------
+ * I'm connected to the network via a SLIP link. Sometimes my sendmail
+ process hangs (although it looks like part of the message has been
+ transfered). Everything else works. What's wrong?
+
+ Most likely, the problem isn't sendmail at all, but the low
+ level network connection. It's important that the MTU (Maximum
+ Transfer Unit) for the SLIP connection be set properly at both
+ ends. If they disagree, large packets will be trashed and
+ the connection will hang.
+----------------------------------------------------------------------
+ * I just upgraded to 8.x and suddenly I'm getting messages in my
+ syslog of the form "collect: I/O error on connection". What is
+ going wrong?
+
+ Nothing. This is just a diagnosis of a condition that had
+ not been diagnosed before. If you are getting a lot of these
+ from a single host, there is probably some incompatibility
+ between 8.x and that host. If you get a lot of them in general,
+ you may have network problems that are causing connections to
+ get reset.
+----------------------------------------------------------------------
+ * How can I get sendmail to deliver local mail to $HOME/.mail
+ instead of into /usr/spool/mail (or /usr/mail)?
+
+ This is a local mailer issue, not a sendmail issue. Either
+ modify your local mailer (source code will be required) or
+ change the program called in the "local" mailer configuration
+ description to be a new program that does this local delivery.
+ I understand that "procmail" works well, although I haven't
+ used it myself.
+----------------------------------------------------------------------
+ * Under V8, the "From " header gets mysteriously munged when I send
+ to an alias.
+
+ ``It's not a bug, it's a feature.'' This happens when you have
+ a "owner-list" alias and you send to "list". V8 propogates the
+ owner information into the envelope sender field (which appears
+ as the "From " header on UNIX mail or as the Return-Path: header)
+ so that downstream errors are properly returned to the mailing
+ list owner instead of to the sender. In order to make this
+ appear as sensible as possible to end users, I recommend making
+ the owner point to a "request" address -- for example:
+
+ list: :include:/path/name/list.list
+ owner-list: list-request
+ list-request: eric
+
+ This will make message sent to "list" come out as being
+ "From list-request" instead of "From eric".
+----------------------------------------------------------------------
+ * There are four UUCP mailers listed in the configuration files.
+ Which one should I use?
+
+ The choice is partly a matter of local preferences and what is
+ running at the other end of your UUCP connection. Unlike good
+ protocols that define what will go over the wire, UUCP uses
+ the policy that you should do what is right for the other end;
+ if they change, you have to change. This makes it hard to
+ do the right thing, and discourages people from updating their
+ software. In general, if you can avoid UUCP, please do.
+
+ If you can't avoid it, you'll have to find the version that is
+ closest to what the other end accepts. Following is a summary
+ of the UUCP mailers available.
+
+ uucp-old (obsolete name: "uucp")
+ This is the oldest, the worst (but the closest to UUCP) way of
+ sending messages accros UUCP connections. It does bangify
+ everything and prepends $U (your UUCP name) to the sender's
+ address (which can already be a bang path itself). It can
+ only send to one address at a time, so it spends a lot of
+ time copying duplicates of messages. Avoid this if at all
+ possible.
+
+ uucp-new (obsolete name: "suucp")
+ The same as above, except that it assumes that in one rmail
+ command you can specify several recipients. It still has a
+ lot of other problems.
+
+ uucp-dom
+ This UUCP mailer keeps everything as domain addresses.
+ Basically, it uses the SMTP mailer rewriting rules.
+
+ Unfortunately, a lot of UUCP mailer transport agents require
+ bangified addresses in the envelope, although you can use
+ domain-based addresses in the message header. (The envelope
+ shows up as the From_ line on UNIX mail.) So....
+
+ uucp-uudom
+ This is a cross between uucp-new (for the envelope addresses)
+ and uucp-dom (for the header addresses). It bangifies the
+ envelope sender (From_ line in messages) without adding the
+ local hostname, unless there is no host name on the address
+ at all (e.g., "wolf") or the host component is a UUCP host name
+ instead of a domain name ("somehost!wolf" instead of
+ "some.dom.ain!wolf").
+
+ Examples:
+
+ We are on host grasp.insa-lyon.fr (UUCP host name "grasp"). The
+ following summarizes the sender rewriting for various mailers.
+
+ Mailer sender rewriting in the envelope
+ ------ ------ -------------------------
+ uucp-{old,new} wolf grasp!wolf
+ uucp-dom wolf wolf@grasp.insa-lyon.fr
+ uucp-uudom wolf grasp.insa-lyon.fr!wolf
+
+ uucp-{old,new} wolf@fr.net grasp!fr.net!wolf
+ uucp-dom wolf@fr.net wolf@fr.net
+ uucp-uudom wolf@fr.net fr.net!wolf
+
+ uucp-{old,new} somehost!wolf grasp!somehost!wolf
+ uucp-dom somehost!wolf somehost!wolf@grasp.insa-lyon.fr
+ uucp-uudom somehost!wolf grasp.insa-lyon.fr!somehost!wolf
+----------------------------------------------------------------------
+ * I'm trying to to get my mail to go into queue only mode, and it
+ delivers the mail interactively anyway. (Or, I'm trying to use
+ the "don't deliver to expensive mailer" flag, and it doesn't
+ delivers the mail interactively anyway.) I can see it does it:
+ here's the output of "sendmail -v foo@somehost" (or Mail -v or
+ equivalent).
+
+ The -v flag to sendmail (which is implied by the -v flag to
+ Mail and other programs in that family) tells sendmail to
+ watch the transaction. Since you have explicitly asked to
+ see what's going on, it assumes that you do not want to to
+ auto-queue, and turns that feature off. Remove the -v flag
+ and use a "tail -f" of the log instead to see what's going on.
+
+ If you are trying to use the "don't deliver to expensive mailer"
+ flag (mailer flag "e"), be sure you also turn on global option
+ "c" -- otherwise it ignores the mailer flag.
+----------------------------------------------------------------------
+ * I'm getting "Local configuration error" messages, such as:
+
+ 553 relay.domain.net config error: mail loops back to myself
+ 554 <user@domain.net>... Local configuration error
+
+ How can I solve this problem?
+
+ You have asked mail to the domain (e.g., domain.net) to be
+ forwarded to a specific host (in this case, relay.domain.net)
+ by using an MX record, but the relay machine doesn't recognize
+ itself as domain.net. Add domain.net to /etc/sendmail.cw
+ (if you are using FEATURE(use_cw_file)) or add "Cw domain.net"
+ to your configuration file.
+----------------------------------------------------------------------
+ * I want to run Sendmail version 8 on my DEC system, but you don't
+ have MAIL11V3 support in sendmail. How do I handle this?
+
+ Get Paul Vixie's reimplementation of the mail11 protocol
+ from gatekeeper.dec.com in /pub/DEC/gwtools.
+----------------------------------------------------------------------
diff --git a/usr.sbin/sendmail/KNOWNBUGS b/usr.sbin/sendmail/KNOWNBUGS
new file mode 100644
index 000000000000..f34c6b738c1d
--- /dev/null
+++ b/usr.sbin/sendmail/KNOWNBUGS
@@ -0,0 +1,131 @@
+
+
+ K N O W N B U G S I N S E N D M A I L
+ (for 8.6.7)
+
+
+The following are bugs or deficiencies in sendmail that I am aware of
+but which have not been fixed in the current release. You probably
+want to get the most up to date version of this from FTP.CS.Berkeley.EDU
+in /ucb/sendmail/KNOWNBUGS. For descriptions of bugs that have been
+fixed, see the file RELEASE_NOTES (in the root directory of the sendmail
+distribution).
+
+This list is not guaranteed to be complete.
+
+
+* Null bytes are not handled properly.
+
+ Sendmail should handle full binary data. As it stands, it handles
+ any value from 0x01-0xFF in the body and 0x01-0x80 and 0xA0-0xFF in
+ the header. Notably missing is 0x00, which would require a major
+ restructuring of the code -- for example, almost no C library support
+ could be used to handle strings.
+
+* Duplicate error messages.
+
+ Sometimes identical, duplicate error messages can be generated. As
+ near as I can tell, this is rare and relatively innocuous.
+
+* No "exposed users" in "nullrelay" configuration.
+
+ The "nullrelay" configuration hides all addresses behind the mail
+ hub name. Some sites might prefer to expose some names such as
+ root. This information is always available in Received: lines.
+
+* $c (hop count) macro improperly set.
+
+ The $c macro is supposed to contain the current hop count, for use
+ when calling a mailer. This macro is initialized too early, and
+ is always zero (or the value of the -c command line flag, if any).
+ This macro will probably be removed entirely in a future release;
+ I don't believe there are any mailers left that require it.
+
+* If you EXPN a list or user that has a program mailer, the output of
+ EXPN will include ``@local.host.name''. You can't actually mail to
+ this address. It's not clear what the right behaviour is in this
+ circumstance.
+
+* REDIRECT aliases don't work with `n' option.
+
+ If you have option `n' set when you use newaliases and have
+ REDIRECT addresses in your aliases file, you'll get the error
+ messages during the newaliases instead of when email is sent to
+ the address in question. The workaround is to turn off the `n'
+ option.
+
+* MX records that point at non-existent hosts work strangly.
+
+ Consider the DNS records:
+
+ hostH MX 1 hostA
+ MX 2 hostB
+ hostA A 128.32.8.9
+
+ (note that there is no A record for hostB). If hostA is down,
+ an attempt to send to hostH gives "host unknown" -- that is, it
+ reflects out the status on the last host it tries, which in this
+ case is hostB, which is unknown. It probably ought to eliminate
+ hostB early in processing.
+
+* NAME environment variables with commas break.
+
+ If you define your NAME environment variable to have a comma
+ (e.g., ``Lastname, Firstname''), and you are using the $q definition
+ that uses ``name <address>'' format, sendmail treats the first and
+ last names as two addresses, thus producing a bogus From line. You
+ can work around this by changing the $q definition to use
+ ``address (name)''.
+
+* \231 considered harmful.
+
+ Header addresses that have the \231 character (and possibly others
+ in the range \201 - \237) behave in odd and usually unexpected ways.
+
+* DEC Alphas (OSF/1 1.3) sometimes time out on sending mail.
+
+ I have one report that DEC Alphas acting as SMTP clients sometimes
+ will apparently not see the "250 OK" message in response to the
+ dot that indicates the end of the message. This only happens if
+ the message is run from the queue -- if it gets through on first
+ try, everything is fine. I have been unable to reproduce this
+ problem at Berkeley.
+
+* accept() problem on SVR4.
+
+ Apparently, the sendmail daemon loop (doing accept()s on the network)
+ can get into a wierd state on SVR4; it starts logging ``SYSERR:
+ getrequests: accept: Protocol Error''. The workaround is to kill
+ and restart the sendmail daemon. We don't have an SVR4 system at
+ Berkeley that carries more than token mail load, so I can't validate
+ this. It is likely to be a glitch in the sockets emulation, since
+ "Protocol Error" is not possible error code with Berkeley TCP/IP.
+
+ I've also had someone report the message ``sendmail: accept:
+ SIOCGPGRP failed errno 22'' on an SVR4 system. This message is
+ not in the sendmail source code, so I assume it is also a bug
+ in the sockets emulation. (Errno 22 is EINVAL "Invalid Argument"
+ on all the systems I have available, including Solaris 2.x.)
+
+* Sending user deletion not done properly in :include: lists.
+
+ If you don't have the "m" (me too) option set, then a person
+ sending to a list that contains themselves should not get a copy
+ of the message. However, if that list points to a :include: file
+ that has one address per line, this will break, and the sender
+ will always get a copy of their own message, just as though the
+ "m" option were set.
+
+ You can eliminate this by adding commas at the end of each line
+ of the :include: file.
+
+* Excessive mailing list nesting can run out of file descriptors.
+
+ If you have a mailing list that includes lots of other mailing
+ lists, each of which has a separate owner, you can run out of
+ file descriptors. Each mailing list with a separate owner uses
+ one open file descriptor (prior to 8.6.6 it was three open
+ file descriptors per list). This is particularly egregious if
+ you have your connection cache set to be large.
+
+(Version 8.18, last updated 3/14/94)
diff --git a/usr.sbin/sendmail/Makefile b/usr.sbin/sendmail/Makefile
index d75173b7ed20..767d48e9b585 100644
--- a/usr.sbin/sendmail/Makefile
+++ b/usr.sbin/sendmail/Makefile
@@ -1,27 +1,24 @@
-# @(#)Makefile 8.1 (Berkeley) 6/7/93
+# @(#)Makefile 8.3 (Berkeley) 2/27/94
-SUBDIR= mailstats makemap praliases
+SUBDIR= src mailstats makemap praliases
+FTPDIR= barad-dur:/disks/barad-dur/ftp/sendmail/.
VER= XX
-# don't trivially install sendmail
-.if !make(install)
-SUBDIR+=src
-.endif
-
tar: Files.base Files.cf Files.misc Files.xdoc
(cd src; ${MAKE})
(cd doc; PRINTER=ps ${MAKE})
+ (cd doc; chmod 444 op/op.ps intro/intro.ps usenix/usenix.ps)
(cd cf/cf; ${MAKE})
- pax -w -x tar -L -f sendmail.${VER}.base.tar `cat Files.base`
+ pax -w -x tar -L -f sendmail.${VER}.base.tar `grep -v ^# Files.base`
compress sendmail.${VER}.base.tar
- pax -w -x tar -L -f sendmail.${VER}.cf.tar `cat Files.cf`
+ pax -w -x tar -L -f sendmail.${VER}.cf.tar `grep -v ^# Files.cf`
compress sendmail.${VER}.cf.tar
- pax -w -x tar -L -f sendmail.${VER}.misc.tar `cat Files.misc`
+ pax -w -x tar -L -f sendmail.${VER}.misc.tar `grep -v ^# Files.misc`
compress sendmail.${VER}.misc.tar
- pax -w -x tar -L -f sendmail.${VER}.xdoc.tar `cat Files.xdoc`
+ pax -w -x tar -L -f sendmail.${VER}.xdoc.tar `grep -v ^# Files.xdoc`
compress sendmail.${VER}.xdoc.tar
ftp: sendmail.${VER}.base.tar.Z sendmail.${VER}.cf.tar.Z sendmail.${VER}.misc.tar.Z sendmail.${VER}.xdoc.tar.Z
- rcp sendmail.${VER}.*.tar.Z RELEASE_NOTES barad-dur:/disks/barad-dur/ftp/sendmail/.
+ rcp sendmail.${VER}.*.tar.Z RELEASE_NOTES FAQ KNOWNBUGS ${FTPDIR}
.include <bsd.subdir.mk>
diff --git a/usr.sbin/sendmail/READ_ME b/usr.sbin/sendmail/READ_ME
index de494f0a477a..52d398960983 100644
--- a/usr.sbin/sendmail/READ_ME
+++ b/usr.sbin/sendmail/READ_ME
@@ -1,5 +1,5 @@
/*-
- * @(#)READ_ME 8.1 (Berkeley) 6/7/93
+ * @(#)READ_ME 8.9 (Berkeley) 1/26/94
*/
SENDMAIL RELEASE 8
@@ -12,6 +12,76 @@ Report any bugs to sendmail@CS.Berkeley.EDU.
The latest version of sendmail is kept on FTP.CS.Berkeley.EDU, directory
/ucb/sendmail; check there for the latest revision.
+
++--------------+
+| MANUAL PAGES |
++--------------+
+
+The sendmail manual pages use contemporary Berkeley troff macros. If
+your system does not process these manual pages, you can pick up the
+new macros in a BSD Net/2 FTP site (e.g. on FTP.UU.NET, the files
+/systems/unix/bsd-sources/share/tmac/me/strip.sed and
+/systems/unix/bsd-sources/share/tmac/*).
+
+The strip.sed file is only used in installation.
+
+After installation, edit tmac.doc and tmac.andoc to reflect the
+installation path of the tmac files. Those files contain pointers to
+/usr/share/tmac/, and those pointers are not changed by the `make
+install` process.
+
+Rename the existing tmac.an to be tmac.an.old, and rename tmac.andoc
+to be tmac.an.
+
+tmac.an will choose between tmac.an.old, your old macros, or tmac.doc,
+which are the new macros, so that both the new man pages and the
+existing man pages will be translated properly.
+
+I'm also told that the groff distribution from MIT has a tmac.doc
+macro set that is compatible with these macros.
+
+
++-----------------------+
+| RELATED DOCUMENTATION |
++-----------------------+
+
+There are other files you should read. Rooted in this directory are:
+
+ CHANGES-R5-R8
+ Describes changes between Release 5 and Release 8 of sendmail.
+ There are some things that may behave somewhat differently.
+ For example, the rules governing when :include: files will
+ be read have been tightened up for security reasons.
+ FAQ
+ Answers to Frequently Asked Questions.
+ KNOWNBUGS
+ Known bugs in the current release. I try to keep this up
+ to date -- get the latest version from FTP.CS.Berkeley.EDU
+ in /ucb/sendmail/KNOWNBUGS.
+ RELEASE_NOTES
+ A detailed description of the changes in each version. This
+ is quite long, but informative.
+ src/READ_ME
+ Details on compiling and installing sendmail.
+ cf/README
+ Details on configuring sendmail.
+ doc/op/op.me
+ The sendmail Installation & Operations Guide. Be warned: if
+ you are running this off on SunOS or some other system with an
+ old version of -me, you need to add the following macro to the
+ macros:
+
+ .de sm
+ \s-1\\$1\\s0\\$2
+ ..
+
+ This sets a word in a smaller pointsize.
+
+
++--------------+
+| RELATED RFCS |
++--------------+
+
There are several related RFCs that you may wish to read -- they are
available via anonymous FTP to several sites, including nic.ddn.mil
(directory rfc), ftp.nisc.sri.com (rfc), nis.nsf.net (RFC),
@@ -43,15 +113,14 @@ relevant to sendmail) are:
RFC987 Mapping between RFC822 and X.400
RFC1049 Content-Type header field (extension to RFC822)
-Unfortunately, for a variety of reasons the Makefiles are for the new
-Berkeley "make" and will not work on the old, traditional make. I urge
-you to get this make from Net2 (available on many public FTP archives).
-Failing that, some directories have a "Makefile.dist" that will work on
-older versions of make (but don't have the niceties included).
+Warning to AIX users: this version of sendmail does not implement
+MB, MR, or MG DNS resource records, as defined as experiments in
+RFC883.
-Similar comments apply to the man pages -- they use the new Berkeley
--mandoc macros instead of the -man macros. You can get these from
-Net2 as well.
+
++-------------------+
+| DATABASE ROUTINES |
++-------------------+
IF YOU WANT TO RUN THE NEW BERKELEY DB SOFTWARE: **** DO NOT ****
use the version that was on the Net2 tape -- it has a number of
@@ -63,6 +132,52 @@ faster, and the interface is nicer to animals and plants. You will
also probably find that you have to add -I/where/you/put/db/include
to the sendmail makefile to get db.h to work properly.
+Be sure you remove ndbm.h and ndbm.o from the db distribution. These
+will cause problems with sendmail because sendmail already understands
+about NEWDB and NDBM coexisting.
+
+
++-------------+
+| USE WITH MH |
++-------------+
+
+This version of sendmail notices and reports certain kinds of SMTP
+protocol violations that were ignored by older versions. If you
+are running MH you may wish to install the patch in contrib/mh.patch
+that will prevent these warning reports. This patch also works
+with the old version of sendmail, so it's safe to go ahead and
+install it.
+
+
++-----------+
+| MAKEFILES |
++-----------+
+
+The Makefiles in this release use the new Berkeley "make" that is
+available in BSD Net/2 and 4.4BSD. If you are using this version
+of make, you may notice one or two places where the Makefile includes
+"../../Makefile.inc". This file is not included with the sendmail
+distribution because it's not part of sendmail. However, it is,
+in toto:
+
+ # @(#)Makefile.inc 8.1 (Berkeley) 6/6/93
+
+ BINDIR?= /usr/sbin
+
+The other directories should all have Makefile.dist files that work
+on the old make, albeit without all the niceties included.
+
+You can also get a new Berkeley make from the Net2 release (available
+on many public FTP archives). This version should also interpret old
+Makefiles, so you could drop it in as your default make.
+
+For more details, see src/READ_ME.
+
+
++---------------------+
+| DIRECTORY STRUCTURE |
++---------------------+
+
The structure of this directory tree is:
cf Source for Berkeley configuration files. These are
@@ -92,3 +207,4 @@ rmail Source for rmail(8). This is used as a delivery
other non-socket oriented mailers. Older versions of
rmail are probably deficient.
src Source for the sendmail program itself.
+test Some test scripts (currently only for compilation aids).
diff --git a/usr.sbin/sendmail/RELEASE_NOTES b/usr.sbin/sendmail/RELEASE_NOTES
index 79846b83b4dd..ff3d145e46f2 100644
--- a/usr.sbin/sendmail/RELEASE_NOTES
+++ b/usr.sbin/sendmail/RELEASE_NOTES
@@ -1,6 +1,1125 @@
+ SENDMAIL RELEASE NOTES
+ @(#)RELEASE_NOTES 8.6.7.1 (Berkeley) 3/14/94
+
+This listing shows the version of the sendmail binary, the version
+of the sendmail configuration files, the date of release, and a
+summary of the changes in that release.
+
+8.6.7/8.6.6 94/03/14
+ SECURITY: it was possible to get root access by using wierd
+ values to the -d flag. Thanks to Alain Durand of
+ INRIA for forwarding me the notice from the bugtraq
+ list.
+
+8.6.6/8.6.6 94/03/13
+ SECURITY: the ability to give files away on System V-based
+ systems proved dangerous -- don't run as the owner
+ of a :include: file on a system that allows giveaways.
+ Unfortunately, this also applies to determining a
+ valid shell.
+ IMPORTANT: Previous versions weren't expiring old connections
+ in the connection cache for a long time under some
+ circumstances. This could result in resource exhaustion,
+ both at your end and at the other end. This checks the
+ connections for timeouts much more frequently. From
+ Doug Anderson of NCSC.
+ Fix a glitch that snuck in that caused programs to be run as
+ the sender instead of the recipient if the mail was
+ from a local user to another local user. From
+ Motonori Nakamura of Kyoto University.
+ Fix "wildcard" on /etc/shell matching -- instead of looking
+ for "*", look for "/SENDMAIL/ANY/SHELL/". From
+ Bryan Costales of ICSI.
+ Change the method used to declare the "statfs" availability;
+ instead of HASSTATFS and/or HASUSTAT with a ton of
+ tweaking in conf.c, there is a single #define called
+ SFS_TYPE which takes on one of six values (SFS_NONE
+ for no statfs availability, SFS_USTAT for the ustat(2)
+ syscall, SFS_4ARGS for a four argument statfs(2) call,
+ and SFS_VFS, SFS_MOUNT, or SFS_STATFS for a two argument
+ statfs(2) call with the declarations in <sys/vfs.h>,
+ <sys/mount.h>, or <sys/statfs.h> respectively).
+ Fix glitch in NetInfo support that could return garbage if
+ there was no "/locations/sendmail" property. From
+ David Meyer of the University of Virginia.
+ Change HASFLOCK from defined/not-defined to a 0/1 definition
+ to allow Linux to turn it off even though it is a
+ BSD-like system.
+ Allow setting of "ident" timeout to zero to turn off the ident
+ protocol entirely.
+ Make 7-bit stripping local to a connection (instead of to a
+ mailer); this allows you to specify that SMTP is a
+ 7-bit channel, but revert to 8-bit should it advertise
+ that it supports 8BITMIME. You still have to specify
+ mailer flag 7 to get this stripping at all.
+ Improve makesendmail script so it handles more cases automatically.
+ Tighten up restrictions on taking ownership of :include: files
+ to avoid problems on systems that allow you to give away
+ files.
+ Fix a problem that made it impossible to rebuild the alias
+ file if it was on a read-only file system. From
+ Harry Edmon of the University of Washington.
+ Improve MX randomization function. From John Gardiner Myers
+ of CMU.
+ Fix a minor glitch causing a bogus message to be printed (used
+ %s instead of %d in a printf string for the line number)
+ when a bad queue file was read. From Harry Edmon.
+ Allow $s to remain NULL on locally generated mail. I'm not
+ sure this is necessary, but a lot of people have complained
+ about it, and there is a legitimate question as to whether
+ "localhost" is legal as an 822-style domain.
+ Fix a problem with very short line lengths (mailer L= flag) in
+ headers. This causes a leading space to be added onto
+ continuation lines (including in the body!), and also
+ tries to wrap headers containing addresses (From:, To:,
+ etc) intelligently at the shorter line lengths. Problem
+ Reported by Lars-Johan Liman of SUNET Operations Center.
+ Log the real user name when logging syserrs, since these can have
+ security implications. Suggested by several people.
+ Fix address logging of cached connections -- it used to always
+ log the numeric address as zero. This is a somewhat
+ bogus implementation in that it does an extra system
+ call, but it should be an inexpensive one. Fix from
+ Motonori Nakamura.
+ Tighten up handling of short syslog buffers even more -- there
+ were cases where the outgoing relay= name was too long
+ to share a line with delay= and mailer= logging.
+ Limit the overhead on split envelopes to one open file descriptor
+ per envelope -- previously the overhead was three
+ descriptors. This was in response to a problem reported
+ by P{r (Pell) Emanuelsson.
+ Fixes to better handle the case of unexpected connection closes;
+ this redirects the output to the transcript so the info
+ is not lost. From Eric Wassenaar.
+ Fix potential string overrun if you macro evaluate a string that
+ has a naked $ at the end. Problem noted by James Matheson
+ <jmrm@eng.cam.ac.uk>.
+ Make default error number on $#error messages 553 (``Requested
+ action not taken: mailbox name not allowed'') instead of
+ 501 (``Syntax error in parameters or arguments'') to
+ avoid bogus "protocol error" messages.
+ Strip off any existing trailing dot on names during $[ ... $]
+ lookup. This prevents it from ending up with two dots
+ on the end of dot terminated names. From Wesley Craig
+ of the University of Michigan and Bryan Costales of ICSI.
+ Clean up file class reading so that the debugging information is
+ more informative. It hadn't been using setclass, so you
+ didn't see the class items being added.
+ Avoid core dump if you are running a version of sendmail where
+ NIS is compiled in, and you specify an NIS map, but
+ NIS is not running. Fix from John Oleynick of
+ Rutgers.
+ Diagnose bizarre case where res_search returns a failure value,
+ but sets h_errno to a success value.
+ Make sure that "too many hops" messages are considered important
+ enough to send an error to the Postmaster (that is, the
+ address specified in the P option). This fix should
+ help problems that cause the df file to be left around
+ sometimes -- unfortunately, I can't seem to reproduce
+ the problem myself.
+ Avoid core dump (null pointer reference) on EXPN command; this
+ only occurred if your log level was set to 10 or higher
+ and the target account was an alias or had a .forward file.
+ Problem noted by Janne Himanka.
+ Avoid "denial of service" attacks by someone who is flooding your
+ SMTP port with bad commands by shutting the connection
+ after 25 bad commands are issued. From Kyle Jones of
+ UUNET.
+ Fix core dump on error messages with very long "to" buffers;
+ fmtmsg overflows the message buffer. Fixed by trimming
+ the to address to 203 characters. Problem reported by
+ John Oleynick.
+ Fix configuration for HASFLOCK -- there were some spots where
+ a #ifndef was incorrectly #ifdef. Pointed out by
+ George Baltz of the University of Maryland.
+ Fix a typo in savemail() that could cause the error message To:
+ lists to be incorrect in some places. From Motonori
+ Nakamura.
+ Fix a glitch that can cause duplicate error messages on split
+ envelopes where an address on one of the lists has a
+ name server failure. Fix from Voradesh Yenbut of the
+ University of Washington.
+ Fix possible bogus pointer reference on ESMTP parameters that
+ don't have an ``=value'' part.
+ CNAME loops caused an error message to be generated, but also
+ re-queued the message. Changed to just re-queue the
+ message (it's really hard to just bounce it because
+ of the wierd way the name server works in the presence
+ of CNAME loops). Problem noted by James M.R.Matheson
+ of Cambridge University.
+ Avoid giving ``warning: foo owned process doing -bs'' messages
+ if they use ``MAIL FROM:<foo>'' where foo is their true
+ user name. Suggested by Andreas Stolcke of ICSI.
+ Change the NAMED_BIND compile flag to be a 0/1 flag so you can
+ override it easily in the Makefile -- that is, you can
+ turn it off using -DNAMED_BIND=0.
+ If a gethostbyname(...) of an address with a trailing dot fails,
+ try it without the trailing dot. This is because if
+ you have a version of gethostbyname() that falls back
+ to NIS or the /etc/hosts file it will fail to find
+ perfectly reasonable names that just don't happen to
+ be dot terminated in the hosts file. You don't want to
+ strip the dot first though because we're trying to ensure
+ that country names that match one of your subdomains get
+ a chance.
+ PRALIASES: fix bogus output on non-null-terminated strings.
+ From Bill Gianopoulos of Raytheon.
+ CONFIG: Avoid rewriting anything that matches $w to be $j.
+ This was in code intended to only catch the self-literal
+ address (that is, [1.2.3.4], where 1.2.3.4 is your
+ IP address), but the code was broken. However, it will
+ still do this if $M is defined; this is necessary to
+ get client configurations to work (sigh). Note that this
+ means that $M overrides :mailname entries in the user
+ database! Problem noted by Paul Southworth.
+ CONFIG: Fix definition of Solaris help file location. From
+ Steve Cliffe <steve@gorgon.cs.uow.edu.au>.
+ CONFIG: Fix bug that broke news.group.USENET mappings.
+ CONFIG: Allow declaration of SMTP_MAILER_MAX, FAX_MAILER_MAX,
+ and USENET_MAILER_MAX to tweak the maximum message
+ size for various mailers.
+ CONFIG: Change definition of USENET_MAILER_ARGS to include argv[0]
+ instead of assuming that it is "inews" for consistency
+ with other mailers. From Michael Corrigan of UC San Diego.
+ CONFIG: When mail is forwarded to a LOCAL_RELAY or a MAIL_HUB,
+ qualify the address in the SMTP envelope as user@{relay|hub}
+ instead of user@$j. From Bill Wisner of The Well.
+ CONFIG: Fix route-addr syntax in nullrelay configuration set.
+ CONFIG: Don't turn off case mapping of user names in the local
+ mailer for IRIX. This was different than most every other
+ system.
+ CONFIG: Avoid infinite loops on certainly list:; syntaxes in
+ envelope. Noted by Thierry Besancon
+ <besancon@excalibur.ens.fr>.
+ CONFIG: Don't include -z by default on uux line -- most systems
+ don't want it set by default. Pointed out by Philippe
+ Michel of Thomson CSF.
+ CONFIG: Fix some bugs with mailertables -- for example, if your
+ host name was foo.bar.ray.com and you matched against
+ ".ray.com", the old implementation bound %1 to "bar"
+ instead of "foo.bar". Also, allow "." in the mailertable
+ to match anything -- essentially, take over SMART_HOST.
+ This also moves matching of explicit local host names
+ before the mailertable so they don't have to be special
+ cased in the mailertable data. Reported by Bill
+ Gianopoulos of Raytheon; the fix for the %1 binding
+ problem was contributed by Nicholas Comanos of the
+ University of Sydney.
+ CONFIG: Don't include "root" in class $=L (users to deliver
+ locally, even if a hub or relay exists) by default.
+ This is because of the known bug where definition of
+ both a LOCAL_RELAY and a MAIL_HUB causes $=L to ignore
+ both and deliver into the local mailbox.
+ CONFIG: Move up bitdomain and uudomain handling so that they
+ are done before .UUCP class matching; uudomain was
+ reported as ineffective before. This also frees up
+ diversion 8 for future use. Problem reported by Kimmo
+ Suominen.
+ CONFIG: Don't try to convert dotted IP address (e.g., [1.2.3.4])
+ into host names. As pointed out by Jonathan Kamens,
+ these are often used because either the forward or reverse
+ mapping is broken; this translation makes it broken again.
+ DOC: Clarify $@ and $: in the Install & Op Guide. From Kimmo
+ Suominen.
+ Portability fixes:
+ Unicos from David L. Kensiski of Sterling Sofware.
+ DomainOS from Don Lewis of Silicon Systems.
+ GNU m4 1.0.3 from Karst Koymans of Utrecht University.
+ Convex from Kimmo Suominen <kim@tac.nyc.ny.us>.
+ NetBSD from Adam Glass <glass@sun-lamp.cs.berkeley.edu>.
+ BSD/386 from Tony Sanders of BSDI.
+ Apollo from Eric Wassenaar.
+ DGUX from Doug Anderson.
+ Sequent DYNIX/ptx 2.0 from Tim Wright of Sequent.
+ NEW FILES:
+ src/Makefile.DomainOS
+ src/Makefile.PTX
+ src/Makefile.SunOS.5.1
+ src/Makefile.SunOS.5.2
+ src/Makefile.SunOS.5.x
+ src/mailq.1
+ cf/ostype/domainos.m4
+ doc/op/Makefile
+ doc/intro/Makefile
+ doc/usenix/Makefile
+
+8.6.5/8.6.5 94/01/13
+ Security fix: /.forward could be owned by anyone (the test
+ to allow root to own any file was backwards). From
+ Bob Campbell at U.C. Berkeley.
+ Security fix: group ids were not completely set when programs
+ were invoked. This caused programs to have group
+ permissions they should not have had (usually group
+ daemon instead of their own group). In particular,
+ Perl scripts would refuse to run.
+ Security: check to make sure files that are written are not
+ symbolic links (at least under some circumstances).
+ Although this does not respond to a specific known
+ attack, it's just a good idea. Suggested by
+ Christian Wettergren.
+ Security fix: if a user had an NFS mounted home directory on
+ a system with a restricted shell listed in their
+ /etc/passwd entry, they could still execute any
+ program by putting that in their .forward file.
+ This fix prevents that by insisting that their shell
+ appear in /etc/shells before allowing a .forward to
+ execute a program or write a file. You can disable
+ this by putting "*" in /etc/shells. It also won't
+ permit world-writable :include: files to reference
+ programs or files (there's no way to disable this).
+ These behaviours are only one level deep -- for
+ example, it is legal for a world-writable :include:
+ file to reference an alias that writes a file, on
+ the assumption that the alias file is well controlled.
+ Security fix: root was not treated suspiciously enough when
+ looking into subdirectories. This would potentially
+ allow a cracker to examine files that were publically
+ readable but in a non-publically searchable directory.
+ Fix a problem that causes an error on QUIT on a cached
+ connection to create problems on the current job.
+ These are typically unrelated, so errors occur in
+ the wrong place.
+ Reset CurrentLA in sendall() -- this makes sendmail queue
+ runs more responsive to load average, and fixes a
+ problem that ignored the load average in locally
+ generated mail. From Eric Wassenaar.
+ Fix possible core dump on aliases with null LHS. From
+ John Orthoefer of BB&N.
+ Revert to using flock() whenever possible -- there are just
+ too many bugs in fcntl() locking, particularly over
+ NFS, that cause sendmail to fail in perverse ways.
+ Fix a bug that causes the connection cache to get confused
+ when sending error messages. This resulted in
+ "unexpected close" messages. It should fix itself
+ on the following queue run. Problem noted by
+ Liudvikas Bukys of Rochester University.
+ Include $k in $=k as documented in the Install & Op Guide.
+ This seems odd, but it was documented.... From
+ Michael Corrigan of UCSD.
+ Fix problem that caused :include:s from alias files to be
+ forced to be owned by root instead of daemon
+ (actually DefUid). From Tim Irvin.
+ Diagnose unrecognized I option values -- from Mortin Forssen
+ of the Chalmers University of Technology.
+ Make "error" mailer work consistently when there is no error
+ code associated with it -- previously it returned OK
+ even though there was a real problem. Now it assumes
+ EX_UNAVAILABLE.
+ Fix bug that caused the last header line of messages that had
+ no body and which were terminated with EOF instead of
+ "." to be discarded. Problem noted by Liudvikas Bukys.
+ Fix core dump on SMTP mail to programs that failed -- it tried
+ to go to a "next MX host" when none existed, causing
+ a core dump. From der Mouse at McGill University.
+ Change IDENTPROTO from a defined/not defined to a 0/1 switch;
+ this makes it easier to turn it off (using
+ -DIDENTPROTO=0 in the Makefile). From der Mouse.
+ Fix YP_MASTER_NAME store to use the unupdated result of
+ gethostname() (instead of myhostname(), which tries
+ to fully qualify the name) to be consistent with
+ SunOS. If your hostname is unqualified, this fixes
+ transfers to slave servers. Bug noted by Keith
+ McMillan of Ameritech Services, Inc.
+ Fix Ultrix problem: gethostbyname() can return a very large
+ (> 500) h_length field, which causes the sockaddr
+ to be trashed. Use the size of the sockaddr instead.
+ Fix from Bob Manson of Ohio State.
+ Don't assume "-a." on host lookups if NAMED_BIND is not
+ defined -- this confuses gethostbyname on hosts
+ file lookups, which doesn't understand the trailing
+ dot convention.
+ Log SMTP server subprocesses that die with a signal instead
+ of from a clean exit.
+ If you don't have option "I" set, don't assume that a DNS
+ "host unknown" message is authoritative -- it
+ might still be found in /etc/hosts.
+ Fix a problem that would cause Deferred: messages to be sent
+ as the subject of an error message, even though the
+ actual cause of a message was more severe than that.
+ Problem noted by Chris Seabrook of OSSI.
+ Fix race condition in DBM alias file locking. From Kyle
+ Jones of UUNET.
+ Limit delivery syslog line length to avoid bugs in some
+ versions of syslog(3). This adds a new compile time
+ variable SYSLOG_BUFSIZE. From Jay Plett of Princeton
+ University, which is in turn derived from IDA.
+ Fix quotes inside of comments in addresses -- previously
+ it insisted that they be balanced, but the 822 spec
+ says that they should be ignored.
+ Dump open file state to syslog upon receiving SIGUSR1 (for
+ debugging). This also evaluates ruleset 89, if set
+ (with the null input), and logs the result. This
+ should be used sparingly, since the rewrite process
+ is not reentrant.
+ Change -qI, -qR, and -qS flags to be case-insensitive as
+ documented in the Bat Book.
+ If the mailer returned EX_IOERR or EX_OSERR, sendmail did not
+ return an error message and did not requeue the message.
+ Fix based on code from Roland Dirlewanger of
+ Reseau Regional Aquarel, Bordeaux, France.
+ Fix a problem that caused a seg fault if you got a 421 error
+ code during some parts of connection initialization.
+ I've only seen this when talking to buggy mailers on
+ the other end, but it shouldn't give a seg fault in
+ any case. From Amir Plivatsky.
+ Fix core dump caused by a ruleset call that returns null.
+ Fix from Bryan Costales of ICSI.
+ Full-Name: field was being ignored. Fix from Motonori Nakamura
+ of Kyoto University.
+ Fix a possible problem with very long input lines in setproctitle.
+ From P{r Emanuelsson.
+ Avoid putting "This is a warning message" out on return receipts.
+ Suggested by Douglas Anderson.
+ Detect loops caused by recursive ruleset calls. Suggested by
+ Bryan Costales.
+ Initialize non-alias maps during alias rebuilds -- they may be
+ needed for parsing. Problem noted by Douglas Anderson.
+ Log sender address even if no message was collected in SMTP
+ (e.g., if all RCPTs failed). Suggested by Motonori
+ Nakamura.
+ Don't reflect the owner-list contents into the envelope sender
+ address if the value contains ", :, /, or | (to avoid
+ illegal addresses appearing there).
+ Efficiency hack for toktype macro -- from Craig Partridge of
+ BB&N.
+ Clean up DNS error printing so that a host name is always
+ included.
+ Remember to set $i during queue runs. Reported by Stephen
+ Campbell of Dartmouth University.
+ If ${HOSTALIASES} is set, use it during canonification so that
+ headers are properly mapped. Reported by Anne Bennett
+ of Concordia University.
+ Avoid printing misleading error message if SMTP mailer (not
+ using [IPC]) should die on a core dump.
+ Avoid incorrect diagnosis of "file 1 closed" when it is caused
+ by the other end closing the connection. From
+ Dave Morrison of Oracle.
+ Improve several of the error messages printed by "mailq"
+ to include a host name or other useful information.
+ Add NetInfo preliminary support for NeXT systems. From Vince
+ DeMarco.
+ Fix a glitch that sometimes caused :include:s that pointed to
+ NFS filesystems that were down to give an "aliasing/
+ forwarding loop broken" message instead of queueing
+ the message for retry. Noted by William C Fenner of
+ the NRL Connection Machine Facility.
+ Fix a problem that could cause a core dump if the input sequence
+ had (or somehow acquired) a \231 character.
+ Make sure that route-addrs always have <angle brackets> around
+ them in non-SMTP envelopes (SMTP envelopes already do
+ this properly).
+ Avoid wierd headers on unbalanced punctuation of the form:
+ ``Joe User <user)'' -- this caused reference to the
+ null macro. Fix from Rick McCarty of IO.COM.
+ Fix a problem that caused an alias "user: user@local.host" to
+ not have the QNOTREMOTE bit set; this caused configs
+ to act as if FEATURE(notsticky) was defined even when
+ it was not. The effect of the problem was to make it
+ very hard to to set up satellite sites that had a few
+ local accounts, with everything else forwarded to a
+ corporate hub. Reported by Detlef Drewanz of the
+ University of Rostock and Mark Frost of NCD.
+ Change queuing to not call rulesets 3, {1 or 2}, 4 on header
+ addresses. This is more efficient (fewer name server
+ calls) and fixes certain unusual configurations, such
+ as those that have ruleset 4 do something that is
+ non-idempotent unless a mailer-specific ruleset did
+ something else. Problem reported by Brian J. Coan
+ of the Institute for Global Communications.
+ Fix the "obsolete argument" routine in main to better understand
+ new arguments. For example, if you used ``sendmail
+ -C config -v -q'' it would choke on the -q because
+ the -C would stop looking for old-format arguments.
+ Fix the code that was intended to allow two users to forward their
+ mail to the same program and have them appear unique.
+ Portability fixes for:
+ SCO UNIX from Murray Kucherawy.
+ SCO Open Server 3.2v4 from Philippe Brand.
+ System V Release 4 from Rick Ellis and others.
+ OSF/1 from Steve Campbell.
+ DG/UX from Ben Mesander of the USGS and Bryan Curnutt
+ of Stoner Associates.
+ Motorola SysV88 from Kevin Johnson of Motorola.
+ Solaris 2.3 from Casper H.S. Dik of the University
+ of Amsterdam and John Caruso of University
+ of Maryland.
+ FreeBSD from Ollivier Robert.
+ NetBSD from Adam Glass.
+ TitanOS from Kate Hedstrom of Rutgers University.
+ Irix from Bryan Curnutt.
+ Dynix from Jim Davis of the University of Arizona.
+ RISC/os.
+ Linux from John Kennedy of California State University
+ at Chico.
+ Solaris 2.x from Tony Boner of the U.S. Air Force.
+ NEXTSTEP 3.x from Vince DeMarco.
+ HP-UX from various people. NOTA BENE: the location
+ of the config file has moved to /usr/lib
+ to match the HP-UX version of sendmail.
+ CONFIG: Don't do any recipient rewriting on relay mailer;
+ since this is intended only for internal use, the
+ usual RFC 821/822/1123 rules can be relaxed. The
+ main point of this is to avoid munging (ugh) UUCP
+ addresses when relaying internally.
+ CONFIG: fix typo in mailer/uucp.m4 that mutilates list:;
+ syntax addresses delivered via UUCP. Solution
+ provided by Peter Wemm.
+ CONFIG: fix thumb-fumble in default UUCP relaying in ruleset
+ zero; it caused double @ signs in addresses. From
+ Irving Reid of the University of Toronto.
+ CONFIG: Portability fixes for SCO Unix 3.2 with TCP/IP 1.2.1
+ from Markku Toijala of ICL Personal Systems Oy.
+ CONFIG: Add trailing "." on pseudo-domains for consistency;
+ this fixes a problem (noted by Al Whaley of Sunnyside)
+ that made it hard to recognize your own pseudodomain
+ names.
+ CONFIG: catch "@host" syntax errors (i.e., null local-parts)
+ rather than letting them get "local configuration
+ error"s. Problem noted by John Gardiner Myers.
+ CONFIG: add uucp-uudom mailer variant, based on code posted
+ by Spider Boardman <spider@Orb.Nashua.NH.US>; this
+ has uucp-dom semantics but old UUCP syntax. This
+ also permits "uucp-old" as an alias for "uucp" and
+ "uucp-new" as a synonym for "suucp" for consistency.
+ CONFIG: add POP mailer support (from Kimmo Suominen
+ <kim@grendel.lut.fi>).
+ CONFIG: drop CSNET_RELAY support -- CSNET is long gone.
+ CONFIG: fix bug caused with domain literal addresses (e.g.,
+ ``[128.32.131.12]'') when FEATURE(allmasquerade)
+ was set; it would get an additional @masquerade.host
+ added to the address. Problem noted by Peter Wan
+ of Georgia Tech.
+ CONFIG: make sure that the local UUCP name is in $=w. From
+ Jim Murray of Stratus.
+ CONFIG: changes to UUCP rewriting to simulate IDA-style "V"
+ mailer flag. Briefly, if you are sending to host
+ "foo", then it rewrites "foo!...!baz" to "...!baz",
+ "foo!baz" remains "foo!baz", and anything else has
+ the local name prepended.
+ CONFIG: portability fixes for HP-UX.
+ DOC: several minor problems fixed in the Install & Op Guide.
+ MAKEMAP: fix core dump problem on lines that are too long or
+ which lack newline. From Mark Delany.
+ MAILSTATS: print sums of columns (total messages & kbytes
+ in and out of the system). From Tom Ferrin of UC
+ San Francisco Computer Graphics Lab.
+ SIGNIFICANT USER- OR SYSAD-VISIBLE CHANGES:
+ On HP-UX, /etc/sendmail.cf has been moved to
+ /usr/lib/sendmail.cf to match HP sendmail.
+ Permissions have been tightened up on world-writable
+ :include: files and accounts that have shells
+ that are not listed in /etc/shells. This may
+ cause some .forward files that have worked
+ before to start failing.
+ SIGUSR1 dumps some state to the log.
+ NEW FILES:
+ src/Makefile.DGUX
+ src/Makefile.Dynix
+ src/Makefile.FreeBSD
+ src/Makefile.Mach386
+ src/Makefile.NetBSD
+ src/Makefile.RISCos
+ src/Makefile.SCO
+ src/Makefile.SVR4
+ src/Makefile.Titan
+ cf/mailer/pop.m4
+ cf/ostype/bsdi1.0.m4
+ cf/ostype/dgux.m4
+ cf/ostype/dynix3.2.m4
+ cf/ostype/sco3.2.m4
+ makemap/Makefile.dist
+ praliases/Makefile.dist
+
+8.6.4/8.6.4 93/10/31
+ Repair core-dump problem (write to read-only memory segment)
+ if you fall back to the return-to-Postmaster case in
+ savemail. Problem reported by Richard Liu.
+ Immediately diagnose bogus sender addresses in SMTP. This
+ makes quite certain that crackers can't use this
+ class of attack.
+ Reliability Fix: check return value from fclose() and fsync()
+ in a few critical places.
+ Minor problem in initsys() that reversed a condition for
+ redirecting the output channel on queue runs. It's
+ not clear this code even does anything. From Eric
+ Wassenaar of the Dutch National Institute for Nuclear
+ and High-Energy Physics.
+ Fix some problems that caused queue runs to do "too much work",
+ such as double-reading the Errors-To: header. From
+ Eric Wassenaar.
+ Error messages on writing the temporary file (including the
+ data file) were getting suppressed in SMTP -- this
+ fix causes them to be properly reported. From Eric
+ Wassenaar.
+ Some changes to support AF_UNIX sockets -- this will only
+ really become relevant in the next release, but some
+ people need it for local patches. From Michael
+ Corrigan of UC San Diego.
+ Use dynamically allocated memory (instead of static buffers)
+ for macros defined in initsys() and settime(); since
+ these can have different values depending on which
+ envelope they are in. From Eric Wassenaar.
+ Improve logging to show ctladdr on to= logging; this tells you
+ what uid/gid processes ran as.
+ Fix a problem that caused error messages to be discarded if
+ the sender address was unparseable for some reason;
+ this was supposed to fall back to the "return to
+ postmaster" case.
+ Improve aliaswait backoff algorithm.
+ Portability patches for Linux (8.6.3 required another header
+ file) (from Karl London) and SCO UNIX.
+ CONFIG: patch prog mailer to not strip host name off of envelope
+ addresses (so that it matches local again). From
+ Christopher Davis.
+ CONFIG: change uucp-dom mailer so that "<>" translates to $n;
+ this prevents uux from seeing lines with null names like
+ ``From Sat Oct 30 14:55:31 1993''. From Motonori
+ Nakamura of Kyoto University.
+ CONFIG: handle <list:;> syntax correctly. This isn't legal, but
+ it shouldn't fail miserably. From Motonori Nakamura.
+
+8.6.3/8.6.3 93/10/24
+ IMPORTANT FIX: Fix several problems that caused open files to
+ be "lost" during queue runs; this overflowed the open
+ file table on large runs. An assumption that fdopen
+ always succeeds sometimes resulted in core dumps when
+ this happens; sometimes the message is delivered twice,
+ sometimes (probably) infinite times. This problem in
+ various form was reported by P{r (Pell) Emanuelsson and
+ Robert Campbell of U.C. Berkeley.
+ Special diagnosis of EMFILE error conditions -- it now prints
+ the known open file descriptors so you can figure out
+ what is consuming so much resources.
+ Fix a couple of problems caused by early address parsing
+ errors -- one caused it to return a "this is only a
+ warning" when it really wasn't, and the other started
+ parsing through a random pointer. The first was
+ noted by Eric Wassenaar.
+ Fix an infinite loop problem caused by null components in the
+ host signature. Problem noted by Jan Sorensen.
+ Be sure to reset the "current date" when sending an error
+ message -- PostMasterCopy messages were being sent
+ with an old Date: header.
+ Fix a problem that caused duplicated mail when sendmail was
+ (1) compiled without HASFLOCK, (2) you are sending to
+ an alias that has an owner-* alias, (3) you execute
+ sendmail with -t flag, (4) you run in -odb mode, and
+ (5) the sender specifies both the alias name and
+ another alias [i.e., the envelope is split], then
+ duplicate messages are sent. The problem description
+ and one-line fix are from Motonori Nakamura of Kyoto
+ University.
+ Avoid a problem that causes error messages to be discarded
+ in some cases -- this was the result of a "fix" to
+ avoid duplicate error messages, but two are better
+ than zero. Reported by Tim Rylance.
+ Fix a minor botch in checkfd012() -- fix from Dave Hill of
+ Computervision R&D Ltd.
+ Remove "X-Authentication-Warning: <user> set sender to <address>
+ using -f" entirely -- it is far too eager to include
+ this, and it is confusing folks. I'll try to make it
+ work "right" in 8.7. Problem noted by Yoshitaka
+ Tokugawa of dit Co., Ltd.
+ Fix a race condition with the errno value in tick() and
+ reapchild() -- this caused occasional misdiagnosis
+ of problems. Kyle Jones of UUNET helped this along.
+ Repair rule loop-detection code. From Michael Corrigan of
+ U.C. San Diego.
+ Fix a problem that caused sender domain addition (C mailer
+ flag to be ignored if you use -odq or use -odb with
+ a high load average. Problem reported by Jim Murray
+ of Stratus.
+ Fix ident protocol on multi-homed machines. It was not
+ always using the correct interface. Fix from J.R.
+ Oldroyd of Opal.
+ Previously, sendmail assumed that any SMTP greeting message
+ that wasn't 2xx was a temporary failure -- it should
+ only take 4xx as a temporary failure, and return a
+ solid error message on anything else -- for example,
+ to allow you to reject connections on a workstation
+ that is MXed to a mail server.
+ Portability enhancements for 386BSD/FreeBSD/NetBSD from
+ Ollivier Robert.
+ CONFIG: FEATURE(always_add_domain) didn't always add the domain;
+ in particular, on local mail it modified the header sender
+ but not the header recipient address(es). Reported by
+ Jeffrey Honig of Cornell University. Also, strip
+ any host from envelope recipient address(es), since
+ local mailers don't understand host names -- this is
+ to help mailertable entries. From Christopher Davis.
+ CONFIG: masquerading didn't apply to addresses that already
+ had a domain. This change replaces a local hostname
+ by the masquerade name in the SMTP mailer (previously
+ it only added the masquerade name if it didn't already
+ have a domain name). Several people complained about
+ this.
+
+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
+ causing an error during parsing, that message was never
+ propogated to the queue file.
+
+8.6/8.6 93/10/05
+ Configuration cleanup: make it easier to undo IDENTPROTO in
+ conf.h (other systems have the same bug).
+ If HASGETDTABLESIZE and _SC_OPEN_MAX are both defined, assume
+ getdtablesize() instead of sysconf(); a disturbingly
+ large number of systems defined _SC_OPEN_MAX in the
+ header files but don't have the syscall.
+ Another patch to really truly ignore MX records in getcanonname
+ if trymx == FALSE.
+ Fix problem that caused the "250 IAA25499 Message accepted for
+ delivery" message to be omitted if there was an error
+ in the header of the message (e.g., a bad Errors-To:
+ line). Pointed out by Michael Corrigan of UCSD.
+ Announce name of host we are chatting when we get errors; this
+ is an IDA-ism suggested by Christophe Wolfhugel.
+ Portability fixes for Alpha OSF/1 (from Anthony Baxter of the
+ Australian Artificial Intelligence Institute), SCO Unix
+ (from Murray Kucherawy of Hookup Communication Corp.),
+ NeXT (from Vince DeMarco and myself), Linux (from
+ Karl London <karl@borg.demon.co.uk>), BSDI (from
+ Christophe Wolfhugel, and SVR4 on Dell (from Kimmo
+ Suominen), AUX 3.0 on Macintosh, and ANSI C compilers.
+ Some changes to get around gcc optimizer bugs. From Takahiro
+ Kanbe.
+ Fix error recovery in queueup if another tf file of the same
+ name already exists. Problem stumbled over by Bill
+ Wisner of The Well.
+ Output YP_MASTER_NAME and YP_LAST_MODIFIED without null bytes.
+ Problem noted by Keith McMillan of Ameritech Services.
+ Deal with group permissions properly when opening .forward and
+ :include: files. This relaxes the 8.1C restrictions
+ slightly more. This includes proper setting of groups
+ when reading :include: files, allowing you to read some
+ files that you should be able to read but have previously
+ been denied unless you owned them or they had "other"
+ read permission.
+ Make certain that $j is in $=w (after the .cf is read) so that
+ if the user is forced to override some silly system,
+ MX suppression will still work.
+ Fix a couple of efficiency problems where newstr was double-
+ calling expensive routines. In at least one case, it
+ wasn't guaranteed that they would always return the
+ same result. Problem noted by Christophe Wolfhugel.
+ Fix null pointer dereference in putoutmsg -- only on an error
+ condition from a non-SMTP mailer. From Motonori
+ Nakamura.
+ Macro expand "C" line class definitions before scanning so that
+ "CX $Z" works.
+ Fix problem that caused error message to be sent while still
+ trying to send the original message if the connection
+ is closed during a DATA command after getting an error
+ on an RCPT command (pretty obscure). Problem reported
+ by John Myers of CMU.
+ Fix reply to NOOP to be 250 instead of 200 -- this is a long
+ term bug.
+ Fix a nasty bug causing core dumps when returning the "warning:
+ cannot deliver for N hours -- will keep trying" message;
+ it only occurred if you had PostMasterCopy set and
+ only on some architectures. Although sendmail would
+ keep trying, it would send error messages on each
+ queue interval. This is an important fix.
+ Allow u and g options to take user and group names respectively.
+ Don't do a chdir into the queue directory in -bt mode to make
+ ruleset testing a bit easier.
+ Don't allow users to turn off logging (using -oL) on the command
+ line -- command line can only raise, not lower, logging
+ level.
+ Set $u to the original recipient on the SMTP transaction or on
+ the command line. This is only done if there is exactly
+ one recipient. Technically, this does not meet the
+ specs, because it does not guarantee a domain on the
+ address.
+ Fix a problem that dumped error messages on bad addresses if
+ you used the -t flag. Problem noted by Josh Smith of
+ Harvey Mudd College.
+ Given an address such as ``<foo> <bar>'', auto-quote the first
+ ``<foo>'' part, giving ``"<foo>" <bar>''. This is to
+ avoid the problem of people who use angle brackets in
+ their full name information.
+ Fix a null pointer dereference if you set option "l", have
+ an Errors-To: header in the message, and have Errors-To:
+ defined in the config file H lines. From J.R. Oldroyd.
+ Put YPCOMPAT on #ifdef NIS instead -- it's one less thing to get
+ wrong when compiling. Suggested by Rick McCarty of TI.
+ Fix a problem that could pass negative SIZE parameter if the
+ df file got lost; this would cause servers to always
+ give a temporary failure, making the problem even worse.
+ Problem noted by Allan Johannesen of WPI.
+ Add "ident" timeout (one of the "r" option selectors) for IDENT
+ protocol timeouts (30s default). Requested by Murray
+ Kucherawy of HookUp Communication Corp. to handle bogus
+ PC TCP/IP implementations.
+ Change $w default definition to be just the first component of
+ the domain name on config level 5. The $j macro defaults
+ to the FQDN; $m remains as before. This lets well-behaved
+ config files use any of the short, long, or subdomain
+ names.
+ Add makesendmail script in src to try to automate multi-architecture
+ builds. I know, this is sub-optimal, but it is still
+ helpful.
+ Fix very obscure race condition that can cause a queue run to
+ get a queue file for an already completed job. This
+ problem has existed for years. Problem noted by the
+ long suffering Allan Johannesen of WPI.
+ Fix a problem that caused the raw sender name to be passed to
+ udbsender instead of the canonified name -- this caused
+ it to sometimes miss records that it should have found.
+ Relax check of name on HELO packet so that a program using -bs
+ that claims to be itself works properly.
+ Restore rewriting of $: part of address through 2, R, 4 in
+ buildaddr -- this requires passing a lot of flags to get
+ it right. Unlike old versions, this ONLY rewrites
+ recipient addresses, not sender addresses.
+ Fix a bug that caused core dumps in config files that cannot
+ resolve /file/name style addresses. Fix from Jonathan
+ Kamens of OpenVision Technologies.
+ Fix problem with fcntl locking that can cause error returns to
+ be lost if the lock is lost; this required fully
+ queueing everything, dropping the envelope (so errors
+ would get returned), and then re-reading the queue from
+ scratch.
+ Fix a problem that caused aliases that redefine an otherwise
+ true address to still send to the original address
+ if and only if the alias failed in certain bizarre
+ ways (e.g, if they pointed at a list:; syntax address).
+ Problem pointed out by Jonathan Kamens.
+ Remove support for frozen configuration files. They caused
+ more trouble than it was worth.
+ Fix problem that can cause error messages to get ignored when
+ using both -odb and -t flags. Problem noted by Rob
+ McNicholas at U.C. Berkeley.
+ Include all "normal" variations on hostname in $=w. For example,
+ if the host name is vangogh.cs.berkeley.edu, $=w will
+ contain vangogh, vangogh.cs, and vangogh.cs.berkeley.edu.
+ Add "restrictqrun" privacy flag -- without this, anyone can run
+ the queue.
+ Reset SmtpPhase global on initial connection creation so that
+ messages don't come out with stale information.
+ Pass an "ext" argument to lockfile so that error/log messages
+ will properly reflect the true filename being locked.
+ Put all [...] address forms into $=w -- this eliminates the need
+ for MAXIPADDR in conf.h. Suggested by John Gardiner
+ Myers of CMU.
+ Fix a bug that can cause qf files to be left around even after
+ an SMTP RSET command. Problem and fix from Michael
+ Corrigan.
+ Don't send a PostMasterCopy to errors when the Precedence: is
+ negative. Error reports still go to the envelope
+ sender address.
+ Add LA_SHORT for load averages.
+ Lock sendmail.st file when posting statistics.
+ Add "SendBufSize" and "RcvBufSize" suboptions to "O" option to
+ set the size of the TCP send and receive buffers; if you
+ run over a slow slip line you may need to set these down
+ (although it would be better to fix the SLIP implementation
+ so that it's not necessary to recompile every program
+ that does bulk data transfer).
+ Allow null defaults on $( ... $) lookups. Problem reported by
+ Amir Plivatsky.
+ Diagnose crufty S and V config lines. This resulted from an
+ observation that some people were using the SITE macro
+ without the SITECONFIG macro first, which was causing
+ bogus config files that were not caught.
+ Fix makemap -f flag to turn off case folding (it was turning it
+ on instead). THIS IS A USER VISIBLE CHANGE!!!
+ Fix a problem that caused multiple error messages to be sent if
+ you used "sendmail -t -oem -odb", your system uses fcntl
+ locking, and one of the recipient addresses is unknown.
+ Reset uid earlier in include() so that recursive .forwards or
+ :include:s don't use the wrong uid.
+ If file descriptor 0, 1, or 2 was closed when sendmail was
+ called, the code to recover the descriptor was broken.
+ This sometimes (only sometimes) caused problems with the
+ alias file. Fix from Motonori Nakamura.
+ Fix a problem that caused aliaswait to go into infinite recursion
+ if the @:@ metasymbol wasn't found in the alias file.
+ Improve error message on newaliases if database files cannot be
+ opened or if running with no database format defined.
+ Do a better estimation of the size of error messages when NoReturn
+ is set. Problem noted by P{r (Pell) Emanuelsson.
+ Fix a problem causing the "c" option (don't connect to expensive
+ mailers) to be ignored in SMTP. Problem noted and the
+ solution suggested by Robert Elz of Munnari University.
+ Improve connection caching algorithm by passing "[host]" to
+ hostsignature, which strips the square brackets and
+ returns the real name. This allows mailertable entries
+ to match regular entries.
+ Re-enable Return-Receipt-To: -- people seem to want this stupid
+ feature, even if it doesn't work right.
+ Catch and log attempts to try the "wiz" command in server SMTP.
+ This also ups the log level from LOG_NOTICE to LOG_CRIT.
+ Be more generous at assigning $z to the home directory -- do this
+ for programs that are specified through a .forward file.
+ Fix from Andrew Chang of Sun Microsystems.
+ Always save a fatal error message in preference to a non-fatal
+ error message so that the "subject" line of return
+ messages is the best possible.
+ CONFIG: reduce the number of quotes needed to quote configuration
+ parameters with commas: two quotes should work now, e.g.,
+ define(ALIAS_FILE, ``/etc/aliases,/etc/aliases.local'').
+ CONFIG: class $=Z is a set of UUCP hosts that use uucp-dom
+ connections (domain-ized UUCP).
+ CONFIG: fix bug in default maps (-o must be before database file
+ name). Pointed out by Christophe Wolfhugel.
+ CONFIG: add FEATURE(nodns) to state that we are not relying on
+ DNS. This would presumably be used in UUCP islands.
+ CONFIG: add OSTYPE(nextstep) and OSTYPE(linux).
+ CONFIG: log $u in Received: line. This is in technical violation
+ of the standards, since it doesn't guarantee a domain
+ on the address.
+ CONFIG: don't assume "m" in local mailer flags -- this means that
+ if you redefine LOCAL_MAILER_FLAGS you will have to include
+ the "m" flag should you want it. Apparently some Solaris 2.2
+ installations can't handle multiple local recipients.
+ Problem noted by Josh Smith.
+ CONFIG: add confDOMAIN_NAME to set $j (if undefined, $j defaults).
+ CONFIG: change default version level from 4 to 5.
+ CONFIG: add FEATURE(nullclient) to create a config file that
+ forwards all mail to a hub without ever looking at the
+ addresses in any detail.
+ CONFIG: properly strip mailer: information off of relays when
+ used to change .BITNET form into %-hack form.
+ CONFIG: fix a problem that caused infinite loops if presented
+ with an address such as "!foo".
+ CONFIG: check for self literal (e.g., [128.32.131.12]) even if
+ the reverse "PTR" mapping is broken. There's a better
+ way to do this, but the change is fairly major and I
+ want to hold it for another release. Problem noted by
+ Bret Marquis.
+
+8.5/8.5 93/07/23
+ Serious bug: if you used a command line recipient that was unknown
+ sendmail would not send a return message (it was treating
+ everything as though it had an SMTP-style client that
+ would do the return itself). Problem noted by Josh Smith.
+ Change "trymx" option in getcanonname() to ignore all MX data,
+ even during a T_ANY query. This actually didn't break
+ anything, because the only time you called getcanonname
+ with !trymx was if you already knew there were no MX
+ records, but it is somewhat cleaner. From Motonori
+ Nakamura.
+ Don't call getcanonname from getmxrr if you already know there
+ are no DNS records matching the name.
+ Fix a problem causing error messages to always include "The
+ original message was received ... from localhost".
+ The correct original host information is now included.
+ Previous change to cf/sh/makeinfo.sh doesn't port to Ultrix (their
+ version of "test" doesn't have the -x flag). Change it
+ to use -f instead. From John Myers.
+ CONFIG: 8.4 mistakenly set the default SMTP-style mailer to
+ esmtp -- it should be smtp.
+ CONFIG: send all relayed mail using confRELAY_MAILER (defaults
+ to "relay" (a variant of "smtp") if MAILER(smtp) is used,
+ else "suucp" if MAILER(uucp) is used, else "unknown");
+ this cleans up the configs somewhat. This fixes a serious
+ problem that caused route-addrs to get mistaken as relays,
+ pointed out by John Myers. WARNING: this also causes
+ the default on SMART_HOST to change from "suucp" to
+ "relay" if you have MAILER(smtp) specified.
+
+8.4/8.4 93/07/22
+ Add option `w'. If you receive a message that comes to you because
+ you are the best (lowest preference) target of an MX, and
+ you haven't explicitly recognized the source MX host in
+ your .cf file, this option will cause you to try the target
+ host directly (as if there were no MX for it at all). If
+ `w' is not set, this case is a configuration error.
+ Beware: if `w' is set, senders may get bogus errors like
+ "message timed out" or "host unknown" for problems that
+ are really configuration errors. This option is
+ disrecommended, provided only for compatibility with
+ UIUC sendmail.
+ Fix a problem that caused the incoming socket to be left open
+ when sendmail forks after the DATA command. This caused
+ calling systems to wait in FIN_WAIT_2 state until the
+ entire list was processed and the child closed -- a
+ potentially prodigious amount of time. Problem noted
+ by Neil Rickert.
+ Fix problem (created in 6.64) that caused mail sent to multiple
+ addresses, one of which was a bad address, to completely
+ suppress the sending of the message. This changes
+ handling of EF_FATALERRS somewhat, and adds an
+ EF_GLOBALERRS flag. This also fixes a potential problem
+ with duplicate error messages if there is a syntax error
+ in the header of a message that isn't noticed until late
+ in processing. Original problem pointed out by Josh Smith
+ of Harvey Mudd College. This release includes quite a bit
+ of dickering with error handling (see below).
+ Back out SMTP transaction if MAIL gets nested 501 error. This
+ will only hurt already-broken software and should help
+ humans.
+ Fix a problem that broke aliases when neither NDBM nor NEWDB were
+ compiled in. It would never read the alias file.
+ Repair unbalanced `)' and `>' (the "open" versions are already
+ repaired).
+ Logging of "done" in dropenvelope() was incorrect: it would
+ log this even when the queue file still existed. Change
+ this to only log "done" (at log level 11) when the
+ queue file is actually removed. From John Myers.
+ Log "lost connection" in server SMTP at log level 20 if there
+ is no pending transaction. Some senders just close the
+ connection rather than sending QUIT.
+ Fix a bug causing getmxrr to add a dot to the end of unqualified
+ domains that do not have MX records -- this would cause
+ the subsequent host name lookup to fail. The problem
+ only occurred if you had FEATURE(nocanonify) set.
+ Problem noted by Rick McCarty of Texas Instruments.
+ Fix invocation of setvbuf when passed a -X flag -- I had
+ unwittingly used an ANSI C extension, and this caused
+ core dumps on some machines.
+ Diagnose self-destructive alias loops on RCPT as well as EXPN.
+ Previously it just gave an empty send queue, which
+ then gave either "Need RCPT (recipient)" at the DATA
+ (confusing, since you had given an RCPT command which
+ returned 250) or just dropped the email, depending on
+ whether you were running VERBose mode. Now it usually
+ diagnoses this case as "aliasing/forwarding loop broken".
+ Unfortunately, it still doesn't adequately diagnose
+ some true error conditions.
+ Add internal concept of "warning messages" using 6xx codes.
+ These are not reported only to Postmaster. Unbalanced
+ parens, brackets, and quotes are printed as 653 codes.
+ They are always mapped to 5xx codes before use in SMTP.
+ Clean up error messages to tell both the actual address that
+ failed and the alias they arose from. This makes it
+ somewhat easier to diagnose problems. Difficulty noted
+ by Motonori Nakamura.
+ Fix a problem that inappropriately added a ctladdr to addresses
+ that shouldn't have had one during a queue run. This
+ caused error messages to be handled differently during
+ a queue run than a direct run.
+ Don't print the qf name and line number if you get errors during
+ the direct run of the queue from srvrsmtp -- this was
+ just extra stuff for users to crawl through.
+ Put command line flags on second line of pid file so you can
+ auto-restart the daemon with all appropriate arguments.
+ Use "kill `head -1 /etc/sendmail.pid`" to stop the
+ daemon, and "eval `tail -1 /etc/sendmail.pid`" to
+ restart it.
+ Remove the ``setuid(getuid())'' in main -- this caused the
+ IDENT daemon to screw up. This required that I change
+ HASSETEUID to HASSETREUID and complicate the mode
+ changing somewhat because both Ultrix and SunOS seem
+ to have a bug causing seteuid() to set the saved uid
+ as well as the effective. The program test/t_setreuid.c
+ will test to see if your implementation of setreuid(2)
+ is appropriately functional.
+ The FallBackMX (option V) handling failed to properly identify
+ fallback to yourself -- most of the code was there,
+ but it wasn't being enabled. Problem noted by Murray
+ Kucherawy of the University of Waterloo.
+ Change :include: open timeout from ETIMEDOUT to an internal
+ code EOPENTIMEOUT; this avoids adding "during SmtpPhase
+ with CurHostName" in error messages, which can be
+ confusing. Reported by Jonathan Kamens of OpenVision
+ Technologies.
+ Back out setpgrp (setpgid on POSIX systems) call to reset the
+ process group id. The original fix was to get around
+ some problems with recalcitrant MUAs, but it breaks
+ any call from a shell that creates a process group id
+ different from the process id. I could try to fix
+ this by diddling the tty owner (using tcsetpgrp or
+ equivalent) but this is too likely to break other
+ things.
+ Portability changes:
+ Support -M as equivalent to -oM on Ultrix -- apparently
+ DECnet calls sendmail with -MrDECnet -Ms<HOST> -bs
+ instead of using standard flags. Oh joy. This
+ behaviour reported by Jon Giltner of University
+ of Colorado.
+ SGI IRIX -- this includes several changes that should
+ help other strict ANSI compilers.
+ SCO Unix -- from Murray Kucherawy of HookUp Communication
+ Corporation.
+ Solaris running the Sun C compiler (which despite the
+ documentation apparently doesn't define
+ __STDC__ by default).
+ ConvexOS from Eric Schnoebelen of Convex.
+ Sony NEWS workstations and Omron LUNA workstations from
+ Motonori Nakamura.
+ CONFIG: add confTRY_NULL_MX_LIST to set option `w'.
+ CONFIG: delete `C' and `e' from default SMTP mailers flags;
+ several people have made a good argument that this
+ creates more problems than it solves (although this
+ may prove painful in the short run).
+ CONFIG: generalize all the relays to accept a "mailer:host"
+ format.
+ CONFIG: move local processing in ruleset 0 into a new ruleset
+ 98 (8 on old sendmail). Domain literal [a.b.c.d]
+ addresses are also passed through this ruleset.
+ CONFIG: if neither SMART_HOST nor MAILER(smtp) were defined,
+ internet-style addresses would "fall off the end" of
+ ruleset zero and be interpreted as local -- however,
+ the angle brackets confused the recursive call.
+ These are now diagnosed as "Unrecognized host name".
+ CONFIG: USENET rules weren't included in S0 because of a mistaken
+ ifdef(`_MAILER_USENET_') instead of
+ ifdef(`_MAILER_usenet_'). Problem found by Rein Tollevik
+ of SINTEF RUNIT, Oslo.
+ CONFIG: move up LOCAL_RULE_0 processing so that it happens very
+ early in ruleset 0; this allows .mc authors to bypass
+ things like the "short circuit" code for local addresses.
+ Prompted by a comment by Bill Wisner of The Well.
+ CONFIG: add confSMTP_MAILER to define the mailer used (smtp or
+ esmtp) to send SMTP mail. This allows you to default
+ to esmtp but use a mailertable or other override to
+ deal with broken servers. This logic was pointed out
+ to me by Bill Wisner. Ditto for confLOCAL_MAILER.
+ Changes to cf/sh/makeinfo.sh to make it portable to SVR4
+ environments. Ugly as sin.
+
8.3/8.3 93/07/13
- Fix (I hope) setuid problems introduced in 8.2 that caused
- messages like "Cannot create qfXXXXXX: Invalid argument"
+ Fix setuid problems introduced in 8.2 that caused messages
+ like "Cannot create qfXXXXXX: Invalid argument"
or "Cannot reopen dfXXXXXX: Permission denied". This
involved a new compile flag "HASSETEUID" that takes
the place of the old _POSIX_SAVED_IDS -- it turns out
@@ -501,7 +1620,7 @@
Fix compilation problem in getauthinfo() if IDENTPROTO is off.
Turn off DEFNAMES and DNSRCH when getting the hostsignature
(i.e., MX records) in level 1 configuration files; this
- matches the old behaviour. From Nakamura Motonori of
+ matches the old behaviour. From Motonori Nakamura of
Kyoto University.
Improve error message printing -- if sent through an alias,
error messages include the name of the alias in the
@@ -519,7 +1638,7 @@
6.53/6.25 93/04/15
Properly diagnose ruleset zero returning null (instead of a mailer
- triple). From Nakamura Motonori of Kyoto University.
+ triple). From Motonori Nakamura of Kyoto University.
More generalization of socket code for other protocols.
Shorten timeouts on reverse name lookups -- since they are done
during connection establishment, long timeouts here can
@@ -530,13 +1649,13 @@
messages in the log.
Redefine $r, $s, and $_ in error envelopes so you don't get
incorrect cruft in the error message. Problem noted by
- Nakamura Motonori of Kyoto University.
+ Motonori Nakamura of Kyoto University.
Fix a problem that can cause failure to return errors to Postmaster
- in certain cases. From Nakamura Motonori.
+ in certain cases. From Motonori Nakamura.
Fix a problem that can cause some systems to give duplicate error
messages when a bad syntax address such as "<a" is presented
to an SMTP server. It doesn't seem to occur on all
- machines. From Nakamura Motonori.
+ machines. From Motonori Nakamura.
Default IDENTPROTO off for Ultrix and HPUX, which apparently have
the interesting "feature" that when they receive a "Host
unreachable" message they closes all open connections to
@@ -583,7 +1702,7 @@
6.52/6.24 93/04/10
Clean up some minor glitches on error return messages pointed out
- by Nakamura Motonori of Kyoto University.
+ by Motonori Nakamura of Kyoto University.
Fix reply() to not reset SmtpReplyBuffer on fatal errors; this
was supposed to reset SmtpMsg Buffer. This makes the
client side code virtually useless. Reported by Allan
@@ -634,7 +1753,7 @@
Some ANSI C fixes.
Arrange to quote backslashes as well as other special characters
in the phrase part of a route-addr.
- Some fixes to FallBackMX code suggested by Nakamura Motonori of
+ Some fixes to FallBackMX code suggested by Motonori Nakamura of
Kyoto University.
More vigorous zeroing of CurHostAddr to avoid logging of bogus
host addresses when you are actually just printing
@@ -654,7 +1773,7 @@
by several people.
Improve information printed when infinite loops are discovered.
Zero CurHostAddr to fix erroneous internet addresses in log when no
- addresses can be bound. Pointed out by Nakamura Motonori
+ addresses can be bound. Pointed out by Motonori Nakamura
of Kyoto University.
"Probe" SMTP connections using RSET instead of NOOP "just in case".
Suggested by John Gardiner Myers of CMU.
@@ -690,7 +1809,7 @@
of U.C. San Diego.
Fall back to other MX records if there is an error anywhere
in delivery (actually on MAIL or DATA -- RCPT is harder).
- Suggested by John Gardiner Myers and Nakamura Motonori.
+ Suggested by John Gardiner Myers and Motonori Nakamura.
Revert to non-prototypes -- it turns out that our ANSI C
compiler is more forgiving than most others about
mixing prototyped extern declarations with non-prototyped
@@ -835,10 +1954,10 @@
John Gardiner Myers).
Fixes to SysExMsg logging (sometimes just got "message: %s"
instead of "message: error message"), noted by Eric
- Wassenaar. Also reported by Nakamura Motonori.
- Improvements to MX piggybacking code, from Nakamura Motonori.
+ Wassenaar. Also reported by Motonori Nakamura.
+ Improvements to MX piggybacking code, from Motonori Nakamura.
Fix case where CurHostName points to an auto variable that has
- been deallocated (from Nakamura Motonori).
+ been deallocated (from Motonori Nakamura).
Fix bug causing newlines to be included in aliases if option
"n" (check alias RHS) is set; bug noted by David Muir
Sharnoff.
@@ -951,7 +2070,7 @@
Fix some more bugs in alias owner code -- there were some wierd
cases where an error in a non-aliased name would override
the return info in an aliased name with an owner.
- Changes from WIDE Project, forwarded to me by Nakamura Motonori:
+ Changes from WIDE Project, forwarded to me by Motonori Nakamura:
Log actual delivery host (after MX et al); from
yasuhiro@dcl.co.jp.
Log daemon startup.
@@ -1092,7 +2211,7 @@
6.24/6.7 93/02/19
Increase the number of domain search entries in domain.c to allow
for the extra "" entry indicating the root domain.
- Reported by Nakamura Motonori of Kyoto U.
+ Reported by Motonori Nakamura of Kyoto U.
Add a "SMART_HOST" in the configs for UUCP-connected sites that
want to forward all mail with extra "@"s to that site.
Also allows SMART_HOST, LOCAL_RELAY, and MAIL_HUB to
@@ -1246,7 +2365,7 @@
Properly log message sender on returned mail during queue run.
Count number of recipients properly.
Fix a problem in yp map code.
- Diagnose "message timed out" (from Nakamura Motonori).
+ Diagnose "message timed out" (from Motonori Nakamura).
6.11/6.3 93/01/20
Fix problem with address delimitor inside quotes.
diff --git a/usr.sbin/sendmail/cf/README b/usr.sbin/sendmail/cf/README
index 35ba5c29af2c..53bc084bb88e 100644
--- a/usr.sbin/sendmail/cf/README
+++ b/usr.sbin/sendmail/cf/README
@@ -4,16 +4,16 @@
Eric Allman <eric@CS.Berkeley.EDU>
- @(#)README 8.3 (Berkeley) 7/13/93
+ @(#)README 8.27 (Berkeley) 3/12/94
This document describes the sendmail configuration files being used
-at Berkeley. These use features in the new (R6) sendmail, and although
+at Berkeley. These use features in the new (R8) sendmail, and although
there is an ``OLDSENDMAIL'' mode, they haven't really been tested on
old versions of sendmail and cannot be expected to work well.
These configuration files are probably not as general as previous
-versions, and don't handle as many of the wierd cases automagically.
+versions, and don't handle as many of the weird cases automagically.
I was able to simplify by them for two reasons. First, the network
has become more consistent -- for example, at this point, everyone
on the internet is supposed to be running a name server, so hacks to
@@ -23,24 +23,26 @@ a long-haul protocol. I realize that this is not universal, but it
does describe the vast majority of sites with which I am familiar,
including those outside the US.
-Of course, the downside of this is that if you do live in a wierd
-world, things are going to get wierder for you. I'm sorry about that,
+Of course, the downside of this is that if you do live in a weird
+world, things are going to get weirder for you. I'm sorry about that,
but at the time we at Berkeley had a problem, and it seemed like the
right thing to do.
This package requires a post-V7 version of m4; if you are running the
4.2bsd, SysV.2, or 7th Edition version, I suggest finding a friend with
a newer version. You can m4-expand on their system, then run locally.
-SunOS's /usr/5bin/m4 or BSD-Net/2's m4 both work. GNU m4 (which is a
-language unto itself) also works, but I don't intend to work so hard
-to keep this up in the future. [Note to GNU folks: the construct
-"define(`FOO')" should work without my having to add a null value.]
+SunOS's /usr/5bin/m4 or BSD-Net/2's m4 both work. GNU m4 version 1.1
+also works. Unfortunately, I'm told that the M4 on BSDI 1.0 doesn't
+work -- you'll have to use a Net/2 or GNU version.
IF YOU DON'T HAVE A BERKELEY MAKE, don't despair! Just run
-"m4 foo.mc > foo.cf" -- that should be all you need.
+"m4 foo.mc > foo.cf" -- that should be all you need. There is also
+a fairly crude (but functional) Makefile.dist that works on the
+old version of make.
To get started, you may want to look at tcpproto.mc (for TCP-only
-sites) and uucpproto.m4 (for UUCP-only sites). Others are versions
+sites), uucpproto.mc (for UUCP-only sites), and clientproto.mc (for
+clusters of clients using a single mail host). Others are versions
that we use at Berkeley, although not all are in current use. For
example, ucbarpa has gone away, but I've left ucbarpa.mc in because
it demonstrates some interesting techniques.
@@ -49,6 +51,13 @@ I'm not pretending that this README describes everything that these
configuration files can do; clever people can probably tweak them
to great effect. But it should get you started.
+*******************************************************************
+*** BE SURE YOU CUSTOMIZE THESE FILES! They have some ***
+*** Berkeley-specific assumptions built in, such as the name ***
+*** of our UUCP-relay. You'll want to create your own domain ***
+*** description, and use that in place of domain/Berkeley.m4. ***
+*******************************************************************
+
+--------------------------+
| INTRODUCTION AND EXAMPLE |
@@ -105,7 +114,7 @@ This example exposes the host inside of the CS subdomain -- that is,
it doesn't try to hide the name of the workstation to the outside
world. Changing this to DOMAIN(cs.hidden) would have made outgoing
messages refer to "<username>@CS.Berkeley.EDU" instead of using the
-local hostname. Internaly this is effected by using
+local hostname. Internally this is effected by using
"MASQUERADE_AS(CS.Berkeley.EDU)".
MAILER(smtp)
@@ -139,10 +148,9 @@ QUEUE_DIR [/var/spool/mqueue] The directory containing
queue files.
STATUS_FILE [/etc/sendmail.st] The file containing status
information.
-LOCAL_MAILER_PATH [/usr/libexec/mail.local] The program used to
- deliver local mail.
-LOCAL_MAILER_FLAGS [rn] The flags used by the local mailer. The
- flags lsDFMm are always included.
+LOCAL_MAILER_PATH [/bin/mail] The program used to deliver local mail.
+LOCAL_MAILER_FLAGS [rmn] The flags used by the local mailer. The
+ flags lsDFM are always included.
LOCAL_MAILER_ARGS [mail -d $u] The arguments passed to deliver local
mail.
LOCAL_SHELL_PATH [/bin/sh] The shell used to deliver piped email.
@@ -155,34 +163,23 @@ USENET_MAILER_PATH [/usr/lib/news/inews] The name of the program
USENET_MAILER_FLAGS [rlsDFMmn] The mailer flags for the usenet mailer.
USENET_MAILER_ARGS [-m -h -n] The command line arguments for the
usenet mailer.
-SMTP_MAILER_FLAGS [undefined] Flags added to SMTP mailer.
-UUCP_MAILER_FLAGS [undefined] Flags added to UUCP mailer.
+USENET_MAILER_MAX [100000] The maximum size of messages that will
+ be accepted by the usenet mailer.
+SMTP_MAILER_FLAGS [undefined] Flags added to SMTP mailer. Default
+ flags are `mDFMUX' (and `a' for esmtp mailer).
+SMTP_MAILER_MAX [undefined] The maximum size of messages that will
+ be transported using the smtp or esmtp mailers.
+UUCP_MAILER_FLAGS [undefined] Flags added to UUCP mailer. Default
+ flags are `DFMhuU' (and `m' for suucp mailer, minus
+ `U' for uucp-dom mailer).
UUCP_MAILER_ARGS [uux - -r -z -a$f -gC $h!rmail ($u)] The arguments
passed to the UUCP mailer.
UUCP_MAX_SIZE [100000] The maximum size message accepted for
transmission by the UUCP mailers.
-HOSTMAP_SPEC [dbm -o /etc/hostmap] The value for the builtin
- hostmap key definition. You can redefine this
- to change the class, flags, and filename of
- the hostmap. The default flag (-o) makes this
- map optional.
-
-In addition, the following boolean flags may be defined -- the value
-is ignored.
-
-NEED_DOMAIN If set, the $j macro is defined as $w.$D.
- If not set, $j is defined as $w. If this is
- set, the domain must be defined using the line
- DD<domainname> (probably in the domain file,
- but possibly in the .mc file). You will only
- need this if you define your system hostname
- without a domain (type "hostname" -- if it
- has no dots in the output, you qualify) AND
- if you are not running the nameserver AND if
- the first (canonical) name in /etc/hosts for
- your machine has no domain -- OR if you are
- running Ultrix or OSF/1 sendmail. Either of
- these is probably a mistake.
+FAX_MAILER_PATH [/usr/local/lib/fax/mailfax] The program used to
+ submit FAX messages.
+FAX_MAILER_MAX [100000] The maximum size message accepted for
+ transmission by FAX.
+---------+
| DOMAINS |
@@ -198,8 +195,6 @@ UUCP_RELAY The host that will forward UUCP-addressed email.
connected.
BITNET_RELAY The host that will forward BITNET-addressed email.
If not defined, the .BITNET pseudo-domain won't work.
-CSNET_RELAY The host that will forward CSNET-addressed email.
- If not defined, the .CSNET pseudo-domain won't work.
LOCAL_RELAY The site that will handle unqualified names -- that
is, names with out an @domain extension. If not set,
they are assumed to belong on this machine. This
@@ -208,6 +203,15 @@ LOCAL_RELAY The site that will handle unqualified names -- that
only works at small sites, and there are better
methods.
+Each of these can be either ``mailer:hostname'' (in which case the
+mailer is the internal mailer name, such as ``suucp'' and the hostname
+is the name of the host as appropriate for that mailer) or just a
+``hostname'', in which case a default mailer type (usually ``relay'',
+a variant on SMTP) is used. WARNING: if you have a wildcard MX
+record matching your domain, you probably want to define these to
+have a trailing dot so that you won't get the mail diverted back
+to yourself.
+
The domain file can also be used to define a domain name, if needed
(using "DD<domain>") and set certain site-wide features. If all hosts
at your site masquerade behind one email name, you could also use
@@ -244,10 +248,15 @@ uucp The Unix-to-Unix Copy Program mailer. Actually, this
is for when you know that the UUCP mailer at the other
end can handle multiple recipients in one transfer.
When you invoke this, sendmail looks for all names in
- the $=U class and sends them to the uucp mailer; all
- names in the $=Y class are sent to suucp. Note that
+ the $=U class and sends them to the uucp-old mailer; all
+ names in the $=Y class are sent to uucp-new; and all
+ names in the $=Z class are sent to uucp-uudom. Note that
this is a function of what version of rmail runs on
the receiving end, and hence may be out of your control.
+ If smtp is defined, it also defines "uucp-dom" and
+ "uucp-uudom" mailers that use domain-style rewriting.
+ See the section below describing UUCP mailers in more
+ detail.
usenet Usenet (network news) delivery. If this is specified,
an extra rule is added to ruleset 0 that forwards all
@@ -259,6 +268,8 @@ fax Facsimile transmission. This is experimental and based
on Sam Leffler's FlexFAX software. For more information,
see below.
+pop Post Office Protocol.
+
+----------+
| FEATURES |
@@ -284,25 +295,33 @@ use_cw_file Read the file /etc/sendmail.cw file to get alternate
"Cw<name1> <name2> ..." is probably superior.
The actual filename can be overridden by redefining
confCW_FILE.
+
redirect Reject all mail addressed to "address.REDIRECT" with
a ``551 User not local; please try <address>'' message.
If this is set, you can alias people who have left
to their new address with ".REDIRECT" appended.
+
nouucp Don't do anything special with UUCP addresses at all.
+
nocanonify Don't pass addresses to $[ ... $] for canonification.
This would generally only be used by sites that only
act as mail gateways or which have user agents that do
- full canonification themselves.
+ full canonification themselves. You may also want to
+ use "define(`confBIND_OPTS',`-DNSRCH -DEFNAMES')" to
+ turn off the usual resolver options that do a similar
+ thing.
+
notsticky By default, email sent to "user@local.host" are marked
as "sticky" -- that is, the local addresses aren't
matched against UDB and don't go through ruleset 5.
This features disables this treatment. It would
normally be used on network gateway machines.
+
mailertable Include a "mailer table" which can be used to override
routing for particular domains. The argument of the
FEATURE may be the key definition. If none is specified,
the definition used is:
- hash /etc/mailertable -o
+ hash -o /etc/mailertable
Keys in this database are fully qualified domain names
or partial domains preceded by a dot -- for example,
"vangogh.CS.Berkeley.EDU" or ".CS.Berkeley.EDU".
@@ -311,32 +330,37 @@ mailertable Include a "mailer table" which can be used to override
where "mailer" is the internal mailer name, and "domain"
is where to send the message. These maps are not
reflected into the message header.
+
domaintable Include a "domain table" which can be used to provide
full domains on unqualified (single word) hosts. The
argument of the FEATURE may be the key definition. If
none is specified, the definition used is:
- hash /etc/domaintable -o
+ hash -o /etc/domaintable
The key in this table is the unqualified host name; the
value is the fully qualified domain. Anything in the
domaintable is reflected into headers; that is, this
is done in ruleset 3.
+
bitdomain Look up bitnet hosts in a table to try to turn them into
internet addresses. The table can be built using the
- bitdomain program contributed by John Gardiner Meyers.
+ bitdomain program contributed by John Gardiner Myers.
The argument of the FEATURE may be the key definition; if
none is specified, the definition used is:
- hash /etc/bitdomain.db -o
+ hash -o /etc/bitdomain.db
Keys are the bitnet hostname; values are the corresponding
internet hostname.
+
uucpdomain Similar feature for UUCP hosts. The default map definition
is:
- hash /etc/uudomain.db -o
+ hash -o /etc/uudomain.db
At the moment there is no automagic tool to build this
database.
+
always_add_domain
Include the local host domain even on locally delivered
mail. Normally it is not added unless it is already
present.
+
allmasquerade If masquerading is enabled (using MASQUERADE_AS), this
feature will cause recipient addresses to also masquerade
as being from the masquerade host. Normally they get
@@ -350,8 +374,22 @@ allmasquerade If masquerading is enabled (using MASQUERADE_AS), this
namespace on your masquerade host supersets all the
local entries.
-Other FEATUREs should be defined, but I was trying to keep these
-config files fairly lean and mean.
+nodns We aren't running DNS at our site (for example,
+ we are UUCP-only connected). It's hard to consider
+ this a "feature", but hey, it had to go somewhere.
+
+nullclient This is a special case -- it creates a stripped down
+ configuration file containing nothing but support for
+ forwarding all mail to a central hub via a local
+ SMTP-based network. The argument is the name of that
+ hub.
+
+ The only other feature that should be used in conjunction
+ with this one is "nocanonify" (this causes addresses to
+ be sent unqualified via the SMTP connection; normally
+ they are qualifed with the masquerade name, which
+ defaults to the name of the hub machine). No mailers
+ should be defined. No aliasing or forwarding is done.
+-------+
@@ -375,6 +413,20 @@ Complex sites will need more local configuration information, such as
lists of UUCP hosts they speak with directly. This can get a bit more
tricky. For an example of a "complex" site, see cf/ucbvax.mc.
+If your host is known by several different names, you need to augment
+the $=w class. This is a list of names by which you are known, and
+anything sent to an address using a host name in this list will be
+treated as local mail. You can do this in two ways: either create
+the file /etc/sendmail.cw containing a list of your aliases (one per
+line), and use ``FEATURE(use_cw_file)'' in the .mc file, or add the
+line:
+
+ Cw alias.host.name
+
+at the end of that file. See the ``vangogh.mc'' file for an example.
+Be sure you use the fully-qualified name of the host, rather than a
+short name.
+
The SITECONFIG macro allows you to indirectly reference site-dependent
configuration information stored in the siteconfig subdirectory. For
example, the line
@@ -383,18 +435,26 @@ example, the line
reads the file uucp.ucbvax for local connection information. The
second parameter is the local name (in this case just "ucbvax" since
-it is locally connected, and hence a UUCP hostname) and the name of
-the class in which to store the host information. Another SITECONFIG
-line reads
+it is locally connected, and hence a UUCP hostname). The third
+parameter is the name of both a macro to store the local name (in
+this case, $U) and the name of the class (e.g., $=U) in which to store
+the host information read from the file. Another SITECONFIG line reads
SITECONFIG(uucp.ucbarpa, ucbarpa.Berkeley.EDU, W)
This says that the file uucp.ucbarpa contains the list of UUCP sites
connected to ucbarpa.Berkeley.EDU. The $=W class will be used to
-store this list. [The machine ucbarpa is gone now, but I've left
+store this list, and $W is defined to be ucbarpa.Berkeley.EDU, that
+is, the name of the relay to which the hosts listed in uucp.ucbarpa
+are connected. [The machine ucbarpa is gone now, but I've left
this out-of-date configuration file around to demonstrate how you
might do this.]
+Note that the case of SITECONFIG with a third parameter of ``U'' is
+special; the second parameter is assumed to be the UUCP name of the
+local site, rather than the name of a remote site, and the UUCP name
+is entered into $=w (the list of local hostnames) as $U.UUCP.
+
The siteconfig file (e.g., siteconfig/uucp.ucbvax.m4) contains nothing
more than a sequence of SITE macros describing connectivity. For
example:
@@ -407,6 +467,92 @@ same line; these are usually aliases for the same host (or are at
least in the same company).
++--------------------+
+| USING UUCP MAILERS |
++--------------------+
+
+It's hard to get UUCP mailers right because of the extremely ad hoc
+nature of UUCP addressing. These config files are really designed
+for domain-based addressing, even for UUCP sites.
+
+There are four UUCP mailers available. The choice of which one to
+use is partly a matter of local preferences and what is running at
+the other end of your UUCP connection. Unlike good protocols that
+define what will go over the wire, UUCP uses the policy that you
+should do what is right for the other end; if they change, you have
+to change. This makes it hard to do the right thing, and discourages
+people from updating their software. In general, if you can avoid
+UUCP, please do.
+
+The major choice is whether to go for a domainized scheme or a
+non-domainized scheme. This depends entirely on what the other
+end will recognize. If at all possible, you should encourage the
+other end to go to a domain-based system -- non-domainized addresses
+don't work entirely properly.
+
+The four mailers are:
+
+ uucp-old (obsolete name: "uucp")
+ This is the oldest, the worst (but the closest to UUCP) way of
+ sending messages accros UUCP connections. It does bangify
+ everything and prepends $U (your UUCP name) to the sender's
+ address (which can already be a bang path itself). It can
+ only send to one address at a time, so it spends a lot of
+ time copying duplicates of messages. Avoid this if at all
+ possible.
+
+ uucp-new (obsolete name: "suucp")
+ The same as above, except that it assumes that in one rmail
+ command you can specify several recipients. It still has a
+ lot of other problems.
+
+ uucp-dom
+ This UUCP mailer keeps everything as domain addresses.
+ Basically, it uses the SMTP mailer rewriting rules.
+
+ Unfortunately, a lot of UUCP mailer transport agents require
+ bangified addresses in the envelope, although you can use
+ domain-based addresses in the message header. (The envelope
+ shows up as the From_ line on UNIX mail.) So....
+
+ uucp-uudom
+ This is a cross between uucp-new (for the envelope addresses)
+ and uucp-dom (for the header addresses). It bangifies the
+ envelope sender (From_ line in messages) without adding the
+ local hostname, unless there is no host name on the address
+ at all (e.g., "wolf") or the host component is a UUCP host name
+ instead of a domain name ("somehost!wolf" instead of
+ "some.dom.ain!wolf").
+
+Examples:
+
+We are on host grasp.insa-lyon.fr (UUCP host name "grasp"). The
+following summarizes the sender rewriting for various mailers.
+
+Mailer sender rewriting in the envelope
+------ ------ -------------------------
+uucp-{old,new} wolf grasp!wolf
+uucp-dom wolf wolf@grasp.insa-lyon.fr
+uucp-uudom wolf grasp.insa-lyon.fr!wolf
+
+uucp-{old,new} wolf@fr.net grasp!fr.net!wolf
+uucp-dom wolf@fr.net wolf@fr.net
+uucp-uudom wolf@fr.net fr.net!wolf
+
+uucp-{old,new} somehost!wolf grasp!somehost!wolf
+uucp-dom somehost!wolf somehost!wolf@grasp.insa-lyon.fr
+uucp-uudom somehost!wolf grasp.insa-lyon.fr!somehost!wolf
+
+If you are using one of the domainized UUCP mailers, you really want
+to convert all UUCP addresses to domain format -- otherwise, it will
+do it for you (and probably not the way you expected). For example,
+if you have the address foo!bar!baz (and you are not sending to foo),
+the heuristics will add the @uucp.relay.name or @local.host.name to
+this address. However, if you map foo to foo.host.name first, it
+will not add the local hostname. You can do this using the uucpdomain
+feature.
+
+
+-------------------+
| TWEAKING RULESETS |
+-------------------+
@@ -426,7 +572,7 @@ will cause addresses of the form "decvax!user" and "research!user"
to be converted to "user@decvax.dec.com" and "user@research.att.com"
respectively.
-This could also be used to look hosts in a database map:
+This could also be used to look up hosts in a database map:
LOCAL_RULE_3
R$* < @ $+ > $* $: $1 < @ $(hostmap $2 $) > $3
@@ -438,7 +584,7 @@ For example, new rules are needed to parse hostnames that you accept
via MX records. For example, you might have:
LOCAL_RULE_0
- R$+ < @ cnmat.Berkeley.EDU > $#uucp $@ cnmat $: $1
+ R$+ <@ host.dom.ain.> $#uucp $@ cnmat $: $1 < @ host.dom.ain.>
You would use this if you had installed an MX record for cnmat.Berkeley.EDU
pointing at this host; this rule catches the message and forwards it on
@@ -464,11 +610,15 @@ You can have your host masquerade as another using
MASQUERADE_AS(host.domain)
-This causes outgoing SMTP mail to be labelled as coming from the
+This causes outgoing SMTP mail to be labeled as coming from the
indicated domain, rather than $j. One normally masquerades as one
-of your own subdomains (for example, it's unlikely that I would
+of one's own subdomains (for example, it's unlikely that I would
choose to masquerade as an MIT site).
+The masquerade name is not normally canonified, so it is important
+that it be your One True Name, that is, fully qualified and not a
+CNAME.
+
there are always users that need to be "exposed" -- that is, their
internal site name should be displayed instead of the masquerade name.
Root is an example. You can add users to this list using
@@ -497,15 +647,17 @@ This adds users to class L; you could also use something like
FL/etc/sendmail.cL
-If you want all mail sent to a centralized hub, as for a shared
-/var/spool/mail scheme, use
+If you want all incoming mail sent to a centralized hub, as for a
+shared /var/spool/mail scheme, use
define(`MAIL_HUB', mailer:hostname)
Again, ``mailer:'' defaults to "smtp". If you define both LOCAL_RELAY
-and MAIL_HUB, unqualified names and names in class L will be sent to
-the LOCAL_RELAY and other local names will be sent to MAIL_HUB. For
-example, if are on machine mastodon.CS.Berkeley.EDU, the following
+and MAIL_HUB, unqualified names will be sent to the LOCAL_RELAY and
+other local names will be sent to MAIL_HUB. Names in $=L will be
+delivered locally, so you MUST have aliases or .forward files for them.
+
+For example, if are on machine mastodon.CS.Berkeley.EDU, the following
combinations of settings will have the indicated effects:
email sent to.... eric eric@mastodon.CS.Berkeley.EDU
@@ -519,6 +671,20 @@ mammoth.CS.Berkeley.EDU
Both LOCAL_RELAY and mail.CS.Berkeley.EDU mammoth.CS.Berkeley.EDU
MAIL_HUB set as above
+If you want all outgoing mail to go to a central relay site, define
+SMART_HOST as well. Briefly:
+
+ LOCAL_RELAY applies to unqualifed names (e.g., "eric").
+ MAIL_HUB applies to names qualified with the name of the
+ local host (e.g., "eric@mastodon.CS.Berkeley.EDU").
+ SMART_HOST applies to names qualified with other hosts.
+
+However, beware that other relays (e.g., UUCP_RELAY, BITNET_RELAY, and
+FAX_RELAY) take precedence over SMART_HOST, so if you really want
+absolutely everything to go to a single central site you will need to
+unset all the other relays -- or better yet, find or build a minimal
+config file that does this.
+
+-------------------------------+
| NON-SMTP BASED CONFIGURATIONS |
@@ -535,7 +701,7 @@ using:
define(`SMART_HOST', mailer:hostname)
-In this case, the ``mailer:'' defaults to "suucp". Any messages that
+In this case, the ``mailer:'' defaults to "relay". Any messages that
can't be handled using the usual UUCP rules are passed to this host.
If you are on a local SMTP-based net that connects to the outside
@@ -560,6 +726,84 @@ use:
That is, send directly only to things you found in your DNS lookup;
anything else goes through SMART_HOST.
+If you are not running DNS at all, it is important to use
+FEATURE(nodns) to avoid having sendmail queue everything waiting
+for the name server to come up.
+
+
++-----------+
+| WHO AM I? |
++-----------+
+
+Normally, the $j macro is automatically defined to be your fully
+qualified domain name (FQDN). Sendmail does this by getting your
+host name using gethostname and then calling gethostbyname on the
+result. For example, in some environments gethostname returns
+only the root of the host name (such as "foo"); gethostbyname is
+supposed to return the FQDN ("foo.bar.com"). In some (fairly rare)
+cases, gethostbyname may fail to return the FQDN. In this case
+you MUST define confDOMAIN_NAME to be your fully qualified domain
+name. This is usually done using:
+
+ Dmbar.com
+ define(`confDOMAIN_NAME', `$w.$m')dnl
+
+
++--------------------+
+| USING MAILERTABLES |
++--------------------+
+
+To use FEATURE(mailertable), you will have to create an external
+database containing the routing information for various domains.
+For example, a mailertable file in text format might be:
+
+ .my.domain xnet:%1.my.domain
+ uuhost1.my.domain suucp:uuhost1
+ .bitnet smtp:relay.bit.net
+
+This should normally be stored in /etc/mailertable. The actual
+database version of the mailertable is built using:
+
+ makemap hash /etc/mailertable.db < /etc/mailertable
+
+The semantics are simple. Any LHS entry that does not begin with
+a dot matches the full host name indicated. LHS entries beginning
+with a dot match anything ending with that domain name -- that is,
+they can be thought of as having a leading "*" wildcard. Matching
+is done in order of most-to-least qualified -- for example, even
+though ".my.domain" is listed first in the above example, an entry
+of "uuhost1.my.domain" will match the second entry since it is
+more explicit.
+
+The RHS should always be a "mailer:host" pair. The mailer is the
+configuration name of a mailer (that is, an `M' line in the
+sendmail.cf file). The "host" will be the hostname passed to
+that mailer. In domain-based matches (that is, those with leading
+dots) the "%1" may be used to interpolate the wildcarded part of
+the host name. For example, the first line above sends everything
+addressed to "anything.my.domain" to that same host name, but using
+the (presumably experimental) xnet mailer.
+
+
++--------------------------------+
+| USING USERDB TO MAP FULL NAMES |
++--------------------------------+
+
+The user database was not originally intended for mapping full names
+to login names (e.g., Eric.Allman => eric), but some people are using
+it that way. (I would recommend that you set up aliases for this
+purpose instead -- since you can specify multiple alias files, this
+is fairly easy.) The intent was to locate the default maildrop at
+a site, but allow you to override this by sending to a specific host.
+
+If you decide to set up the user database in this fashion, it is
+imperative that you also specify FEATURE(notsticky) -- otherwise,
+e-mail sent to Full.Name@local.host.name will be rejected.
+
+To build the internal form of the user databae, use:
+
+ makemap btree /usr/data/base.db < /usr/data/base.txt
+
+------------------+
| FlexFAX SOFTWARE |
@@ -569,16 +813,16 @@ Sam Leffler's FlexFAX software is still in beta test -- but he expects a
public version out "later this week" [as of 3/1/93]. The following
blurb is direct from Sam:
- $Header: /a/cvs/386BSD/src/usr.sbin/sendmail/cf/README,v 1.4 1993/08/09 11:22:56 rgrimes Exp $
+ $Header: /home/cvs/386BSD/src/usr.sbin/sendmail/cf/README,v 1.7.2.1 1994/04/18 03:51:03 rgrimes Exp $
How To Obtain This Software (in case all you get is this file)
-
+ --------------------------------------------------------------
The source code is available for public ftp on
- sgi.com sgi/fax/v2.1beta.tar.Z
+ sgi.com sgi/fax/v2.1.src.tar.Z
(192.48.153.1)
You can also obtain inst'able images for Silicon Graphics machines from
- sgi.com sgi/fax/v2.1beta.inst.tar
+ sgi.com sgi/fax/v2.1.inst.tar
(192.48.153.1)
For example,
@@ -588,47 +832,69 @@ blurb is direct from Sam:
... <type in password>
ftp> cd sgi/fax
ftp> binary
- ftp> get v2.1beta.tar.Z
-
- If you cannot use FTP at all, there is a service called "ftpmail"
- available from gateekeeper.dec.com: you can send e-mail to this
- machine and it will use FTP to retrieve files for you and send you the
- files back again via e-mail. To find out more about the ftpmail
+ ftp> get v2.1.src.tar.Z
+
+ In general, the latest version of the 2.1 release of the software is
+ always available as "v2.1.src.tar.Z" or "v2.1.inst.tar" in the ftp
+ directory. This file is a link to the appropriate released version (so
+ don't waste your time retrieving the linked file as well!) Any files of
+ the form v2.1.*.patch are shell scripts that can be used to patch older
+ versions of the source code. For example, the file v2.1.0.patch would
+ contain patches to update v2.1.0.tar.Z. (Note to beta testers: this is
+ different than the naming conventions used during beta testing.) Patch
+ files only work to go between consecutive versions, so if you are
+ multiple versions behind the latest release, you will need to apply
+ each patch file between your current version and the latest.
+
+
+ Obtaining the Software by Electronic Mail
+ -----------------------------------------
+ Do not send me requests for the software; they will be ignored (without
+ response). If you cannot use FTP at all, there is a service called
+ "ftpmail" available from gatekeeper.dec.com: you can send e-mail to
+ this machine and it will use FTP to retrieve files for you and send you
+ the files back again via e-mail. To find out more about the ftpmail
service, send a message to "ftpmail@gatekeeper.dec.com" whose body
consists of the single line "help".
+
+ Obtaining the Software Within Silicon Graphics
+ ----------------------------------------------
Internal to Silicon Graphics there are inst'able images on the host
- flake.asd in the directory /d/dist. Thus you can do something like:
+ flake.asd in the directory /usr/dist. Thus you can do something like:
- % inst -f flake.asd.sgi.com:/d/dist/flexfax
+ % inst -f flake.asd.sgi.com:/usr/dist/flexfax
- to install the software on your machine.
+ to install the latest version of the software on your machine.
+
+ What to do Once You've Retrieved Stuff
+ --------------------------------------
The external distributions come in a compressed or uncompressed tar
file. To extract the source distribution:
- % zcat v2.1beta.tar.Z | tar xf -
+ % zcat v2.1.src.tar.Z | tar xf -
(uncompress and extract individual files in current directory). To
unpack and install the client portion of the inst'able distribution:
% mkdir dist
- % cd dist; tar xf ../v2.1beta.inst.tar; cd ..
+ % cd dist; tar xf ../v2.1.inst.tar; cd ..
% inst -f dist/flexfax
...
inst> go
(Note, the dist subdirectory is because some versions of inst fail if
- the files are in the current directory.) Server binaries is also
- included in the inst'able images as flexfax.server.*. It is not
- installed by default, so to get it also you need to extract the do:
+ the files are in the current directory.) Server binaries are also
+ included in the inst'able images as flexfax.server.*. They are not
+ installed by default, so to get them also you need to do:
% inst -f flexfax
...
inst> install flexfax.server.*
inst> go
- The SGI binaries were built for Version 4.0.5 of the IRIX operating
+ The SGI binaries were built for Version 4.0.5H of the IRIX operating
system. They should work w/o problem on earlier versions of the
system, but I have not fully tested this. Also, note that to install a
server on an SGI machine, you need to have installed the Display
@@ -636,23 +902,35 @@ blurb is direct from Sam:
server will not be able to convert PostScript to facsimile for
transmission.
- If you are working from the source distribution, look at the file README
- in the top of the source tree. If you are working from the inst images,
- you need to run faxaddmodem to setup and configure your fax modem. Do
- man faxaddmodem for more information.
+ If you are working from the source distribution, look at the file
+ README in the top of the source tree. If you are working from the inst
+ images, the subsystem flexfax.man.readme contains the README file and
+ other useful pieces of information--the installed files are placed in
+ the directory /usr/local/doc/flexfax). Basically you will need to run
+ the faxaddmodem script to setup and configure your fax modem. Consult
+ the README file and the manual page for faxaddmodem for information.
-Also from Sam:
+ FlexFAX Mail List
+ -----------------
A mailing list for users of this software is located on sgi.com.
If you want to join this mailing list or have a list-related request
such as getting your name removed from it, send a request to
- flexfax-request@sgi.com
+ majordomo@whizzer.wpd.sgi.com
+
+ For example, to subscribe, send the line "subscribe flexfax" in
+ the body of your message. The line "help" will return a list of
+ the commands understood by the mailing list management software.
Submissions (including bug reports) should be directed to:
flexfax@sgi.com
+ When corresponding about this software please always specify what
+ version you have, what system you're running on, and, if the problem is
+ specific to your modem, identify the modem and firmware revision.
+
+--------------------------------+
| TWEAKING CONFIGURATION OPTIONS |
@@ -670,7 +948,14 @@ Some options are likely to be deprecated in future versions -- that is,
the option is only included to provide back-compatibility. These are
marked with "*".
+Remember that these options are M4 variables, and hence may need to
+be quoted. In particular, arguments with commas will usually have to
+be ``double quoted, like this phrase'' to avoid having the comma
+confuse things. This is common for alias file definitions and for
+the read timeout.
+
M4 Variable Name Default Mac/Opt Description
+================ ======= ======= ===========
confMAILER_NAME MAILER-DAEMON Dn The sender name used for
internally generated
outgoing messages.
@@ -679,7 +964,7 @@ confFROM_LINE From $g $d Dl The From_ line used when
confFROM_HEADER $?x$x <$g>$|$g$. The format of an internally
Dq generated From: address.
confOPERATORS .:%@!^/[] Do Address operator characters.
-confSTMP_LOGIN_MSG $j Sendmail $v/$Z ready at $b
+confSMTP_LOGIN_MSG $j Sendmail $v/$Z ready at $b
De The initial (spontaneous)
SMTP greeting message.
confSEVEN_BIT_INPUT False O7 Force input to seven bits?
@@ -690,8 +975,8 @@ confMIN_FREE_BLOCKS 4 Ob Minimum number of free blocks
SMTP mail.
confBLANK_SUB . OB Blank (space) substitution
character.
-confCON_EXPENSIVE False Oc Connect immediately to
- mailers marked expensive?
+confCON_EXPENSIVE False Oc Avoid connecting immediately
+ to mailers marked expensive?
confCHECKPOINT_INTERVAL 10 OC Checkpoint queue files
every N recipients.
confDELIVERY_MODE background Od Default delivery mode.
@@ -711,6 +996,9 @@ confBIND_OPTS (empty) OI Default options for BIND.
confMIME_FORMAT_ERRORS True Oj * Send error messages as MIME-
encapsulated messages per
RFC 1344.
+confFORWARD_PATH (undefined) OJ The colon-separated list of
+ places to search for .forward
+ files.
confMCI_CACHE_SIZE 2 Ok Size of open connection cache.
confMCI_CACHE_TIMEOUT 5m OK Open connection cache timeout.
confUSE_ERRORS_TO False Ol * Use the Errors-To: header to
@@ -743,6 +1031,11 @@ confTIME_ZONE USE_SYSTEM Ot Time zone info -- can be
confDEF_USER_ID 1 Ou Default user id.
confUSERDB_SPEC (undefined) OU User database specification.
confFALLBACK_MX (undefined) OV Fallback MX host.
+confTRY_NULL_MX_LIST False Ow If we are the best MX for a
+ host and haven't made other
+ arrangements, try connecting
+ to the host directly; normally
+ this would be a config error.
confQUEUE_LA 8 Ox Load average at which queue-only
function kicks in.
confREFUSE_LA 12 OX Load average at which incoming
@@ -756,6 +1049,20 @@ confWORK_TIME_FACTOR (undefined) OZ Cost of each delivery attempt.
confCW_FILE /etc/sendmail.cw Name of file used to get the
Fw local additions to the $=w
class.
+confSMTP_MAILER smtp - The mailer name used when
+ SMTP connectivity is required.
+ Either "smtp" or "esmtp".
+confLOCAL_MAILER local - The mailer name used when
+ local connectivity is required.
+ Almost always "local".
+confRELAY_MAILER relay - The default mailer name used
+ for relaying any mail (e.g.,
+ to a BITNET_RELAY, a
+ SMART_HOST, or whatever).
+ This can reasonably be "suucp"
+ if you are on a UUCP-connected
+ site.
+confDOMAIN_NAME (undefined) Dj If defined, sets $j.
+-----------+
@@ -801,7 +1108,7 @@ feature These hold special orthogonal features that you might
hack Local hacks. These can be referenced using the HACK
macro. They shouldn't be of more than voyeuristic
interest outside the .Berkeley.EDU domain, but who knows?
- We've all got our own peccadilloes.
+ We've all got our own peccadillos.
siteconfig Site configuration -- e.g., tables of locally connected
UUCP sites.
@@ -826,16 +1133,23 @@ RULESETS (* means built in to sendmail)
5 * Local address rewrite (after aliasing)
1x mailer rules (sender qualification)
2x mailer rules (recipient qualification)
+ 3x mailer rules (sender header qualification)
+ 4x mailer rules (recipient header qualification)
+ 5x mailer subroutines (general)
+ 6x mailer subroutines (general)
+ 7x mailer subroutines (general)
+ 8x reserved
90 Mailertable host stripping
96 Bottom half of Ruleset 3 (ruleset 6 in old sendmail)
97 Hook for recursive ruleset 0 call (ruleset 7 in old sendmail)
+ 98 Local part of ruleset 0 (ruleset 8 in old sendmail)
MAILERS
0 local, prog local and program mailers
- 1 smtp SMTP channel
- 2 uucp UNIX-to-UNIX Copy Program
+ 1 [e]smtp, relay SMTP channel
+ 2 uucp-* UNIX-to-UNIX Copy Program
3 netnews Network News delivery
4 fax Sam Leffler's FlexFAX software
@@ -844,7 +1158,7 @@ MACROS
A
B Bitnet Relay
- C CSNET Relay
+ C
D The local domain -- usually not needed
E
F FAX Relay
@@ -897,7 +1211,7 @@ CLASSES
W UUCP hosts connected to relay $W
X UUCP hosts connected to relay $X
Y locally connected smart UUCP hosts
- Z
+ Z locally connected domain-ized UUCP hosts
. the class containing only a dot
@@ -910,5 +1224,5 @@ M4 DIVERSIONS
5 locally interpreted names (overrides $R)
6 local configuration (at top of file)
7 mailer definitions
- 8 special local name recognition (late in ruleset 3)
+ 8
9 special local rulesets (1 and 2)
diff --git a/usr.sbin/sendmail/cf/cf/Makefile b/usr.sbin/sendmail/cf/cf/Makefile
index 37ca97b01abb..05613dfee5c0 100644
--- a/usr.sbin/sendmail/cf/cf/Makefile
+++ b/usr.sbin/sendmail/cf/cf/Makefile
@@ -1,4 +1,4 @@
-# @(#)Makefile 8.1 (Berkeley) 6/7/93
+# @(#)Makefile 8.5 (Berkeley) 12/1/93
M4= m4
#M4= /usr/src/usr.bin/m4/obj/m4
@@ -10,18 +10,20 @@ RM= rm -f
.mc.cf:
$(RM) $@
- (cd ${.CURDIR} && $(M4) ${@:R}.mc) > $@
+ (cd ${.CURDIR} && $(M4) ${@:R}.mc > obj/$@)
$(CHMOD) $(ROMODE) $@
ALL= cs-hidden.cf cs-exposed.cf \
hpux-cs-exposed.cf hpux-cs-hidden.cf \
+ riscos-cs-exposed.cf \
sunos3.5-cs-exposed.cf sunos3.5-cs-hidden.cf \
sunos4.1-cs-exposed.cf sunos4.1-cs-hidden.cf \
ultrix4.1-cs-exposed.cf ultrix4.1-cs-hidden.cf \
+ osf1-cs-exposed.cf osf1-cs-hidden.cf \
mail.cs.cf mail.eecs.cf ucbvax.cf vangogh.cf \
chez.cf knecht.cf cogsci.cf alpha.cf s2k.cf auspex.cf \
- python.cf sun-lamp.cf boat-anchor.cf\
- tcpproto.cf uucpproto.cf
+ python.cf \
+ clientproto.cf tcpproto.cf uucpproto.cf
all: $(ALL)
@@ -31,23 +33,53 @@ clean cleandir:
depend install:
# this is overkill, but....
-M4FILES=../domain/cs.exposed.m4 \
- ../domain/cs.hidden.m4 \
+M4FILES=\
../domain/Berkeley.m4 \
+ ../domain/cs.exposed.m4 \
+ ../domain/cs.hidden.m4 \
+ ../domain/eecs.hidden.m4 \
+ ../domain/s2k.m4 \
+ ../feature/allmasquerade.m4 \
+ ../feature/always_add_domain.m4 \
+ ../feature/bitdomain.m4 \
+ ../feature/domaintable.m4 \
+ ../feature/mailertable.m4 \
+ ../feature/nocanonify.m4 \
+ ../feature/nodns.m4 \
+ ../feature/notsticky.m4 \
+ ../feature/nouucp.m4 \
+ ../feature/nullclient.m4 \
+ ../feature/redirect.m4 \
../feature/use_cw_file.m4 \
+ ../feature/uucpdomain.m4 \
../hack/cssubdomain.m4 \
../m4/cf.m4 \
+ ../m4/nullrelay.m4 \
../m4/proto.m4 \
../m4/version.m4 \
+ ../mailer/fax.m4 \
../mailer/local.m4 \
../mailer/smtp.m4 \
+ ../mailer/usenet.m4 \
../mailer/uucp.m4 \
+ ../ostype/aix3.m4 \
../ostype/bsd4.3.m4 \
../ostype/bsd4.4.m4 \
+ ../ostype/hpux.m4 \
+ ../ostype/irix.m4 \
+ ../ostype/linux.m4 \
+ ../ostype/nextstep.m4 \
+ ../ostype/osf1.m4 \
../ostype/riscos4.5.m4 \
+ ../ostype/solaris2.m4 \
../ostype/sunos3.5.m4 \
../ostype/sunos4.1.m4 \
+ ../ostype/svr4.m4 \
../ostype/ultrix4.1.m4 \
+ ../siteconfig/uucp.cogsci.m4 \
+ ../siteconfig/uucp.old.arpa.m4 \
+ ../siteconfig/uucp.ucbarpa.m4 \
+ ../siteconfig/uucp.ucbvax.m4 \
$(ALL): $(M4FILES)
diff --git a/usr.sbin/sendmail/cf/cf/Makefile.dist b/usr.sbin/sendmail/cf/cf/Makefile.dist
new file mode 100644
index 000000000000..074529edae69
--- /dev/null
+++ b/usr.sbin/sendmail/cf/cf/Makefile.dist
@@ -0,0 +1,85 @@
+#
+# Makefile for configuration files.
+#
+# @(#)Makefile.dist 8.1 (Berkeley) 8/25/93
+
+M4= m4
+#M4= /usr/src/usr.bin/m4/obj/m4
+CHMOD= chmod
+ROMODE= 444
+RM= rm -f
+
+.SUFFIXES: .mc .cf
+
+.mc.cf:
+ $(RM) $@
+ $(M4) $*.mc > $@
+ $(CHMOD) $(ROMODE) $@
+
+ALL= cs-hidden.cf cs-exposed.cf \
+ hpux-cs-exposed.cf hpux-cs-hidden.cf \
+ sunos3.5-cs-exposed.cf sunos3.5-cs-hidden.cf \
+ sunos4.1-cs-exposed.cf sunos4.1-cs-hidden.cf \
+ ultrix4.1-cs-exposed.cf ultrix4.1-cs-hidden.cf \
+ mail.cs.cf mail.eecs.cf ucbvax.cf vangogh.cf \
+ chez.cf knecht.cf cogsci.cf alpha.cf s2k.cf auspex.cf \
+ python.cf \
+ clientproto.cf tcpproto.cf uucpproto.cf
+
+all: $(ALL)
+
+clean cleandir:
+ $(RM) $(ALL) core
+
+depend install:
+
+# this is overkill, but....
+M4FILES=\
+ ../domain/Berkeley.m4 \
+ ../domain/cs.exposed.m4 \
+ ../domain/cs.hidden.m4 \
+ ../domain/eecs.hidden.m4 \
+ ../domain/s2k.m4 \
+ ../feature/allmasquerade.m4 \
+ ../feature/always_add_domain.m4 \
+ ../feature/bitdomain.m4 \
+ ../feature/domaintable.m4 \
+ ../feature/mailertable.m4 \
+ ../feature/nocanonify.m4 \
+ ../feature/nodns.m4 \
+ ../feature/notsticky.m4 \
+ ../feature/nouucp.m4 \
+ ../feature/nullclient.m4 \
+ ../feature/redirect.m4 \
+ ../feature/use_cw_file.m4 \
+ ../feature/uucpdomain.m4 \
+ ../hack/cssubdomain.m4 \
+ ../m4/cf.m4 \
+ ../m4/nullrelay.m4 \
+ ../m4/proto.m4 \
+ ../m4/version.m4 \
+ ../mailer/fax.m4 \
+ ../mailer/local.m4 \
+ ../mailer/smtp.m4 \
+ ../mailer/usenet.m4 \
+ ../mailer/uucp.m4 \
+ ../ostype/aix3.m4 \
+ ../ostype/bsd4.3.m4 \
+ ../ostype/bsd4.4.m4 \
+ ../ostype/hpux.m4 \
+ ../ostype/irix.m4 \
+ ../ostype/linux.m4 \
+ ../ostype/nextstep.m4 \
+ ../ostype/osf1.m4 \
+ ../ostype/riscos4.5.m4 \
+ ../ostype/solaris2.m4 \
+ ../ostype/sunos3.5.m4 \
+ ../ostype/sunos4.1.m4 \
+ ../ostype/svr4.m4 \
+ ../ostype/ultrix4.1.m4 \
+ ../siteconfig/uucp.cogsci.m4 \
+ ../siteconfig/uucp.old.arpa.m4 \
+ ../siteconfig/uucp.ucbarpa.m4 \
+ ../siteconfig/uucp.ucbvax.m4 \
+
+$(ALL): $(M4FILES)
diff --git a/usr.sbin/sendmail/cf/cf/clientproto.mc b/usr.sbin/sendmail/cf/cf/clientproto.mc
new file mode 100644
index 000000000000..902c1eb752ef
--- /dev/null
+++ b/usr.sbin/sendmail/cf/cf/clientproto.mc
@@ -0,0 +1,49 @@
+divert(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+#
+# This the prototype for a "null client" -- that is, a client that
+# does nothing except forward all mail to a mail hub.
+#
+# To use this, you MUST use the nullclient feature with the name of
+# the mail hub as its argument. You MAY also define an OSTYPE to
+# define the location of the queue directories and the like.
+# Other than these, it should never contain any other lines.
+#
+
+include(`../m4/cf.m4')
+VERSIONID(`@(#)clientproto.mc 8.2 (Berkeley) 8/21/93')
+
+FEATURE(nullclient, mailhost.$m)
diff --git a/usr.sbin/sendmail/cf/cf/mail.cs.mc b/usr.sbin/sendmail/cf/cf/mail.cs.mc
index cb447c12d10c..227e2fe52ecf 100644
--- a/usr.sbin/sendmail/cf/cf/mail.cs.mc
+++ b/usr.sbin/sendmail/cf/cf/mail.cs.mc
@@ -34,9 +34,10 @@ divert(-1)
#
include(`../m4/cf.m4')
-VERSIONID(`@(#)mail.cs.mc 8.1 (Berkeley) 6/7/93')
+VERSIONID(`@(#)mail.cs.mc 8.3 (Berkeley) 10/15/93')
OSTYPE(ultrix4.1)dnl
-DOMAIN(cs.exposed)dnl
+DOMAIN(Berkeley)dnl
+MASQUERADE_AS(CS.Berkeley.EDU)dnl
FEATURE(notsticky)dnl
MAILER(local)dnl
MAILER(smtp)dnl
diff --git a/usr.sbin/sendmail/cf/cf/osf1-cs-exposed.mc b/usr.sbin/sendmail/cf/cf/osf1-cs-exposed.mc
new file mode 100644
index 000000000000..eaed6cc4e529
--- /dev/null
+++ b/usr.sbin/sendmail/cf/cf/osf1-cs-exposed.mc
@@ -0,0 +1,41 @@
+divert(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+include(`../m4/cf.m4')
+VERSIONID(`@(#)osf1-cs-exposed.mc 8.1 (Berkeley) 10/15/93')
+OSTYPE(osf1)dnl
+DOMAIN(cs.exposed)dnl
+MAILER(local)dnl
+MAILER(smtp)dnl
diff --git a/usr.sbin/sendmail/cf/cf/osf1-cs-hidden.mc b/usr.sbin/sendmail/cf/cf/osf1-cs-hidden.mc
new file mode 100644
index 000000000000..2b85ba4be179
--- /dev/null
+++ b/usr.sbin/sendmail/cf/cf/osf1-cs-hidden.mc
@@ -0,0 +1,41 @@
+divert(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+include(`../m4/cf.m4')
+VERSIONID(`@(#)osf1-cs-hidden.mc 8.1 (Berkeley) 10/15/93')
+OSTYPE(osf1)dnl
+DOMAIN(cs.hidden)dnl
+MAILER(local)dnl
+MAILER(smtp)dnl
diff --git a/usr.sbin/sendmail/cf/cf/tcpproto.mc b/usr.sbin/sendmail/cf/cf/tcpproto.mc
index 7fcb65ab08a3..aa31ca152dca 100644
--- a/usr.sbin/sendmail/cf/cf/tcpproto.mc
+++ b/usr.sbin/sendmail/cf/cf/tcpproto.mc
@@ -33,8 +33,18 @@ divert(-1)
# SUCH DAMAGE.
#
+#
+# This is the prototype file for a configuration that supports nothing
+# but basic SMTP connections via TCP.
+#
+# You may want to add an OSTYPE macro to get the location of various
+# support files for your operating system environment.
+#
+
include(`../m4/cf.m4')
-VERSIONID(`@(#)tcpproto.mc 8.1 (Berkeley) 6/7/93')
+VERSIONID(`@(#)tcpproto.mc 8.2 (Berkeley) 8/21/93')
+
FEATURE(nouucp)
+
MAILER(local)
MAILER(smtp)
diff --git a/usr.sbin/sendmail/cf/cf/uucpproto.mc b/usr.sbin/sendmail/cf/cf/uucpproto.mc
index 9fe749e24709..c460d76b3cda 100644
--- a/usr.sbin/sendmail/cf/cf/uucpproto.mc
+++ b/usr.sbin/sendmail/cf/cf/uucpproto.mc
@@ -33,7 +33,17 @@ divert(-1)
# SUCH DAMAGE.
#
+#
+# This is the prototype for a configuration that only supports UUCP.
+#
+# You may want to add an OSTYPE macro to get the location of various
+# support files for your operating system environment.
+#
+
include(`../m4/cf.m4')
-VERSIONID(`@(#)uucpproto.mc 8.1 (Berkeley) 6/7/93')
+VERSIONID(`@(#)uucpproto.mc 8.3 (Berkeley) 8/21/93')
+
+FEATURE(nodns)dnl
+
MAILER(local)dnl
MAILER(uucp)dnl
diff --git a/usr.sbin/sendmail/cf/cf/vangogh.mc b/usr.sbin/sendmail/cf/cf/vangogh.mc
index edf98656e3a3..2406364c5a82 100644
--- a/usr.sbin/sendmail/cf/cf/vangogh.mc
+++ b/usr.sbin/sendmail/cf/cf/vangogh.mc
@@ -34,10 +34,11 @@ divert(-1)
#
include(`../m4/cf.m4')
-VERSIONID(`@(#)vangogh.mc 8.1 (Berkeley) 6/7/93')
+VERSIONID(`@(#)vangogh.mc 8.2 (Berkeley) 1/26/94')
DOMAIN(cs.exposed)dnl
OSTYPE(bsd4.4)dnl
MAILER(local)dnl
MAILER(smtp)dnl
define(`MCI_CACHE_SIZE', 5)
-Cw okeeffe
+Cw okeeffe.CS.Berkeley.EDU
+Cw python.CS.Berkeley.EDU
diff --git a/usr.sbin/sendmail/cf/cf/whisker.mc b/usr.sbin/sendmail/cf/cf/whisker.mc
new file mode 100644
index 000000000000..b21cd88635bc
--- /dev/null
+++ b/usr.sbin/sendmail/cf/cf/whisker.mc
@@ -0,0 +1,42 @@
+divert(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+include(`../m4/cf.m4')
+VERSIONID(`@(#)whisker.mc 8.1 (FreeBSD) 25/10/93')
+OSTYPE(bsd4.4)
+
+FEATURE(nouucp)
+MAILER(local)dnl
+MAILER(smtp)dnl
diff --git a/usr.sbin/sendmail/cf/domain/Berkeley.m4 b/usr.sbin/sendmail/cf/domain/Berkeley.m4
index fc72e0761c59..4f572d6436ae 100644
--- a/usr.sbin/sendmail/cf/domain/Berkeley.m4
+++ b/usr.sbin/sendmail/cf/domain/Berkeley.m4
@@ -33,8 +33,10 @@ divert(-1)
# SUCH DAMAGE.
#
divert(0)
-VERSIONID(`@(#)Berkeley.m4 8.1 (Berkeley) 6/7/93')
+VERSIONID(`@(#)Berkeley.m4 8.5 (Berkeley) 2/18/94')
define(`UUCP_RELAY', `ucbvax.Berkeley.EDU')dnl
-define(`BITNET_RELAY', `jade.Berkeley.EDU')dnl
-define(`CSNET_RELAY', `Relay.Prime.COM')dnl
+define(`BITNET_RELAY', `CMSA.Berkeley.EDU')dnl
+define(`confFORWARD_PATH', `$z/.forward.$w:$z/.forward')dnl
+define(`confCW_FILE', `-o /etc/sendmail.cw')dnl
FEATURE(redirect)dnl
+FEATURE(use_cw_file)dnl
diff --git a/usr.sbin/sendmail/cf/feature/allmasquerade.m4 b/usr.sbin/sendmail/cf/feature/allmasquerade.m4
index ec6700db3f9b..c7cbffa78ea3 100644
--- a/usr.sbin/sendmail/cf/feature/allmasquerade.m4
+++ b/usr.sbin/sendmail/cf/feature/allmasquerade.m4
@@ -34,8 +34,8 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)allmasquerade.m4 8.1 (Berkeley) 7/7/93')
+VERSIONID(`@(#)allmasquerade.m4 8.2 (Berkeley) 1/22/94')
divert(-1)
-define(`_ALL_MASQUERADE_')
+define(`_ALL_MASQUERADE_', 1)
diff --git a/usr.sbin/sendmail/cf/feature/bitdomain.m4 b/usr.sbin/sendmail/cf/feature/bitdomain.m4
index 91ee8aeb7ea7..85c8cf0017fc 100644
--- a/usr.sbin/sendmail/cf/feature/bitdomain.m4
+++ b/usr.sbin/sendmail/cf/feature/bitdomain.m4
@@ -34,16 +34,16 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)bitdomain.m4 8.1 (Berkeley) 6/7/93')
+VERSIONID(`@(#)bitdomain.m4 8.6 (Berkeley) 2/19/94')
divert(-1)
PUSHDIVERT(6)
-Kbitdomain ifelse(_ARG_, `', `hash /etc/bitdomain -o', `_ARG_')
+Kbitdomain ifelse(_ARG_, `', `hash -o /etc/bitdomain', `_ARG_')
POPDIVERT
-PUSHDIVERT(8)
+PUSHDIVERT(2)
# handle BITNET mapping
R$* < @ $+ .BITNET > $* $: $1 < @ $(bitdomain $2 $: $2.BITNET $) > $3
POPDIVERT
diff --git a/usr.sbin/sendmail/cf/feature/domaintable.m4 b/usr.sbin/sendmail/cf/feature/domaintable.m4
index 5c059e9a697e..bfad1bcecc45 100644
--- a/usr.sbin/sendmail/cf/feature/domaintable.m4
+++ b/usr.sbin/sendmail/cf/feature/domaintable.m4
@@ -34,7 +34,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)domaintable.m4 8.1 (Berkeley) 7/8/93')
+VERSIONID(`@(#)domaintable.m4 8.2 (Berkeley) 8/9/93')
divert(-1)
-define(`DOMAIN_TABLE', ifelse(_ARG_, `', `hash /etc/domaintable -o', `_ARG_'))dnl
+define(`DOMAIN_TABLE', ifelse(_ARG_, `', `hash -o /etc/domaintable', `_ARG_'))dnl
diff --git a/usr.sbin/sendmail/cf/feature/mailertable.m4 b/usr.sbin/sendmail/cf/feature/mailertable.m4
index 89e17483e6f2..fa399973bf7f 100644
--- a/usr.sbin/sendmail/cf/feature/mailertable.m4
+++ b/usr.sbin/sendmail/cf/feature/mailertable.m4
@@ -34,7 +34,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)mailertable.m4 8.1 (Berkeley) 6/7/93')
+VERSIONID(`@(#)mailertable.m4 8.3 (Berkeley) 8/7/93')
divert(-1)
-define(`MAILER_TABLE', ifelse(_ARG_, `', `hash /etc/mailertable -o', `_ARG_'))dnl
+define(`MAILER_TABLE', ifelse(_ARG_, `', `hash -o /etc/mailertable', `_ARG_'))dnl
diff --git a/usr.sbin/sendmail/cf/feature/nodns.m4 b/usr.sbin/sendmail/cf/feature/nodns.m4
new file mode 100644
index 000000000000..465a5ae46539
--- /dev/null
+++ b/usr.sbin/sendmail/cf/feature/nodns.m4
@@ -0,0 +1,40 @@
+divert(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+divert(0)
+VERSIONID(`@(#)nodns.m4 8.1 (Berkeley) 8/6/93')
+divert(-1)
+
+undefine(`confBIND_OPTS')dnl
diff --git a/usr.sbin/sendmail/cf/feature/nullclient.m4 b/usr.sbin/sendmail/cf/feature/nullclient.m4
new file mode 100644
index 000000000000..930f265c4b86
--- /dev/null
+++ b/usr.sbin/sendmail/cf/feature/nullclient.m4
@@ -0,0 +1,61 @@
+PUSHDIVERT(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+ifdef(`SMTP_MAILER_FLAGS',,
+ `define(`SMTP_MAILER_FLAGS',
+ `ifdef(`_OLD_SENDMAIL_', `L', `')')')
+define(_NULL_CLIENT_ONLY_, `1')
+ifelse(_ARG_, `', `errprint(`Feature "nullclient" requires argument')',
+ `define(`MAIL_HUB', _ARG_)')
+POPDIVERT
+
+#
+# This is used only for relaying mail from a client to a hub when
+# that client does absolutely nothing else -- i.e., it is a "null
+# mailer". In this sense, it acts like the "R" option in Sun
+# sendmail.
+#
+
+VERSIONID(`@(#)nullclient.m4 8.2 (Berkeley) 8/21/93')
+
+PUSHDIVERT(7)
+############################################
+### Null Client Mailer specification ###
+############################################
+
+ifdef(`confRELAY_MAILER',,
+ `define(`confRELAY_MAILER', `nullclient')')dnl
+
+Mnullclient, P=[IPC], F=CONCAT(mDFMuXa, SMTP_MAILER_FLAGS), A=IPC $h
+POPDIVERT
diff --git a/usr.sbin/sendmail/cf/feature/redirect.m4 b/usr.sbin/sendmail/cf/feature/redirect.m4
index 941fad896e81..0f2199c9755f 100644
--- a/usr.sbin/sendmail/cf/feature/redirect.m4
+++ b/usr.sbin/sendmail/cf/feature/redirect.m4
@@ -34,13 +34,13 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)redirect.m4 8.1 (Berkeley) 6/7/93')
+VERSIONID(`@(#)redirect.m4 8.2 (Berkeley) 12/27/93')
divert(-1)
PUSHDIVERT(3)
# addresses sent to foo@host.REDIRECT will give a 551 error code
-R$* < @ $+ .REDIRECT > $# error $@ NOUSER $: "551 User not local; please try " <$1@$2>
+R$* < @ $+ .REDIRECT. > $# error $@ NOUSER $: "551 User not local; please try " <$1@$2>
POPDIVERT
PUSHDIVERT(6)
diff --git a/usr.sbin/sendmail/cf/feature/uucpdomain.m4 b/usr.sbin/sendmail/cf/feature/uucpdomain.m4
index 98396fdc5b9a..77cc97bbe4a0 100644
--- a/usr.sbin/sendmail/cf/feature/uucpdomain.m4
+++ b/usr.sbin/sendmail/cf/feature/uucpdomain.m4
@@ -34,16 +34,16 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)uucpdomain.m4 8.1 (Berkeley) 6/7/93')
+VERSIONID(`@(#)uucpdomain.m4 8.6 (Berkeley) 2/19/94')
divert(-1)
PUSHDIVERT(6)
-Kuudomain ifelse(_ARG_, `', `hash /etc/uudomain -o', `_ARG_')
+Kuudomain ifelse(_ARG_, `', `hash -o /etc/uudomain', `_ARG_')
POPDIVERT
-PUSHDIVERT(8)
+PUSHDIVERT(2)
# handle UUCP mapping
R$* < @ $+ .UUCP > $* $: $1 < @ $(uudomain $2 $: $2.UUCP $) > $3
POPDIVERT
diff --git a/usr.sbin/sendmail/cf/m4/cf.m4 b/usr.sbin/sendmail/cf/m4/cf.m4
index 4e4ca929b096..528cbfffef93 100644
--- a/usr.sbin/sendmail/cf/m4/cf.m4
+++ b/usr.sbin/sendmail/cf/m4/cf.m4
@@ -51,6 +51,7 @@ divert(-1)
changecom()
undefine(`format')
+undefine(`hpux')
ifdef(`pushdef', `',
`errprint(`You need a newer version of M4, at least as new as
System V or GNU')
@@ -92,7 +93,7 @@ define(`DOL', ``$'$1')
define(`SITECONFIG',
`CONCAT(D, $3, $2)
define(`_CLASS_$3_', `')dnl
-ifelse($3, U, Cw$2, `dnl')
+ifelse($3, U, Cw$2 $2.UUCP, `dnl')
define(`SITE', `ifelse(CONCAT($'2`, $3), SU,
CONCAT(CY, $'1`),
CONCAT(C, $3, $'1`))')
@@ -142,6 +143,7 @@ define(`confREFUSE_LA', `12')
define(`confSEPARATE_PROC', `False')
define(`confCW_FILE', `/etc/sendmail.cw')
define(`confMIME_FORMAT_ERRORS', `True')
+define(`confTRY_NULL_MX_LIST', `False')
divert(0)dnl
-VERSIONID(`@(#)cf.m4 8.1 (Berkeley) 6/7/93')
+VERSIONID(`@(#)cf.m4 8.4 (Berkeley) 12/24/93')
diff --git a/usr.sbin/sendmail/cf/m4/nullrelay.m4 b/usr.sbin/sendmail/cf/m4/nullrelay.m4
new file mode 100644
index 000000000000..c79d1797f474
--- /dev/null
+++ b/usr.sbin/sendmail/cf/m4/nullrelay.m4
@@ -0,0 +1,302 @@
+divert(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+divert(0)
+
+VERSIONID(`@(#)nullrelay.m4 8.5 (Berkeley) 2/1/94')
+
+#
+# This configuration applies only to relay-only hosts. They send
+# all mail to a hub without consideration of the address syntax
+# or semantics, except for adding the hub qualification to the
+# addresses.
+#
+# This is based on a prototype done by Bryan Costales of ICSI.
+#
+
+# hub host (to which all mail is sent)
+DH`'ifdef(`MAIL_HUB', MAIL_HUB,
+ `errprint(`MAIL_HUB not defined for nullclient feature')')
+
+# name from which everyone will appear to come
+DM`'ifdef(`MASQUERADE_NAME', MASQUERADE_NAME, MAIL_HUB)
+
+# route-addr separators
+C: : ,
+
+undivert(6)dnl
+
+######################
+# Special macros #
+######################
+
+# SMTP initial login message
+De`'confSMTP_LOGIN_MSG
+
+# UNIX initial From header format
+Dl`'confFROM_LINE
+
+# my name for error messages
+Dn`'confMAILER_NAME
+
+# delimiter (operator) characters
+Do`'confOPERATORS
+
+# format of a total name
+Dq<$g>
+include(`../m4/version.m4')
+
+###############
+# Options #
+###############
+
+# strip message body to 7 bits on input?
+O7`'confSEVEN_BIT_INPUT
+
+# no aliases here
+
+# substitution for space (blank) characters
+OB`'confBLANK_SUB
+
+# default delivery mode
+Od`'confDELIVERY_MODE
+
+# error message header/file
+ifdef(`confERROR_MESSAGE',
+ OE`'confERROR_MESSAGE,
+ #OE/etc/sendmail.oE)
+
+# error mode
+ifdef(`confERROR_MODE',
+ Oe`'confERROR_MODE,
+ #Oep)
+
+# save Unix-style "From_" lines at top of header?
+Of`'confSAVE_FROM_LINES
+
+# temporary file mode
+OF`'confTEMP_FILE_MODE
+
+# default GID
+Og`'confDEF_GROUP_ID
+
+# maximum hop count
+Oh`'confMAX_HOP
+
+# location of help file
+OH`'ifdef(`HELP_FILE', HELP_FILE, /usr/lib/sendmail.hf)
+
+# ignore dots as terminators in incoming messages?
+Oi`'confIGNORE_DOTS
+
+# Insist that the BIND name server be running to resolve names
+ifdef(`confBIND_OPTS',
+ OI`'confBIND_OPTS,
+ #OI)
+
+# deliver MIME-encapsulated error messages?
+Oj`'confMIME_FORMAT_ERRORS
+
+# open connection cache size
+Ok`'confMCI_CACHE_SIZE
+
+# open connection cache timeout
+OK`'confMCI_CACHE_TIMEOUT
+
+# use Errors-To: header?
+Ol`'confUSE_ERRORS_TO
+
+# log level
+OL`'confLOG_LEVEL
+
+# send to me too, even in an alias expansion?
+Om`'confME_TOO
+
+# default messages to old style headers if no special punctuation?
+Oo`'confOLD_STYLE_HEADERS
+
+# SMTP daemon options
+ifdef(`confDAEMON_OPTIONS',
+ OO`'confDAEMON_OPTIONS,
+ #OOPort=esmtp)
+
+# privacy flags
+Op`'confPRIVACY_FLAGS
+
+# who (if anyone) should get extra copies of error messages
+ifdef(`confCOPY_ERRORS_TO',
+ OP`'confCOPY_ERRORS_TO,
+ #OPPostmaster)
+
+# slope of queue-only function
+ifdef(`confQUEUE_FACTOR',
+ Oq`'confQUEUE_FACTOR,
+ #Oq600000)
+
+# queue directory
+OQ`'ifdef(`QUEUE_DIR', QUEUE_DIR, /var/spool/mqueue)
+
+# read timeout -- now OK per RFC 1123 section 5.3.2
+ifdef(`confREAD_TIMEOUT',
+ Or`'confREAD_TIMEOUT,
+ #Ordatablock=10m)
+
+# queue up everything before forking?
+Os`'confSAFE_QUEUE
+
+# status file
+OS`'ifdef(`STATUS_FILE', STATUS_FILE, /etc/sendmail.st)
+
+# default message timeout interval
+OT`'confMESSAGE_TIMEOUT
+
+# time zone handling:
+# if undefined, use system default
+# if defined but null, use TZ envariable passed in
+# if defined and non-null, use that info
+ifelse(confTIME_ZONE, `USE_SYSTEM', `#Ot',
+ confTIME_ZONE, `USE_TZ', `Ot',
+ `Ot`'confTIME_ZONE')
+
+# default UID
+Ou`'confDEF_USER_ID
+
+# deliver each queued job in a separate process?
+OY`'confSEPARATE_PROC
+
+# work class factor
+ifdef(`confWORK_CLASS_FACTOR',
+ Oz`'confWORK_CLASS_FACTOR,
+ #Oz1800)
+
+# work time factor
+ifdef(`confWORK_TIME_FACTOR',
+ OZ`'confWORK_TIME_FACTOR,
+ #OZ90000)
+
+###########################
+# Message precedences #
+###########################
+
+Pfirst-class=0
+Pspecial-delivery=100
+Plist=-30
+Pbulk=-60
+Pjunk=-100
+
+#####################
+# Trusted users #
+#####################
+
+Troot
+Tdaemon
+Tuucp
+
+#########################
+# Format of headers #
+#########################
+
+H?P?Return-Path: $g
+HReceived: $?sfrom $s $.$?_($_) $.by $j ($v/$Z)$?r with $r$. id $i$?u for $u$.; $b
+H?D?Resent-Date: $a
+H?D?Date: $a
+H?F?Resent-From: $q
+H?F?From: $q
+H?x?Full-Name: $x
+HSubject:
+# HPosted-Date: $a
+# H?l?Received-Date: $b
+H?M?Resent-Message-Id: <$t.$i@$j>
+H?M?Message-Id: <$t.$i@$j>
+#
+######################################################################
+######################################################################
+#####
+##### REWRITING RULES
+#####
+######################################################################
+######################################################################
+
+###########################################
+### Rulset 3 -- Name Canonicalization ###
+###########################################
+S3
+
+# handle null input and list syntax (translate to <@> special case)
+R$@ $@ <@>
+R$*:;$* $@ $1 :; <@>
+
+# basic textual canonicalization -- note RFC733 heuristic here
+R$*<$*>$*<$*>$* $2$3<$4>$5 strip multiple <> <>
+R$*<$*<$+>$*>$* <$3>$5 2-level <> nesting
+R$*<>$* $@ <@> MAIL FROM:<> case
+R$*<$+>$* $2 basic RFC821/822 parsing
+
+ifdef(`_NO_CANONIFY_', `dnl',
+`# eliminate local host if present
+R@ $=w $=: $+ $@ @ $M $2 $3 @thishost ...
+R@ $+ $@ @ $1 @somewhere ...
+
+R$+ @ $=w $@ $1 @ $M ...@thishost
+R$+ @ $+ $@ $1 @ $2 ...@somewhere
+
+R$=w ! $+ $@ $2 @ $M thishost!...
+R$+ ! $+ $@ $1 ! $2 @ $M somewhere ! ...
+
+R$+ % $=w $@ $1 @ $M ...%thishost
+R$+ % $+ $@ $1 @ $2 ...%somewhere
+
+R$+ $@ $1 @ $M unadorned user')
+
+
+######################################
+### Ruleset 0 -- Parse Address ###
+######################################
+
+S0
+
+R$*:;<@> $#error $@ USAGE $: "list:; syntax illegal for recipient addresses"
+
+# pass everything else to a relay host
+R$* $#_RELAY_ $@ $H $: $1
+
+#
+######################################################################
+######################################################################
+#####
+`##### MAILER DEFINITIONS'
+#####
+######################################################################
+######################################################################
+undivert(7)dnl
diff --git a/usr.sbin/sendmail/cf/m4/proto.m4 b/usr.sbin/sendmail/cf/m4/proto.m4
index 39cbd628502f..284572988f90 100644
--- a/usr.sbin/sendmail/cf/m4/proto.m4
+++ b/usr.sbin/sendmail/cf/m4/proto.m4
@@ -34,58 +34,74 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)proto.m4 8.2 (Berkeley) 7/11/93')
+VERSIONID(`@(#)proto.m4 8.45 (Berkeley) 3/4/94')
MAILER(local)dnl
ifdef(`_OLD_SENDMAIL_',
-`define(`_SET_96_', 6)dnl
-define(`_SET_97_', 7)dnl',
-`# level 4 config file format
-V4
+`define(`_SET_95_', 5)dnl
+define(`_SET_96_', 6)dnl
+define(`_SET_97_', 7)dnl
+define(`_SET_98_', 8)dnl
+define(`confDOMAIN_NAME',
+ `ifdef(`NEED_DOMAIN', `$w.$d', `$w')')dnl',
+`# level 5 config file format
+V5
+define(`_SET_95_', 95)dnl
define(`_SET_96_', 96)dnl
-define(`_SET_97_', 97)dnl')
+define(`_SET_97_', 97)dnl
+define(`_SET_98_', 98)dnl')
+ifdef(`confSMTP_MAILER',, `define(`confSMTP_MAILER', `smtp')')dnl
+ifdef(`confLOCAL_MAILER',, `define(`confLOCAL_MAILER', `local')')dnl
+ifdef(`confRELAY_MAILER',,
+ `define(`confRELAY_MAILER',
+ `ifdef(`_MAILER_smtp_', `relay',
+ `ifdef(`_MAILER_uucp', `suucp', `unknown')')')')dnl
+define(`_SMTP_', `confSMTP_MAILER')dnl for readability only
+define(`_LOCAL_', `confLOCAL_MAILER')dnl for readability only
+define(`_RELAY_', `confRELAY_MAILER')dnl for readability only
##################
# local info #
##################
-CP.
-
Cwlocalhost
ifdef(`USE_CW_FILE',
`# file containing names of hosts for which we receive email
-CONCAT(`Fw', confCW_FILE)', `dnl')
+Fw`'confCW_FILE',
+ `dnl')
+ifdef(`confDOMAIN_NAME', `
+# my official domain name
+Dj`'confDOMAIN_NAME',
+ `dnl')
+
+ifdef(`_NULL_CLIENT_ONLY_',
+`include(../m4/nullrelay.m4)m4exit',
+ `dnl')
+
+CP.
ifdef(`UUCP_RELAY',
`# UUCP relay host
-CONCAT(DY, UUCP_RELAY)
+DY`'UUCP_RELAY
CPUUCP
')dnl
ifdef(`BITNET_RELAY',
`# BITNET relay host
-CONCAT(DB, BITNET_RELAY)
+DB`'BITNET_RELAY
CPBITNET
')dnl
-ifdef(`CSNET_RELAY',
-`# CSNET relay host
-CONCAT(DC, CSNET_RELAY)
-CPCSNET
-
-')dnl
ifdef(`FAX_RELAY',
`# FAX relay host
-CONCAT(DF, FAX_RELAY)
+DF`'FAX_RELAY
CPFAX
')dnl
-ifdef(`SMART_HOST',
-`# "Smart" UUCP relay host
-CONCAT(DS, SMART_HOST)
+# "Smart" relay host (may be null)
+DS`'ifdef(`SMART_HOST', SMART_HOST)
-')dnl
ifdef(`MAILER_TABLE',
`# Mailer table (overriding domains)
Kmailertable MAILER_TABLE
@@ -97,20 +113,17 @@ Kdomaintable DOMAIN_TABLE
')dnl
# who I send unqualified names to (null means deliver locally)
-CONCAT(DR, ifdef(`LOCAL_RELAY', LOCAL_RELAY))
+DR`'ifdef(`LOCAL_RELAY', LOCAL_RELAY)
# who gets all local email traffic ($R has precedence for unqualified names)
-CONCAT(DH, ifdef(`MAIL_HUB', MAIL_HUB))
-
-# my official hostname ($w or $w.$D)
-CONCAT(Dj$w, ifdef(`NEED_DOMAIN', .$D))
+DH`'ifdef(`MAIL_HUB', MAIL_HUB)
-# who I masquerade as (can be $j)
-CONCAT(DM, ifdef(`MASQUERADE_NAME', MASQUERADE_NAME, $j))
+# who I masquerade as (null for no masquerading)
+DM`'ifdef(`MASQUERADE_NAME', MASQUERADE_NAME)
# class L: names that should be delivered locally, even if we have a relay
# class E: names that should be exposed as from this host, even if we masquerade
-CLroot
+#CLroot
CEroot
undivert(5)dnl
@@ -131,20 +144,20 @@ undivert(6)dnl
######################
# SMTP initial login message
-CONCAT(De, confSMTP_LOGIN_MSG)
+De`'confSMTP_LOGIN_MSG
# UNIX initial From header format
-CONCAT(Dl, confFROM_LINE)
+Dl`'confFROM_LINE
# my name for error messages
-CONCAT(Dn, confMAILER_NAME)
+Dn`'confMAILER_NAME
# delimiter (operator) characters
-CONCAT(Do, confOPERATORS)
+Do`'confOPERATORS
# format of a total name
-CONCAT(Dq, ifdef(`confFROM_HEADER', confFROM_HEADER,
- ifdef(`_OLD_SENDMAIL_', `$g$?x ($x)$.', `$?x$x <$g>$|$g$.')))
+Dq`'ifdef(`confFROM_HEADER', confFROM_HEADER,
+ ifdef(`_OLD_SENDMAIL_', `$g$?x ($x)$.', `$?x$x <$g>$|$g$.'))
include(`../m4/version.m4')
###############
@@ -152,173 +165,176 @@ include(`../m4/version.m4')
###############
# strip message body to 7 bits on input?
-CONCAT(O7, confSEVEN_BIT_INPUT)
+O7`'confSEVEN_BIT_INPUT
# wait (in minutes) for alias file rebuild
-CONCAT(Oa, confALIAS_WAIT)
+Oa`'confALIAS_WAIT
# location of alias file
-CONCAT(OA, ifdef(`ALIAS_FILE', ALIAS_FILE, /etc/aliases))
+OA`'ifdef(`ALIAS_FILE', `ALIAS_FILE', /etc/aliases)
# minimum number of free blocks on filesystem
-CONCAT(Ob, confMIN_FREE_BLOCKS)
+Ob`'confMIN_FREE_BLOCKS
# substitution for space (blank) characters
-CONCAT(OB, confBLANK_SUB)
+OB`'confBLANK_SUB
-# connect to "expensive" mailers on initial submission?
-CONCAT(Oc, confCON_EXPENSIVE)
+# avoid connecting to "expensive" mailers on initial submission?
+Oc`'confCON_EXPENSIVE
# checkpoint queue runs after every N successful deliveries
-CONCAT(OC, confCHECKPOINT_INTERVAL)
+OC`'confCHECKPOINT_INTERVAL
# default delivery mode
-CONCAT(Od, confDELIVERY_MODE)
+Od`'confDELIVERY_MODE
# automatically rebuild the alias database?
-CONCAT(OD, confAUTO_REBUILD)
+OD`'confAUTO_REBUILD
-# error message header/file */
+# error message header/file
ifdef(`confERROR_MESSAGE',
- CONCAT(OE, confERROR_MESSAGE),
+ OE`'confERROR_MESSAGE,
#OE/etc/sendmail.oE)
# error mode
ifdef(`confERROR_MODE',
- CONCAT(Oe, confERROR_MODE),
+ Oe`'confERROR_MODE,
#Oep)
# save Unix-style "From_" lines at top of header?
-CONCAT(Of, confSAVE_FROM_LINES)
+Of`'confSAVE_FROM_LINES
# temporary file mode
-CONCAT(OF, confTEMP_FILE_MODE)
+OF`'confTEMP_FILE_MODE
# match recipients against GECOS field?
-CONCAT(OG, confMATCH_GECOS)
+OG`'confMATCH_GECOS
# default GID
-CONCAT(Og, confDEF_GROUP_ID)
+Og`'confDEF_GROUP_ID
# maximum hop count
-CONCAT(Oh, confMAX_HOP)
+Oh`'confMAX_HOP
# location of help file
-CONCAT(OH, ifdef(`HELP_FILE', HELP_FILE, /usr/lib/sendmail.hf))
+OH`'ifdef(`HELP_FILE', HELP_FILE, /usr/lib/sendmail.hf)
# ignore dots as terminators in incoming messages?
-CONCAT(Oi, confIGNORE_DOTS)
+Oi`'confIGNORE_DOTS
# Insist that the BIND name server be running to resolve names
ifdef(`confBIND_OPTS',
- CONCAT(OI, confBIND_OPTS),
+ OI`'confBIND_OPTS,
#OI)
# deliver MIME-encapsulated error messages?
-CONCAT(Oj, confMIME_FORMAT_ERRORS)
+Oj`'confMIME_FORMAT_ERRORS
# Forward file search path
ifdef(`confFORWARD_PATH',
- CONCAT(OJ, confFORWARD_PATH),
+ OJ`'confFORWARD_PATH,
#OJ/var/forward/$u:$z/.forward.$w:$z/.forward)
# open connection cache size
-CONCAT(Ok, confMCI_CACHE_SIZE)
+Ok`'confMCI_CACHE_SIZE
# open connection cache timeout
-CONCAT(OK, confMCI_CACHE_TIMEOUT)
+OK`'confMCI_CACHE_TIMEOUT
# use Errors-To: header?
-CONCAT(Ol, confUSE_ERRORS_TO)
+Ol`'confUSE_ERRORS_TO
# log level
-CONCAT(OL, confLOG_LEVEL)
+OL`'confLOG_LEVEL
# send to me too, even in an alias expansion?
-CONCAT(Om, confME_TOO)
+Om`'confME_TOO
# verify RHS in newaliases?
-CONCAT(On, confCHECK_ALIASES)
+On`'confCHECK_ALIASES
# default messages to old style headers if no special punctuation?
-CONCAT(Oo, confOLD_STYLE_HEADERS)
+Oo`'confOLD_STYLE_HEADERS
# SMTP daemon options
ifdef(`confDAEMON_OPTIONS',
- CONCAT(OO, confDAEMON_OPTIONS),
+ OO`'confDAEMON_OPTIONS,
#OOPort=esmtp)
# privacy flags
-CONCAT(Op, confPRIVACY_FLAGS)
+Op`'confPRIVACY_FLAGS
# who (if anyone) should get extra copies of error messages
ifdef(`confCOPY_ERRORS_TO',
- CONCAT(OP, confCOPY_ERRORS_TO),
+ OP`'confCOPY_ERRORS_TO,
#OPPostmaster)
# slope of queue-only function
ifdef(`confQUEUE_FACTOR',
- CONCAT(Oq, confQUEUE_FACTOR),
+ Oq`'confQUEUE_FACTOR,
#Oq600000)
# queue directory
-CONCAT(OQ, ifdef(`QUEUE_DIR', QUEUE_DIR, /var/spool/mqueue))
+OQ`'ifdef(`QUEUE_DIR', QUEUE_DIR, /var/spool/mqueue)
# read timeout -- now OK per RFC 1123 section 5.3.2
ifdef(`confREAD_TIMEOUT',
- CONCAT(Or, confREAD_TIMEOUT),
+ Or`'confREAD_TIMEOUT,
#Ordatablock=10m)
# queue up everything before forking?
-CONCAT(Os, confSAFE_QUEUE)
+Os`'confSAFE_QUEUE
# status file
-CONCAT(OS, ifdef(`STATUS_FILE', STATUS_FILE, /etc/sendmail.st))
+OS`'ifdef(`STATUS_FILE', STATUS_FILE, /etc/sendmail.st)
# default message timeout interval
-CONCAT(OT, confMESSAGE_TIMEOUT)
+OT`'confMESSAGE_TIMEOUT
# time zone handling:
# if undefined, use system default
# if defined but null, use TZ envariable passed in
# if defined and non-null, use that info
ifelse(confTIME_ZONE, `USE_SYSTEM', `#Ot',
- confTIME_ZONE, `USE_TZ', `',
- `CONCAT(Ot, confTIME_ZONE)')
+ confTIME_ZONE, `USE_TZ', `Ot',
+ `Ot`'confTIME_ZONE')
# default UID
-CONCAT(Ou, confDEF_USER_ID)
+Ou`'confDEF_USER_ID
# list of locations of user database file (null means no lookup)
OU`'ifdef(`confUSERDB_SPEC', `confUSERDB_SPEC')
# fallback MX host
ifdef(`confFALLBACK_MX',
- CONCAT(OV, confFALLBACK_MX),
+ OV`'confFALLBACK_MX,
#OVfall.back.host.net)
+# if we are the best MX host for a site, try it directly instead of config err
+Ow`'confTRY_NULL_MX_LIST
+
# load average at which we just queue messages
-CONCAT(Ox, confQUEUE_LA)
+Ox`'confQUEUE_LA
# load average at which we refuse connections
-CONCAT(OX, confREFUSE_LA)
+OX`'confREFUSE_LA
# work recipient factor
ifdef(`confWORK_RECIPIENT_FACTOR',
- CONCAT(Oy, confWORK_RECIPIENT_FACTOR),
+ Oy`'confWORK_RECIPIENT_FACTOR,
#Oy30000)
# deliver each queued job in a separate process?
-CONCAT(OY, confSEPARATE_PROC)
+OY`'confSEPARATE_PROC
# work class factor
ifdef(`confWORK_CLASS_FACTOR',
- CONCAT(Oz, confWORK_CLASS_FACTOR),
+ Oz`'confWORK_CLASS_FACTOR,
#Oz1800)
# work time factor
ifdef(`confWORK_TIME_FACTOR',
- CONCAT(OZ, confWORK_TIME_FACTOR),
+ OZ`'confWORK_TIME_FACTOR,
#OZ90000)
###########################
@@ -344,7 +360,7 @@ Tuucp
#########################
H?P?Return-Path: $g
-HReceived: $?sfrom $s $.$?_($_) $.by $j ($v/$Z)$?r with $r$. id $i; $b
+HReceived: $?sfrom $s $.$?_($?s$|from $.$_) $.by $j ($v/$Z)$?r with $r$. id $i$?u for $u$.; $b
H?D?Resent-Date: $a
H?D?Date: $a
H?F?Resent-From: $q
@@ -371,16 +387,18 @@ undivert(9)dnl
###########################################
S3
-# handle null input and list syntax (translate to <@> special case)
+# handle null input (translate to <@> special case)
R$@ $@ <@>
-R$*:;$* $@ $1 :; <@>
# basic textual canonicalization -- note RFC733 heuristic here
-R$*<$*>$*<$*>$* <$2>$3$4$5 strip multiple <> <>
+R$*<$*>$*<$*>$* $2$3<$4>$5 strip multiple <> <>
R$*<$*<$+>$*>$* <$3>$5 2-level <> nesting
R$*<>$* $@ <@> MAIL FROM:<> case
R$*<$+>$* $2 basic RFC821/822 parsing
+# handle list:; syntax as special case
+R$*:;$* $@ $1 :; <@>
+
# make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
R@ $+ , $+ @ $1 : $2 change all "," to ":"
@@ -396,6 +414,9 @@ R$+ @ $+ $: $1 < @ $2 > focus on domain
R$+ < $+ @ $+ > $1 $2 < @ $3 > move gaze right
R$+ < @ $+ > $@ $>_SET_96_ $1 < @ $2 > already canonical
+# do some sanity checking
+R$* < @ $* : $* > $* $1 < @ $2 $3 > $4 nix colons in addrs
+
ifdef(`_NO_UUCP_', `dnl',
`# convert old-style addresses to a domain-based address
R$- ! $+ $@ $>_SET_96_ $2 < @ $1 .UUCP > resolve uucp names
@@ -422,6 +443,9 @@ R$* < @ localhost > $* $: $1 < @ $j . > $2 no domain at all
R$* < @ localhost . $m > $* $: $1 < @ $j . > $2 local domain
ifdef(`_NO_UUCP_', `dnl',
`R$* < @ localhost . UUCP > $* $: $1 < @ $j . > $2 .UUCP domain')
+R$* < @ [ $+ ] > $* $: $1 < @@ [ $2 ] > $3 mark [a.b.c.d]
+R$* < @@ $=w > $* $: $1 < @ $j . > $3 self-literal
+R$* < @@ $+ > $* $@ $1 < @ $2 > $3 canon IP addr
ifdef(`DOMAIN_TABLE', `
# look up unqualified domains in the domain table
R$* < @ $- > $* $: $1 < @ $(domaintable $2 $) > $3',
@@ -431,32 +455,33 @@ undivert(2)dnl
ifdef(`_NO_UUCP_', `dnl',
`ifdef(`UUCP_RELAY',
`# pass UUCP addresses straight through
-R$* < @ $+ . UUCP > $* $@ $1 < @ $2 . UUCP > $3',
+R$* < @ $+ . UUCP > $* $@ $1 < @ $2 . UUCP . > $3',
`# if really UUCP, handle it immediately
ifdef(`_CLASS_U_',
-`R$* < @ $=U . UUCP > $* $@ $1 < @ $2 . UUCP > $3', `dnl')
+`R$* < @ $=U . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl')
ifdef(`_CLASS_V_',
-`R$* < @ $=V . UUCP > $* $@ $1 < @ $2 . UUCP > $3', `dnl')
+`R$* < @ $=V . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl')
ifdef(`_CLASS_W_',
-`R$* < @ $=W . UUCP > $* $@ $1 < @ $2 . UUCP > $3', `dnl')
+`R$* < @ $=W . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl')
ifdef(`_CLASS_X_',
-`R$* < @ $=X . UUCP > $* $@ $1 < @ $2 . UUCP > $3', `dnl')
+`R$* < @ $=X . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl')
ifdef(`_CLASS_Y_',
-`R$* < @ $=Y . UUCP > $* $@ $1 < @ $2 . UUCP > $3', `dnl')
+`R$* < @ $=Y . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl')
# try UUCP traffic as a local address
-R$* < @ $+ . UUCP > $* $: $1 < @ $[ $2 $] . UUCP > $3
+R$* < @ $+ . UUCP > $* $: $1 < @ $[ $2 $] . UUCP . > $3
ifdef(`_OLD_SENDMAIL_',
-`R$* < @ $+ . $+ . UUCP > $* $@ $1 < @ $2 . $3 . > $4',
-`R$* < @ $+ . . UUCP > $* $@ $1 < @ $2 . > $3')')
+`R$* < @ $+ . $+ . UUCP . > $* $@ $1 < @ $2 . $3 . > $4',
+`R$* < @ $+ . . UUCP . > $* $@ $1 < @ $2 . > $3')')
')
-ifdef(`_NO_CANONIFY_',
-`# make sure local host names appear canonical
-R$* < @ $=w > $* $: $1 < @ $2 . > $3',
+ifdef(`_NO_CANONIFY_', `dnl',
`# pass to name server to make hostname canonical
R$* < @ $* $~P > $* $: $1 < @ $[ $2 $3 $] > $4')
-undivert(8)dnl
+# local host aliases and pseudo-domains are always canonical
+R$* < @ $=w > $* $: $1 < @ $2 . > $3
+R$* < @ $* $=P > $* $: $1 < @ $2 $3 . > $4
+R$* < @ $* . . > $* $1 < @ $2 . > $3
# if this is the local hostname, make sure we treat is as canonical
R$* < @ $j > $* $: $1 < @ $j . > $2
@@ -469,9 +494,6 @@ S4
R$*<@> $@ $1 handle <> and list:;
-# resolve numeric addresses to name if possible
-R$* < @ [ $+ ] > $* $: $1 < @ $[ [$2] $] > $3 lookup numeric internet addr
-
# strip trailing dot off possibly canonical name
R$* < @ $+ . > $* $1 < @ $2 > $3
@@ -505,117 +527,110 @@ R$* $@ $>0 $1
S0
-R<@> $#local $: <> special case error msgs
-R$*:;<@> $#error $@ USAGE $: "list:; syntax illegal for recipient addresses"
+R<@> $#_LOCAL_ $: <> special case error msgs
+R$* : $* ; $#error $@ USAGE $: "list:; syntax illegal for recipient addresses"
+R<@ $+> $#error $@ USAGE $: "user address required"
+R<$* : $* > $#error $@ USAGE $: "colon illegal in host name part"
ifdef(`_MAILER_smtp_',
`# handle numeric address spec
-R$* < @ [ $+ ] > $* $: $1 < @ $[ [$2] $] > $3 numeric internet addr
-R$* < @ [ $+ ] > $* $#smtp $@ [$2] $: $1 @ [$2] $3 numeric internet spec',
-`dnl')
+R$* < @ [ $+ ] > $* $: $>_SET_98_ $1 < @ [ $2 ] > $3 numeric internet spec
+R$* < @ [ $+ ] > $* $#_SMTP_ $@ [$2] $: $1 < @ [$2] > $3 still numeric: send',
+ `dnl')
# now delete the local info -- note $=O to find characters that cause forwarding
-R$* < @ > $* $@ $>_SET_97_ $1 user@ => user
-R< @ $=w . > : $* $@ $>_SET_97_ $2 @here:... -> ...
-R$* $=O $* < @ $=w . > $@ $>_SET_97_ $1 $2 $3 ...@here -> ...
+R$* < @ > $* $@ $>_SET_97_ $1 user@ => user
+R< @ $=w . > : $* $@ $>_SET_97_ $2 @here:... -> ...
+R$* $=O $* < @ $=w . > $@ $>_SET_97_ $1 $2 $3 ...@here -> ...
+
+# handle local hacks
+R$* $: $>_SET_98_ $1
+
+# short circuit local delivery so forwarded email works
+ifdef(`_LOCAL_NOT_STICKY_',
+`R$=L < @ $=w . > $#_LOCAL_ $: @ $1 special local names
+R$+ < @ $=w . > $#_LOCAL_ $: $1 dispose directly',
+`R$+ < @ $=w . > $: $1 < @ $2 . @ $H > first try hub
+ifdef(`_OLD_SENDMAIL_',
+`R$+ < $+ @ $-:$+ > $# $3 $@ $4 $: $1 < $2 > yep ....
+R$+ < $+ @ $+ > $#relay $@ $3 $: $1 < $2 > yep ....
+R$+ < $+ @ > $#_LOCAL_ $: $1 nope, local address',
+`R$+ < $+ @ $+ > $#_LOCAL_ $: $1 yep ....
+R$+ < $+ @ > $#_LOCAL_ $: @ $1 nope, local address')')
ifdef(`MAILER_TABLE',
`
-# try mailer table lookup
+# not local -- try mailer table lookup
R$* <@ $+ > $* $: < $2 > $1 < @ $2 > $3 extract host name
R< $+ . > $* $: < $1 > $2 strip trailing dot
R< $+ > $* $: < $(mailertable $1 $) > $2 lookup
R< $- : $+ > $* $# $1 $@ $2 $: $3 check -- resolved?
R< $+ > $* $: $>90 <$1> $2 try domain',
`dnl')
-
-# short circuit local delivery so forwarded email works
-ifdef(`_LOCAL_NOT_STICKY_',
-`R$=L < @ $=w . > $#local $: @ $1 special local names
-R$+ < @ $=w . > $#local $: $1 dispose directly',
-`R$+ < @ $=w . > $: $1 < @ $2 @ $H > first try hub
-ifdef(`_OLD_SENDMAIL_',
-`R$+ < $+ @ $-:$+ > $# $3 $@ $4 $: $1 < $2 > yep ....
-R$+ < $+ @ $+ > $#relay $@ $3 $: $1 < $2 > yep ....
-R$+ < $+ @ > $#local $: $1 nope, local address',
-`R$+ < $+ @ $+ > $#local $: $1 yep ....
-R$+ < $+ @ > $#local $: @ $1 nope, local address')')
-undivert(3)dnl
undivert(4)dnl
ifdef(`_NO_UUCP_', `dnl',
`# resolve remotely connected UUCP links (if any)
ifdef(`_CLASS_V_',
-`R$* < @ $=V . UUCP > $* $#smtp $@ $V $: <@ $V> : $1 @ $2.UUCP $3',
+`R$* < @ $=V . UUCP . > $* $: $>_SET_95_ < $V > $1 <@$2.UUCP.> $3',
`dnl')
ifdef(`_CLASS_W_',
-`R$* < @ $=W . UUCP > $* $#smtp $@ $W $: <@ $W> : $1 @ $2.UUCP $3',
+`R$* < @ $=W . UUCP . > $* $: $>_SET_95_ < $W > $1 <@$2.UUCP.> $3',
`dnl')
ifdef(`_CLASS_X_',
-`R$* < @ $=X . UUCP > $* $#smtp $@ $X $: <@ $X> : $1 @ $2.UUCP $3',
+`R$* < @ $=X . UUCP . > $* $: $>_SET_95_ < $X > $1 <@$2.UUCP.> $3',
`dnl')')
# resolve fake top level domains by forwarding to other hosts
ifdef(`BITNET_RELAY',
-`R$*<@$+.BITNET>$* $#smtp $@ $B $: $1 <@$2.BITNET> $3 user@host.BITNET',
+`R$*<@$+.BITNET.>$* $: $>_SET_95_ < $B > $1 <@$2.BITNET.> $3 user@host.BITNET',
`dnl')
-ifdef(`CSNET_RELAY',
-`R$*<@$+.CSNET>$* $#smtp $@ $C $: $1 <@$2.CSNET> $3 user@host.CSNET',
+ifdef(`_MAILER_pop_',
+`R$+ < @ POP. > $#pop $: $1 user@POP',
`dnl')
ifdef(`_MAILER_fax_',
-`R$+ < @ $+ .FAX > $#fax $@ $2 $: $1 user@host.FAX',
+`R$+ < @ $+ .FAX. > $#fax $@ $2 $: $1 user@host.FAX',
`ifdef(`FAX_RELAY',
-`R$*<@$+.FAX>$* $#smtp $@ $F $: $1 <@$2.FAX> $3 user@host.FAX',
+`R$*<@$+.FAX.>$* $: $>_SET_95_ < $F > $1 <@$2.FAX.> $3 user@host.FAX',
`dnl')')
ifdef(`UUCP_RELAY',
`# forward non-local UUCP traffic to our UUCP relay
-R$*<@$*.UUCP>$* $#smtp $@ $Y $: <@ $Y> : $1 @ $2.UUCP $3 uucp mail',
+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:...
-R$+ < @ $+ .UUCP > $#uucp $@ $2 $: $1 user@host.UUCP',
+R$* < @ $+ .UUCP. > $* $#uucp $@ $2 $: $1 < @ $2 .UUCP. > $3 user@host.UUCP',
`dnl')')
-
-ifdef(`_MAILER_USENET_', `
+ifdef(`_MAILER_usenet_', `
# addresses sent to net.group.USENET will get forwarded to a newsgroup
-R$+ . USENET $# usenet $: $1',
-`dnl')
+R$+ . USENET $#usenet $: $1',
+ `dnl')
ifdef(`_LOCAL_RULES_',
`# figure out what should stay in our local mail system
undivert(1)', `dnl')
-ifdef(`SMART_HOST', `
-# pass names that still have a host to a smarthost
-R$* < @ $* > $* $: < $S > $1 < @ $2 > $3 glue on smarthost name
-R<$-:$+> $* < @$* > $* $# $1 $@ $2 $: $3 < @ $4 > $5 if non-null, use it
-R<$+> $* < @$* > $* $#suucp $@ $1 $: $2 < @ $3 > $4 if non-null, use it
-R<> $* < @ $* > $* $1 < @ $2 > $3 else strip off gunk',
+# pass names that still have a host to a smarthost (if defined)
+R$* < @ $* > $* $: $>_SET_95_ < $S > $1 < @ $2 > $3 glue on smarthost name
-`ifdef(`_LOCAL_RULES_', `
-# reject messages that have host names we do not understand
-R$* < @ $* > $* $#error $@ NOHOST $: Unrecognized host name $2',
-`ifdef(`_MAILER_smtp_',
-`# deal with other remote names
-R$* < @ $* > $* $#smtp $@ $2 $: $1 < @ $2 > $3 user@host.domain')')')
+# deal with other remote names
+ifdef(`_MAILER_smtp_',
+`R$* < @$* > $* $#_SMTP_ $@ $2 $: $1 < @ $2 > $3 user@host.domain',
+`R$* < @$* > $* $#error $@NOHOST $: Unrecognized host name $2')
ifdef(`_OLD_SENDMAIL_',
`# forward remaining names to local relay, if any
-R$=L $#local $: $1 special local names
-R$+ $: $1 < @ $R > append relay
-R$+ < @ > $: $1 < @ $H > no relay, try hub
-R$+ < @ > $#local $: $1 no relay or hub: local
-R$+ < @ $=w > $#local $: $1 we are relay/hub: local
-R$+ < @ $-:$+ > $# $2 $@ $3 $: $1 deliver to relay/hub
-R$+ < @ $+ > $#relay $@ $2 $: $1 deliver to relay/hub',
+R$=L $#_LOCAL_ $: $1 special local names
+R$+ $: $>_SET_95_ < $R > $1 try relay
+R$+ $: $>_SET_95_ < $H > $1 try hub
+R$+ $#_LOCAL_ $: $1 no relay or hub: local',
`# if this is quoted, strip the quotes and try again
R$+ $: $(dequote $1 $) strip quotes
-R$* $=O $* $@ $>_SET_97_ $1 $2 $3 try again
+R$+ $=O $+ $@ $>_SET_97_ $1 $2 $3 try again
# handle locally delivered names
-R$=L $#local $: @ $1 special local names
-R$+ $#local $: $1 regular local names
+R$=L $#_LOCAL_ $: @ $1 special local names
+R$+ $#_LOCAL_ $: $1 regular local names
###########################################################################
### Ruleset 5 -- special rewriting after aliases have been expanded ###
@@ -625,26 +640,44 @@ R$+ $#local $: $1 regular local names
S5
# see if we have a relay or a hub
-R$+ $: $1 < @ $R >
-R$+ < @ > $: $1 < @ $H > no relay, try hub
-R$+ < @ $=w > $@ $1 we are relay/hub: local
-R$+ < @ $-:$+ > $# $2 $@ $3 $: $1 send to relay or hub
-ifdef(`_MAILER_smtp_',
-`R$+ < @ $+ > $#relay $@ $2 $: $1 send to relay or hub')')
+R$+ $: < $R > $1 try relay
+R< > $+ $: < $H > $1 try hub
+R< > $+ $@ $1 nope, give up
+R< $- : $+ > $+ $: $>_SET_95_ < $1 : $2 > $3 < @ $2 >
+R< $+ > $+ $@ $>_SET_95_ < $1 > $2 < @ $1 >')
ifdef(`MAILER_TABLE',
`
-###########################################################################
-### Ruleset 90 -- try domain part of mailertable entry ###
-### (new sendmail only) ###
-###########################################################################
+###################################################################
+### Ruleset 90 -- try domain part of mailertable entry ###
+### (new sendmail only) ###
+###################################################################
S90
-R<$- . $+ > $* $: < $(mailertable .$2 $) > $3 lookup
-R<$- : $+ > $* $# $1 $@ $2 $: $3 check -- resolved?
-R< . $+ > $* $@ $>90 <$1> $2 no -- strip & try again
-R<$*> $* $@ $2 no match',
+R$* <$- . $+ > $* $: $1$2 < $(mailertable .$3 $@ $1$2 $@ $2 $) > $4
+R$* <$- : $+ > $* $# $2 $@ $3 $: $4 check -- resolved?
+R$* < . $+ > $* $@ $>90 $1 . <$2> $3 no -- strip & try again
+R$* < $* > $* $: < $(mailertable . $@ $1$2 $) > $3 try "."
+R<$- : $+ > $* $# $1 $@ $2 $: $3 "." found?
+R< $* > $* $@ $2 no mailertable match',
`dnl')
+
+###################################################################
+### Ruleset _SET_95_ -- canonify mailer:host syntax to triple ###
+###################################################################
+
+S`'_SET_95_
+R< > $* $@ $1 strip off null relay
+R< $- : $+ > $* $# $1 $@ $2 $: $3 try qualified mailer
+R< $=w > $* $@ $2 delete local host
+R< $+ > $* $#_RELAY_ $@ $1 $: $2 use unqualified mailer
+
+###################################################################
+### Ruleset _SET_98_ -- local part of ruleset zero (can be null) ###
+###################################################################
+
+S`'_SET_98_
+undivert(3)dnl
#
######################################################################
######################################################################
diff --git a/usr.sbin/sendmail/cf/m4/version.m4 b/usr.sbin/sendmail/cf/m4/version.m4
index 174b7da4b661..d71e816810fc 100644
--- a/usr.sbin/sendmail/cf/m4/version.m4
+++ b/usr.sbin/sendmail/cf/m4/version.m4
@@ -32,8 +32,8 @@ divert(-1)
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-VERSIONID(`@(#)version.m4 8.3 (Berkeley) 7/13/93')
+VERSIONID(`@(#)version.m4 8.6.6.1 (Berkeley) 3/13/94')
#
divert(0)
# Configuration version number
-DZ8.3
+DZ8.6.6
diff --git a/usr.sbin/sendmail/cf/mailer/fax.m4 b/usr.sbin/sendmail/cf/mailer/fax.m4
index 3d9068db981d..0c98a3bde196 100644
--- a/usr.sbin/sendmail/cf/mailer/fax.m4
+++ b/usr.sbin/sendmail/cf/mailer/fax.m4
@@ -37,12 +37,14 @@ PUSHDIVERT(-1)
ifdef(`FAX_MAILER_PATH',,
`define(`FAX_MAILER_PATH', /usr/local/lib/fax/mailfax)')
+ifdef(`FAX_MAILER_MAX',,
+ `define(`FAX_MAILER_MAX', 100000)')
POPDIVERT
####################################
### FAX Mailer specification ###
####################################
-VERSIONID(`@(#)fax.m4 8.1 (Berkeley) 6/7/93')
+VERSIONID(`@(#)fax.m4 8.2 (Berkeley) 1/24/94')
-Mfax, P=FAX_MAILER_PATH, F=DFMhu, S=14, R=24, M=100000,
+Mfax, P=FAX_MAILER_PATH, F=DFMhu, S=14, R=24, M=FAX_MAILER_MAX,
A=mailfax $u $h $f
diff --git a/usr.sbin/sendmail/cf/mailer/local.m4 b/usr.sbin/sendmail/cf/mailer/local.m4
index 8c968512660d..24a820413cb1 100644
--- a/usr.sbin/sendmail/cf/mailer/local.m4
+++ b/usr.sbin/sendmail/cf/mailer/local.m4
@@ -32,8 +32,8 @@ PUSHDIVERT(-1)
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `rn')')
-ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /usr/libexec/mail.local)')
+ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `rmn')')
+ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /bin/mail)')
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `mail -d $u')')
ifdef(`LOCAL_SHELL_FLAGS',, `define(`LOCAL_SHELL_FLAGS', `eu')')
ifdef(`LOCAL_SHELL_PATH',, `define(`LOCAL_SHELL_PATH', /bin/sh)')
@@ -44,15 +44,21 @@ POPDIVERT
### Local and Program Mailer specification ###
##################################################
-VERSIONID(`@(#)local.m4 8.3 (Berkeley) 7/13/93')
+VERSIONID(`@(#)local.m4 8.6 (Berkeley) 10/24/93')
-Mlocal, P=LOCAL_MAILER_PATH, F=CONCAT(`lsDFMm', LOCAL_MAILER_FLAGS), S=10, R=20,
+Mlocal, P=LOCAL_MAILER_PATH, F=CONCAT(`lsDFM', LOCAL_MAILER_FLAGS), S=10, R=20/40,
A=LOCAL_MAILER_ARGS
-Mprog, P=LOCAL_SHELL_PATH, F=CONCAT(`lsDFM', LOCAL_SHELL_FLAGS), S=10, R=20, D=$z:/,
+Mprog, P=LOCAL_SHELL_PATH, F=CONCAT(`lsDFM', LOCAL_SHELL_FLAGS), S=10, R=20/40, D=$z:/,
A=LOCAL_SHELL_ARGS
S10
R<@> $n errors to mailer-daemon
+R$+ $: $>40 $1
+
+S20
+R$+ < @ $* > $: $1 strip host part
+
+S40
ifdef(`_ALWAYS_ADD_DOMAIN_',
`R$* < @ $* > $* $@ $1 < @ $2 > $3 already fully qualified
R$* $: $1 @ $M add local qualification
diff --git a/usr.sbin/sendmail/cf/mailer/pop.m4 b/usr.sbin/sendmail/cf/mailer/pop.m4
new file mode 100644
index 000000000000..92bcff9e7907
--- /dev/null
+++ b/usr.sbin/sendmail/cf/mailer/pop.m4
@@ -0,0 +1,53 @@
+PUSHDIVERT(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+ifdef(`POP_MAILER_PATH',, `define(`POP_MAILER_PATH', /usr/lib/mh/spop)')
+ifdef(`POP_MAILER_FLAGS',, `define(`POP_MAILER_FLAGS', `eu')')
+ifdef(`POP_MAILER_ARGS',, `define(`POP_MAILER_ARGS', `pop $u')')
+
+POPDIVERT
+
+####################################
+### POP Mailer specification ###
+####################################
+
+VERSIONID(`@(#)pop.m4 8.2 (Berkeley) 2/19/94')
+
+Mpop, P=POP_MAILER_PATH, F=CONCAT(`lsDFM', POP_MAILER_FLAGS), S=10, R=20/40,
+ A=POP_MAILER_ARGS
+
+LOCAL_CONFIG
+# POP mailer is a pseudo-domain
+CPPOP
diff --git a/usr.sbin/sendmail/cf/mailer/smtp.m4 b/usr.sbin/sendmail/cf/mailer/smtp.m4
index 9119451e3f1c..45efbd68a81f 100644
--- a/usr.sbin/sendmail/cf/mailer/smtp.m4
+++ b/usr.sbin/sendmail/cf/mailer/smtp.m4
@@ -40,57 +40,87 @@ POPDIVERT
### SMTP Mailer specification ###
#####################################
-VERSIONID(`@(#)smtp.m4 8.3 (Berkeley) 7/11/93')
+VERSIONID(`@(#)smtp.m4 8.15 (Berkeley) 2/14/94')
-Msmtp, P=[IPC], F=CONCAT(mDFMueXC, SMTP_MAILER_FLAGS), S=11, R=ifdef(`_ALL_MASQUERADE_', `11', `21'), E=\r\n,
- ifdef(`_OLD_SENDMAIL_',, `L=990, ')A=IPC $h
-Mesmtp, P=[IPC], F=CONCAT(mDFMueXCa, SMTP_MAILER_FLAGS), S=11, R=ifdef(`_ALL_MASQUERADE_', `11', `21'), E=\r\n,
- ifdef(`_OLD_SENDMAIL_',, `L=990, ')A=IPC $h
-Mrelay, P=[IPC], F=CONCAT(mDFMueXCa, SMTP_MAILER_FLAGS), S=11, R=19, E=\r\n,
+Msmtp, P=[IPC], F=CONCAT(mDFMuX, SMTP_MAILER_FLAGS), S=11/31, R=ifdef(`_ALL_MASQUERADE_', `11/31', `21'), E=\r\n,
+ ifdef(`_OLD_SENDMAIL_',, `L=990, ')ifdef(`SMTP_MAILER_MAX', `M=SMTP_MAILER_MAX, ')A=IPC $h
+Mesmtp, P=[IPC], F=CONCAT(mDFMuXa, SMTP_MAILER_FLAGS), S=11/31, R=ifdef(`_ALL_MASQUERADE_', `11/31', `21'), E=\r\n,
+ ifdef(`_OLD_SENDMAIL_',, `L=990, ')ifdef(`SMTP_MAILER_MAX', `M=SMTP_MAILER_MAX, ')A=IPC $h
+Mrelay, P=[IPC], F=CONCAT(mDFMuXa, SMTP_MAILER_FLAGS), S=11/31, R=61, E=\r\n,
ifdef(`_OLD_SENDMAIL_',, `L=2040, ')A=IPC $h
+#
+# envelope sender and masquerading recipient rewriting
+#
S11
+R$+ $: $>51 $1 sender/recipient common
+R$* :; <@> $@ $1 :; list:; special case
+R$* $@ $>61 $1 qualify unqual'ed names
-# do sender/recipient common rewriting
-R$+ $: $>19 $1
-
-# if already @ qualified, we are done
-R$* < @ $* > $* $@ $1 < @ $2 > $3 already qualified
-
-# do not qualify list:; syntax
-R$* :; <@> $@ $1 :;
-
-# unqualified names (e.g., "eric") "come from" $M
-R$=E $@ $1 < @ $j> show exposed names
-R$+ $: $1 < @ $M > user w/o host
-R$+ <@> $: $1 < @ $j > in case $M undefined
-ifdef(`_ALL_MASQUERADE_', `dnl',
-`S21
+#
+# header recipient rewriting if not masquerading recipients
+#
+S21
# do sender/recipient common rewriting
-R$+ $: $>19 $1
+R$+ $: $>51 $1
-# if already @ qualified, we are done
+# unqualified names (e.g., "eric") are qualified by local host
R$* < @ $* > $* $@ $1 < @ $2 > $3 already qualified
+R$+ $: $1 < @ $j > add local domain
-# do not qualify list:; syntax
-R$* :; <@> $@ $1 :;
-# unqualified names (e.g., "eric") are qualified by local host
-R$+ $: $1 < @ $j >')
+#
+# header sender and masquerading recipient rewriting
+#
+S31
+R$+ $: $>51 $1 sender/recipient common
+R$* :; <@> $@ $1 :; list:; special case
-S19
+# do special header rewriting
+R$* <@> $* $@ $1 <@> $2 pass null host through
+R< @ $* > $* $@ < @ $1 > $2 pass route-addr through
+R$=E < @ $=w . > $@ $1 < @ $2 > exposed user as is
+R$* < @ $=w . > $: $1 < @ $2 @ $M > masquerade as domain
+R$* < @ $+ @ > $@ $1 < @ $2 > in case $M undefined
+R$* < @ $+ @ $+ > $@ $1 < @ $3 > $M is defined -- use it
+R$* $@ $>61 $1 qualify unqual'ed names
+
+
+#
+# convert pseudo-domain addresses to real domain addresses
+#
+S51
# pass <route-addr>s through
R< @ $+ > $* $@ < @ $1 > $2 resolve <route-addr>
# output fake domains as user%fake@relay
ifdef(`BITNET_RELAY',
-`R$+ <@ $+ . BITNET > $: $1 % $2 .BITNET < @ $B > user@host.BITNET',
+`R$+ <@ $+ .BITNET. > $: $1 % $2 .BITNET < @ $B > user@host.BITNET
+R$+.BITNET <@ $+:$+ > $: $1 .BITNET < @ $3 > strip mailer: part',
`dnl')
-ifdef(`CSNET_RELAY',
-`R$+ <@ $+ . CSNET > $: $1 % $2 .CSNET < @ $C > user@host.CSNET',
- `dnl')
-ifdef(`_NO_UUCP_', `dnl',
-`R$+ <@ $+ . UUCP > $: $2 ! $1 < @ $j > user@host.UUCP')
+ifdef(`_NO_UUCP_', `dnl', `
+# do UUCP heuristics; note that these are shared with UUCP mailers
+R$+ < @ $+ .UUCP. > $: < $2 ! > $1 convert to UUCP form
+R$+ < @ $* > $* $@ $1 < @ $2 > $3 not UUCP form
+
+# leave these in .UUCP form to avoid further tampering
+R< $&h ! > $- ! $+ $@ $2 < @ $1 .UUCP. >
+R< $&h ! > $-.$+ ! $+ $@ $3 < @ $1.$2 >
+R< $&h ! > $+ $@ $1 < @ $&h .UUCP. >
+R< $+ ! > $+ $: $1 ! $2 < @ $Y >
+R$+ < @ > $: $1 < @ $j > in case $Y undefined
+R$+ < @ $+ : $+ > $: $1 < @ $3 > strip mailer: part')
+
+
+#
+# common sender and masquerading recipient rewriting
+#
+S61
+
+R$* < @ $* > $* $@ $1 < @ $2 > $3 already qualified
+R$=E $@ $1 < @ $j> show exposed names
+R$+ $: $1 < @ $M > user w/o host
+R$+ <@> $: $1 < @ $j > in case $M undefined
diff --git a/usr.sbin/sendmail/cf/mailer/usenet.m4 b/usr.sbin/sendmail/cf/mailer/usenet.m4
index 4a2fddaae114..fe6ee3071f8d 100644
--- a/usr.sbin/sendmail/cf/mailer/usenet.m4
+++ b/usr.sbin/sendmail/cf/mailer/usenet.m4
@@ -35,13 +35,13 @@ PUSHDIVERT(-1)
ifdef(`USENET_MAILER_PATH',, `define(`USENET_MAILER_PATH', /usr/lib/news/inews)')
ifdef(`USENET_MAILER_FLAGS',, `define(`USENET_MAILER_FLAGS', `rlsDFMmn')')
-ifdef(`USENET_MAILER_ARGS',, `define(`USENET_MAILER_ARGS', `-m -h -n')')
+ifdef(`USENET_MAILER_ARGS',, `define(`USENET_MAILER_ARGS', `inews -m -h -n')')
POPDIVERT
####################################
### USENET Mailer specification ###
####################################
-VERSIONID(`@(#)usenet.m4 8.1 (Berkeley) 6/7/93')
+VERSIONID(`@(#)usenet.m4 8.3 (Berkeley) 1/24/94')
-Musenet, P=USENET_MAILER_PATH, F=USENET_MAILER_FLAGS, S=10, R=20,
- A=inews USENET_MAILER_ARGS $u
+Musenet, P=USENET_MAILER_PATH, F=USENET_MAILER_FLAGS, S=10, R=20,ifdef(`USENET_MAILER_MAX', ` M=USENET_MAILER_MAX,')
+ A=USENET_MAILER_ARGS $u
diff --git a/usr.sbin/sendmail/cf/mailer/uucp.m4 b/usr.sbin/sendmail/cf/mailer/uucp.m4
index f97e3dcc315b..517839f1613e 100644
--- a/usr.sbin/sendmail/cf/mailer/uucp.m4
+++ b/usr.sbin/sendmail/cf/mailer/uucp.m4
@@ -34,7 +34,7 @@ PUSHDIVERT(-1)
#
ifdef(`UUCP_MAILER_PATH',, `define(`UUCP_MAILER_PATH', /usr/bin/uux)')
-ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -z -a$f -gC $h!rmail ($u)')')
+ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -a$f -gC $h!rmail ($u)')')
ifdef(`UUCP_MAILER_FLAGS',, `define(`UUCP_MAILER_FLAGS', `')')
ifdef(`UUCP_MAX_SIZE',, `define(`UUCP_MAX_SIZE', 100000)')
POPDIVERT
@@ -42,23 +42,38 @@ POPDIVERT
### UUCP Mailer specification ###
#####################################
-VERSIONID(`@(#)uucp.m4 8.4 (Berkeley) 7/13/93')
+VERSIONID(`@(#)uucp.m4 8.15 (Berkeley) 2/16/94')
-# old UUCP mailer
+#
+# There are innumerable variations on the UUCP mailer. It really
+# is rather absurd.
+#
+
+# old UUCP mailer (two names)
Muucp, P=UUCP_MAILER_PATH, F=CONCAT(DFMhuU, UUCP_MAILER_FLAGS), S=12, R=22, M=UUCP_MAX_SIZE,
A=UUCP_MAILER_ARGS
+Muucp-old, P=UUCP_MAILER_PATH, F=CONCAT(DFMhuU, UUCP_MAILER_FLAGS), S=12, R=22, M=UUCP_MAX_SIZE,
+ A=UUCP_MAILER_ARGS
-# smart UUCP mailer (handles multiple addresses)
+# smart UUCP mailer (handles multiple addresses) (two names)
Msuucp, P=UUCP_MAILER_PATH, F=CONCAT(mDFMhuU, UUCP_MAILER_FLAGS), S=12, R=22, M=UUCP_MAX_SIZE,
A=UUCP_MAILER_ARGS
+Muucp-new, P=UUCP_MAILER_PATH, F=CONCAT(mDFMhuU, UUCP_MAILER_FLAGS), S=12, R=22, M=UUCP_MAX_SIZE,
+ A=UUCP_MAILER_ARGS
ifdef(`_MAILER_smtp_',
`# domain-ized UUCP mailer
-Muucp-dom, P=UUCP_MAILER_PATH, F=CONCAT(mDFMhu, UUCP_MAILER_FLAGS), S=11, R=21, M=UUCP_MAX_SIZE,
+Muucp-dom, P=UUCP_MAILER_PATH, F=CONCAT(mDFMhu, UUCP_MAILER_FLAGS), S=52/31, R=ifdef(`_ALL_MASQUERADE_', `11/31', `21'), M=UUCP_MAX_SIZE,
+ A=UUCP_MAILER_ARGS
+
+# domain-ized UUCP mailer with UUCP-style sender envelope
+Muucp-uudom, P=UUCP_MAILER_PATH, F=CONCAT(mDFMhu, UUCP_MAILER_FLAGS), S=72/31, R=ifdef(`_ALL_MASQUERADE_', `11/31', `21'), M=UUCP_MAX_SIZE,
A=UUCP_MAILER_ARGS')
-# sender rewriting
+#
+# envelope and header sender rewriting
+#
S12
# handle error address as a special case
@@ -68,26 +83,75 @@ R<@> $n errors to mailer-daemon
R$* :; <@> $@ $1 :;
R$* < @ $* . > $1 < @ $2 > strip trailing dots
-R$* < @ $j > $1 strip local name
+R$* < @ $=w > $1 strip local name
+R<@ $- . UUCP > : $+ $1 ! $2 convert to UUCP format
+R<@ $+ > : $+ $1 ! $2 convert to UUCP format
R$* < @ $- . UUCP > $2 ! $1 convert to UUCP format
R$* < @ $+ > $2 ! $1 convert to UUCP format
+R$&h ! $+ ! $+ $@ $1 ! $2 $h!...!user => ...!user
+R$&h ! $+ $@ $&h ! $1 $h!user => $h!user
R$+ $: $U ! $1 prepend our name
+R! $+ $: $k ! $1 in case $U undefined
-# recipient rewriting
+#
+# envelope and header recipient rewriting
+#
S22
# don't touch list:; syntax
-R$* :; <@> $@ $1 ;:
+R$* :; <@> $@ $1 :;
R$* < @ $* . > $1 < @ $2 > strip trailing dots
R$* < @ $j > $1 strip local name
+R<@ $- . UUCP > : $+ $1 ! $2 convert to UUCP format
+R<@ $+ > : $+ $1 ! $2 convert to UUCP format
R$* < @ $- . UUCP > $2 ! $1 convert to UUCP format
R$* < @ $+ > $2 ! $1 convert to UUCP format
+R$&h ! $+ ! $+ $@ $1 ! $2 $h!...!user => ...!user
+R$&h ! $+ $@ $&h ! $1 $h!user => $h!user
+R$+ $: $U ! $1 prepend our name
+R! $+ $: $k ! $1 in case $U undefined
+
+
+ifdef(`_MAILER_smtp_',
+`#
+# envelope sender rewriting for uucp-dom mailer
+#
+S52
+
+# handle error address as a special case
+R<@> $n errors to mailer-daemon
+
+# pass everything to standard SMTP mailer rewriting
+R$* $@ $>11 $1
+
+#
+# envelope sender rewriting for uucp-uudom mailer
+#
+S72
+
+# handle error address as a special case
+R<@> $n errors to mailer-daemon
+
+# do not qualify list:; syntax
+R$* :; <@> $@ $1 :;
+
+R$* < @ $* . > $1 < @ $2 > strip trailing dots
+R$* < @ $=w > $1 strip local name
+R<@ $- . UUCP > : $+ $1 ! $2 convert to UUCP format
+R<@ $+ > : $+ $1 ! $2 convert to UUCP format
+R$* < @ $- . UUCP > $2 ! $1 convert to UUCP format
+R$* < @ $+ > $@ $2 ! $1 convert to UUCP format
+
+R$&h ! $+ ! $+ $@ $1 ! $2 $h!...!user => ...!user
+R$&h ! $+ $@ $&h ! $1 $h!user => $h!user
+R$+ $: $M ! $1 prepend masquerade name
+R! $+ $: $j ! $1 in case $M undefined')
+
PUSHDIVERT(4)
# resolve locally connected UUCP links
-R< @ $=Y . UUCP > : $+ $#suucp $@ $1 $: $2 @host.UUCP: ...
-R< @ $=U . UUCP > : $+ $#uucp $@ $1 $: $2 @host.UUCP: ...
-R$+ < @ $=Y . UUCP > $#suucp $@ $2 $: $1 user@host.UUCP
-R$+ < @ $=U . UUCP > $#uucp $@ $2 $: $1 user@host.UUCP
+R$* < @ $=Z . UUCP. > $* $#uucp-uudom $@ $2 $: $1 < @ $2 .UUCP. > $3
+R$* < @ $=Y . UUCP. > $* $#uucp-new $@ $2 $: $1 < @ $2 .UUCP. > $3
+R$* < @ $=U . UUCP. > $* $#uucp-old $@ $2 $: $1 < @ $2 .UUCP. > $3
POPDIVERT
diff --git a/usr.sbin/sendmail/cf/ostype/aix3.m4 b/usr.sbin/sendmail/cf/ostype/aix3.m4
index 3eda5634de07..4411fd064512 100644
--- a/usr.sbin/sendmail/cf/ostype/aix3.m4
+++ b/usr.sbin/sendmail/cf/ostype/aix3.m4
@@ -34,7 +34,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)aix3.m4 8.2 (Berkeley) 7/13/93')
+VERSIONID(`@(#)aix3.m4 8.3 (Berkeley) 8/8/93')
define(`LOCAL_MAILER_PATH', /bin/bellmail)dnl
define(`LOCAL_MAILER_ARGS', mail $u)dnl
-define(`LOCAL_MAILER_FLAGS', `n')dnl
+define(`LOCAL_MAILER_FLAGS', `mn')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/aux.m4 b/usr.sbin/sendmail/cf/ostype/aux.m4
new file mode 100644
index 000000000000..b7ea47ba1462
--- /dev/null
+++ b/usr.sbin/sendmail/cf/ostype/aux.m4
@@ -0,0 +1,43 @@
+divert(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+divert(0)
+VERSIONID(`@(#)aux.m4 8.1 (Berkeley) 9/2/93')
+define(`ALIAS_FILE', /usr/lib/aliases)dnl
+define(`QUEUE_DIR', /usr/spool/mqueue)dnl
+define(`STATUS_FILE', /usr/lib/sendmail.st)dnl
+define(`UUCP_MAILER_PATH', /usr/bin/uux)dnl
+define(`LOCAL_MAILER_FLAGS', mn)dnl
+define(`LOCAL_MAILER_ARGS', `mail -d -r $f $u')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/bsd4.3.m4 b/usr.sbin/sendmail/cf/ostype/bsd4.3.m4
index 3c519ca94ea6..32aac4d7b431 100644
--- a/usr.sbin/sendmail/cf/ostype/bsd4.3.m4
+++ b/usr.sbin/sendmail/cf/ostype/bsd4.3.m4
@@ -34,5 +34,6 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)bsd4.3.m4 8.1 (Berkeley) 6/7/93')
+VERSIONID(`@(#)bsd4.3.m4 8.2 (Berkeley) 2/10/94')
define(`QUEUE_DIR', /usr/spool/mqueue)dnl
+define(`UUCP_MAILER_ARGS', `uux - -r -z -a$f $h!rmail ($u)')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/bsd4.4.m4 b/usr.sbin/sendmail/cf/ostype/bsd4.4.m4
index bdaa1fc5fe27..1950528902be 100644
--- a/usr.sbin/sendmail/cf/ostype/bsd4.4.m4
+++ b/usr.sbin/sendmail/cf/ostype/bsd4.4.m4
@@ -35,7 +35,8 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)bsd4.4.m4 8.1 (Berkeley) 6/7/93')
+VERSIONID(`@(#)bsd4.4.m4 8.2 (Berkeley) 2/10/94')
define(`HELP_FILE', /usr/share/misc/sendmail.hf)dnl
define(`STATUS_FILE', /var/log/sendmail.st)dnl
define(`LOCAL_MAILER_PATH', /usr/libexec/mail.local)dnl
+define(`UUCP_MAILER_ARGS', `uux - -r -z -a$f $h!rmail ($u)')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/bsdi1.0.m4 b/usr.sbin/sendmail/cf/ostype/bsdi1.0.m4
new file mode 100644
index 000000000000..28088f000521
--- /dev/null
+++ b/usr.sbin/sendmail/cf/ostype/bsdi1.0.m4
@@ -0,0 +1,38 @@
+divert(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+divert(0)
+VERSIONID(`@(#)bsdi1.0.m4 8.1 (Berkeley) 12/11/93')dnl
+OSTYPE(bsd4.4)
diff --git a/usr.sbin/sendmail/cf/ostype/dgux.m4 b/usr.sbin/sendmail/cf/ostype/dgux.m4
new file mode 100644
index 000000000000..38c1c1a0c817
--- /dev/null
+++ b/usr.sbin/sendmail/cf/ostype/dgux.m4
@@ -0,0 +1,39 @@
+divert(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+divert(0)
+VERSIONID(`@(#)dgux.m4 8.1 (Berkeley) 11/27/93')
+define(`LOCAL_MAILER_FLAGS', m)dnl
+define(`confTIME_ZONE', `USE_TZ')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/dynix3.2.m4 b/usr.sbin/sendmail/cf/ostype/dynix3.2.m4
new file mode 100644
index 000000000000..a4d6e527a8f0
--- /dev/null
+++ b/usr.sbin/sendmail/cf/ostype/dynix3.2.m4
@@ -0,0 +1,39 @@
+divert(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+divert(0)
+VERSIONID(`@(#)dynix3.2.m4 8.1 (Berkeley) 11/27/93')
+define(`ALIAS_FILE', /usr/lib/aliases)dnl
+define(`QUEUE_DIR', /usr/spool/mqueue)dnl
diff --git a/usr.sbin/sendmail/cf/ostype/hpux.m4 b/usr.sbin/sendmail/cf/ostype/hpux.m4
index ea1c05b0c66b..1be21f36c3c1 100644
--- a/usr.sbin/sendmail/cf/ostype/hpux.m4
+++ b/usr.sbin/sendmail/cf/ostype/hpux.m4
@@ -34,6 +34,11 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)hpux.m4 8.1 (Berkeley) 6/7/93')
-define(`_HPUX_', `')dnl
-define(`LOCAL_MAILER_FLAGS', `')dnl
+VERSIONID(`@(#)hpux.m4 8.5 (Berkeley) 1/9/94')
+
+define(`QUEUE_DIR', /usr/spool/mqueue)dnl
+define(`ALIAS_FILE', /usr/lib/aliases)dnl
+define(`STATUS_FILE', /usr/lib/sendmail.st)dnl
+define(`LOCAL_MAILER_FLAGS', `m')dnl
+define(`UUCP_MAILER_ARGS', `uux - -r -a$f -gC $h!rmail ($u)')dnl
+define(`confTIME_ZONE', `USE_TZ')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/irix.m4 b/usr.sbin/sendmail/cf/ostype/irix.m4
index 7e4e8dc6f4be..6cd7fc9a9599 100644
--- a/usr.sbin/sendmail/cf/ostype/irix.m4
+++ b/usr.sbin/sendmail/cf/ostype/irix.m4
@@ -34,5 +34,8 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)irix.m4 8.1 (Berkeley) 6/7/93')
-define(`LOCAL_MAILER_FLAGS', Ehu)dnl
+VERSIONID(`@(#)irix.m4 8.4 (Berkeley) 2/1/94')
+define(`LOCAL_MAILER_FLAGS', Ehm)dnl
+define(`QUEUE_DIR', /usr/spool/mqueue)dnl
+define(`ALIAS_FILE', /usr/lib/aliases)dnl
+define(`STATUS_FILE', /usr/lib/sendmail.st)dnl
diff --git a/usr.sbin/sendmail/cf/ostype/linux.m4 b/usr.sbin/sendmail/cf/ostype/linux.m4
new file mode 100644
index 000000000000..527b6fa3372b
--- /dev/null
+++ b/usr.sbin/sendmail/cf/ostype/linux.m4
@@ -0,0 +1,38 @@
+divert(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+divert(0)
+VERSIONID(`@(#)linux.m4 8.2 (Berkeley) 8/21/93')
+define(`LOCAL_MAILER_PATH', /bin/mail.local)dnl
diff --git a/usr.sbin/sendmail/cf/ostype/nextstep.m4 b/usr.sbin/sendmail/cf/ostype/nextstep.m4
new file mode 100644
index 000000000000..8144c3e69012
--- /dev/null
+++ b/usr.sbin/sendmail/cf/ostype/nextstep.m4
@@ -0,0 +1,44 @@
+divert(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+divert(0)
+VERSIONID(`@(#)nextstep.m4 8.4 (Berkeley) 11/30/93')
+define(`ALIAS_FILE', /etc/sendmail/aliases)dnl
+define(`HELP_FILE', /usr/lib/sendmail.hf)dnl
+define(`STATUS_FILE', /etc/sendmail/sendmail.st)dnl
+define(`UUCP_MAILER_PATH', /usr/bin/uux)dnl
+define(`QUEUE_DIR', /usr/spool/mqueue)dnl
+define(`LOCAL_MAILER_FLAGS', `rmnP')dnl
+define(`LOCAL_SHELL_FLAGS', `euP')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/riscos4.5.m4 b/usr.sbin/sendmail/cf/ostype/riscos4.5.m4
index 847cb0e39258..b45b25263fd3 100644
--- a/usr.sbin/sendmail/cf/ostype/riscos4.5.m4
+++ b/usr.sbin/sendmail/cf/ostype/riscos4.5.m4
@@ -34,4 +34,9 @@ divert(-1)
#
divert(0)
-VERSIONID(`@(#)riscos4.5.m4 8.1 (Berkeley) 6/7/93')
+VERSIONID(`@(#)riscos4.5.m4 8.2 (Berkeley) 12/1/93')
+
+define(`LOCAL_MAILER_ARGS', `rmail -d $u')dnl
+define(`ALIAS_FILE', `/usr/lib/aliases')dnl
+define(`QUEUE_DIR', `/usr/spool/mqueue')dnl
+define(`HELP_FILE', `/usr/lib/sendmail.hf')dnl
diff --git a/usr.sbin/sendmail/cf/ostype/sco3.2.m4 b/usr.sbin/sendmail/cf/ostype/sco3.2.m4
new file mode 100644
index 000000000000..08ed0fd404af
--- /dev/null
+++ b/usr.sbin/sendmail/cf/ostype/sco3.2.m4
@@ -0,0 +1,45 @@
+divert(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+divert(0)
+VERSIONID(`@(#)sco32.m4 8.1 (Berkeley) 11/27/93')
+define(`ALIAS_FILE', /usr/lib/mail/aliases)dnl
+define(`QUEUE_DIR', /usr/spool/mqueue)dnl
+define(`STATUS_FILE', /usr/lib/sendmail.st)dnl
+define(`UUCP_MAILER_PATH', /usr/bin/uux)dnl
+define(`LOCAL_MAILER_PATH', /usr/bin/lmail)dnl
+define(`LOCAL_MAILER_FLAGS', PuhCE)dnl
+define(`LOCAL_MAILER_ARGS', `lmail $u')dnl
+define(`LOCAL_SHELL_FLAGS', Peu)dnl
diff --git a/usr.sbin/sendmail/cf/ostype/solaris2.1.m4 b/usr.sbin/sendmail/cf/ostype/solaris2.1.m4
deleted file mode 100644
index 21142cae1e1a..000000000000
--- a/usr.sbin/sendmail/cf/ostype/solaris2.1.m4
+++ /dev/null
@@ -1,17 +0,0 @@
-divert(-1)
-#
-# Copyright (c) 1983 Eric P. Allman
-# Copyright (c) 1988, 1993
-# The Regents of the University of California. All rights reserved.
-#
-# %sccs.include.redist.sh%
-#
-
-divert(0)
-VERSIONID(`%W% (Berkeley) %G%')
-divert(-1)
-
-define(`ALIAS_FILE', /etc/mail/aliases)
-define(`HELP_FILE', /var/lib/sendmail.hf)
-define(`STATUS_FILE', /etc/mail/sendmail.st)
-define(`LOCAL_MAILER_FLAGS', `fSn')
diff --git a/usr.sbin/sendmail/cf/ostype/solaris2.m4 b/usr.sbin/sendmail/cf/ostype/solaris2.m4
new file mode 100644
index 000000000000..5e87027253d2
--- /dev/null
+++ b/usr.sbin/sendmail/cf/ostype/solaris2.m4
@@ -0,0 +1,43 @@
+divert(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+divert(0)
+VERSIONID(`@(#)solaris2.m4 8.2 (Berkeley) 1/23/94')
+divert(-1)
+
+define(`ALIAS_FILE', /etc/mail/aliases)
+define(`HELP_FILE', /etc/mail/sendmail.hf)
+define(`STATUS_FILE', /etc/mail/sendmail.st)
+define(`LOCAL_MAILER_FLAGS', `fSn')
diff --git a/usr.sbin/sendmail/cf/ostype/svr4.m4 b/usr.sbin/sendmail/cf/ostype/svr4.m4
new file mode 100644
index 000000000000..dd50127d4e1a
--- /dev/null
+++ b/usr.sbin/sendmail/cf/ostype/svr4.m4
@@ -0,0 +1,45 @@
+divert(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+divert(0)
+VERSIONID(`@(#)svr4.m4 8.1 (Berkeley) 8/24/93')
+
+ifdef(`ALIAS_FILE',,`define(`ALIAS_FILE', /usr/ucblib/aliases)')dnl
+ifdef(`HELP_FILE',,`define(`HELP_FILE', /usr/ucblib/sendmail.hf)')dnl
+ifdef(`STATUS_FILE',,`define(`STATUS_FILE', /usr/ucblib/sendmail.st)')dnl
+define(`LOCAL_MAILER_PATH', `/usr/ucblib/binmail')dnl
+define(`LOCAL_MAILER_FLAGS', `rmn')dnl
+define(`LOCAL_SHELL_FLAGS', `ehuP')dnl
+define(`UUCP_MAILER_ARGS', `uux - -r -a$f -gmedium $h!rmail ($u)')dnl
diff --git a/usr.sbin/sendmail/cf/sh/makeinfo.sh b/usr.sbin/sendmail/cf/sh/makeinfo.sh
index c7c3633e177e..dd5044afe972 100644
--- a/usr.sbin/sendmail/cf/sh/makeinfo.sh
+++ b/usr.sbin/sendmail/cf/sh/makeinfo.sh
@@ -32,8 +32,46 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# @(#)makeinfo.sh 8.1 (Berkeley) 6/7/93
+# @(#)makeinfo.sh 8.4 (Berkeley) 3/4/94
#
-echo '#####' built by `whoami` on `date`
-echo '#####' in `pwd` on `hostname`
+usewhoami=0
+usehostname=0
+for p in `echo $PATH | sed 's/:/ /g'`
+do
+ if [ "x$p" = "x" ]
+ then
+ p="."
+ fi
+ if [ -f $p/whoami ]
+ then
+ usewhoami=1
+ if [ $usehostname -ne 0 ]
+ then
+ break;
+ fi
+ fi
+ if [ -f $p/hostname ]
+ then
+ usehostname=1
+ if [ $usewhoami -ne 0 ]
+ then
+ break;
+ fi
+ fi
+done
+if [ $usewhoami -ne 0 ]
+then
+ user=`whoami`
+else
+ user=$LOGNAME
+fi
+
+if [ $usehostname -ne 0 ]
+then
+ host=`hostname`
+else
+ host=`uname -n`
+fi
+echo '#####' built by $user@$host on `date`
+echo '#####' in `pwd` | sed 's/\/tmp_mnt//'
diff --git a/usr.sbin/sendmail/contrib/converting.sun.configs b/usr.sbin/sendmail/contrib/converting.sun.configs
new file mode 100644
index 000000000000..0fcd91967307
--- /dev/null
+++ b/usr.sbin/sendmail/contrib/converting.sun.configs
@@ -0,0 +1,446 @@
+
+ Converting Standard Sun Config
+ Files to Sendmail Version 8
+
+ Rick McCarty
+ Texas Instruments Inc.
+ Latest Update: 08/25/93 - RJMc
+
+This document details the changes necessary to continue using your
+current SunOS sendmail.cf with sendmail version 8. In the longer term,
+it is recommended that one move to using an m4 based configuration such
+as those shipped with sendmail, but if you're like me and have made
+enough modifications to your .cf file that you'd rather put that task
+off until later, here's the sum total of my experience to get you to
+version 8 with minimal pain. I'll cover .cf as well as build issues.
+
+Some background - as many are surely aware, Sun has some "special"
+features in the sendmail they ship ($%x, %y LHS lookup, NIS alias DB
+search, etc.). (Some of those features can be had in alternative forms
+in IDA sendmail, but v8 has picked up some IDA capabilities as well as
+new ones, making it IMHO a most desirable version to go to.) What I
+will explain below includes v8 functional "equivalences" to these Sun
+sendmail features.
+
+So with that out of the way, let's begin.
+
+First, some assumptions:
+
+ 1) I'm going to assume you've got sendmail version 8.6 or
+ later in hand - if not, grab it from ftp.cs.berkeley.edu
+ in the ucb/sendmail directory. There are bugs in earlier
+ versions which affect some of the needed functionality.
+
+ 2) Second, I'm going to detail this based upon the
+ "sendmail.main.cf" configuration. (BTW, if you attempt
+ to move to using an m4 generated config in the future,
+ MAIL_HUB is the feature which should provide similar
+ functionality).
+
+ In general, the changes will be similar for a subsidiary
+ file, but since we (my TI group) funnel all non-local mail
+ through our mailhost, we're not as interested in getting v8
+ to run on such systems and I haven't tried it.
+
+ 3) You're using DNS and sendmail.mx. If you're not, you ought
+ to be, even if you're also running it along with NIS (which
+ we do - except for gethostbyxxx() lookups, which I'll be
+ talking about later). I would imagine you could get things
+ running OK without DNS support, but I haven't tried it myself.
+
+ 4) You're not mounting /var/spool/mail from other systems.
+ I haven't found a v8 feature to guarantee this will work
+ correctly. Anyway, in the past, we've tried doing that
+ here and found it to be a rather "ugly" feature, though
+ Sun ostensibly supports it ("R" option). Perhaps v8
+ will one day have a similar feature, but for now, bottom
+ line, I would recommend against it.
+
+ 5) You're not on Solaris or using NIS+. I'm on 4.1.3. I've
+ looked at Solaris briefly and have noted that things are
+ pretty much similar there except that they've moved some
+ things into the /etc/mail directory. I'd guess the
+ executables aren't functionally all that different from
+ what they had before - the configs are roughly the same.
+ So I'd bet most of what I say in here will apply to
+ Solaris.
+
+OK, let's configure our sendmail.cf! I'll just go from the top down...
+
+ VARIOUS DECLARATIONS
+
+1) For v8, you need to define your .cf as AT LEAST a version level 4
+ configuration. Add the following line:
+
+ V4
+
+ There are some issues regarding certain predefined macros - $w, $j, and
+ $m. With a V4 configuration:
+
+ $w is defined to be the hostname, which will usually be fully
+ qualified (i.e. "firefly.add.itg.ti.com").
+
+ $j should have the same value as $w.
+
+ $m will be predefined as the domain portion of $w
+ (ex. "add.itg.ti.com").
+
+ One note about this - if your configuration relies on the "w" macro to
+ be the "simple" hostname (as mine does)...
+
+ If the configuration version is 5 or larger:
+
+ $w is supposed to be the "simple" name (ex. "firefly")
+
+ $j should be the fully qualified name (i.e. "firefly.add.itg.ti.com")
+
+ $m will be predefined as the domain portion of $j
+ (ex. "add.itg.ti.com").
+
+ I have not experimented with the various combinations, so I cannot
+ guarantee you that the above definitions will always come out as
+ expected. Bottom line: if your sendmail.cf depends on $w being the
+ simple hostname, test it carefully or define the name explicitly,
+ for example:
+
+ Dwfirefly
+
+2) To replace the Sun's "%y" feature, we must use a hostname mapping
+ feature in v8. If you want to do similar lookups with v8, you need
+ to define the following map (we'll go over the rules that use this
+ map later):
+
+ Khostlookup host -f -m -a.
+
+ This will define a "lookup only" map that is otherwise the same as
+ sendmail version 8's built-in "host" map (see the "Sendmail
+ Installation and Operation Guide" for details on this map.).
+
+ An important note: Whether or not these lookups will be done via
+ NIS is a function of what gethostbyxxx() functions you link into
+ your sendmail. DO NOT redefine your host mapping to use NIS
+ explicitly within sendmail - there can be unexpected behaviour if
+ you do so (if you do any canonicalization in your .cf, you can get
+ incorrect results, for one thing).
+
+ For example, DO NOT TRY:
+
+ Khost nis -f -a. hosts.byname
+
+3) If you're doing reverse alias mapping as done in ruleset 22, instead of:
+
+ DZmail.byaddr
+
+ you'll need to declare the following:
+
+ Kaliasrev nis -f -N mail.byaddr
+
+4) If you are doing any other NIS map lookups, you'll need to define the
+ map as done in the below example. I have a "mailhosts" map, which I
+ use to distinguish between local and non-local hosts. Look at the
+ sendmail doc for details on this stuff.
+
+ Kmailhosts nis -f -m -a. mailhosts
+
+5) You might wish to add the following line to support Errors-To: headers.
+ I don't.
+
+ Ol
+
+6) Comment out/remove the following line:
+
+ OR
+
+ The R option means something different under v8 - check the documentation
+ if you're interested in using it.
+
+7) If you're running NIS and have a separate alias map, BELOW the
+ following line where the alias file is declared:
+
+ OA/etc/aliases
+
+ ADD the following:
+
+ OAnis:mail.aliases
+
+ This will set things up so v8 will look at the local alias DB first,
+ then the NIS map, just as Sun sendmail does.
+
+8) Though you don't have to, I'd suggest changing:
+
+ OT3d
+
+ to use v8's warning feature, which allows a warning message to be
+ sent if a message cannot be delivered within a specified period.
+ I use:
+
+ OT5d/4h
+
+ which says - bounce after 5 days, warn after 4 hours.
+
+9) I set the following option to be explicit about how I want DNS
+ handled:
+
+ OI +DNSRCH +DEFNAMES
+
+10) The following line:
+
+ T root daemon uucp
+
+ may be deleted, though it will be ignored if you leave it around.
+
+11) It would probably be good to change the version macro value (which
+ shows up in "Received:" headers) so no one debugging mail problems
+ gets the wrong idea about what config you're running under. Look
+ for something like:
+
+ DVSMI-4.1
+
+ Mine, for example is:
+
+ DVADD-HUB-2.1
+
+ RULESETS
+
+1) In ruleset 3, BELOW this rule:
+
+ # basic textual canonicalization
+ R$*<$+>$* $2 basic RFC822 parsing
+
+
+I add the following rule to remove a trailing dot in the domain spec so
+it won't interfere with v8 mapping features, etc. (Having a trailing dot is
+not RFC-compliant anyway.):
+
+ R$+. $1
+
+2) Because ruleset 5 is special in v8, I rename it to S95 and also change
+ all RHS expressions containing ">5" to use ">95" instead. In v8,
+ 5 is executed against addresses which resolve to the local mailer and
+ are not an alias. If you don't change S5 to something else, you might
+ get a surprise!
+
+3) If you're doing any lookups via the generalized NIS "$%x/$!x"
+ mechanisms (such as with the mailhost map I referred to earlier) it's
+ done differently under v8. For example:
+
+ DMmailhosts
+ ...
+ R$*<@$%M.uucp>$* $#ether $@$2 $:$1<@$2>$3
+
+ takes a different map definition and two rules under version 8:
+
+ Kmailhosts nis -f -m -a. mailhosts
+ ...
+ R$*<@$+.uucp>$* $: $1<@$(mailhosts $2 $).uucp>$3
+ R$*<@$+..uucp>$* $#ether $@$2 $:$1<@$2>$3
+
+4) Sun has a special case of the "$%x" feature for host lookups - "%y" is
+ automagically defined to do an NIS "hosts.byname" search with no other
+ definition, as done in the below example:
+
+ R$*<@$%y.LOCAL>$* $#ether $@$2 $:$1<@$2>$3
+
+ (Sun does this in more than one place. But the above syntax is almost
+ identical in each - mostly a case of changing names to protect the
+ innocent.)
+
+ In version 8, the predefined "host" map can be used to do essentially
+ the same thing. (However, whether or not it does an NIS lookup is
+ a function of what gethostbyxxx() functions are linked in.)
+
+ Recall the map definition I mentioned earlier in the DECLARATIONS
+ section:
+
+ Khostlookup host -f -m -a.
+
+ Here's where we will use it. It will take two rules:
+
+ R$*<@$+.LOCAL>$* $: $1<@$(hostlookup $2 $).LOCAL>$3
+ R$*<@$+..LOCAL>$* $#ether $@$2 $:$1<@$2>$3
+
+ Note that this is almost verbatim the same change as was used in the
+ previous "mailhosts" example.
+
+5) Although Sun's default configs don't do this, because I mentioned
+ canonicalization earlier, it deserves an example, as it's illustrative
+ of the functional difference in the map definitions I discussed before.
+ This stuff is also convered in the "Sendmail Installation and Operation
+ Guide".
+
+ Remember the built-in "host" map definition? As you'll recall, unlike
+ the "hostlookup" map we defined, "host" will actually CHANGE the
+ hostname in addition to appending a dot. "hostlookup" only appends a
+ dot if the name is found and doesn't change it otherwise. Anyway,
+ here's the example:
+
+ R$*<@$+>$* $: $1<@$(host $2 $)>$3 canonicalize
+ R$*<@$+.>$* $1<@$2>$3 remove trailing dot
+
+ Using the above, say you had input of:
+
+ joe<@tilde>
+
+ OR
+
+ joe<@[128.247.160.56]>
+
+ Assuming "tilde" or the IP address is found, it might be
+ canonicalized as:
+
+ joe<@tilde.csc.ti.com>
+
+6) As another instance of the NIS lookup feature, with a slightly
+ different twist, Sun implements reverse alias mapping in ruleset 22
+ with the below:
+
+ DZmail.byaddr
+ ...
+ R$-<@$-> $:$>3${Z$1@$2$} invert aliases
+
+ To use this feature under v8, change the above rule a (remember to
+ define the alias map as I showed earlier):
+
+ R$-<@$-> $:$>3$(aliasrev $1@$2 $) invert aliases
+
+
+ MAILER DEFINITIONS
+
+1) Where "TCP" is defined in the "P=" and "A=" parameters of mailers, I
+ changed it to "IPC". Version 8 will accept "TCP", but "IPC" is
+ preferred.
+
+2) On all IPC mailers, I also defined "E=\r\n" and added an "L=1000" as
+ in the below example:
+
+ Mether, P=[IPC], F=mDFMuCX, S=11, R=21, L=1000, E=\r\n, A=IPC $h
+
+ The "E=\r\n" will save you headaches interoperating with such things as
+ VMS TCP products.
+
+ The "L=1000" is for RFC821 compatibility. Not strictly necessary.
+
+ I also removed the "s" (strip quotes) mailer flag Sun puts in for
+ these mailers. Stripping quotes violates protocols, which say
+ clearly that you can't touch the local-part (left hand side of
+ the @) until you are on the delivering host.
+
+NOW. If I haven't left anything out, you should be able to run through
+your Sun sendmail.cf file and convert it to run under v8.
+
+ BUILD ISSUES
+
+Some important notes on building v8 on SunOS:
+
+Makefile
+
+The default makefile in the version 8 source (src) directory assumes the
+new Berkeley make. Unless you want to go to the trouble of building it,
+you can use your regular make, but you need to use a different makefile.
+You can use "Makefile.dist" or "Makefile.SunOS" in the src directory. I
+made changes to get it to build so it is as compatible as possible with
+the file/directory locations Sun uses. Here are some relevant sections
+out of my makefile:
+
+ CC=gcc
+
+ # use O=-O (usual) or O=-g (debugging)
+ O= -O
+
+ # define the database mechanisms available for map & alias lookups:
+ # -DNDBM -- use new DBM
+ # -DNEWDB -- use new Berkeley DB
+ # -DNDBM -DNEWDB -DYPCOMPAT -- use both plus YP compatility
+ # -DNIS -- include client NIS support
+ # The really old (V7) DBM library is no longer supported.
+ # See READ_ME for a description of how these flags interact.
+ #DBMDEF= -DNDBM -DNEWDB
+ DBMDEF= -DNDBM -DNIS
+
+ # environment definitions (e.g., -D_AIX3)
+ ENVDEF=
+
+ # see also conf.h for additional compilation flags
+
+ # library directories
+ LIBDIRS=-L/usr/local/lib
+
+ # libraries required on your system
+ #LIBS= -ldb -ldbm
+ LIBS= -ldbm -lresolv
+
+ # location of sendmail binary (usually /usr/sbin or /usr/lib)
+ BINDIR= ${DESTDIR}/usr/lib
+
+ # location of sendmail.st file (usually /var/log or /usr/lib)
+ STDIR= ${DESTDIR}/etc
+
+ # location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
+ HFDIR= ${DESTDIR}/usr/lib
+
+For the resolver library, you can use the one shipped with Sun if you
+want. But I'd recommend using another version of the resolver library
+(such as the one with Bind 4.8.3 or 4.9). Sun's resolver stuff (at
+least with 4.1.x) is quite old - I believe it is of 4.3.1 vintage. (Do
+you get the impression I don't TRUST what Sun ships with their systems?)
+
+If you want NIS host lookup while maintaining DNS capability, you might
+take a look at resolv+, which has NIS capable gethostbyxxx() functions
+in it. My recommendation, however, is to avoid doing NIS host lookups
+in sendmail altogether, and to use a "pure" version of the resolver
+library.
+
+There are probably no situations (at least I think so) where it makes
+any sense to link in Sun's NIS gethostbyxxx() functions from libc.
+You could, I guess do it (I haven't tried it) and wind up with a
+sendmail equivalent to the non-mx version Sun ships. You'd need to
+insure that NAMED_BIND is not defined in the build. (If you do
+this and have the "-b" DNS passthru option set in NIS, remember that
+while you have some DNS functionality you'll not have any MX support.
+(This, IMO, is what makes this a non-optimal choice.)
+
+ INSTALLATION/TESTING ISSUES
+
+The sendmail.hf file in the src directory should replace the one currently
+in /usr/lib. You also might choose to edit it a bit to "localize" what it
+says.
+
+The sendmail executable goes, of course, in /usr/lib in place of the current
+one. What I did was create a subdirectory in /usr/lib and put all of the
+Sun sendmail stuff in there. I named the v8 sendmail executable to be
+sendmail.v8.mx and then symbolically linked it to sendmail.
+
+One other thing. If you use address test mode, keep in mind that
+Version 8 is like IDA in that it does not automatically execute ruleset
+3 first. So say you're playing around with things testing addresses and
+you're used to things like:
+
+ 0 jimbob@good.old.boy.com
+
+under v8 you need to say instead:
+
+ 3,0 jimbob@good.old.boy.com
+
+ INTEROPERABILITY ISSUES YOU MIGHT ENCOUNTER
+
+Be aware that sendmail v8 issues a multi-line SMTP welcome (220)
+response upon a client connection. Most systems in your network should
+handle it OK, but there are some that choke on it, because whoever wrote
+the clients assumed only a single line. THIS IS NOT SENDMAIL's FAULT.
+A multi-line 220 response is perfectly valid. A likely place you'll
+encounter this problem is with non-Un*x SMTP clients. If you do run
+into it, you should report it to the vendor.
+
+A final note about version 8 - if you follow the above configuration
+scenario, you'll notice it doesn't like to get envelope sender
+addresses it doesn't know how to get back to. Sun sendmail would take
+anything, even though it might not be able to bounce the message back
+should something happen downstream. So if another sendmail on a host
+that's not locally known is trying to pump mail through your v8 host,
+the ENVELOPE sender it gives had better be fully qualified. This is
+a GREAT thing, because it helps clear up problems we've had with not
+being able to get things back to the sender, resulting in an
+overburdened postmaster.
+
+I hope this helps those running Sun sendmail feel more at ease with moving
+on to v8. It's really worth going to.
diff --git a/usr.sbin/sendmail/contrib/expn.pl b/usr.sbin/sendmail/contrib/expn.pl
index 4012699cac2f..15d287b5c650 100644
--- a/usr.sbin/sendmail/contrib/expn.pl
+++ b/usr.sbin/sendmail/contrib/expn.pl
@@ -1,10 +1,10 @@
#!/usr/local/bin/perl
-'di';
-'ig00';
+'di ';
+'ds 00 \\"';
+'ig00 ';
+#
# THIS PROGRAM IS ITS OWN MANUAL PAGE. INSTALL IN man & bin.
-# groff cannot handle the wrapman constructs, so if you use
-# groff, you must cut the manual part out and install it
-# separately.
+#
# hardcoded constants, should work fine for BSD-based systems
$AF_INET = 2;
@@ -14,17 +14,17 @@ $sockaddr = 'S n a4 x8';
# system requirements:
# must have 'nslookup' and 'hostname' programs.
-# version 3.2, 5/5/93
+# $Header: /home/cvs/386BSD/src/usr.sbin/sendmail/contrib/expn.pl,v 1.1.2.1 1994/04/18 03:52:18 rgrimes Exp $
# TODO:
-# CERNVM.CERN.CH needs simple logins for the expn command.
-# format with groff.
# less magic should apply to command-line addresses
# less magic should apply to local addresses
+# add magic to deal with cross-domain cnames
# Checklist: (hard addresses)
-# harry@hofmann.cs.Berkeley.EDU -> harry@tenet (.berkeley.edu)
-# bks@cs.berkeley.edu -> shiva.CS (.berkeley.edu)
+# 250 Kimmo Suominen <"|/usr/local/mh/lib/slocal -user kim"@grendel.tac.nyc.ny.us>
+# harry@hofmann.cs.Berkeley.EDU -> harry@tenet (.berkeley.edu) [dead]
+# bks@cs.berkeley.edu -> shiva.CS (.berkeley.edu) [dead]
# dan@tc.cornell.edu -> brown@tiberius (.tc.cornell.edu)
#############################################################################
@@ -116,7 +116,7 @@ for $a (@ARGV) {
}
next if $a eq "-";
die $usage if $a =~ /^-/;
- &expn(&parse($a,$hostname,undef,1,1));
+ &expn(&parse($a,$hostname,undef,1));
}
$verbose = $flag_v;
$watch = $flag_w;
@@ -165,7 +165,6 @@ while (@hosts) {
# look it up, or try for an mx.
$0 = "$av0 - gethostbyname($server)";
-
($name,$aliases,$type,$len,$thataddr) = gethostbyname($server);
# if we can't get an A record, try for an MX record.
unless($thataddr) {
@@ -195,12 +194,16 @@ while (@hosts) {
# read the greeting
$0 = "$av0 - talking to $server";
+ &alarm("greeting with $server",'');
while(<S>) {
+ alarm(0);
print if $watch;
if (/^(\d+)([- ])/) {
if ($1 != 220) {
$0 = "$av0 - bad numeric responce from $server";
- &toss($2);
+ &alarm("giving up after bet responce from $server",'');
+ &read_response($2,$watch);
+ alarm(0);
print STDERR "$server: NOT 220 greeting: $_"
if ($debug || $vw);
if (&mxlookup(0,$server,"$server: did not respond with a 220 greeting",*users)) {
@@ -219,15 +222,19 @@ while (@hosts) {
close(S);
next HOST;
}
+ &alarm("greeting with $server",'');
}
+ alarm(0);
# if this causes problems, remove it
$0 = "$av0 - sending helo to $server";
+ &alarm("sending helo to $server","");
&ps("helo $hostname");
while(<S>) {
print if $watch;
last if /^\d+ /;
}
+ alarm(0);
# try the users, one by one
USER:
@@ -253,33 +260,31 @@ while (@hosts) {
@toFinal = ();
@toExpn = ();
}
- &ps("expn $u");
- $said_something = 0;
- while($s = <S>) {
- $said_something = 1;
-
- # make sure the server is talking the right language
- if ($s =~ /^(\d+)([- ])/) {
- if ($1 != 250 && $1 != 550) {
- &toss($2);
- &ps("vrfy $u");
- $s = <S>;
- if ($s =~ /^(\d+)/) {
- if ($1 != 250 && $1 != 550) {
- &toss($2);
- &giveup('',"$server: expn/vrfy not implemented",$u);
- last USER;
- }
- }
- }
- }
+ ($ecode,@expansion) = &expn_vrfy($u,$server);
+ if ($ecode) {
+ &giveup('',$ecode,$u);
+ last USER;
+ }
+
+ for $s (@expansion) {
$s =~ s/[\n\r]//g;
$0 = "$av0 - parsing $server: $s";
- print "$s\n" if $watch;
+
+ $skipwatch = $watch;
+
+ if ($s =~ /^[25]51([- ]).*<(.+)>/) {
+ print "$s" if $watch;
+ print "(pretending 250$1<$2>)" if ($debug && $watch);
+ print "\n" if $watch;
+ $s = "250$1<$2>";
+ $skipwatch = 0;
+ }
+
if ($s =~ /^250([- ])(.+)/) {
+ print "$s\n" if $skipwatch;
($done,$addr) = ($1,$2);
- ($newhost, $newaddr, $newname) = &parse($addr,$server,$oldname);
+ ($newhost, $newaddr, $newname) = &parse($addr,$server,$oldname, $#expansion == 0);
print "($newhost, $newaddr, $newname) = &parse($addr, $server, $oldname)\n" if $debug;
if (! $newhost) {
# no expansion is possible w/o a new server to call
@@ -335,13 +340,30 @@ while (@hosts) {
last if ($2 eq " ");
next;
}
+ # 553 is a known code...
+ if ($s =~ /^(553)([- ])/) {
+ if ($valid) {
+ print STDERR "\@$server:$u ($oldname) USER AMBIGUOUS\n";
+ } else {
+ &verbose(&final($u,$server,$oldname,"USER AMBIGUOUS"));
+ }
+ last if ($2 eq " ");
+ next;
+ }
+ # 252 is a known code...
+ if ($s =~ /^(252)([- ])/) {
+ if ($valid) {
+ print STDERR "\@$server:$u ($oldname) REFUSED TO VRFY\n";
+ } else {
+ &verbose(&final($u,$server,$oldname,"REFUSED TO VRFY"));
+ }
+ last if ($2 eq " ");
+ next;
+ }
&giveup('',"$server: did not grok '$s'",$u);
last USER;
}
- if (! $said_something) {
- &giveup('',"$server: lost connection",$u);
- last USER;
- }
+
if ($valid) {
#
# now we decide if we are going to take these
@@ -365,6 +387,7 @@ while (@hosts) {
}
}
+ &alarm("sending 'quit' to $server",'');
$0 = "$av0 - sending 'quit' to $server";
&ps("quit");
while(<S>) {
@@ -372,6 +395,7 @@ while (@hosts) {
last if /^\d+ /;
}
close(S);
+ alarm(0);
}
$0 = "$av0 - printing final results";
@@ -473,7 +497,7 @@ sub try_fallback
print "Fallback an MX expansion $us -> \n" if $debug;
$oldhost = $mxbacktrace{$us};
} else {
- print "Oldhost(host, $us) = " if $debug;
+ print "Oldhost($host, $us) = " if $debug;
$oldhost = $host;
}
print "$oldhost\n" if $debug;
@@ -543,16 +567,97 @@ sub do_validAddr
print "validAddr($addr) = ???\n" if $debug;
return 0;
}
+# Some systems use expn and vrfy interchangeably. Some only
+# implement one or the other. Some check expn against mailing
+# lists and vrfy against users. It doesn't appear to be
+# consistent.
+#
+# So, what do we do? We try everything!
+#
+#
+# Ranking of result codes: good: 250, 251/551, 252, 550, anything else
+#
+# Ranking of inputs: best: user@host.domain, okay: user
+#
+# Return value: $error_string, @responces_from_server
+sub expn_vrfy
+{
+ local($u,$server) = @_;
+ local(@c) = ('expn', 'vrfy');
+ local(@try_u) = $u;
+ local(@ret,$code);
+
+ if (($u =~ /(.+)@(.+)/) && (&trhost($2) eq &trhost($server))) {
+ push(@try_u,$1);
+ }
+
+ TRY:
+ for $c (@c) {
+ for $try_u (@try_u) {
+ &alarm("$c'ing $try_u on $server",'',$u);
+ &ps("$c $try_u");
+ alarm(0);
+ $s = <S>;
+ if ($s eq '') {
+ return "$server: lost connection";
+ }
+ if ($s !~ /^(\d+)([- ])/) {
+ return "$server: garbled reply to '$c $try_u'";
+ }
+ if ($1 == 250) {
+ $code = 250;
+ @ret = ("",$s);
+ push(@ret,&read_response($2,$debug));
+ return @ret;
+ }
+ if ($1 == 551 || $1 == 251) {
+ $code = $1;
+ @ret = ("",$s);
+ push(@ret,&read_response($2,$debug));
+ next;
+ }
+ if ($1 == 252 && ($code == 0 || $code == 550)) {
+ $code = 252;
+ @ret = ("",$s);
+ push(@ret,&read_response($2,$watch));
+ next;
+ }
+ if ($1 == 550 && $code == 0) {
+ $code = 550;
+ @ret = ("",$s);
+ push(@ret,&read_response($2,$watch));
+ next;
+ }
+ &read_response($2,$watch);
+ }
+ }
+ return "$server: expn/vrfy not implemented" unless @ret;
+ return @ret;
+}
+# sometimes the old parse routine (now parse2) didn't
+# reject funky addresses.
+sub parse
+{
+ local($oldaddr,$server,$oldname,$one_to_one) = @_;
+ local($newhost, $newaddr, $newname, $um) = &parse2($oldaddr,$server,$oldname,$one_to_one);
+ if ($newaddr =~ m,^["/],) {
+ return (undef, $oldaddr, $newname) if $valid;
+ return (undef, $um, $newname);
+ }
+ return ($newhost, $newaddr, $newname);
+}
+
# returns ($new_smtp_server,$new_address,$new_name)
# given a responce from a SMTP server ($newaddr), the
# current host ($server), the old "name" and a flag that
# indicates if it is being called during the initial
# command line parsing ($parsing_args)
-sub parse
+sub parse2
{
local($newaddr,$context_host,$old_name,$parsing_args) = @_;
local(@names) = $old_name;
local($urx) = "[-A-Za-z_.0-9+]+";
+ local($unmangle);
#
# first, separate out the address part.
@@ -600,26 +705,27 @@ sub parse
# b!a
# a
#
+ $unmangle = $newaddr;
if ($newaddr =~ /^\@($urx)\:(.+)$/) {
print "(\@:)" if $debug;
# this is a bit of a cheat, but it seems necessary
- return (&domainify($1,$context_host,$2),$2,&firstname(@names));
+ return (&domainify($1,$context_host,$2),$2,&firstname(@names),$unmangle);
}
if ($newaddr =~ /^(.+)\@($urx)$/) {
print "(\@)" if $debug;
- return (&domainify($2,$context_host,$newaddr),$newaddr,&firstname(@names));
+ return (&domainify($2,$context_host,$newaddr),$newaddr,&firstname(@names),$unmangle);
}
if ($parsing_args) {
if ($newaddr =~ /^($urx)\!(.+)$/) {
- return (&domainify($1,$context_host,$newaddr),$newaddr,&firstname(@names));
+ return (&domainify($1,$context_host,$newaddr),$newaddr,&firstname(@names),$unmangle);
}
if ($newaddr =~ /^($urx)$/) {
- return ($context_host,$newaddr,&firstname(@names));
+ return ($context_host,$newaddr,&firstname(@names),$unmangle);
}
print STDERR "Could not parse $newaddr\n";
}
print "(?)" if $debug;
- return(undef,$newaddr,&firstname(@names));
+ return(undef,$newaddr,&firstname(@names),$unmangle);
}
# return $u (@$server) unless $u includes reference to $server
sub compact
@@ -1078,15 +1184,33 @@ sub final
}
"\t$name<$addr>$error\n";
}
+
+sub alarm
+{
+ local($alarm_action,$alarm_redirect,$alarm_user) = @_;
+ alarm(3600);
+ $SIG{ALRM} = 'handle_alarm';
+}
+# this involves one GREAT hack.
+# the "next HOST" has to unwind the stack!
+sub handle_alarm
+{
+ &giveup($alarm_redirect,"Timed out during $alarm_action",$alarm_user);
+ next HOST;
+}
+
# read the rest of the current smtp daemon's responce (and toss it away)
-sub toss
+sub read_response
{
- local($done) = @_;
+ local($done,$watch) = @_;
+ local(@resp);
print $s if $watch;
while(($done eq "-") && ($s = <S>) && ($s =~ /^\d+([- ])/)) {
print $s if $watch;
$done = $1;
+ push(@resp,$s);
}
+ return @resp;
}
# print args if verbose. Return them in any case
sub verbose
@@ -1101,14 +1225,15 @@ $flag_d;
$flag_1;
%already_domainify_fellback;
%already_mx_fellback;
+&handle_alarm;
################### BEGIN PERL/TROFF TRANSITION
-.00;
+.00;
'di \\ " finish diversion--previous line must be blank
.nr nl 0-1 \\ " fake up transition to first page again
.nr % 0 \\ " start at page 1
-'; __END__
-.\" ############### END PERL/TROFF TRANSITION
+.\\"'; __END__
+.\" ############## END PERL/TROFF TRANSITION
.TH EXPN 1 "March 11, 1993"
.AT 3
.SH NAME
@@ -1119,6 +1244,7 @@ expn \- recursively expand mail aliases
.RI [ -v ]
.RI [ -w ]
.RI [ -d ]
+.RI [ -1 ]
.IR user [@ hostname ]
.RI [ user [@ hostname ]]...
.SH DESCRIPTION
diff --git a/usr.sbin/sendmail/contrib/mail.local.linux b/usr.sbin/sendmail/contrib/mail.local.linux
new file mode 100644
index 000000000000..42d2c3c3d9ce
--- /dev/null
+++ b/usr.sbin/sendmail/contrib/mail.local.linux
@@ -0,0 +1,205 @@
+From: Karl London <karl@borg.demon.co.uk>
+Message-Id: <199308111712.SAA05454@borg.demon.co.uk>
+Subject: Final port of mail.local to Linux
+To: eric@cs.berkeley.edu
+Date: Wed, 11 Aug 1993 18:12:27 +0100 (BST)
+X-Mailer: ELM [version 2.4 PL21]
+MIME-Version: 1.0
+Content-Type: text/plain; charset=US-ASCII
+Content-Transfer-Encoding: 7bit
+Content-Length: 11415
+
+Hi,
+ Sorry about this.. This is a final version of mail.local for
+linux..
+
+This is what I would like to see distributed with 8.6 if poss...
+
+Karl
+
+--------------
+
+begin 600 mail.local.linux.tar.Z
+M'YV0;<*D8>."S9LQ8=B\`,"PH<.'$"-*G$BQHL6*(&C`N`$#!@@`($#$N%'#
+M(TB1)$V&7,D2A$<0-6C,D$%3QHT8+V/HI$$#9(V+0(,*'4HT8ITY=,+("0E@
+MC5(V12<ZE0,UJM6K6+-JW<KU:L"!!0\F?`$G#!TT;L*T*3/'!9JN<*WBA*%1
+M)<J2'T..Q'NRY0P;,6:$+`DC!@V:,VK(T#MCQDV0,.)*GFP4J5*F4ZMNS4RY
+ML^?/H#^_4-%"`0@5((:\@9-'3IHS:.B`0#$FA<@<.3Q205,&A)0R9\JXH3,'
+MQ!LS(,[VKN(FC9TR<N:DH9/'./(A"=.8>2.G>1@7IE$'8<,&A&O8Q,VSA?Z<
+M#/C3X7V7(9,&J6LQ=>BD>>,&1!@W9(!P5&]I]#?'&W7(,49O_P4H1H%*5;>=
+M'&W,P0((=TR'AG%+97@6@G3$U\8;])F1!D+Z\7>A4KW!`5T;T]$Q'PAPR/&&
+M'6F0,>-99B7'&PC;D?=&AFZ<`<(8_-&7HAMSQ,<B"&O1H4-\,;@@'WWVI8'?
+MDL4=!\*!"2YX)(F]M7&4;'*4D52!/C(HQHV](<G:>;'%MY(;;^BWX(5GU0<"
+M&_7)YB62`$ZW'Y/^`=@FD&\(2:216([!AD!KR?$>:C)8^1N6=-R7WZ'%L?E@
+M6G)(R%T;4)ZI7HTDUB&F<OZ]^=R8<[Y6YVDLX:EG&7RBX2>@2%DW9J%<)AH@
+MK$$:]"@(D4Z:1J4@L*F<G2&1<5`=:PUGUJ'&OL"=<<HM%9",KB54'*LXZAB@
+MAQO"RJFG2UX*P@Q6CE=>&&0\)X=^TA4)I5G0I6$NE,(M6:"19I1A5H)L<2C@
+M'+UYV6=Q!YI!QQTL4IMJL%C",6EUR#:J[,'^C;$&GG>P,5]PV4H97@*[^<DJ
+M&:[*5J"D=>A(\7$7/ZGC<P:YZ"#(/S+G''3246?=R]@!.J%W%PH!W1IEJ%Q=
+M@]&F1VBG6N;'75OQT6"E$V5H"-VB::TE+*Q&ZYMT=7@N!6O:#7LY77%;P_NU
+MQ@%5)T9O`Q[[!@C"61M=Q$NQ.J*,--I(\QCIZ>A:>T#:B.K$7_*,<9H:LPOB
+MERZ.H=V)C>_7H6MTR-B?BQ36)QU_E\9'!1))3`'"%$\80<4504A1!`BU@P"%
+M%$]8D00111`!@A!9@##[[[X?48035-@>A!/*#_$$]5(D(4055#PAA>U@@!&$
+M[;6?<`((UQ,1W_7-%X'%\$5,8;OXP#<!!1-))`\"[U*0PO6HT+\I7"@)3A@"
+M$ZI`!`0>(6K@`X$3GD`%$/"O"4F@@O_"=Z'GQ2<)^N.?_P`H0.H5$`2Y`T$3
+MBB"%(2!A@$$00A+X1X7FM0\$1LB@$^IG.R/@+PC"ZQT!AU`%)O1.>%60`A2>
+M,(4BO,]W(&C@%!08!!`FSTK`<X($GP""(EAA>A6<P@N9P`3G(0%Z19`>]>XG
+MA=1LCPK=^U[XQK>\W_$OADQP(JY\V$;X13$)OAL"%0Z(/4`609"$',+QP!@$
+M)EQH"E`X9!(:>2'Y%2&$O<O"A?"G/2<T,0I5`.,DF1`?(@2A"4&0GNU0@$`%
+M,M"!$*S@!"MXP0QN\`D7&MX3B.B[%5(/A4:X716$,`4"4@%\OSO"$YY`A"G$
+M!W]-E(+QAE"_'5B0B?<+9A6:>"%34B$(FVRC+G-8/6OB[WM30"`/LZC!`%8!
+M"@3<7@KB@X0G7,&++$Q-$+;IOQMNCWU.:-[SQ->\%-Y1AC34Y/_.^+PV(M"-
+MW`L"(F\'QR0(,CX'G6$&%8J_.5:0E0E<8`.=<`0)II%_:J0F"MM(P3-*X0JU
+M*X)M>E<[!V81H,WC71:>&<$4/@\$_`2F&8.'.]T!L`B5_*(6DQ#,(!#!>$U4
+MGD_/*#QL>D^C-01F?*90!1=&\92I+$+L3I,`(*!@!"DHRUGHUA8T)*`&+A`,
+M"J0F!ZI9S38Q>,%(7I"#&(3G!0H8P<W8D+/>\$"M:&BK#Q006!V9R`V]^0(4
+M@C"[+S!AEU307P)$\`(ZM`$.+S`(0@B"A=*:5@0*"(UJ5_L5@HAV+*T-RVA=
+M,(;5@F8N=<G+7>RR%[NP9"0PJ$$-!B.3FMBD(XSAR0T@8]OF#N5,E_D(9[@R
+M7>=:][K8E<QH2H,KU=0*/;.IS6URX[P?_28XP^D2<MC6'+=-ISI>:IIVN.,=
+M>=G+/+9*3YH@)H?VC!4UFPH4O+B%M0%%RT`(4A"#%#6J"#&*0A;"D(8<YKG\
+MB(A$HT/1H5:4)AJ]*$8S0E>.=H2&'H7,420CE))`Y:0.1VE*N*K2E03<M6)Y
+M"4P*'I..-H8F-0FD/[`*@ZSBM)K6Y%=CNCH1KWSTJT`)2\6&XD]QL';BD?FK
+M692"CKPR->,L;0E4!P9!@TOU8%29*5AIFIFK>A/D(=/*R.A!<IZ4W*LF!VM0
+M28HRHJC\HV0-B618?M;9I,4;C5EK#-@JV+;XTZUOY8DWX@)8N=AP+ANE:T;L
+M6M2[:GPH>=&+?>3Q3[Z@PR^2C2M@`VO9H4B6L(7MUV$&EIBO=F:QS96!;ZKJ
+MV,<6Y>=EA<%D*%,9&5A6,!BK`&:S;ERK('=@G.DL<[7V61F`MIH9B8%HRVDO
+MTMZ[-++*]VD"B]K4JE:&JRGJ;L/BVI:^)B^Q2;!LX4*;6B*VWJ)I.SK<CIN\
+MUZ+>K.&-/^KV6G3X%@:_`0YB@B,<@+Z&.&4OKD6.JUEQ)'>T`)G!<DRF=<\X
+MAZN55%@V<PA=ADOWK3N@3G4>;MT<7N>&_P[5=D7=7>]^%SQ=&@]YRF.>&=&H
+MQNH!-'MOC"/XQ$<^\Z%O"NK[^?L"VL7Y^<Y^*\W?_OJG/!(.L(")%"DLEQ?!
+M65H0A+94'@=W_L$04OU_O2LA`>LGU!6V\(74BR%6;8@]'.IPG7QD7Q"E,,0B
+M'A$*25QB$Y_X.RE2T8I$P.)#)]A%I89QC&7\:?3`R$:(5E2.1*_CU_&H1]3D
+MW8\-#.0@LQCZ0XZ^E8N,NR-O%TE%4K+IE]Q?)L,)T4^&TH2-+"5853F;5FJ=
+MI+'<(BW!KD&QXU)XQ./E)<$H5*X2TYC(!($RF>E,7$&3A=.LYC6AGD)^=I.R
+MX(SZ.#,X!7.V$9WJA#H"VRF%=\;3"?/$53WO^<4V#F&?4?TY"K7HQX%*H:#!
+ME%$)=2%7P%`N=5.=!$<2-7K%U#T7A2L"N%&TYU&]%U*O1%(F=00H-3TJA3\M
+MQ4(PU40SU3WIA($/Y4<ZQ5,5-%6_$U13152Y(W.^DU33`SQ-]50Q)57!]%."
+METX(M5%:A2M<Y56FA$K2<RF`%5C:`2!E@!R`,AP*,`8EMA1R`F>QL05=``(]
+MH``B8%9HE1I%1B>R01MXA1NZ85[`43#]QEY'@V]*$U_9`6[?P05NP`6F<5]B
+M6!S[Q1[SX0)T*`([$%B%HQT@,!H@H"M_4B"RH0))*%AFP(1.J(@*8!EZ<B13
+M^"5C,`;20098J(4@T(5GE0*Q]5H$,09OY0(V,!MT95?E9ALVH%<YP%<Q`(B"
+M6"C(88B(^(2+V(B#55@@P`-SD`=S0!9*H19NL5B"Y0;.9EC!.(R4>(Q*J(R$
+MM6/`*(PO<"`FHR;0F(S+^(O-^`(FHC+;V(O4"%GZ88XO4"#C*(V^6(US8!!G
+ML([=R`-F,`;#01!H@(SD:%CF2`9B((_3:%AP<`?ND8_1.(_ZL18`V8YUT!Q(
+M49#ZR([4"!W=\08+28T/N1\7R8QT0`:`\H\&R8T!Z8U<4R0;^8F(Q59N@5J-
+MU80%4@8)8`3@QP0)D`!^-0*.]9(),$LR^4TT"0.,I8@)H".`HB\@\`62A0(H
+MH(@7(H67H0(ID`*!:`=OD",)0)%'F91+.1Q-*66RX91+H0(7X@)D&953695D
+MD`!)9@9Y\"!F@!Q("05*"9:G898*()1(P1V1I95T"952J0!4:95'$0;!D95R
+MB0*!209VJ0!?X08HH!1G,`8<=@9V,$\)H(C^(0>1&8@)T)<J`)EV$(A[H`!7
+MB0?DTA^8N1KG2`:<60:F"1W]T9>J"9F<:1\U0R-AL'($>1H#R9F8*8478@9D
+M<"'3EA"<60<Y\@6R@9RL29I]>7%OT`:!2)K5Y@;PB`(B,(IBP08B<"&7=022
+MQ4+$(P7>^03@B4HS])>D"9VHT@,25$1,P)EWX"LJ,QNTL2'N&1QTH)J/J9F2
+MF9F4>2$B0`9FH`-RH`,B$)4@$`+N602Y8YD),`<>(H7W:1NC69,(`3$@<`)D
+M<`(Z4).&*`:_M@:;$R!(\EG;(@;UR8BD69-BD"9AL`:<V9FYV1LG8`8>VJ(9
+M:J-RX*$@BAHB:C(E.B8HJA\JVALL6I.7B1PHP)X0F@`L09$HT).OEYUUP`;Z
+MX3&]T0+(H9J@DJ`SF@#LZ8FSJ9EA^J(*(Z,Z6J,;^@,Y6I..%097ZC)*.IC!
+M@0)_69-]0)J0.08@T`+NZ:4`PIF@"0(K$*APL)K3N:2S$0*?J9F5V:)V6@9X
+MNJBC09JXD@3(,::(&')E(#HF,A\78F!S,V^5$YT@H)_P6"!X&BWU=FM0BAK,
+M^2]T((5L<2&/!AT9`C&CJJ&EJC9C"BMEH9O<87$#`:NX@B1RL%]PD&?^LI^+
+MPIS@$:N`E0"SFI]JPIR52IJ$B`(A,*8F8`*-VJ08AZUTL*J.J:!\P`>8NA(A
+M@`(#Z8GZ.9!I0Z[1J:Y\0"-WT`(^,)!?,*L,*B`Y$I4M.J;N":]W(*]J,I#:
+MRIP*^@/ZRJ_^2C<@H`.?^`,82XOK&2#NF9=I8J]MD*<3,AO%61[N"0/6]*B4
+M:4TKL`*@":$E"P)\X)Y$V89-.IRG\;*MB0?3@0(E^Y=[.HG[^;%.ZIR7J`+L
+M*9JDF4-Y=!IF``><F9!EH)S)80?&R:W#`20X6S4OR9E]20=N<"%/6`9;(`-T
+M@0-=L*A@ZXGV03-P@`*215E(8%F8I3]YVJTWZXEML`9(40:?A0)@JZ`]X)XM
+M$`,RFZ_O^K2>*)S5>;,">@<KD*`$6Y-22J6K)P(-*63U":W5F1Q^VZQRX&#A
+M6`9@2IJ(B98IT)!/N`:`ZP8BFR:4&KB+>KH#*[4H8`)T8+5LD*>TJYA/ZQK#
+M809-"@<":@085P+%@;S=>:IMT)2VB[NZNY@),+9;``-9Z)XGP`4P<`*<.;(^
+M.[:>&`/69`;Z.0<H,+87(AUZ4`;'<;XOF0+IVY$%(I46VJ+=2KW6JX782X<G
+M\*1<"UGA.Z-5HZ$76I/=^K^]$:Z)"%G5>[W8:P3KH\`A(`9C\+?H^XG&BZK+
+M6P.3JZ2]FU;Y,08H<`(^<`+!"0=Y2KG@>[(SNJ<U^<&_JXC"^[0"JKQB^[XS
+MVJT)LZS<,;P=G`!H&J.<&;0)8(B:2C`K1YB]@8B0E3(OZ;FMDQ8R@K.0-2/_
+M03BF&;I6DJ3=&@(%HB-XX+Z0=2'9ZP;]"Z$?#`<A/,+\>\)Y:HA/D!]J+!MA
+M<(AEX,2094VZLF2?JS3\-@=*/&4=EA#*TH>G4:UIO,9E;,)`@L*SFY@I\):$
+M-0=HX,.^R:0[;"-RX,,PNZQ3.I,"*B.?Q1VB>ZP8@CJ]09'<4;H)D"9TD"".
+M*9Q`RU@UJR^.>XCS9IF8*9Q>>[1TH[01VBFW28E?(@:U*<S,-JP2&B`JT)M8
+M^Y4P.L47T@9B()P7X@9R<,UW@*MO>2']=;6=>8EN:085<@9;,!==<"'X809;
+M@`,J@!,R0`/IC)MGL06H-#]RFT=.D+;4^994BV@VTLU_`C%EP+KJ6<0J@*FH
+M003U0<A#PBQ<JR\@,S@->3)#TA]L]:<M`#J?*C#ET5IO@@<-@Q#]\3<*#0(E
+M!B#"%F:P`C$`TEK^`2@U6ARC.ZV'S*U,^J[Q:J[TJA8H0#=16;^4Z\D\"<J?
+M6-$H@]'S9K$VC,MKD<*N#,LH$`-Y2L0?''+`2P?"BU@U/(Q-';>5A9Y,$'K7
+MG,N+VL6T$<TSXIZ4EA1T`*]F@0878@)S(`8*&J[M&A(H4-<N@!1?8)T%L@8+
+MZIZ&NZZW\P6UPP1.L`1[_8]^/2(Z$M0@4,!26M0^V=46N[HS,KK+BUA0G:W=
+M,=55S5@(?=*[`1UE<`)39AZ_UAN0MJ4;?3&#PRH+LG(-TR=N(-C*X3>/=B1J
+M308GC2S'BD4Q4QQK\1_%(=SU2=*(^#<"`MBYW8<*7:UX2\W"J85Y;1PNXIA<
+MC4)?$`10$$G8PP=/\`5#X#N41=Y?<`7$XP1,H%!3@-CM-P52P`?QG017L$U2
+MH*`\X!)"?95$34&6B]D@T-3=;1^JO,D4B2=V69-1'=I4/<2D_<TFZQ*<:8BF
+M9;%/L-U?@@8(P@8!XM`):P:BM08G0#+*70;61-`9X0(T0$R)=].,VJ0EC@+6
+MC;.7-01+\`7RHZ"4'>!4,."?B+Q,/0>='=?QFR8\K.#+RN!0K;L!W*)GD">#
+M(Z+-F0!$#-#'@1QL3="L>^,7`@.KUT1%L./30P2\"\E8+<,H,,[EW-5`4`(@
+M_H=EO19-F2!;?K=,2FEE4-"W+.:/5`1E_@5-1`6V,;BSL>7*F0*%^]^5:]0B
+M(,J@6\HJ4^3+B^!+[K--_@8-WLI03M@S.N70:N423IKS:<I*B<V>"*-D<,OK
+MG+YIL+[MN\Z2[0/^7;#?@@);[HDH:QW(T=_8K,=+`:B'N,V^;JCNZ09W\*1X
+MJ^R>:'+30:E@+F9U@!PKX.O7+`?\[=^3W:)#O<F67:5$7N!&?B$'WBD)KND5
+MV>DU*>J#(\S*&*8NW*VJWM\PX.B>+.21_KFD3&:C:^E)GNX+SNE_">]C\*$)
+M`,,&#S`V7LTXJ^5O^>0)$>583MJ7&JNWHR:+<M%G@S5G8"-U``=8A`2!PATG
+M0LAYH,X%`M-IIC!3G''^$2(8KS!2^"\#`=%%"1UY@$57L,2#8Q!%<C;6DG$K
+MLG+8@N(E9C.O>M(<'QV^`@<.PSHPLG)@=@>H;8G_$1S'\MH8DIO^H1ZYR6@C
+M:RT'<]('8M,L:N4?VJUC\-NVT:(P+(47W?#6'+']>@?_FB/FOJ]W_P5G,+"/
+MC+IF$(S*2/>*N0,_&D7\<0*R@3'3\6`"`@=D`#!;C,B0+"EO`#&&+Y6)GP2?
+M!2BBLYS6>1!K4/FDW<44#J%KV9;:(;QN/@=GD*</[IBI'XA!FY@*L/KC;..P
+M;YE]6<[`3(FD8YO,AHU.009D(`=?P";XDOS'O"U^NLN>6+C'+`>WZ>%]F[4J
+M@`902YK$#W)\J/TAYYM9JS)N<-8YW?R6TB]?8`9J,1!Y\-^&*#5?<JQ92XCC
+M_"7LH62'F"?^8;4#07.5`=-GP'+:7H-ZYHJ_V(%K0S>PTSA;7IB+#,`!R?6D
+M9E\.,X#<3V%]"*3``.<-=B)%V(\.4,!NIZ0JFX"#="`P\TD)<G?IT%VF&WCL
+MS@*V*!>6`-1?7RL0[>_]L8'JX)ZX'[]"`U]`_5$'%S&C*%B100$^T`<`0?4W
+MUVP@^V."*`T._,`O8/[.P%E(84X0!X(NV="QI*`/F`-?8`M*N!GWZUP""%!@
+M38IMD3XU@0*"@!%`;#N$`>V2'4<$CH``:0)A3G`1+JI&`@$<N#N!E^T3&3\U
+M`?"^A`O49.K.R<TH&5CQII=P8%N=POSQOMAGJ$3")9L-+HT,[*<F-<U@G]@2
+M#F'N0NPU9`9R2)_ZJTLF``JJ+_8EO-3?Y&()`<O\=;(_&.0@728<=:VO$&(Z
+M1`@#9QE@0DL*8%+A*05PH1Y=(,1<@"PX6"SM-%I`P!;@4LPK"PV(I4"67$#I
+M"EJ.*"L5$R(P!)#201I)P*@C0:9M-,!NC4AJ1U8K=&DFQ5*+2@1CP7W9$"EM
+MPV[X!12`E,),]<'])04VT)68Q%<Z6N2,#HRELB2(^)P]]&3YT"PDA.#4!NB`
+M+KM_<T`?@K/GU!`YD]7Z`F1`4K1#[4`,2=-%!!9TK/O%0T)'!;BA-TP`%]$R
+M[(O'1+R`1$/\2R.@''K$,/`%5.);"P..;".:`8_8C*[3=^)Q`80A"D3_D!-1
+M(DTL'"Q1S\V&A+@/81;/>FL13@'LJ>Q"%:NB5;R*6#$K:L6M*!&8X5AH`C'*
+M):D,KJ@5<`MR.0F]1;>DQ;[0$F2`3B`N,Z$F<(2<(`-L@&)@+F2QN4"7I2!=
+MGD)7J"YY,3`*1LDP`LI**`*+5&-TG2*YLHK(3?P3"7KE!L@BQJ)+CD`/2`!>
+MD0TH`%3B!'#`9<R,+@`HR9`)<@6<P&6T$7E"`8S&)L!,BD`/H`'"I0:H1@02
+M>GK`"Q@5C,4%[*-?)`;F@'M@%?%H;RV6P4@<BZ-Q/(Z",3.^`-"(`Y!C13"+
+MO"4EJ$7IR!97@@VP`3>`!@R&CF`#8*,,4`RI2"0TAL?@$IPC9=B+F,$O4A?U
+M:![;HWMD"'Y(!("A[Q(;PDL9(B^G33Z@E_0@:[)-&WH;PN+;T!>!`1[B(Z@I
+M#WE(/2A`Z18?%8"!##!>YE,PF@*CH=@$CA$36&/,F`H(<R$R3<G1$"#"07(!
+M^0C9,LRB"5N9J45\F-018BS-B-EZ)J;/B(P_XR^@#)<0D?+Q2;P8'"D2-,5\
+MH#%?1LH(BPM)9';,F>DQ:P+(_`@A`R?>C!CBD7=BSNP)F`<2GTR>*19\IC?T
+M&D!3'R1%EK$4/)++0,B`4RQ$!83P=Z>"QZR*B/,JEJ2;J4)/TD!&R5U19XI#
+ME<0SQ`+,9$E&@6*N3)=T%M""T-P:.5DMKD7+.)&-9BGDJDA#+CQ:I;D1+U+"
+MG`5-`R0E9,OAD9_FON`+?5%J_,6IF33&K6"L&G_1:E[9J_D6L:;>^(F*L7$&
+MY8AD"4>26=0'CU%P>,V,]#7`9D@(&V(S'*9$?$0V,H--V@R)U#!8I:V!:-1&
+M:(@9;`-4[@V`/`XX,@$(R.X0;I;'N+$:QL+?I!N]$1T*Y*MT-V3#;,B-'T&Q
+M^F.S_(_YYEO\JKJ!'-!-WJ@Q>X-0_@N#\S!VQ.`H'`PGZEF./`%QEDWD"!B4
+M(U@E&V.9,>3EQ^%HH(ITU`C3<<I`S.KX,%0/=N!('CD[8)!1F3G`PW;8G$62
+M<P0*59D\:T3_)""A,T>*SOG(F$FG??!(/R(_Z`?W<2AF9X2DG:M3/[+.!7H@
+M7$>64)"O@T&*C_,X/A[$0(*0J2,S`PC-S"8JA(6X$!CR@[+*#2$G.P3J?)Z]
+MTW>,B#@)/$S$B1A(C&EXC`CB43Q:A/'@DU\B1AI)Y/F8:83R1)V1Z3V&#AT1
+M`G9DD@B!/,(C/P_3*3T3A38:DKR90%)/((0DDN3U6!),\G]H3R>Q/:(D]QC(
+M(A165HGON9G!Q^O4$I\Y=G2)\O$E*RB8.)]BDD&BS_1I)CSR^D@3BZ)]+@OW
+MT2;<Y*M\$]HS?LI)U$$_41-]4`_QY'Z2@#SAD?,'G]@?_--/ZLX_Z3]GA*`(
+ME0A40PB0`<HG#V5D+J!'4E$NBH$DGAREC5`@D.)*1DI)V2$:*`FDE-_A@1I*
+M")(I[(,$V903Q'12D(%\`CUE!U$5%Z0^+:8,0BJ-IP8Q%?:!@_(/"ZHJ]N.J
+M)!2M8B"'$!+X*D9(K$S,7^F%1)%`<"W;R07@@`1@`Q2H*KJ6K2@CO`";,!D;
+MI`L@`@$B""S,\F`3+D0,P`U^Y8+*!K'F`G)<(P$!.,!!/H$FX0*FP(9P`J=$
+M:SH!,W-`94M"<)!.($!XK#)Q0,-,'0-I;P`/.$@7>CNRP`2!`NG$F;B`&6KS
+M$.AH4:%0SPB4!^00!)8">W*05;1>4D.R-$0W!/*8(MT#GMA.)X!#4058!`ND
+M2`&PNN3V(RP#@%`*`:)`S+'(EQP&QQ4K'"W@.'`I4X8U<.)V(P.A0C9`*YJ'
+M!K#H4IB&&XJ%0H$?>D`50$U3`*?-D&I1QJ0JG%L=TUTY0HLZM0'H(*$`'("D
+M/\)+"<DGX?5ZS1SPE4*@/+2`I&`D6D"&T(0;`@_(TBOJ`I*`;)"B0()]6%'+
+MH0"F@,AA2XLB$T('U;9)"V01T(PNP),J@"10*-)%'9AX,.V/!3*6]B.`*!Y(
+MD3CO642[H9$H",=GH0X*`'SU&FMS-198;_@;?\\--`=_D6E:6DDR$N4C@Z$*
+M]0$>@`CXVAH_!NGUABSA+^(IQE$?O6*?%HYA6APH5A]-#H+&$*J%3QHLR\`?
+MM9>$X]=LB%J&V@)$-&4+R9"3`A$5]1\$&_CR$WYTH"8<0HK$,FH]355J30ZL
+MTI2&]4(7Y#@;**!\E+#^%2TJC4,5J74T452'CZHDRP1&56(*X-35/"1QI1Q$
+MF0@48;$_C*PZYD]15=*I63""7)C3`JE,\R-,&UV"+)7A`9PA'8#&3EV#ZV+"
+M.$@L8$5+'`B0`4&5/O'0FP=2X<!#=0^=]),>,5A1/L99TE&`_,]/S#YR.E:7
+M0OEB#QU0;0@&%J``8$7^6Y!+P4^LI30P([P$14T3%K6&QE50.BB9:&8,AOH!
+M4"@-UX1N/`*CF0.NHK9%&*SA`SP"(;JC2\XX9*($`39:Z(:8'L:CO6%.!YE*
+M_Q0K_5.O=%)^L8+A(&UI%[$#SD,+*(`J@'!R*L00I$O2K=J(A0DP$*K:T`/\
+M(6+T5.?*%I+"9S&FR)2(,JWZ05M5Z6UUI3EB4G:6SQ):$JAI,2U_ZD25!<C1
+M6V7#(BU$G@6TD"(7<%Y+2V'E=^I00APK%NI;W^L+2(?+\8"^@&D8#/D+,;6F
+MLC)-0`[ND`<<Y#'MHK=#T+$/)H`[^FH3%0D@@+#2UZ6`!S(AAM6P9!5(F-7%
+M`&+]JII0@(&U-PQ6"WNB`)ELP`$9UL)F0IB60ETK"*`=Q82@*``@`EI9QW%=
+M&DN4AJ+1[:0`D&"#>$)&`L&R.I+A]:Q>J/%Z,.VQQC\%$%)91!QU`UA4-MB!
+M&P`"P(/7$U8VXN.IA3)Z8<'#>SRS:#;-JMDURV;;K)M]LW`VSLK9.4MGZZR=
+HO;-X-L_JV3W+9_NLG_VS@#;0"MI!2V@+K:$]M(@VT2K:1<MH&^UD`$MG
+`
+end
diff --git a/usr.sbin/sendmail/contrib/mh.patch b/usr.sbin/sendmail/contrib/mh.patch
new file mode 100644
index 000000000000..7b23a5b71dd4
--- /dev/null
+++ b/usr.sbin/sendmail/contrib/mh.patch
@@ -0,0 +1,193 @@
+Message-Id: <199309031900.OAA19417@ignatz.acs.depaul.edu>
+To: bug-mh@ics.uci.edu
+cc: mh-users@ics.uci.edu, eric@cs.berkeley.edu
+Subject: MH-6.8.1/Sendmail 8.X (MH patch) updated
+Date: Fri, 03 Sep 1993 14:00:46 -0500
+From: Dave Nelson <dcn@ignatz.acs.depaul.edu>
+
+
+ This patch will fix the "X-auth..." warnings from the newer
+Sendmails (8.X) while continuing to work with the old sendmails.
+
+ I think the following patch will make everyone happy.
+
+ 1) Anybody with MH-6.8.1 can install this. It doesn't matter
+ what version of sendmail you're running. It doesn't matter
+ if you're not running sendmail (but it won't fix anything
+ for you).
+
+ 2) No configuration file hacks. If the -client switch is
+ absent (the default), the new sendmails will get an EHLO
+ using what LocalName() returns as the hostname. On my systems,
+ this returns the FQDN. If the EHLO fails with a result between
+ 500 and 599 and the -client switch is not set, we give up on
+ sending EHLO/HELO and just go deliver the mail.
+
+ 3) No new configuration options.
+
+ 4) Retains the undocumented -client switch. One warning: it
+ is possible using the -client switch to cause the old sendmails
+ to return "I refuse to talk to myself". You could do this under
+ the old code as well. This will happen if you claim to be the
+ same system as the sendmail you're sending to is running on.
+ That's pointless, but possible. If you do this, just like under
+ the old code, you will get an error.
+
+ 5) If you're running a site with both old and new sendmails, you only
+ have to build MH once. The code's the same; works with them
+ both.
+
+ If you decide to install this, make sure that you look the patch
+over and that you agree with what it is doing. It works for me, but I
+can't test it on every possible combination. Make sure that it works
+before you really install it for your users, if any. No promises.
+
+ To install this, save this to a file in the mts/sendmail directory.
+Feed it to patch. Patch will ignore the non-patch stuff. You should have
+"mts sendmail/smtp" in your configuration file. This works with old and
+new sendmails. Using "mts sendmail" will cause the new sendmails to
+print an "X-auth..." warning about who owns the process piping the mail
+message. I don't know of anyway of getting rid of these.
+
+ mh-config (if necessary), make, make inst-all.
+
+
+I hope this helps people.
+
+/dcn
+
+Dave Nelson
+Academic Computer Services
+DePaul University, Chicago
+
+*** smail.c Fri Sep 3 11:58:05 1993
+--- smail.c Fri Sep 3 11:57:27 1993
+***************
+*** 239,261 ****
+ return RP_RPLY;
+ }
+
+! if (client && *client) {
+! doingEHLO = 1;
+! result = smtalk (SM_HELO, "EHLO %s", client);
+! doingEHLO = 0;
+
+! if (500 <= result && result <= 599)
+ result = smtalk (SM_HELO, "HELO %s", client);
+!
+! switch (result) {
+ case 250:
+! break;
+
+ default:
+ (void) sm_end (NOTOK);
+ return RP_RPLY;
+ }
+ }
+
+ #ifndef ZMAILER
+ if (onex)
+--- 239,276 ----
+ return RP_RPLY;
+ }
+
+! doingEHLO = 1;
+! result = smtalk (SM_HELO, "EHLO %s",
+! (client && *client) ? client : LocalName());
+! doingEHLO = 0;
+!
+! switch (result)
+! {
+! case 250:
+! break;
+
+! default:
+! if (!(500 <= result && result <= 599))
+! {
+! (void) sm_end (NOTOK);
+! return RP_RPLY;
+! }
+!
+! if (client && *client)
+! {
+ result = smtalk (SM_HELO, "HELO %s", client);
+! switch (result)
+! {
+ case 250:
+! break;
+
+ default:
+ (void) sm_end (NOTOK);
+ return RP_RPLY;
++ }
+ }
+ }
++
+
+ #ifndef ZMAILER
+ if (onex)
+***************
+*** 357,380 ****
+ return RP_RPLY;
+ }
+
+! if (client && *client) {
+! doingEHLO = 1;
+! result = smtalk (SM_HELO, "EHLO %s", client);
+! doingEHLO = 0;
+
+! if (500 <= result && result <= 599)
+ result = smtalk (SM_HELO, "HELO %s", client);
+!
+! switch (result) {
+! case 250:
+ break;
+
+! default:
+ (void) sm_end (NOTOK);
+ return RP_RPLY;
+ }
+ }
+!
+ send_options: ;
+ if (watch && EHLOset ("XVRB"))
+ (void) smtalk (SM_HELO, "VERB on");
+--- 372,409 ----
+ return RP_RPLY;
+ }
+
+! doingEHLO = 1;
+! result = smtalk (SM_HELO, "EHLO %s",
+! (client && *client) ? client : LocalName());
+! doingEHLO = 0;
+!
+! switch (result)
+! {
+! case 250:
+! break;
+!
+! default:
+! if (!(500 <= result && result <= 599))
+! {
+! (void) sm_end (NOTOK);
+! return RP_RPLY;
+! }
+
+! if (client && *client)
+! {
+ result = smtalk (SM_HELO, "HELO %s", client);
+! switch (result)
+! {
+! case 250:
+ break;
+
+! default:
+ (void) sm_end (NOTOK);
+ return RP_RPLY;
++ }
+ }
+ }
+!
+ send_options: ;
+ if (watch && EHLOset ("XVRB"))
+ (void) smtalk (SM_HELO, "VERB on");
diff --git a/usr.sbin/sendmail/contrib/mmuegel b/usr.sbin/sendmail/contrib/mmuegel
index b762edeb3b30..6db4a45189c1 100644
--- a/usr.sbin/sendmail/contrib/mmuegel
+++ b/usr.sbin/sendmail/contrib/mmuegel
@@ -1,26 +1,16 @@
-Return-Path: mmuegel@cssmp.corp.mot.com
-Received: from hofmann.CS.Berkeley.EDU by auspex.Berkeley.EDU (ALPHA-6.30/6.9) id AA02096; Sun, 11 Apr 1993 19:50:02 -0700
-Received: from motgate.mot.com by hofmann.CS.Berkeley.EDU (ALPHA-6.35/6.16) id AA14977; Sun, 11 Apr 1993 19:49:57 -0700
-Received: from pobox.mot.com ([129.188.137.100]) by motgate.mot.com with SMTP (5.65c/IDA-1.4.4/MOT-2.13 for <eric@cs.berkeley.edu>)
- id AA05603; Sun, 11 Apr 1993 21:49:54 -0500
-Received: from cssmp.corp.mot.com by pobox.mot.com with SMTP (5.65c/IDA-1.4.4/MOT-2.12 for <eric@cs.berkeley.edu>)
- id AA08281; Sun, 11 Apr 1993 21:49:51 -0500
-Received: by cssmp.corp.mot.com (5.65c/IDA-1.4.4/MOT-2.12 for eric@cs.berkeley.edu)
- id AA02812; Sun, 11 Apr 1993 21:49:48 -0500
-From: "Michael S. Muegel" <mmuegel@cssmp.corp.mot.com>
-Message-Id: <199304120249.AA02812@cssmp.corp.mot.com>
-Subject: Sendmail tools README
+From: "Michael S. Muegel" <mmuegel@cssun6.corp.mot.com>
+Message-Id: <199307280818.AA08111@cssun6.corp.mot.com>
+Subject: Re: contributed software
To: eric@cs.berkeley.edu (Eric Allman)
-Date: Sun, 11 Apr 1993 21:49:48 -0500 (CDT)
-Cc: costales@icsi.berkeley.edu (Bryan Costales)
-X-Mailer: ELM [version 2.4 PL17]
+Date: Wed, 28 Jul 1993 03:18:02 -0500 (CDT)
+In-Reply-To: <199307221853.LAA04266@mastodon.CS.Berkeley.EDU> from "Eric Allman" at Jul 22, 93 11:53:47 am
+X-Mailer: ELM [version 2.4 PL22]
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
-Content-Length: 67910
+Content-Length: 69132
-
-As promised, here is a new distribution with a decent README.
+OK. Here is a new shell archive.
Cheers,
-Mike
@@ -31,26 +21,26 @@ Cheers,
# To extract the files from this archive, save it to a file, remove
# everything above the "!/bin/sh" line above, and type "sh file_name".
#
-# made 04/12/1993 02:34 UTC by mmuegel@mot.com (Michael S. Muegel)
-# Source directory /usr/var/rtmp/shar2336
+# made 07/28/1993 08:13 UTC by mmuegel@mot.com (Michael S. Muegel)
+# Source directory /home/ustart/NeXT/src/mail-tools/dist/foo
#
# existing files will NOT be overwritten unless -c is specified
#
# This shar contains:
# length mode name
# ------ ---------- ------------------------------------------
-# 4367 -r--r--r-- README
-# 11619 -r--r--r-- libs/date.pl
-# 3243 -r--r--r-- libs/elapsed.pl
-# 4379 -r--r--r-- libs/mail.pl
-# 6953 -r--r--r-- libs/mqueue.pl
-# 7030 -r--r--r-- libs/newgetopts.pl
-# 4718 -r--r--r-- libs/strings1.pl
-# 1637 -r--r--r-- libs/timespec.pl
-# 5229 -r--r--r-- man/cqueue.1
-# 2097 -r--r--r-- man/postclip.1
-# 6702 -r-xr-xr-x src/cqueue
-# 1900 -r-xr-xr-x src/postclip
+# 4308 -r--r--r-- README
+# 12339 -r--r--r-- libs/date.pl
+# 3198 -r--r--r-- libs/elapsed.pl
+# 4356 -r--r--r-- libs/mail.pl
+# 6908 -r--r--r-- libs/mqueue.pl
+# 7024 -r--r--r-- libs/newgetopts.pl
+# 4687 -r--r--r-- libs/strings1.pl
+# 1609 -r--r--r-- libs/timespec.pl
+# 5212 -r--r--r-- man/cqueue.1
+# 2078 -r--r--r-- man/postclip.1
+# 6647 -r-xr-xr-x src/cqueue
+# 1836 -r-xr-xr-x src/postclip
#
# ============= README ==============
if test -f 'README' -a X"$1" != X"-c"; then
@@ -60,9 +50,9 @@ echo 'x - extracting README (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'README' &&
-------------------------------------------------------------------------------
Document Revision Control Information:
-X $Author: nate $
-X $Source: /a/cvs/386BSD/src/usr.sbin/sendmail/contrib/mmuegel,v $
-X $Revision: 1.2 $ of $Date: 1993/07/30 17:20:45 $
+X mmuegel
+X /usr/local/ustart/src/mail-tools/dist/foo/README,v
+X 1.1 of 1993/07/28 08:12:53
-------------------------------------------------------------------------------
X
1. Introduction
@@ -154,8 +144,8 @@ SHAR_EOF
chmod 0444 README ||
echo 'restore of README failed'
Wc_c="`wc -c < 'README'`"
-test 4367 -eq "$Wc_c" ||
- echo 'README: original size 4367, current size' "$Wc_c"
+test 4308 -eq "$Wc_c" ||
+ echo 'README: original size 4308, current size' "$Wc_c"
fi
# ============= libs/date.pl ==============
if test ! -d 'libs'; then
@@ -202,7 +192,7 @@ sed 's/^X//' << 'SHAR_EOF' > 'libs/date.pl' &&
;# %m month of year - 01 to 12
;# %M minute - 00 to 59
;# %n insert a newline character
-;# %p AM or PM
+;# %p ante-meridiem or post-meridiem indicator (AM or PM)
;# %r time in AM/PM notation
;# %R time as HH:MM
;# %S second - 00 to 59
@@ -228,7 +218,7 @@ sed 's/^X//' << 'SHAR_EOF' > 'libs/date.pl' &&
;# specificaiton is removed if present.
;#
;# Remarks
-;# This is version 3.3 of date.pl
+;# This is version 3.4 of date.pl
;#
;# An extension of `ctime.pl' by Waldemar Kebsch (kebsch.pad@nixpbe.UUCP),
;# as modified by Marion Hakanson (hakanson@ogicse.ogi.edu).
@@ -249,12 +239,12 @@ sed 's/^X//' << 'SHAR_EOF' > 'libs/date.pl' &&
;# the Perl 4.0 release. See the COPYING file in your Perl kit for
;# more information.
;#
-;# Please send any bug reports or comments to tmcgonigal@gvc.com
+;# Please send any bug reports or comments to tmcgonigal@gallium.com
;#
;# Modification History
;# Nmemonic Version Date Who
;#
-;# NONE 1.0 02feb91 Terry McGonigal (tmcgonigal@gvc.com)
+;# NONE 1.0 02feb91 Terry McGonigal (tmcgonigal@gallium.com)
;# Created from ctime.pl
;#
;# NONE 2.0 07feb91 tmcgonigal
@@ -298,12 +288,23 @@ sed 's/^X//' << 'SHAR_EOF' > 'libs/date.pl' &&
;# this is the behaviour you were looking for, it seems more
;# correct to me...
;#
+;# NONE 3.4 26jul93 tmcgonigal
+;# Incorporated some fixes provided by DaviD W. Sanderson
+;# (dws@ssec.wisc.edu): February was spelled incorrectly and
+;# &wkno() was always using the current year while calculating
+;# week numbers, regardless of year implied by the time value
+;# passed to &date(). DaviD also contributed an improved &date()
+;# test script, thanks DaviD, I appreciate the effort. Finally,
+;# changed my mailling address from @gvc.com to @gallium.com
+;# to reflect, well, my new address!
+;#
;# SccsId = "%W% %E%"
;#
+require 'timelocal.pl';
package date;
X
# Months of the year
-@MoY = ('January', 'Febuary', 'March', 'April', 'May', 'June',
+@MoY = ('January', 'February', 'March', 'April', 'May', 'June',
X 'July', 'August', 'September','October', 'November', 'December');
X
# days of the week
@@ -356,10 +357,10 @@ X '%S', q|$rep = &date'pad($sec, 2, "0")|, # second - 00 to 59
X '%t', q|$rep = "\t"|, # insert a tab
X '%T', q|$rep = '%H:%M:%S'|, # time as HH:MM:SS
X '%u', q|$rep = '%y%m%d%H%M.%S'|, # daaate/time in date(1) required format
-X '%U', q|$rep = &date'wkno($yday, 0)|, # week number (weeks start on Sun) - 00 to 53
+X '%U', q|$rep = &date'wkno($year, $yday, 0)|, # week number (weeks start on Sun) - 00 to 53
X '%V', q|$rep = '%m%d%H%M%y'|, # SysV touch(1) date-time format (mmddHHMMyy)
X '%w', q|$rep = $wday; 1|, # day of week - Sunday = 0
-X '%W', q|$rep = &date'wkno($yday, 1)|, # week number (weeks start on Mon) - 00 to 53
+X '%W', q|$rep = &date'wkno($year, $yday, 1)|, # week number (weeks start on Mon) - 00 to 53
X '%x', q|$rep = $locDF; 1|, # date in local format
X '%X', q|$rep = $locTF; 1|, # time in local format
X '%y', q|($rep = $year) =~ s/..(..)/\1/|, # last 2 digits of year - 00 to 99
@@ -409,7 +410,7 @@ X if (defined $Tags{$tag}) {
X
X # trap dead evals...
X if (! eval $Tags{$tag}) {
-X print STDERR "date.pl: internal error: eval for $tag failed.\n";
+X print STDERR "date.pl: internal error: eval for $tag failed: $@\n";
X return "";
X }
X } else {
@@ -436,12 +437,11 @@ X return $mday . 'th';
X
# weekno - figure out week number
sub wkno {
-X local ($yday, $firstweekday) = @_;
+X local ($year, $yday, $firstweekday) = @_;
X local ($jan1, @jan1, $wks);
-X local ($now) = time;
X
-X # figure out the `time' value for January 1
-X $jan1 = $now - ((&gettime ($TZ, $now))[7] * 86400); # 86400 sec/day
+X # figure out the `time' value for January 1 of the given year
+X $jan1 = &maketime ($TZ, 0, 0, 0, 1, 0, $year-1900);
X
X # figure out what day of the week January 1 was
X @jan1= &gettime ($TZ, $jan1);
@@ -463,6 +463,9 @@ X
# gettime - get the time via {local,gmt}time
sub gettime { ((shift @_) eq 'GMT') ? gmtime(shift @_) : localtime(shift @_); }
X
+# maketime - make a time via time{local,gmt}
+sub maketime { ((shift @_) eq 'GMT') ? &main'timegm(@_) : &main'timelocal(@_); }
+X
# ls - generate the time/year portion of an ls(1) style date
sub ls {
X return ((&gettime ($TZ, time))[5] == @_[0]) ? "%R" : " %Y";
@@ -482,8 +485,8 @@ SHAR_EOF
chmod 0444 libs/date.pl ||
echo 'restore of libs/date.pl failed'
Wc_c="`wc -c < 'libs/date.pl'`"
-test 11619 -eq "$Wc_c" ||
- echo 'libs/date.pl: original size 11619, current size' "$Wc_c"
+test 12339 -eq "$Wc_c" ||
+ echo 'libs/date.pl: original size 12339, current size' "$Wc_c"
fi
# ============= libs/elapsed.pl ==============
if test -f 'libs/elapsed.pl' -a X"$1" != X"-c"; then
@@ -498,9 +501,9 @@ sed 's/^X//' << 'SHAR_EOF' > 'libs/elapsed.pl' &&
;# Michael S. Muegel <mmuegel@mot.com>
;#
;# RCS INFORMATION
-;# $Author: nate $
-;# $Source: /a/cvs/386BSD/src/usr.sbin/sendmail/contrib/mmuegel,v $
-;# $Revision: 1.2 $ of $Date: 1993/07/30 17:20:45 $
+;# mmuegel
+;# /usr/local/ustart/src/mail-tools/dist/foo/libs/elapsed.pl,v
+;# 1.1 of 1993/07/28 08:07:19
X
package elapsed;
X
@@ -618,8 +621,8 @@ SHAR_EOF
chmod 0444 libs/elapsed.pl ||
echo 'restore of libs/elapsed.pl failed'
Wc_c="`wc -c < 'libs/elapsed.pl'`"
-test 3243 -eq "$Wc_c" ||
- echo 'libs/elapsed.pl: original size 3243, current size' "$Wc_c"
+test 3198 -eq "$Wc_c" ||
+ echo 'libs/elapsed.pl: original size 3198, current size' "$Wc_c"
fi
# ============= libs/mail.pl ==============
if test -f 'libs/mail.pl' -a X"$1" != X"-c"; then
@@ -634,8 +637,8 @@ sed 's/^X//' << 'SHAR_EOF' > 'libs/mail.pl' &&
;# Michael S. Muegel (mmuegel@mot.com)
;#
;# RCS INFORMATION
-;# $Author: nate $
-;# $Header: /a/cvs/386BSD/src/usr.sbin/sendmail/contrib/mmuegel,v 1.2 1993/07/30 17:20:45 nate Exp $
+;# mmuegel
+;# /usr/local/ustart/src/mail-tools/dist/foo/libs/mail.pl,v 1.1 1993/07/28 08:07:19 mmuegel Exp
X
package mail;
X
@@ -771,8 +774,8 @@ SHAR_EOF
chmod 0444 libs/mail.pl ||
echo 'restore of libs/mail.pl failed'
Wc_c="`wc -c < 'libs/mail.pl'`"
-test 4379 -eq "$Wc_c" ||
- echo 'libs/mail.pl: original size 4379, current size' "$Wc_c"
+test 4356 -eq "$Wc_c" ||
+ echo 'libs/mail.pl: original size 4356, current size' "$Wc_c"
fi
# ============= libs/mqueue.pl ==============
if test -f 'libs/mqueue.pl' -a X"$1" != X"-c"; then
@@ -792,9 +795,9 @@ sed 's/^X//' << 'SHAR_EOF' > 'libs/mqueue.pl' &&
;# Michael S. Muegel (mmuegel@mot.com)
;#
;# RCS INFORMATION
-;# $Author: nate $
-;# $Source: /a/cvs/386BSD/src/usr.sbin/sendmail/contrib/mmuegel,v $
-;# $Revision: 1.2 $ of $Date: 1993/07/30 17:20:45 $
+;# mmuegel
+;# /usr/local/ustart/src/mail-tools/dist/foo/libs/mqueue.pl,v
+;# 1.1 of 1993/07/28 08:07:19
X
package mqueue;
X
@@ -999,8 +1002,8 @@ SHAR_EOF
chmod 0444 libs/mqueue.pl ||
echo 'restore of libs/mqueue.pl failed'
Wc_c="`wc -c < 'libs/mqueue.pl'`"
-test 6953 -eq "$Wc_c" ||
- echo 'libs/mqueue.pl: original size 6953, current size' "$Wc_c"
+test 6908 -eq "$Wc_c" ||
+ echo 'libs/mqueue.pl: original size 6908, current size' "$Wc_c"
fi
# ============= libs/newgetopts.pl ==============
if test -f 'libs/newgetopts.pl' -a X"$1" != X"-c"; then
@@ -1015,8 +1018,8 @@ sed 's/^X//' << 'SHAR_EOF' > 'libs/newgetopts.pl' &&
;# AUTHOR
;# Mike Muegel (mmuegel@mot.com)
;#
-;# $Author: nate $
-;# $Header: /a/cvs/386BSD/src/usr.sbin/sendmail/contrib/mmuegel,v 1.2 1993/07/30 17:20:45 nate Exp $
+;# mmuegel
+;# /usr/local/ustart/src/mail-tools/dist/foo/libs/newgetopts.pl,v 1.1 1993/07/28 08:07:19 mmuegel Exp
X
;###############################################################################
;# New_Getopts
@@ -1225,8 +1228,8 @@ SHAR_EOF
chmod 0444 libs/newgetopts.pl ||
echo 'restore of libs/newgetopts.pl failed'
Wc_c="`wc -c < 'libs/newgetopts.pl'`"
-test 7030 -eq "$Wc_c" ||
- echo 'libs/newgetopts.pl: original size 7030, current size' "$Wc_c"
+test 7024 -eq "$Wc_c" ||
+ echo 'libs/newgetopts.pl: original size 7024, current size' "$Wc_c"
fi
# ============= libs/strings1.pl ==============
if test -f 'libs/strings1.pl' -a X"$1" != X"-c"; then
@@ -1245,8 +1248,8 @@ sed 's/^X//' << 'SHAR_EOF' > 'libs/strings1.pl' &&
;# Michael S. Muegel (mmuegel@mot.com)
;#
;# RCS INFORMATION
-;# $Author: nate $
-;# $Header: /a/cvs/386BSD/src/usr.sbin/sendmail/contrib/mmuegel,v 1.2 1993/07/30 17:20:45 nate Exp $
+;# mmuegel
+;# /usr/local/ustart/src/mail-tools/dist/foo/libs/strings1.pl,v 1.1 1993/07/28 08:07:19 mmuegel Exp
X
package strings1;
X
@@ -1385,8 +1388,8 @@ SHAR_EOF
chmod 0444 libs/strings1.pl ||
echo 'restore of libs/strings1.pl failed'
Wc_c="`wc -c < 'libs/strings1.pl'`"
-test 4718 -eq "$Wc_c" ||
- echo 'libs/strings1.pl: original size 4718, current size' "$Wc_c"
+test 4687 -eq "$Wc_c" ||
+ echo 'libs/strings1.pl: original size 4687, current size' "$Wc_c"
fi
# ============= libs/timespec.pl ==============
if test -f 'libs/timespec.pl' -a X"$1" != X"-c"; then
@@ -1401,8 +1404,8 @@ sed 's/^X//' << 'SHAR_EOF' > 'libs/timespec.pl' &&
;# Michael S. Muegel (mmuegel@mot.com)
;#
;# RCS INFORMATION
-;# $Author: nate $
-;# $Header: /a/cvs/386BSD/src/usr.sbin/sendmail/contrib/mmuegel,v 1.2 1993/07/30 17:20:45 nate Exp $
+;# mmuegel
+;# /usr/local/ustart/src/mail-tools/dist/foo/libs/timespec.pl,v 1.1 1993/07/28 08:07:19 mmuegel Exp
X
package timespec;
X
@@ -1458,8 +1461,8 @@ SHAR_EOF
chmod 0444 libs/timespec.pl ||
echo 'restore of libs/timespec.pl failed'
Wc_c="`wc -c < 'libs/timespec.pl'`"
-test 1637 -eq "$Wc_c" ||
- echo 'libs/timespec.pl: original size 1637, current size' "$Wc_c"
+test 1609 -eq "$Wc_c" ||
+ echo 'libs/timespec.pl: original size 1609, current size' "$Wc_c"
fi
# ============= man/cqueue.1 ==============
if test ! -d 'man'; then
@@ -1473,8 +1476,8 @@ echo 'x - extracting man/cqueue.1 (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'man/cqueue.1' &&
.TH CQUEUE 1L
\"
-\" $Author: nate $
-\" $Header: /a/cvs/386BSD/src/usr.sbin/sendmail/contrib/mmuegel,v 1.2 1993/07/30 17:20:45 nate Exp $
+\" mmuegel
+\" /usr/local/ustart/src/mail-tools/dist/foo/man/cqueue.1,v 1.1 1993/07/28 08:08:25 mmuegel Exp
\"
.ds mp \fBcqueue\fR
.de IB
@@ -1641,8 +1644,8 @@ SHAR_EOF
chmod 0444 man/cqueue.1 ||
echo 'restore of man/cqueue.1 failed'
Wc_c="`wc -c < 'man/cqueue.1'`"
-test 5229 -eq "$Wc_c" ||
- echo 'man/cqueue.1: original size 5229, current size' "$Wc_c"
+test 5212 -eq "$Wc_c" ||
+ echo 'man/cqueue.1: original size 5212, current size' "$Wc_c"
fi
# ============= man/postclip.1 ==============
if test -f 'man/postclip.1' -a X"$1" != X"-c"; then
@@ -1652,8 +1655,8 @@ echo 'x - extracting man/postclip.1 (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'man/postclip.1' &&
.TH POSTCLIP 1L
\"
-\" $Author: nate $
-\" $Header: /a/cvs/386BSD/src/usr.sbin/sendmail/contrib/mmuegel,v 1.2 1993/07/30 17:20:45 nate Exp $
+\" mmuegel
+\" /usr/local/ustart/src/mail-tools/dist/foo/man/postclip.1,v 1.1 1993/07/28 08:08:25 mmuegel Exp
\"
.ds mp \fBpostclip\fR
.SH NAME
@@ -1713,8 +1716,8 @@ SHAR_EOF
chmod 0444 man/postclip.1 ||
echo 'restore of man/postclip.1 failed'
Wc_c="`wc -c < 'man/postclip.1'`"
-test 2097 -eq "$Wc_c" ||
- echo 'man/postclip.1: original size 2097, current size' "$Wc_c"
+test 2078 -eq "$Wc_c" ||
+ echo 'man/postclip.1: original size 2078, current size' "$Wc_c"
fi
# ============= src/cqueue ==============
if test ! -d 'src'; then
@@ -1738,8 +1741,8 @@ X
# Michael S. Muegel <mmuegel@mot.com>
#
# RCS INFORMATION
-# $Author: nate $
-# $Header: /a/cvs/386BSD/src/usr.sbin/sendmail/contrib/mmuegel,v 1.2 1993/07/30 17:20:45 nate Exp $
+# mmuegel
+# /usr/local/ustart/src/mail-tools/dist/foo/src/cqueue,v 1.1 1993/07/28 08:09:02 mmuegel Exp
X
# So that date.pl does not yell (Domain/OS version does a ``)
$ENV{'PATH'} = "";
@@ -1763,7 +1766,7 @@ $DATE_FORMAT = "%r %D";
X
# Constants that probably should not be changed
$USAGE = "Usage: $Script_Name [ -abdms ] [ -q queue-dir ] [ -t time ] [ -u user ] [ -w width ]\n";
-$VERSION = "${Script_Name} by \$Author: nate $; \$Revision: 1.2 $ of \$Date: 1993/07/30 17:20:45 $";
+$VERSION = "${Script_Name} by mmuegel; 1.1 of 1993/07/28 08:09:02";
$SWITCHES = "abdmst:u:q:w:";
$SPLIT_EXPR = '\s,\.@!%:';
$ADDR_PART_EXPR = '[^!@%]+';
@@ -1972,8 +1975,8 @@ SHAR_EOF
chmod 0555 src/cqueue ||
echo 'restore of src/cqueue failed'
Wc_c="`wc -c < 'src/cqueue'`"
-test 6702 -eq "$Wc_c" ||
- echo 'src/cqueue: original size 6702, current size' "$Wc_c"
+test 6647 -eq "$Wc_c" ||
+ echo 'src/cqueue: original size 6647, current size' "$Wc_c"
fi
# ============= src/postclip ==============
if test -f 'src/postclip' -a X"$1" != X"-c"; then
@@ -1993,8 +1996,8 @@ X
# Michael S. Muegel <mmuegel@mot.com>
#
# RCS INFORMATION
-# $Source: /a/cvs/386BSD/src/usr.sbin/sendmail/contrib/mmuegel,v $
-# $Revision: 1.2 $ of $Date: 1993/07/30 17:20:45 $
+# /usr/local/ustart/src/mail-tools/dist/foo/src/postclip,v
+# 1.1 of 1993/07/28 08:09:02
X
# We use this to send off the mail
require "newgetopts.pl";
@@ -2005,7 +2008,7 @@ X
X
# Some famous constants
$USAGE = "Usage: $Script_Name [ -v ] [ to ... ]\n";
-$VERSION = "${Script_Name} by \$Author: nate $; \$Revision: 1.2 $ of \$Date: 1993/07/30 17:20:45 $";
+$VERSION = "${Script_Name} by mmuegel; 1.1 of 1993/07/28 08:09:02";
$SWITCHES = "v";
X
# Let getopts parse for switches
@@ -2059,8 +2062,8 @@ SHAR_EOF
chmod 0555 src/postclip ||
echo 'restore of src/postclip failed'
Wc_c="`wc -c < 'src/postclip'`"
-test 1900 -eq "$Wc_c" ||
- echo 'src/postclip: original size 1900, current size' "$Wc_c"
+test 1836 -eq "$Wc_c" ||
+ echo 'src/postclip: original size 1836, current size' "$Wc_c"
fi
exit 0
@@ -2071,3 +2074,6 @@ exit 0
| Corporate Information Office | Voice: (708) 576-0507 |
| Motorola | Fax: (708) 576-4153 |
+----------------------------------------------------------------------------+
+
+ "I'm disturbed, I'm depressed, I'm inadequate -- I've got it all!"
+ -- George from _Seinfeld_
diff --git a/usr.sbin/sendmail/contrib/oldbind.compat.c b/usr.sbin/sendmail/contrib/oldbind.compat.c
new file mode 100644
index 000000000000..1621a7ba5e80
--- /dev/null
+++ b/usr.sbin/sendmail/contrib/oldbind.compat.c
@@ -0,0 +1,79 @@
+/*
+** OLDBIND.COMPAT.C
+**
+** Very old systems do not have res_query(), res_querydomain() or
+** res_search(), so emulate them here.
+**
+** You really ought to be upgrading to a newer version of BIND
+** (4.8.2 or later) rather than be using this.
+**
+** J.R. Oldroyd <jr@inset.com>
+*/
+
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+
+typedef union
+{
+ HEADER qb1;
+ char qb2[PACKETSZ];
+} querybuf;
+
+res_query(dname, class, type, data, datalen)
+ char * dname;
+ int class;
+ int type;
+ char * data;
+ int datalen;
+{
+ int n;
+ querybuf buf;
+
+ n = res_mkquery(QUERY, dname, class, type, (char *) NULL, 0,
+ NULL, (char *) &buf, sizeof buf);
+ n = res_send((char *)&buf, n, data, datalen);
+
+ return n;
+}
+
+res_querydomain(host, dname, class, type, data, datalen)
+ char * host;
+ char * dname;
+ int class;
+ int type;
+ char * data;
+ int datalen;
+{
+ int n;
+ querybuf buf;
+ char dbuf[256];
+
+ strcpy(dbuf, host);
+ if (dbuf[strlen(dbuf)-1] != '.')
+ strcat(dbuf, ".");
+ strcat(dbuf, dname);
+ n = res_mkquery(QUERY, dbuf, class, type, (char *) NULL, 0,
+ NULL, (char *)&buf, sizeof buf);
+ n = res_send((char *) &buf, n, data, datalen);
+
+ return n;
+}
+
+res_search(dname, class, type, data, datalen)
+ char * dname;
+ int class;
+ int type;
+ char * data;
+ int datalen;
+{
+ int n;
+ querybuf buf;
+
+ n = res_mkquery(QUERY, dname, class, type, (char *)NULL, 0,
+ NULL, (char *) &buf, sizeof buf);
+ n = res_send((char *) &buf, n, data, datalen);
+
+ return n;
+}
diff --git a/usr.sbin/sendmail/contrib/rcpt-streaming b/usr.sbin/sendmail/contrib/rcpt-streaming
index 329a9782869c..a43af6d43f44 100644
--- a/usr.sbin/sendmail/contrib/rcpt-streaming
+++ b/usr.sbin/sendmail/contrib/rcpt-streaming
@@ -1,10 +1,11 @@
-(Message /home/auspex/a/staff/eric/.mh/inbox:2575)
-From: John Gardiner Myers <jgm+@cmu.edu>
+Message-ID: <wgKo1lW00WBw46OU8k@andrew.cmu.edu>
+Date: Sun, 1 Aug 1993 00:02:57 -0400 (EDT)
+From: John Gardiner Myers <jgm+@CMU.EDU>
+To: sendmail@cs.berkeley.edu
Subject: contrib/rcpt-streaming
-Date: Fri, 4 Jun 1993 13:54:06 -0400 (EDT)
-To: sendmail@cs.berkeley.edu
+Beak: Is
-This patch implements "RCPT streaming" in sendmail version 6. This
+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.
@@ -15,12 +16,12 @@ 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.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
+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
***************
-*** 1325,1330 ****
---- 1325,1345 ----
+*** 1334,1339 ****
+--- 1334,1354 ----
register int i;
/* send the recipient list */
@@ -42,9 +43,9 @@ diff -cr src.orig/deliver.c src/deliver.c
tobuf[0] = '\0';
for (to = tochain; to != NULL; to = to->q_tchain)
{
-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
+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 ----
@@ -85,19 +86,21 @@ diff -cr src.orig/usersmtp.c src/usersmtp.c
#endif
***************
*** 404,410 ****
---- 424,432 ----
+--- 424,434 ----
{
register int r;
-+ #ifndef RCPTSTREAM
++ #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 = "RCPT wait";
+ SmtpPhase = mci->mci_phase = "client RCPT";
setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
***************
-*** 626,631 ****
---- 648,657 ----
+*** 667,672 ****
+--- 694,703 ----
bool firstline = TRUE;
char junkbuf[MAXLINE];
@@ -109,8 +112,8 @@ diff -cr src.orig/usersmtp.c src/usersmtp.c
(void) fflush(mci->mci_out);
***************
-*** 641,646 ****
---- 667,709 ----
+*** 682,687 ****
+--- 713,755 ----
register char *p;
extern time_t curtime();
@@ -155,8 +158,8 @@ diff -cr src.orig/usersmtp.c src/usersmtp.c
if (e->e_xfp != NULL)
(void) fflush(e->e_xfp); /* for debugging */
***************
-*** 742,747 ****
---- 805,880 ----
+*** 792,797 ****
+--- 860,937 ----
return (r);
}
@@ -197,6 +200,8 @@ diff -cr src.orig/usersmtp.c src/usersmtp.c
+
+ 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");
@@ -233,15 +238,13 @@ diff -cr src.orig/usersmtp.c src/usersmtp.c
/*
** SMTPMESSAGE -- send message to server
**
-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
+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
***************
-*** 955,960 ****
---- 955,1004 ----
+*** 1034,1039 ****
+--- 1034,1091 ----
return (FALSE);
return (TRUE);
}
@@ -281,10 +284,18 @@ diff -cr src.orig/util.c src/util.c
+
+ 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);
+ }
@@ -292,6 +303,3 @@ diff -cr src.orig/util.c src/util.c
/*
** STRCONTAINEDIN -- tell if one string is contained in another
**
-Only in src: util.c.orig
-Only in src: util.o
-Only in src: version.o
diff --git a/usr.sbin/sendmail/doc/intro/Makefile b/usr.sbin/sendmail/doc/intro/Makefile
new file mode 100644
index 000000000000..ed371b489c7a
--- /dev/null
+++ b/usr.sbin/sendmail/doc/intro/Makefile
@@ -0,0 +1,14 @@
+# @(#)Makefile 8.2 (Berkeley) 2/28/94
+
+DIR= smm/09.sendmail
+SRCS= intro.me
+MACROS= -me
+CLEANFILES= *.ps
+
+all: intro.ps
+
+intro.ps: ${SRCS}
+ rm -f ${.TARGET}
+ ${PIC} ${SRCS} | ${ROFF} > ${.TARGET}
+
+.include <bsd.doc.mk>
diff --git a/usr.sbin/sendmail/doc/intro/intro.me b/usr.sbin/sendmail/doc/intro/intro.me
index 5907004efce7..0406bb1fdd67 100644
--- a/usr.sbin/sendmail/doc/intro/intro.me
+++ b/usr.sbin/sendmail/doc/intro/intro.me
@@ -30,7 +30,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)intro.me 8.1 (Berkeley) 6/8/93
+.\" @(#)intro.me 8.2 (Berkeley) 11/27/93
.\"
.\" pic -Pxx intro.me | ditroff -me -Pxx
.eh 'SMM:9-%''SENDMAIL \*- An Internetwork Mail Router'
@@ -43,7 +43,7 @@
SENDMAIL \*- An Internetwork Mail Router
.sz
.sp
-Eric Allman\(dg
+Eric Allman*
.sp 0.5
.i
University of California, Berkeley
@@ -75,7 +75,7 @@ queueing, and aliasing.
.)l
.sp 2
.(f
-\(dgA considerable part of this work
+*A considerable part of this work
was done while under the employ
of the INGRES Project
at the University of California at Berkeley
diff --git a/usr.sbin/sendmail/doc/intro/intro.ps b/usr.sbin/sendmail/doc/intro/intro.ps
deleted file mode 100644
index 8514f5988329..000000000000
--- a/usr.sbin/sendmail/doc/intro/intro.ps
+++ /dev/null
@@ -1,1295 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.08
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Italic
-%%+ font Times-Bold
-%%DocumentSuppliedResources: procset grops 1.08 0
-%%Pages: 13
-%%PageOrder: Ascend
-%%Orientation: Portrait
-%%EndComments
-%%BeginProlog
-%%BeginResource: procset grops 1.08 0
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}bind def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/FL{
-currentgray exch setgray fill setgray
-}bind def
-/BL/fill load def
-/LW/setlinewidth load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-}bind def
-/PEND{
-clear
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Italic
-%%IncludeResource: font Times-Bold
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 def/PL
-792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron/scaron/zcaron
-/Ydieresis/trademark/quotesingle/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/space
-/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright/parenleft
-/parenright/asterisk/plus/comma/hyphen/period/slash/zero/one/two/three/four
-/five/six/seven/eight/nine/colon/semicolon/less/equal/greater/question/at/A/B/C
-/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash
-/bracketright/circumflex/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q
-/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase
-/guillemotleft/guillemotright/bullet/florin/fraction/perthousand/dagger
-/daggerdbl/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen/brokenbar
-/section/dieresis/copyright/ordfeminine/guilsinglleft/logicalnot/minus
-/registered/macron/degree/plusminus/twosuperior/threesuperior/acute/mu
-/paragraph/periodcentered/cedilla/onesuperior/ordmasculine/guilsinglright
-/onequarter/onehalf/threequarters/questiondown/Agrave/Aacute/Acircumflex/Atilde
-/Adieresis/Aring/AE/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute
-/Icircumflex/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls
-/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla/egrave/eacute
-/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis/eth/ntilde/ograve
-/oacute/ocircumflex/otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex
-/udieresis/yacute/thorn/ydieresis]def/Times-Bold@0 ENC0/Times-Bold RE
-/Times-Italic@0 ENC0/Times-Italic RE/Times-Roman@0 ENC0/Times-Roman RE
-%%EndProlog
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 14/Times-Roman@0 SF(SENDMAIL \212 An Internetw)159.172 141 Q
-(ork Mail Router)-.14 E/F1 10/Times-Roman@0 SF(Eric Allman\207)260.92 165 Q/F2
-10/Times-Italic@0 SF(Univer)220.2 183 Q(sity of California, Berk)-.1 E(ele)-.1
-E(y)-.3 E(Mammoth Pr)251.98 195 Q(oject)-.45 E F1(ABSTRA)262.085 227.4 Q(CT)-.4
-E 1.41(Routing mail through a heterogenous internet presents man)112 243.6 R
-3.91(yn)-.15 G 1.91 -.25(ew p)372.55 243.6 T 3.91(roblems. Among).25 F .297
-(the w)112 255.6 R .297(orst of these is that of address mapping.)-.1 F
-(Historically)5.297 E 2.797(,t)-.65 G .298(his has been handled on an)355.03
-255.6 R F2(ad hoc)112 267.6 Q F1 2.5(basis. Ho)2.5 F(we)-.25 E -.15(ve)-.25 G
-.8 -.4(r, t).15 H(his approach has become unmanageable as internets gro).4 E
--.65(w.)-.25 G .15(Sendmail acts a uni\214ed "post of)112 283.8 R .15
-(\214ce" to which all mail can be submitted.)-.25 F .15(Address inter)5.15 F(-)
--.2 E .426(pretation is controlled by a production system, which can parse bot\
-h domain-based ad-)112 295.8 R .423(dressing and old-style)112 307.8 R F2 .423
-(ad hoc)2.923 F F1 2.923(addresses. The)2.923 F .422(production system is po)
-2.922 F .422(werful enough to)-.25 F(re)112 319.8 Q 1.357(write addresses in t\
-he message header to conform to the standards of a number of)-.25 F 1.15
-(common tar)112 331.8 R 1.15(get netw)-.18 F 1.15
-(orks, including old \(NCP/RFC733\) Arpanet, ne)-.1 F 3.65(w\()-.25 G
-(TCP/RFC822\))405.65 331.8 Q 1.119(Arpanet, UUCP)112 343.8 R 3.619(,a)-1.11 G
-1.119(nd Phonenet.)186.448 343.8 R 1.119(Sendmail also implements an SMTP serv)
-6.119 F(er)-.15 E 3.619(,m)-.4 G(essage)437.9 343.8 Q(queueing, and aliasing.)
-112 355.8 Q F2(Sendmail)97 400.2 Q F1 .501(implements a general internetw)3 F
-.501(ork mail routing f)-.1 F(acility)-.1 E 3.001(,f)-.65 G .501
-(eaturing aliasing and forw)369.847 400.2 R(arding,)-.1 E
-(automatic routing to netw)72 412.2 Q(ork g)-.1 E(ate)-.05 E -.1(wa)-.25 G
-(ys, and \215e).1 E(xible con\214guration.)-.15 E .624(In a simple netw)97
-428.4 R .624(ork, each node has an address, and resources can be identi\214ed \
-with a host-resource)-.1 F .374(pair; in particular)72 440.4 R 2.874(,t)-.4 G
-.374(he mail system can refer to users using a host-username pair)149.932 440.4
-R 5.374(.H)-.55 G .375(ost names and numbers)409.276 440.4 R(ha)72 452.4 Q .3
--.15(ve t)-.2 H 2.5(ob).15 G 2.5(ea)108.31 452.4 S
-(dministered by a central authority)119.69 452.4 Q 2.5(,b)-.65 G
-(ut usernames can be assigned locally to each host.)263.82 452.4 Q .649
-(In an internet, multiple netw)97 468.6 R .649(orks with dif)-.1 F .649
-(ferent characterstics and managements must communicate.)-.25 F .389
-(In particular)72 480.6 R 2.889(,t)-.4 G .389
-(he syntax and semantics of resource identi\214cation change.)129.308 480.6 R
-.39(Certain special cases can be han-)5.389 F 1.033(dled tri)72 492.6 R 1.033
-(vially by)-.25 F F2 1.033(ad hoc)3.533 F F1 1.032(techniques, such as pro)
-3.533 F 1.032(viding netw)-.15 F 1.032
-(ork names that appear local to hosts on other)-.1 F(netw)72 504.6 Q 1.454
-(orks, as with the Ethernet at Xerox P)-.1 F 3.955(ARC. Ho)-.92 F(we)-.25 E
--.15(ve)-.25 G 4.755 -.4(r, t).15 H 1.455(he general case is e).4 F 1.455
-(xtremely comple)-.15 F 3.955(x. F)-.15 F(or)-.15 E -.15(ex)72 516.6 S .192
-(ample, some netw).15 F .192(orks require point-to-point routing, which simpli\
-\214es the database update problem since)-.1 F .618(only adjacent hosts must b\
-e entered into the system tables, while others use end-to-end addressing.)72
-528.6 R(Some)5.618 E(netw)72 540.6 Q .123(orks use a left-associati)-.1 F .423
--.15(ve s)-.25 H .123(yntax and others use a right-associati).15 F .423 -.15
-(ve s)-.25 H .123(yntax, causing ambiguity in mix).15 F(ed)-.15 E(addresses.)72
-552.6 Q .678(Internet standards seek to eliminate these problems.)97 568.8 R
-(Initially)5.678 E 3.178(,t)-.65 G .679(hese proposed e)353.134 568.8 R .679
-(xpanding the address)-.15 F .65(pairs to address triples, consisting of {netw)
-72 580.8 R .649(ork, host, resource} triples.)-.1 F(Netw)5.649 E .649
-(ork numbers must be uni)-.1 F -.15(ve)-.25 G -.2(r-).15 G 1.452
-(sally agreed upon, and hosts can be assigned locally on each netw)72 592.8 R
-3.952(ork. The)-.1 F(user)3.952 E(-le)-.2 E -.15(ve)-.25 G 3.952(lp).15 G 1.452
-(resentation w)440.718 592.8 R(as)-.1 E 2.352(quickly e)72 604.8 R 2.352(xpand\
-ed to address domains, comprised of a local resource identi\214cation and a hi\
-erarchical)-.15 F .256(domain speci\214cation with a common static root.)72
-616.8 R .257(The domain technique separates the issue of ph)5.257 F .257
-(ysical v)-.05 F(er)-.15 E(-)-.2 E .807(sus logical addressing.)72 628.8 R -.15
-(Fo)5.807 G 3.307(re).15 G .807
-(xample, an address of the form \231eric@a.cc.berk)191.028 628.8 R(ele)-.1 E
--.65(y.)-.15 G .807(arpa\232 describes only the).65 F(logical or)72 640.8 Q
--.05(ga)-.18 G(nization of the address space.).05 E F2(Sendmail)97 657 Q F1
-.493(is intended to help bridge the g)2.992 F .493(ap between the totally)-.05
-F F2 .493(ad hoc)2.993 F F1 -.1(wo)2.993 G .493(rld of netw).1 F .493
-(orks that kno)-.1 F(w)-.25 E .855
-(nothing of each other and the clean, tightly-coupled w)72 669 R .854
-(orld of unique netw)-.1 F .854(ork numbers.)-.1 F .854(It can accept old)5.854
-F .32 LW 76 678.6 72 678.6 DL 80 678.6 76 678.6 DL 84 678.6 80 678.6 DL 88
-678.6 84 678.6 DL 92 678.6 88 678.6 DL 96 678.6 92 678.6 DL 100 678.6 96 678.6
-DL 104 678.6 100 678.6 DL 108 678.6 104 678.6 DL 112 678.6 108 678.6 DL 116
-678.6 112 678.6 DL 120 678.6 116 678.6 DL 124 678.6 120 678.6 DL 128 678.6 124
-678.6 DL 132 678.6 128 678.6 DL 136 678.6 132 678.6 DL 140 678.6 136 678.6 DL
-144 678.6 140 678.6 DL 148 678.6 144 678.6 DL 152 678.6 148 678.6 DL 156 678.6
-152 678.6 DL 160 678.6 156 678.6 DL 164 678.6 160 678.6 DL 168 678.6 164 678.6
-DL 172 678.6 168 678.6 DL 176 678.6 172 678.6 DL 180 678.6 176 678.6 DL 184
-678.6 180 678.6 DL 188 678.6 184 678.6 DL 192 678.6 188 678.6 DL 196 678.6 192
-678.6 DL 200 678.6 196 678.6 DL 204 678.6 200 678.6 DL 208 678.6 204 678.6 DL
-212 678.6 208 678.6 DL 216 678.6 212 678.6 DL/F3 8/Times-Roman@0 SF .557
-(\207A considerable part of this w)93.6 690.6 R .557(ork w)-.08 F .557
-(as done while under the emplo)-.08 F 2.557(yo)-.08 G 2.556(ft)323.116 690.6 S
-.556(he INGRES Project at the Uni)330.56 690.6 R -.12(ve)-.2 G .556
-(rsity of California at).12 F(Berk)72 700.2 Q(ele)-.08 E 2(ya)-.12 G
-(nd at Britton Lee.)106.232 700.2 Q/F4 10/Times-Bold@0 SF
-(SENDMAIL \212 An Inter)72 756 Q(netw)-.15 E(ork Mail Router)-.1 E(SMM:9-1)
-462.9 756 Q EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 192.28(SMM:9-2 SENDMAIL)72 60 R 2.5<8a41>2.5 G 2.5(nI)
-383.99 60 S(nter)395.94 60 Q(netw)-.15 E(ork Mail Router)-.1 E/F1 10
-/Times-Roman@0 SF .632(arbitrary address syntax)72 96 R .633(es, resolving amb\
-iguities using heuristics speci\214ed by the system administrator)-.15 F 3.133
-(,a)-.4 G(s)500.11 96 Q .348(well as domain-based addressing.)72 108 R .347
-(It helps guide the con)5.347 F -.15(ve)-.4 G .347
-(rsion of message formats between disparate net-).15 F -.1(wo)72 120 S 3.394
-(rks. In).1 F(short,)3.394 E/F2 10/Times-Italic@0 SF(sendmail)3.394 E F1 .894
-(is designed to assist a graceful transition to consistent internetw)3.394 F
-.895(ork addressing)-.1 F(schemes.)72 132 Q .153
-(Section 1 discusses the design goals for)97 160.2 R F2(sendmail)2.653 E F1
-5.153(.S)C .152(ection 2 gi)308.214 160.2 R -.15(ve)-.25 G 2.652(sa).15 G 2.652
-(no)370.76 160.2 S -.15(ve)383.262 160.2 S(rvie).15 E 2.652(wo)-.25 G 2.652(ft)
-422.724 160.2 S .152(he basic functions)431.486 160.2 R .644(of the system.)72
-172.2 R .644(In section 3, details of usage are discussed.)5.644 F .644
-(Section 4 compares)5.644 F F2(sendmail)3.144 E F1 .645(to other internet)3.144
-F(mail routers, and an e)72 184.2 Q -.25(va)-.25 G(luation of).25 E F2
-(sendmail)2.5 E F1(is gi)2.5 E -.15(ve)-.25 G 2.5(ni).15 G 2.5(ns)283.3 184.2 S
-(ection 5, including future plans.)294.69 184.2 Q F0 2.5(1. DESIGN)72 208.2 R
-(GO)2.5 E(ALS)-.4 E F1(Design goals for)112 224.4 Q F2(sendmail)2.5 E F1
-(include:)2.5 E 12.5(\(1\) Compatibility)92 240.6 R 1.363(with the e)3.864 F
-1.363(xisting mail programs, including Bell v)-.15 F 1.363
-(ersion 6 mail, Bell v)-.15 F 1.363(ersion 7)-.15 F 1.202(mail [UNIX83], Berk)
-118.66 252.6 R(ele)-.1 E(y)-.15 E F2(Mail)3.702 E F1 1.202
-([Shoens79], BerkNet mail [Schmidt79], and hopefully UUCP)3.702 F(mail [No)
-118.66 264.6 Q(witz78a, No)-.25 E 2.5(witz78b]. ARP)-.25 F(ANET mail [Crock)
--.92 E(er77a, Postel77] w)-.1 E(as also required.)-.1 E 12.5(\(2\) Reliability)
-92 280.8 R 4.003(,i)-.65 G 4.003(nt)169.523 280.8 S 1.502
-(he sense of guaranteeing that e)181.306 280.8 R -.15(ve)-.25 G 1.502
-(ry message is correctly deli).15 F -.15(ve)-.25 G 1.502(red or at least).15 F
-.368
-(brought to the attention of a human for correct disposal; no message should e)
-118.66 292.8 R -.15(ve)-.25 G 2.868(rb).15 G 2.868(ec)452.252 292.8 S
-(ompletely)464 292.8 Q 2.541(lost. This)118.66 304.8 R .041(goal w)2.541 F .041
-(as considered essential because of the emphasis on mail in our en)-.1 F 2.54
-(vironment. It)-.4 F 1.754
-(has turned out to be one of the hardest goals to satisfy)118.66 316.8 R 4.255
-(,e)-.65 G 1.755(specially in the f)363.75 316.8 R 1.755(ace of the man)-.1 F
-(y)-.15 E .978(anomalous message formats produced by v)118.66 328.8 R .977
-(arious ARP)-.25 F .977(ANET sites.)-.92 F -.15(Fo)5.977 G 3.477(re).15 G .977
-(xample, certain sites)420.116 328.8 R .069
-(generate improperly formated addresses, occasionally causing error)118.66
-340.8 R .069(-message loops.)-.2 F .069(Some hosts)5.069 F .063(use blanks in \
-names, causing problems with UNIX mail programs that assume that an address is)
-118.66 352.8 R .111(one w)118.66 364.8 R 2.611(ord. The)-.1 F .111
-(semantics of some \214elds are interpreted slightly dif)2.611 F .112
-(ferently by dif)-.25 F .112(ferent sites.)-.25 F(In)5.112 E(summary)118.66
-376.8 Q 3.023(,t)-.65 G .523(he obscure features of the ARP)163.533 376.8 R
-.523(ANET mail protocol really)-.92 F F2(ar)3.023 E(e)-.37 E F1 .522
-(used and are dif)3.023 F(\214cult)-.25 E(to support, b)118.66 388.8 Q
-(ut must be supported.)-.2 E 12.5(\(3\) Existing)92 405 R(softw)2.938 E .438
-(are to do actual deli)-.1 F -.15(ve)-.25 G .439(ry should be used whene).15 F
--.15(ve)-.25 G 2.939(rp).15 G 2.939(ossible. This)387.654 405 R .439(goal deri)
-2.939 F -.15(ve)-.25 G 2.939(sa).15 G(s)500.11 405 Q
-(much from political and practical considerations as technical.)118.66 417 Q
-12.5(\(4\) Easy)92 433.2 R -.15(ex)2.899 G .399(pansion to f).15 F .399
-(airly comple)-.1 F 2.898(xe)-.15 G -.4(nv)261.064 433.2 S .398
-(ironments, including multiple connections to a single net-).4 F -.1(wo)118.66
-445.2 S .115
-(rk type \(such as with multiple UUCP or Ether nets [Metcalfe76]\).).1 F .115
-(This goal requires consid-)5.115 F .587(eration of the contents of an address\
- as well as its syntax in order to determine which g)118.66 457.2 R(ate)-.05 E
--.1(wa)-.25 G(y).1 E 1.018(to use.)118.66 469.2 R -.15(Fo)6.018 G 3.518(re).15
-G 1.018(xample, the ARP)173.354 469.2 R 1.019
-(ANET is bringing up the TCP protocol to replace the old NCP)-.92 F 4.791
-(protocol. No)118.66 481.2 R 2.291(host at Berk)4.791 F(ele)-.1 E 4.791(yr)-.15
-G 2.291(uns both TCP and NCP)256.235 481.2 R 4.791(,s)-1.11 G 4.79(oi)369.37
-481.2 S 4.79(ti)381.94 481.2 S 4.79(sn)392.29 481.2 S 2.29
-(ecessary to look at the)405.97 481.2 R(ARP)118.66 493.2 Q .016
-(ANET host name to determine whether to route mail to an NCP g)-.92 F(ate)-.05
-E -.1(wa)-.25 G 2.517(yo).1 G 2.517(raT)435.569 493.2 S .017(CP g)454.483 493.2
-R(ate)-.05 E -.1(wa)-.25 G -.65(y.).1 G 12.5(\(5\) Con\214guration)92 509.4 R
-.145(should not be compiled into the code.)2.645 F 2.645(As)5.145 G .145
-(ingle compiled program should be able)346.905 509.4 R .91(to run as is at an)
-118.66 521.4 R 3.41(ys)-.15 G .91
-(ite \(barring such basic changes as the CPU type or the operating system\).)
-200.63 521.4 R 2.61 -.8(We h)118.66 533.4 T -2.25 -.2(av e).8 H 1.009
-(found this seemingly unimportant goal to be critical in real life.)3.71 F
-1.009(Besides the simple)6.009 F .66(problems that occur when an)118.66 545.4 R
-3.16(yp)-.15 G .66(rogram gets recompiled in a dif)249.84 545.4 R .66
-(ferent en)-.25 F .66(vironment, man)-.4 F 3.16(ys)-.15 G(ites)490.11 545.4 Q
-(lik)118.66 557.4 Q 2.5(et)-.1 G 2.5<6f99>138.84 557.4 S(\214ddle\232 with an)
-150.78 557.4 Q(ything that the)-.15 E 2.5(yw)-.15 G(ill be recompiling an)
-282.42 557.4 Q(yw)-.15 E(ay)-.1 E(.)-.65 E(\(6\))92 573.6 Q F2(Sendmail)118.66
-573.6 Q F1 .184(must be able to let v)2.684 F .184
-(arious groups maintain their o)-.25 F .184(wn mailing lists, and let indi)-.25
-F(viduals)-.25 E(specify their o)118.66 585.6 Q(wn forw)-.25 E
-(arding, without modifying the system alias \214le.)-.1 E 12.5(\(7\) Each)92
-601.8 R .313(user should be able to specify which mailer to e)2.813 F -.15(xe)
--.15 G .313(cute to process mail being deli).15 F -.15(ve)-.25 G .314(red for)
-.15 F 3.098(him. This)118.66 613.8 R .598(feature allo)3.098 F .598
-(ws users who are using specialized mailers that use a dif)-.25 F .598
-(ferent format to)-.25 F -.2(bu)118.66 625.8 S .25(ild their en).2 F .25
-(vironment without changing the system, and f)-.4 F .25
-(acilitates specialized functions \(such)-.1 F(as returning an \231I am on v)
-118.66 637.8 Q(acation\232 message\).)-.25 E 12.5(\(8\) Netw)92 654 R 1.553
-(ork traf)-.1 F 1.552(\214c should be minimized by batching addresses to a sin\
-gle host where possible,)-.25 F(without assistance from the user)118.66 666 Q
-(.)-.55 E .374(These goals moti)112 682.2 R -.25(va)-.25 G .374
-(ted the architecture illustrated in \214gure 1.).25 F .375
-(The user interacts with a mail gen-)5.375 F .491(erating and sending program.)
-87 694.2 R .491(When the mail is created, the generator calls)5.491 F F2
-(sendmail)2.99 E F1 2.99(,w)C .49(hich routes the)444.14 694.2 R .84
-(message to the correct mailer\(s\).)87 706.2 R .841
-(Since some of the senders may be netw)5.84 F .841(ork serv)-.1 F .841
-(ers and some of the)-.15 F(mailers may be netw)87 718.2 Q(ork clients,)-.1 E
-F2(sendmail)2.5 E F1(may be used as an internet mail g)2.5 E(ate)-.05 E -.1(wa)
--.25 G -.65(y.).1 G EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(SENDMAIL \212 An Inter)72 60 Q(netw)-.15 E
-(ork Mail Router)-.1 E(SMM:9-3)462.9 60 Q .4 LW 77 108 72 108 DL 79 108 74 108
-DL 84 108 79 108 DL 89 108 84 108 DL 94 108 89 108 DL 99 108 94 108 DL 104 108
-99 108 DL 109 108 104 108 DL 114 108 109 108 DL 119 108 114 108 DL 124 108 119
-108 DL 129 108 124 108 DL 134 108 129 108 DL 139 108 134 108 DL 144 108 139 108
-DL 149 108 144 108 DL 154 108 149 108 DL 159 108 154 108 DL 164 108 159 108 DL
-169 108 164 108 DL 174 108 169 108 DL 179 108 174 108 DL 184 108 179 108 DL 189
-108 184 108 DL 194 108 189 108 DL 199 108 194 108 DL 204 108 199 108 DL 209 108
-204 108 DL 214 108 209 108 DL 219 108 214 108 DL 224 108 219 108 DL 229 108 224
-108 DL 234 108 229 108 DL 239 108 234 108 DL 244 108 239 108 DL 249 108 244 108
-DL 254 108 249 108 DL 259 108 254 108 DL 264 108 259 108 DL 269 108 264 108 DL
-274 108 269 108 DL 279 108 274 108 DL 284 108 279 108 DL 289 108 284 108 DL 294
-108 289 108 DL 299 108 294 108 DL 304 108 299 108 DL 309 108 304 108 DL 314 108
-309 108 DL 319 108 314 108 DL 324 108 319 108 DL 329 108 324 108 DL 334 108 329
-108 DL 339 108 334 108 DL 344 108 339 108 DL 349 108 344 108 DL 354 108 349 108
-DL 359 108 354 108 DL 364 108 359 108 DL 369 108 364 108 DL 374 108 369 108 DL
-379 108 374 108 DL 384 108 379 108 DL 389 108 384 108 DL 394 108 389 108 DL 399
-108 394 108 DL 404 108 399 108 DL 409 108 404 108 DL 414 108 409 108 DL 419 108
-414 108 DL 424 108 419 108 DL 429 108 424 108 DL 434 108 429 108 DL 439 108 434
-108 DL 444 108 439 108 DL 449 108 444 108 DL 454 108 449 108 DL 459 108 454 108
-DL 464 108 459 108 DL 469 108 464 108 DL 474 108 469 108 DL 479 108 474 108 DL
-484 108 479 108 DL 489 108 484 108 DL 494 108 489 108 DL 499 108 494 108 DL 504
-108 499 108 DL/F1 10/Times-Roman@0 SF(sender1)164.45 155.6 Q 144 135.6 144
-171.6 DL 216 135.6 144 135.6 DL 216 171.6 216 135.6 DL 144 171.6 216 171.6 DL
-(sender2)272.45 155.6 Q 252 135.6 252 171.6 DL 324 135.6 252 135.6 DL 324 171.6
-324 135.6 DL 252 171.6 324 171.6 DL(sender3)380.45 155.6 Q 360 135.6 360 171.6
-DL 432 135.6 360 135.6 DL 432 171.6 432 135.6 DL 360 171.6 432 171.6 DL 288
-207.6 288 171.6 DL 288 207.6 286.2 200.4 DL 288 207.6 289.8 200.4 DL(sendmail)
-269.945 227.6 Q 216 207.6 216 243.6 DL 360 207.6 216 207.6 DL 360 243.6 360
-207.6 DL 216 243.6 360 243.6 DL 288 279.6 288 243.6 DL 288 279.6 286.2 272.4 DL
-288 279.6 289.8 272.4 DL(mailer1)164.725 299.6 Q 144 279.6 144 315.6 DL 216
-279.6 144 279.6 DL 216 315.6 216 279.6 DL 144 315.6 216 315.6 DL(mailer2)
-272.725 299.6 Q 252 279.6 252 315.6 DL 324 279.6 252 279.6 DL 324 315.6 324
-279.6 DL 252 315.6 324 315.6 DL(mailer3)380.725 299.6 Q 360 279.6 360 315.6 DL
-432 279.6 360 279.6 DL 432 315.6 432 279.6 DL 360 315.6 432 315.6 DL 252 207.6
-180 171.6 DL 252 207.6 244.728 206.016 DL 252 207.6 246.384 202.776 DL 324
-207.6 396 171.6 DL 324 207.6 329.616 202.776 DL 324 207.6 331.272 206.016 DL
-180 279.6 252 243.6 DL 180 279.6 185.616 274.776 DL 180 279.6 187.272 278.016
-DL 396 279.6 324 243.6 DL 396 279.6 388.728 278.016 DL 396 279.6 390.384
-274.776 DL(Figure 1 \212 Sendmail System Structure.)208 346.8 Q 77 358.8 72
-358.8 DL 79 358.8 74 358.8 DL 84 358.8 79 358.8 DL 89 358.8 84 358.8 DL 94
-358.8 89 358.8 DL 99 358.8 94 358.8 DL 104 358.8 99 358.8 DL 109 358.8 104
-358.8 DL 114 358.8 109 358.8 DL 119 358.8 114 358.8 DL 124 358.8 119 358.8 DL
-129 358.8 124 358.8 DL 134 358.8 129 358.8 DL 139 358.8 134 358.8 DL 144 358.8
-139 358.8 DL 149 358.8 144 358.8 DL 154 358.8 149 358.8 DL 159 358.8 154 358.8
-DL 164 358.8 159 358.8 DL 169 358.8 164 358.8 DL 174 358.8 169 358.8 DL 179
-358.8 174 358.8 DL 184 358.8 179 358.8 DL 189 358.8 184 358.8 DL 194 358.8 189
-358.8 DL 199 358.8 194 358.8 DL 204 358.8 199 358.8 DL 209 358.8 204 358.8 DL
-214 358.8 209 358.8 DL 219 358.8 214 358.8 DL 224 358.8 219 358.8 DL 229 358.8
-224 358.8 DL 234 358.8 229 358.8 DL 239 358.8 234 358.8 DL 244 358.8 239 358.8
-DL 249 358.8 244 358.8 DL 254 358.8 249 358.8 DL 259 358.8 254 358.8 DL 264
-358.8 259 358.8 DL 269 358.8 264 358.8 DL 274 358.8 269 358.8 DL 279 358.8 274
-358.8 DL 284 358.8 279 358.8 DL 289 358.8 284 358.8 DL 294 358.8 289 358.8 DL
-299 358.8 294 358.8 DL 304 358.8 299 358.8 DL 309 358.8 304 358.8 DL 314 358.8
-309 358.8 DL 319 358.8 314 358.8 DL 324 358.8 319 358.8 DL 329 358.8 324 358.8
-DL 334 358.8 329 358.8 DL 339 358.8 334 358.8 DL 344 358.8 339 358.8 DL 349
-358.8 344 358.8 DL 354 358.8 349 358.8 DL 359 358.8 354 358.8 DL 364 358.8 359
-358.8 DL 369 358.8 364 358.8 DL 374 358.8 369 358.8 DL 379 358.8 374 358.8 DL
-384 358.8 379 358.8 DL 389 358.8 384 358.8 DL 394 358.8 389 358.8 DL 399 358.8
-394 358.8 DL 404 358.8 399 358.8 DL 409 358.8 404 358.8 DL 414 358.8 409 358.8
-DL 419 358.8 414 358.8 DL 424 358.8 419 358.8 DL 429 358.8 424 358.8 DL 434
-358.8 429 358.8 DL 439 358.8 434 358.8 DL 444 358.8 439 358.8 DL 449 358.8 444
-358.8 DL 454 358.8 449 358.8 DL 459 358.8 454 358.8 DL 464 358.8 459 358.8 DL
-469 358.8 464 358.8 DL 474 358.8 469 358.8 DL 479 358.8 474 358.8 DL 484 358.8
-479 358.8 DL 489 358.8 484 358.8 DL 494 358.8 489 358.8 DL 499 358.8 494 358.8
-DL 504 358.8 499 358.8 DL F0 2.5(2. O)72 394.8 R(VER)-.5 E(VIEW)-.55 E 2.5
-(2.1. System)87 418.8 R(Or)2.5 E(ganization)-.1 E/F2 10/Times-Italic@0 SF
-(Sendmail)127 435 Q F1 .874(neither interf)3.374 F .874
-(aces with the user nor does actual mail deli)-.1 F -.15(ve)-.25 G(ry).15 E
-5.873(.R)-.65 G(ather)431.241 435 Q 3.373(,i)-.4 G 3.373(tc)459.484 435 S .873
-(ollects a)470.077 435 R .619(message generated by a user interf)102 447 R .619
-(ace program \(UIP\) such as Berk)-.1 F(ele)-.1 E(y)-.15 E F2(Mail)3.12 E F1
-3.12(,M)C 3.12(S[)427.6 447 S(Crock)439.61 447 Q .62(er77b], or)-.1 F 1.428
-(MH [Borden79], edits the message as required by the destination netw)102 459 R
-1.427(ork, and calls appropriate)-.1 F .28(mailers to do mail deli)102 473 R
--.15(ve)-.25 G .281(ry or queueing for netw).15 F .281(ork transmission)-.1 F
-/F3 7/Times-Roman@0 SF(1)364.275 469 Q F1 5.281(.T)367.775 473 S .281
-(his discipline allo)381.666 473 R .281(ws the inser)-.25 F(-)-.2 E 1.354
-(tion of ne)102 485 R 3.854(wm)-.25 G 1.354(ailers at minimum cost.)161.642 485
-R 1.354(In this sense)6.354 F F2(sendmail)3.853 E F1 1.353
-(resembles the Message Processing)3.853 F(Module \(MPM\) of [Postel79b].)102
-497 Q F0 2.5(2.2. Interfaces)87 521 R(to the Outside W)2.5 E(orld)-.75 E F1
-.041(There are three w)127 537.2 R(ays)-.1 E F2(sendmail)2.541 E F1 .041
-(can communicate with the outside w)2.541 F .042(orld, both in recei)-.1 F .042
-(ving and)-.25 F 1.195(in sending mail.)102 549.2 R 1.194
-(These are using the con)6.194 F -.15(ve)-.4 G 1.194(ntional UNIX ar).15 F
-1.194(gument v)-.18 F 1.194(ector/return status, speaking)-.15 F(SMTP o)102
-561.2 Q -.15(ve)-.15 G 2.5(rap).15 G(air of UNIX pipes, and speaking SMTP o)
-162.53 561.2 Q -.15(ve)-.15 G 2.5(ra).15 G 2.5(ni)348.03 561.2 S
-(nterprocess\(or\) channel.)358.31 561.2 Q F0 2.5(2.2.1. Ar)102 585.2 R
-(gument v)-.1 E(ector/exit status)-.1 E F1 .52(This technique is the standard \
-UNIX method for communicating with the process.)142 601.4 R 3.02(Al)5.52 G(ist)
-494.55 601.4 Q .442(of recipients is sent in the ar)117 613.4 R .441(gument v)
--.18 F(ector)-.15 E 2.941(,a)-.4 G .441
-(nd the message body is sent on the standard input.)299.491 613.4 R(An)117
-625.4 Q .351(ything that the mailer prints is simply collected and sent back t\
-o the sender if there were an)-.15 F(y)-.15 E 2.621(problems. The)117 637.4 R
--.15(ex)2.621 G .121(it status from the mailer is collected after the message \
-is sent, and a diagnostic).15 F(is printed if appropriate.)117 649.4 Q .32 LW
-76 678.8 72 678.8 DL 80 678.8 76 678.8 DL 84 678.8 80 678.8 DL 88 678.8 84
-678.8 DL 92 678.8 88 678.8 DL 96 678.8 92 678.8 DL 100 678.8 96 678.8 DL 104
-678.8 100 678.8 DL 108 678.8 104 678.8 DL 112 678.8 108 678.8 DL 116 678.8 112
-678.8 DL 120 678.8 116 678.8 DL 124 678.8 120 678.8 DL 128 678.8 124 678.8 DL
-132 678.8 128 678.8 DL 136 678.8 132 678.8 DL 140 678.8 136 678.8 DL 144 678.8
-140 678.8 DL 148 678.8 144 678.8 DL 152 678.8 148 678.8 DL 156 678.8 152 678.8
-DL 160 678.8 156 678.8 DL 164 678.8 160 678.8 DL 168 678.8 164 678.8 DL 172
-678.8 168 678.8 DL 176 678.8 172 678.8 DL 180 678.8 176 678.8 DL 184 678.8 180
-678.8 DL 188 678.8 184 678.8 DL 192 678.8 188 678.8 DL 196 678.8 192 678.8 DL
-200 678.8 196 678.8 DL 204 678.8 200 678.8 DL 208 678.8 204 678.8 DL 212 678.8
-208 678.8 DL 216 678.8 212 678.8 DL/F4 5/Times-Roman@0 SF(1)93.6 689.2 Q/F5 8
-/Times-Roman@0 SF -.12(ex)3.2 K(cept when mailing to a \214le, when).12 E/F6 8
-/Times-Italic@0 SF(sendmail)2 E F5(does the deli)2 E -.12(ve)-.2 G(ry directly)
-.12 E(.)-.52 E EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 192.28(SMM:9-4 SENDMAIL)72 60 R 2.5<8a41>2.5 G 2.5(nI)
-383.99 60 S(nter)395.94 60 Q(netw)-.15 E(ork Mail Router)-.1 E 2.5(2.2.2. SMTP)
-102 96 R -.1(ove)2.5 G 2.5(rp).1 G(ipes)186.52 96 Q/F1 10/Times-Roman@0 SF .774
-(The SMTP protocol [Postel82] can be used to run an interacti)142 112.2 R 1.074
--.15(ve l)-.25 H .774(ock-step interf).15 F .774(ace with)-.1 F .507
-(the mailer)117 124.2 R 5.507(.A)-.55 G .506(subprocess is still created, b)
-175.461 124.2 R .506(ut no recipient addresses are passed to the mailer via)-.2
-F .075(the ar)117 136.2 R .075(gument list.)-.18 F .075(Instead, the)5.075 F
-2.575(ya)-.15 G .075
-(re passed one at a time in commands sent to the processes stan-)249.805 136.2
-R .19(dard input.)117 148.2 R(An)5.19 E .19(ything appearing on the standard o\
-utput must be a reply code in a special format.)-.15 F F0 2.5(2.2.3. SMTP)102
-172.2 R -.1(ove)2.5 G 2.5(ra).1 G 2.5(nI)185.96 172.2 S(PC connection)197.91
-172.2 Q F1 .366(This technique is similar to the pre)142 188.4 R .366
-(vious technique, e)-.25 F .366(xcept that it uses a 4.2bsd IPC chan-)-.15 F
-.953(nel [UNIX83].)117 200.4 R .953(This method is e)5.953 F .953
-(xceptionally \215e)-.15 F .952
-(xible in that the mailer need not reside on the)-.15 F(same machine.)117 212.4
-Q(It is normally used to connect to a sendmail process on another machine.)5 E
-F0 2.5(2.3. Operational)87 236.4 R(Description)2.5 E F1 .228(When a sender w)
-127 252.6 R .228(ants to send a message, it issues a request to)-.1 F/F2 10
-/Times-Italic@0 SF(sendmail)2.729 E F1 .229(using one of the three)2.729 F
-1.028(methods described abo)102 264.6 R -.15(ve)-.15 G(.).15 E F2(Sendmail)
-6.028 E F1 1.028(operates in tw)3.528 F 3.528(od)-.1 G 1.028(istinct phases.)
-325.706 264.6 R 1.028(In the \214rst phase, it collects)6.028 F .612
-(and stores the message.)102 276.6 R .612(In the second phase, message deli)
-5.612 F -.15(ve)-.25 G .612(ry occurs.).15 F .612(If there were errors during)
-5.612 F 1.59(processing during the second phase,)102 288.6 R F2(sendmail)4.09 E
-F1 1.59(creates and returns a ne)4.09 F 4.09(wm)-.25 G 1.59
-(essage describing the)415.84 288.6 R
-(error and/or returns an status code telling what went wrong.)102 300.6 Q F0
-2.5(2.3.1. Ar)102 324.6 R(gument pr)-.1 E(ocessing and addr)-.18 E(ess parsing)
--.18 E F1(If)142 340.8 Q F2(sendmail)3.321 E F1 .821
-(is called using one of the tw)3.321 F 3.322(os)-.1 G .822
-(ubprocess techniques, the ar)320.66 340.8 R .822(guments are \214rst)-.18 F
-.797(scanned and option speci\214cations are processed.)117 352.8 R .796
-(Recipient addresses are then collected, either)5.796 F .717(from the command \
-line or from the SMTP RCPT command, and a list of recipients is created.)117
-364.8 R .347(Aliases are e)117 376.8 R .347
-(xpanded at this step, including mailing lists.)-.15 F .347(As much v)5.347 F
-.346(alidation as possible of the)-.25 F 1.001
-(addresses is done at this step: syntax is check)117 388.8 R 1.002
-(ed, and local addresses are v)-.1 F 1.002(eri\214ed, b)-.15 F 1.002
-(ut detailed)-.2 F .709
-(checking of host names and addresses is deferred until deli)117 400.8 R -.15
-(ve)-.25 G(ry).15 E 5.708(.F)-.65 G(orw)388.946 400.8 Q .708
-(arding is also performed)-.1 F(as the local addresses are v)117 412.8 Q
-(eri\214ed.)-.15 E F2(Sendmail)142 429 Q F1 .307
-(appends each address to the recipient list after parsing.)2.807 F .307
-(When a name is aliased)5.307 F .322(or forw)117 441 R .322(arded, the old nam\
-e is retained in the list, and a \215ag is set that tells the deli)-.1 F -.15
-(ve)-.25 G .322(ry phase to).15 F .479(ignore this recipient.)117 453 R .479
-(This list is k)5.479 F .479(ept free from duplicates, pre)-.1 F -.15(ve)-.25 G
-.48(nting alias loops and duplicate).15 F(messages deli)117 465 Q -.15(ve)-.25
-G(rd to the same recipient, as might occur if a person is in tw).15 E 2.5(og)
--.1 G(roups.)428.12 465 Q F0 2.5(2.3.2. Message)102 489 R(collection)2.5 E F2
-(Sendmail)142 505.2 Q F1 .454(then collects the message.)2.954 F .454
-(The message should ha)5.454 F .754 -.15(ve a h)-.2 H .453(eader at the be).15
-F(ginning.)-.15 E .778(No formatting requirements are imposed on the message e)
-117 517.2 R .778(xcept that the)-.15 F 3.278(ym)-.15 G .778(ust be lines of te)
-427.708 517.2 R(xt)-.15 E .78(\(i.e., binary data is not allo)117 529.2 R 3.28
-(wed\). The)-.25 F .779(header is parsed and stored in memory)3.28 F 3.279(,a)
--.65 G .779(nd the body of)443.613 529.2 R(the message is sa)117 541.2 Q -.15
-(ve)-.2 G 2.5(di).15 G 2.5(nat)204.97 541.2 S(emporary \214le.)222.19 541.2 Q
-3.227 -.8(To s)142 557.4 T 1.627(implify the program interf).8 F 1.628
-(ace, the message is collected e)-.1 F -.15(ve)-.25 G 4.128(ni).15 G 4.128(fn)
-420.536 557.4 S 4.128(oa)432.994 557.4 S 1.628(ddresses were)446.562 557.4 R
--.25(va)117 569.4 S 2.5(lid. The).25 F(message will be returned with an error)
-2.5 E(.)-.55 E F0 2.5(2.3.3. Message)102 593.4 R(deli)2.5 E -.1(ve)-.1 G(ry).1
-E F1 -.15(Fo)142 609.6 S 2.618(re).15 G .117
-(ach unique mailer and host in the recipient list,)162.798 609.6 R F2(sendmail)
-2.617 E F1 .117(calls the appropriate mailer)2.617 F(.)-.55 E .619
-(Each mailer in)117 621.6 R -.2(vo)-.4 G .619(cation sends to all users recei)
-.2 F .619(ving the message on one host.)-.25 F .62(Mailers that only)5.62 F
-(accept one recipient at a time are handled properly)117 633.6 Q(.)-.65 E .47
-(The message is sent to the mailer using one of the same three interf)142 649.8
-R .47(aces used to submit a)-.1 F 1.465(message to sendmail.)117 661.8 R 1.465
-(Each cop)6.465 F 3.965(yo)-.1 G 3.965(ft)263.925 661.8 S 1.465
-(he message is prepended by a customized header)274 661.8 R 6.465(.T)-.55 G(he)
-494.56 661.8 Q 1.455(mailer status code is caught and check)117 673.8 R 1.455
-(ed, and a suitable error message gi)-.1 F -.15(ve)-.25 G 3.955(na).15 G 3.955
-(sa)448.115 673.8 S(ppropriate.)460.4 673.8 Q .589(The e)117 685.8 R .589(xit \
-code must conform to a system standard or a generic message \(\231Service una)
--.15 F -.25(va)-.2 G(ilable\232\)).25 E(is gi)117 697.8 Q -.15(ve)-.25 G(n.).15
-E EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(SENDMAIL \212 An Inter)72 60 Q(netw)-.15 E
-(ork Mail Router)-.1 E(SMM:9-5)462.9 60 Q 2.5(2.3.4. Queueing)102 96 R -.25(fo)
-2.5 G 2.5(rr).25 G(etransmission)192.4 96 Q/F1 10/Times-Roman@0 SF .209(If the\
- mailer returned an status that indicated that it might be able to handle the \
-mail later)142 112.2 R(,)-.4 E/F2 10/Times-Italic@0 SF(sendmail)117 124.2 Q F1
-(will queue the mail and try ag)2.5 E(ain later)-.05 E(.)-.55 E F0 2.5
-(2.3.5. Retur)102 148.2 R 2.5(nt)-.15 G 2.5(os)165.73 148.2 S(ender)177.12
-148.2 Q F1 .588(If errors occur during processing,)142 164.4 R F2(sendmail)
-3.088 E F1 .589(returns the message to the sender for retrans-)3.088 F 3.133
-(mission. The)117 176.4 R .632(letter can be mailed back or written in the \
-\214le \231dead.letter\232 in the sender')3.133 F 3.132(sh)-.55 G(ome)486.78
-176.4 Q(directory)117 190.4 Q/F3 7/Times-Roman@0 SF(2)153.1 186.4 Q F1(.)156.6
-190.4 Q F0 2.5(2.4. Message)87 214.4 R(Header Editing)2.5 E F1 1.756
-(Certain editing of the message header occurs automatically)127 230.6 R 6.756
-(.H)-.65 G 1.756(eader lines can be inserted)391.456 230.6 R .41
-(under control of the con\214guration \214le.)102 242.6 R .41
-(Some lines can be mer)5.41 F .41(ged; for e)-.18 F .41
-(xample, a \231From:\232 line and)-.15 F 2.5<6199>102 254.6 S
-(Full-name:\232 line can be mer)113.38 254.6 Q
-(ged under certain circumstances.)-.18 E F0 2.5(2.5. Con\214guration)87 278.6 R
-(File)2.5 E F1 .798(Almost all con\214guration information is read at runtime \
-from an ASCII \214le, encoding macro)127 294.8 R .679
-(de\214nitions \(de\214ning the v)102 306.8 R .678
-(alue of macros used internally\), header declarations \(telling sendmail the)
--.25 F 1.009(format of header lines that it will process specially)102 318.8 R
-3.509(,i)-.65 G 1.009(.e., lines that it will add or reformat\), mailer)320.398
-318.8 R .478(de\214nitions \(gi)102 330.8 R .478(ving information such as the \
-location and characteristics of each mailer\), and address)-.25 F(re)102 342.8
-Q .428(writing rules \(a limited production system to re)-.25 F .429
-(write addresses which is used to parse and re)-.25 F(write)-.25 E
-(the addresses\).)102 354.8 Q 2.828 -.8(To i)127 371 T(mpro).8 E 1.528 -.15
-(ve p)-.15 H 1.228(erformance when reading the con\214guration \214le, a memor\
-y image can be pro-).15 F 2.5(vided. This)102 383 R(pro)2.5 E
-(vides a \231compiled\232 form of the con\214guration \214le.)-.15 E F0 2.5
-(3. USA)72 407 R(GE AND IMPLEMENT)-.55 E -.95(AT)-.9 G(ION).95 E 2.5(3.1. Ar)87
-431 R(guments)-.1 E F1(Ar)127 447.2 Q .376
-(guments may be \215ags and addresses.)-.18 F .377(Flags set v)5.377 F .377
-(arious processing options.)-.25 F -.15(Fo)5.377 G(llo).15 E .377(wing \215ag)
--.25 F(ar)102 459.2 Q .281(guments, address ar)-.18 F .281(guments may be gi)
--.18 F -.15(ve)-.25 G .281(n, unless we are running in SMTP mode.).15 F .28
-(Addresses fol-)5.28 F(lo)102 471.2 Q 2.5(wt)-.25 G(he syntax in RFC822 [Crock)
-122.03 471.2 Q(er82] for ARP)-.1 E(ANET address formats.)-.92 E
-(In brief, the format is:)5 E 12.5(\(1\) An)107 487.4 R
-(ything in parentheses is thro)-.15 E(wn a)-.25 E -.1(wa)-.15 G 2.5(y\().1 G
-(as a comment\).)299.65 487.4 Q 12.5(\(2\) An)107 503.6 R .051
-(ything in angle brack)-.15 F .051(ets \(\231<)-.1 F .051
-(>\232\) is preferred o)1.666 F -.15(ve)-.15 G 2.551(ra).15 G -.15(ny)348.064
-503.6 S .051(thing else.).15 F .051(This rule implements the)5.051 F(ARP)133.66
-515.6 Q(ANET standard that addresses of the form)-.92 E
-(user name <machine-address>)173.66 531.8 Q(will send to the electronic \231ma\
-chine-address\232 rather than the human \231user name.)133.66 548 Q<9a>-.7 E
-12.5(\(3\) Double)107 564.2 R 2.246(quotes \()4.746 F -2.754 2.5("\) q)2.5 H
-2.246(uote phrases; backslashes quote characters.)224.188 564.2 R 2.246
-(Backslashes are more)7.246 F(po)133.66 576.2 Q .654(werful in that the)-.25 F
-3.154(yw)-.15 G .655(ill cause otherwise equi)229.196 576.2 R -.25(va)-.25 G
-.655(lent phrases to compare dif).25 F .655(ferently \212 for)-.25 F -.15(ex)
-133.66 588.2 S(ample,).15 E F2(user)2.5 E F1(and)2.5 E F2("user")2.5 E F1
-(are equi)2.5 E -.25(va)-.25 G(lent, b).25 E(ut)-.2 E F2(\\user)2.5 E F1
-(is dif)2.5 E(ferent from either of them.)-.25 E -.15(Pa)127 604.4 S 1.12
-(rentheses, angle brack).15 F 1.12
-(ets, and double quotes must be properly balanced and nested.)-.1 F(The)6.12 E
-(re)102 618.4 Q(writing rules control remaining parsing)-.25 E F3(3)266.17
-614.4 Q F1(.)269.67 618.4 Q .32 LW 76 646 72 646 DL 80 646 76 646 DL 84 646 80
-646 DL 88 646 84 646 DL 92 646 88 646 DL 96 646 92 646 DL 100 646 96 646 DL 104
-646 100 646 DL 108 646 104 646 DL 112 646 108 646 DL 116 646 112 646 DL 120 646
-116 646 DL 124 646 120 646 DL 128 646 124 646 DL 132 646 128 646 DL 136 646 132
-646 DL 140 646 136 646 DL 144 646 140 646 DL 148 646 144 646 DL 152 646 148 646
-DL 156 646 152 646 DL 160 646 156 646 DL 164 646 160 646 DL 168 646 164 646 DL
-172 646 168 646 DL 176 646 172 646 DL 180 646 176 646 DL 184 646 180 646 DL 188
-646 184 646 DL 192 646 188 646 DL 196 646 192 646 DL 200 646 196 646 DL 204 646
-200 646 DL 208 646 204 646 DL 212 646 208 646 DL 216 646 212 646 DL/F4 5
-/Times-Roman@0 SF(2)93.6 656.4 Q/F5 8/Times-Roman@0 SF(Ob)3.2 I(viously)-.12 E
-2.226(,i)-.52 G 2.226(ft)135.246 659.6 S .226(he site gi)142.36 659.6 R .226(v\
-ing the error is not the originating site, the only reasonable option is to ma\
-il back to the sender)-.2 F 4.227(.A)-.44 G(lso,)492.664 659.6 Q .191
-(there are man)72 669.2 R 2.191(ym)-.12 G .19(ore error disposition options, b)
-128.213 669.2 R .19(ut the)-.16 F 2.19(yo)-.12 G .19(nly ef)255.514 669.2 R .19
-(fect the error message \212 the \231return to sender\232 function is al)-.2 F
--.08(wa)-.08 G .19(ys han-).08 F(dled in one of these tw)72 678.8 Q 2(ow)-.08 G
-(ays.)156.272 678.8 Q F4(3)93.6 689.2 Q F5
-(Disclaimer: Some special processing is done after re)3.2 I
-(writing local names; see belo)-.2 E -.52(w.)-.2 G EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 192.28(SMM:9-6 SENDMAIL)72 60 R 2.5<8a41>2.5 G 2.5(nI)
-383.99 60 S(nter)395.94 60 Q(netw)-.15 E(ork Mail Router)-.1 E 2.5(3.2. Mail)87
-96 R(to Files and Pr)2.5 E(ograms)-.18 E/F1 10/Times-Roman@0 SF .609
-(Files and programs are le)127 112.2 R .609(gitimate message recipients.)-.15 F
-.609(Files pro)5.609 F .609(vide archi)-.15 F -.25(va)-.25 G 3.109(ls).25 G .61
-(torage of mes-)445.02 112.2 R .124
-(sages, useful for project administration and history)102 124.2 R 5.124(.P)-.65
-G .124(rograms are useful as recipients in a v)318.308 124.2 R .124(ariety of)
--.25 F .69(situations, for e)102 136.2 R .691(xample, to maintain a public rep\
-ository of systems messages \(such as the Berk)-.15 F(ele)-.1 E(y)-.15 E/F2 10
-/Times-Italic@0 SF(msgs)102 148.2 Q F1(program, or the MARS system [Sattle)2.5
-E(y78]\).)-.15 E(An)127 164.4 Q 3.188(ya)-.15 G .688(ddress passing through th\
-e initial parsing algorithm as a local address \(i.e, not appear)151.698 164.4
-R(-)-.2 E .276(ing to be a v)102 176.4 R .276
-(alid address for another mailer\) is scanned for tw)-.25 F 2.776(os)-.1 G .277
-(pecial cases.)362.128 176.4 R .277(If pre\214x)5.277 F .277(ed by a v)-.15 F
-(erti-)-.15 E .18(cal bar \(\231)102 188.4 R .833<7c9a>.833 G 2.68(\)t)-.833 G
-.179(he rest of the address is processed as a shell command.)156.456 188.4 R
-.179(If the user name be)5.179 F .179(gins with a)-.15 F(slash mark \(\231/)102
-200.4 Q(\232\) the name is used as a \214le name, instead of a login name.).833
-E .241(Files that ha)127 216.6 R .541 -.15(ve s)-.2 H .241
-(etuid or setgid bits set b).15 F .241(ut no e)-.2 F -.15(xe)-.15 G .241
-(cute bits set ha).15 F .541 -.15(ve t)-.2 H .241(hose bits honored if).15 F F2
-(send-)2.742 E(mail)102 228.6 Q F1(is running as root.)2.5 E F0 2.5
-(3.3. Aliasing,)87 252.6 R -.25(Fo)2.5 G(rwarding, Inclusion).25 E F2(Sendmail)
-127 268.8 Q F1 1.075(reroutes mail three w)3.575 F 3.575(ays. Aliasing)-.1 F
-1.074(applies system wide.)3.575 F -.15(Fo)6.074 G(rw).15 E 1.074(arding allo)
--.1 F 1.074(ws each)-.25 F .233
-(user to reroute incoming mail destined for that account.)102 280.8 R .233
-(Inclusion directs)5.233 F F2(sendmail)2.733 E F1 .233(to read a \214le for)
-2.733 F 2.5(al)102 292.8 S
-(ist of addresses, and is normally used in conjunction with aliasing.)111.72
-292.8 Q F0 2.5(3.3.1. Aliasing)102 316.8 R F1 1.554
-(Aliasing maps names to address lists using a system-wide \214le.)142 333 R
-1.553(This \214le is inde)6.553 F -.15(xe)-.15 G 4.053(dt).15 G(o)499 333 Q 1.1
-(speed access.)117 345 R 1.101(Only names that parse as local are allo)6.1 F
-1.101(wed as aliases; this guarantees a unique)-.25 F -.1(ke)117 357 S 2.5(y\()
--.05 G(since there are no nicknames for the local host\).)137.02 357 Q F0 2.5
-(3.3.2. F)102 381 R(orwarding)-.25 E F1 .651
-(After aliasing, recipients that are local and v)142 397.2 R .651
-(alid are check)-.25 F .65(ed for the e)-.1 F .65(xistence of a \231.for)-.15 F
-(-)-.2 E -.1(wa)117 409.2 S .493(rd\232 \214le in their home directory).1 F
-5.493(.I)-.65 G 2.994(fi)264.178 409.2 S 2.994(te)273.282 409.2 S .494
-(xists, the message is)283.346 409.2 R F2(not)2.994 E F1 .494
-(sent to that user)2.994 F 2.994(,b)-.4 G .494(ut rather to)459.132 409.2 R .37
-(the list of users in that \214le.)117 421.2 R .37
-(Often this list will contain only one address, and the feature will be)5.37 F
-(used for netw)117 433.2 Q(ork mail forw)-.1 E(arding.)-.1 E -.15(Fo)142 449.4
-S(rw).15 E 1.151(arding also permits a user to specify a pri)-.1 F -.25(va)-.25
-G 1.152(te incoming mailer).25 F 6.152(.F)-.55 G 1.152(or e)437.346 449.4 R
-1.152(xample, for)-.15 F(-)-.2 E -.1(wa)117 461.4 S(rding to:).1 E -2.5 .833
-("| /)157 477.6 T(usr/local/ne)-.833 E(wmail myname")-.25 E(will use a dif)117
-493.8 Q(ferent incoming mailer)-.25 E(.)-.55 E F0 2.5(3.3.3. Inclusion)102
-517.8 R F1(Inclusion is speci\214ed in RFC 733 [Crock)142 534 Q(er77a] syntax:)
--.1 E(:Include: pathname)157 550.2 Q .391
-(An address of this form reads the \214le speci\214ed by)117 566.4 R F2
-(pathname)2.891 E F1 .391(and sends to all users listed in that)2.891 F
-(\214le.)117 578.4 Q .644(The intent is)142 594.6 R F2(not)3.144 E F1 .644
-(to support direct use of this feature, b)3.144 F .644
-(ut rather to use this as a subset of)-.2 F 2.5(aliasing. F)117 606.6 R(or e)
--.15 E(xample, an alias of the form:)-.15 E
-(project: :include:/usr/project/userlist)157 622.8 Q 1.93(is a method of letti\
-ng a project maintain a mailing list without interaction with the system)117
-639 R(administration, e)117 651 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(ft)203.54 651
-S(he alias \214le is protected.)212.15 651 Q 2.024(It is not necessary to reb)
-142 667.2 R 2.024(uild the inde)-.2 F 4.524(xo)-.15 G 4.524(nt)317.822 667.2 S
-2.025(he alias database when a :include: list is)330.126 667.2 R(changed.)117
-679.2 Q EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(SENDMAIL \212 An Inter)72 60 Q(netw)-.15 E
-(ork Mail Router)-.1 E(SMM:9-7)462.9 60 Q 2.5(3.4. Message)87 96 R(Collection)
-2.5 E/F1 10/Times-Roman@0 SF .857
-(Once all recipient addresses are parsed and v)127 112.2 R .857
-(eri\214ed, the message is collected.)-.15 F .856(The message)5.857 F
-(comes in tw)102 124.2 Q 2.5(op)-.1 G
-(arts: a message header and a message body)162.73 124.2 Q 2.5(,s)-.65 G
-(eparated by a blank line.)343.42 124.2 Q
-(The header is formatted as a series of lines of the form)127 140.4 Q
-(\214eld-name: \214eld-v)178 156.6 Q(alue)-.25 E(Field-v)102 172.8 Q 1.366
-(alue can be split across lines by starting the follo)-.25 F 1.366
-(wing lines with a space or a tab)-.25 F 6.366(.S)-.4 G(ome)486.78 172.8 Q .211
-(header \214elds ha)102 184.8 R .511 -.15(ve s)-.2 H .211
-(pecial internal meaning, and ha).15 F .511 -.15(ve a)-.2 H .211
-(ppropriate special processing.).15 F .21(Other headers)5.21 F
-(are simply passed through.)102 196.8 Q
-(Some header \214elds may be added automatically)5 E 2.5(,s)-.65 G
-(uch as time stamps.)413.53 196.8 Q .86(The body is a series of te)127 213 R
-.861(xt lines.)-.15 F .861(It is completely uninterpreted and untouched, e)
-5.861 F .861(xcept that)-.15 F 1.43(lines be)102 225 R 1.43
-(ginning with a dot ha)-.15 F 1.729 -.15(ve t)-.2 H 1.429
-(he dot doubled when transmitted o).15 F -.15(ve)-.15 G 3.929(ra).15 G 3.929
-(nS)407.213 225 S 1.429(MTP channel.)421.702 225 R(This)6.429 E -.15(ex)102 237
-S(tra dot is stripped by the recei).15 E -.15(ve)-.25 G -.55(r.).15 G F0 2.5
-(3.5. Message)87 261 R(Deli)2.5 E -.1(ve)-.1 G(ry).1 E F1 .028
-(The send queue is ordered by recei)127 277.2 R .029
-(ving host before transmission to implement message batch-)-.25 F 3.07
-(ing. Each)102 289.2 R .57(address is mark)3.07 F .57
-(ed as it is sent so rescanning the list is safe.)-.1 F .57(An ar)5.57 F .57
-(gument list is b)-.18 F .57(uilt as)-.2 F 1.138(the scan proceeds.)102 301.2 R
-1.139(Mail to \214les is detected during the scan of the send list.)6.139 F
-1.139(The interf)6.139 F 1.139(ace to the)-.1 F
-(mailer is performed using one of the techniques described in section 2.2.)102
-313.2 Q .996(After a connection is established,)127 329.4 R/F2 10
-/Times-Italic@0 SF(sendmail)3.496 E F1(mak)3.495 E .995(es the per)-.1 F .995
-(-mailer changes to the header and)-.2 F .236(sends the result to the mailer)
-102 341.4 R 5.236(.I)-.55 G 2.736(fa)228.406 341.4 S .537 -.15(ny m)238.912
-341.4 T .237(ail is rejected by the mailer).15 F 2.737(,a\215)-.4 G .237
-(ag is set to in)386.628 341.4 R -.2(vo)-.4 G .437 -.1(ke t).2 H .237
-(he return-).1 F(to-sender function after all deli)102 353.4 Q -.15(ve)-.25 G
-(ry completes.).15 E F0 2.5(3.6. Queued)87 377.4 R(Messages)2.5 E F1 .163
-(If the mailer returns a \231temporary f)127 393.6 R .163(ailure\232 e)-.1 F
-.162(xit status, the message is queued.)-.15 F 2.662(Ac)5.162 G .162
-(ontrol \214le is)455.336 393.6 R .85
-(used to describe the recipients to be sent to and v)102 405.6 R .851
-(arious other parameters.)-.25 F .851(This control \214le is for)5.851 F(-)-.2
-E 1.011(matted as a series of lines, each describing a sender)102 417.6 R 3.511
-(,ar)-.4 G 1.011(ecipient, the time of submission, or some)333.494 417.6 R .776
-(other salient parameter of the message.)102 429.6 R .776
-(The header of the message is stored in the control \214le, so)5.776 F(that th\
-e associated data \214le in the queue is just the temporary \214le that w)102
-441.6 Q(as originally collected.)-.1 E F0 2.5(3.7. Con\214guration)87 465.6 R
-F1 .493(Con\214guration is controlled primarily by a con\214guration \214le re\
-ad at startup.)127 481.8 R F2(Sendmail)5.492 E F1(should)2.992 E
-(not need to be recomplied e)102 493.8 Q(xcept)-.15 E 12.5(\(1\) T)107 510 R
-2.5(oc)-.8 G(hange operating systems \(V6, V7/32V)150.91 510 Q 2.5(,4)-1.29 G
-(BSD\).)313.21 510 Q 12.5(\(2\) T)107 526.2 R 2.5(or)-.8 G(emo)149.8 526.2 Q .3
--.15(ve o)-.15 H 2.5(ri).15 G(nsert the DBM \(UNIX database\) library)192.27
-526.2 Q(.)-.65 E 12.5(\(3\) T)107 542.4 R 2.5(oc)-.8 G(hange ARP)150.91 542.4 Q
-(ANET reply codes.)-.92 E 12.5(\(4\) T)107 558.6 R 2.5(oa)-.8 G
-(dd headers \214elds requiring special processing.)150.91 558.6 Q .434
-(Adding mailers or changing parsing \(i.e., re)102 574.8 R .435
-(writing\) or routing information does not require recom-)-.25 F(pilation.)102
-586.8 Q 1.317(If the mail is being sent by a local user)127 603 R 3.817(,a)-.4
-G 1.317(nd the \214le \231.mailcf\232 e)303.914 603 R 1.317
-(xists in the sender')-.15 F 3.817(sh)-.55 G(ome)486.78 603 Q(directory)102 615
-Q 2.721(,t)-.65 G .221(hat \214le is read as a con\214guration \214le after th\
-e system con\214guration \214le.)145.451 615 R .222(The primary use)5.222 F
-(of this feature is to add header lines.)102 627 Q 3.25(The con\214guration \
-\214le encodes macro de\214nitions, header de\214nitions, mailer de\214nitions\
-,)127 643.2 R(re)102 655.2 Q(writing rules, and options.)-.25 E F0 2.5
-(3.7.1. Macr)102 679.2 R(os)-.18 E F1 .332(Macros can be used in three w)142
-695.4 R 2.833(ays. Certain)-.1 F .333(macros transmit unstructured te)2.833 F
-.333(xtual informa-)-.15 F .07(tion into the mail system, such as the name)117
-707.4 R F2(sendmail)2.57 E F1 .07
-(will use to identify itself in error messages.)2.57 F 1.247
-(Other macros transmit information from)117 719.4 R F2(sendmail)3.747 E F1
-1.247(to the con\214guration \214le for use in creating)3.747 F EP
-%%Page: 8 8
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 192.28(SMM:9-8 SENDMAIL)72 60 R 2.5<8a41>2.5 G 2.5(nI)
-383.99 60 S(nter)395.94 60 Q(netw)-.15 E(ork Mail Router)-.1 E/F1 10
-/Times-Roman@0 SF .312(other \214elds \(such as ar)117 96 R .312(gument v)-.18
-F .312(ectors to mailers\); e.g., the name of the sender)-.15 F 2.811(,a)-.4 G
-.311(nd the host and)442.237 96 R .848(user of the recipient.)117 108 R .848
-(Other macros are unused internally)5.848 F 3.348(,a)-.65 G .848
-(nd can be used as shorthand in the)361.142 108 R(con\214guration \214le.)117
-120 Q F0 2.5(3.7.2. Header)102 144 R(declarations)2.5 E F1 .355
-(Header declarations inform)142 160.2 R/F2 10/Times-Italic@0 SF(sendmail)2.854
-E F1 .354(of the format of kno)2.854 F .354(wn header lines.)-.25 F(Kno)5.354 E
-.354(wledge of)-.25 F 2.5(af)117 172.2 S .5 -.25(ew h)127.27 172.2 T
-(eader lines is b).25 E(uilt into)-.2 E F2(sendmail)2.5 E F1 2.5(,s)C
-(uch as the \231From:\232 and \231Date:\232 lines.)284.59 172.2 Q 1.201(Most c\
-on\214gured headers will be automatically inserted in the outgoing message if \
-the)142 188.4 R(y)-.15 E(don')117 200.4 Q 2.5(te)-.18 G
-(xist in the incoming message.)144.72 200.4 Q
-(Certain headers are suppressed by some mailers.)5 E F0 2.5(3.7.3. Mailer)102
-224.4 R(declarations)2.5 E F1 1.756(Mailer declarations tell)142 240.6 R F2
-(sendmail)4.256 E F1 1.756(of the v)4.256 F 1.756(arious mailers a)-.25 F -.25
-(va)-.2 G 1.756(ilable to it.).25 F 1.755(The de\214nition)6.755 F .119
-(speci\214es the internal name of the mailer)117 252.6 R 2.619(,t)-.4 G .12
-(he pathname of the program to call, some \215ags associ-)285.183 252.6 R 2.036
-(ated with the mailer)117 264.6 R 4.536(,a)-.4 G 2.036(nd an ar)213.894 264.6 R
-2.036(gument v)-.18 F 2.036(ector to be used on the call; this v)-.15 F 2.035
-(ector is macro-)-.15 F -.15(ex)117 276.6 S(panded before use.).15 E F0 2.5
-(3.7.4. Addr)102 300.6 R(ess r)-.18 E(ewriting rules)-.18 E F1 .458
-(The heart of address parsing in)142 316.8 R F2(sendmail)2.959 E F1 .459
-(is a set of re)2.959 F .459(writing rules.)-.25 F .459(These are an ordered)
-5.459 F .561(list of pattern-replacement rules, \(some)117 328.8 R .561
-(what lik)-.25 F 3.061(eap)-.1 G .561(roduction system, e)328.867 328.8 R .56
-(xcept that order is criti-)-.15 F 1.905
-(cal\), which are applied to each address.)117 340.8 R 1.905(The address is re)
-6.905 F 1.906(written te)-.25 F 1.906(xtually until it is either)-.15 F(re)117
-352.8 Q .308(written into a special canonical form \(i.e., a \(mailer)-.25 F
-2.807(,h)-.4 G .307(ost, user\) 3-tuple, such as {arpanet, usc-)342.118 352.8 R
-.64(isif, postel} representing the address \231postel@usc-isif\232\), or it f)
-117 364.8 R .641(alls of)-.1 F 3.141(ft)-.25 G .641(he end.)406.466 364.8 R
-.641(When a pattern)5.641 F(matches, the rule is reapplied until it f)117 376.8
-Q(ails.)-.1 E 1.222
-(The con\214guration \214le also supports the editing of addresses into dif)142
-393 R 1.221(ferent formats.)-.25 F -.15(Fo)6.221 G(r).15 E -.15(ex)117 405 S
-(ample, an address of the form:).15 E(ucsfcgl!tef)157 421.2 Q
-(might be mapped into:)117 437.4 Q(tef@ucsfcgl.UUCP)157 453.6 Q
-(to conform to the domain syntax.)117 469.8 Q -.35(Tr)5 G
-(anslations can also be done in the other direction.).35 E F0 2.5
-(3.7.5. Option)102 493.8 R(setting)2.5 E F1 1.168(There are se)142 510 R -.15
-(ve)-.25 G 1.169(ral options that can be set from the con\214guration \214le.)
-.15 F 1.169(These include the)6.169 F(pathnames of v)117 522 Q
-(arious support \214les, timeouts, def)-.25 E(ault modes, etc.)-.1 E F0 2.5
-(4. COMP)72 546 R(ARISON WITH O)-.74 E(THER MAILERS)-.4 E 2.5(4.1. Deli)87 570
-R -.1(ve)-.1 G(rmail).1 E F2(Sendmail)127 586.2 Q F1(is an outgro)2.5 E(wth of)
--.25 E F2(delivermail)2.5 E F1 5(.T)C(he primary dif)301.18 586.2 Q
-(ferences are:)-.25 E 12.5(\(1\) Con\214guration)107 602.4 R .273
-(information is not compiled in.)2.773 F .272(This change simpli\214es man)
-5.273 F 2.772(yo)-.15 G 2.772(ft)445.686 602.4 S .272(he problems)454.568 602.4
-R(of mo)133.66 614.4 Q(ving to other machines.)-.15 E(It also allo)5 E
-(ws easy deb)-.25 E(ugging of ne)-.2 E 2.5(wm)-.25 G(ailers.)413.89 614.4 Q
-12.5(\(2\) Address)107 630.6 R .681(parsing is more \215e)3.181 F 3.182
-(xible. F)-.15 F .682(or e)-.15 F(xample,)-.15 E F2(delivermail)3.182 E F1 .682
-(only supported one g)3.182 F(ate)-.05 E -.1(wa)-.25 G 3.182(yt).1 G(o)499
-630.6 Q(an)133.66 642.6 Q 2.817(yn)-.15 G(etw)155.767 642.6 Q .317
-(ork, whereas)-.1 F F2(sendmail)2.817 E F1 .317(can be sensiti)2.817 F .616
--.15(ve t)-.25 H 2.816(oh).15 G .316(ost names and reroute to dif)345.224 642.6
-R .316(ferent g)-.25 F(ate-)-.05 E -.1(wa)133.66 654.6 S(ys.).1 E 12.5(\(3\) F)
-107 670.8 R(orw)-.15 E 1.627(arding and :include: features eliminate the requi\
-rement that the system alias \214le be)-.1 F .074(writable by an)133.66 682.8 R
-2.574(yu)-.15 G .073
-(ser \(or that an update program be written, or that the system administration)
-203.442 682.8 R(mak)133.66 694.8 Q 2.5(ea)-.1 G(ll changes\).)162.16 694.8 Q
-(\(4\))107 711 Q F2(Sendmail)133.66 711 Q F1 .4
-(supports message batching across netw)2.9 F .401
-(orks when a message is being sent to mul-)-.1 F(tiple recipients.)133.66 723 Q
-EP
-%%Page: 9 9
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(SENDMAIL \212 An Inter)72 60 Q(netw)-.15 E
-(ork Mail Router)-.1 E(SMM:9-9)462.9 60 Q/F1 10/Times-Roman@0 SF 12.5(\(5\) A)
-107 96 R .875(mail queue is pro)3.375 F .874(vided in)-.15 F/F2 10
-/Times-Italic@0 SF(sendmail.)3.374 E F1 .874(Mail that cannot be deli)5.874 F
--.15(ve)-.25 G .874(red immediately b).15 F .874(ut can)-.2 F 1.063
-(potentially be deli)133.66 108 R -.15(ve)-.25 G 1.064
-(red later is stored in this queue for a later retry).15 F 6.064(.T)-.65 G
-1.064(he queue also pro-)427.218 108 R .896(vides a b)133.66 120 R(uf)-.2 E
-.896(fer ag)-.25 F .895
-(ainst system crashes; after the message has been collected it may be reli-)
--.05 F(ably redeli)133.66 132 Q -.15(ve)-.25 G(red e).15 E -.15(ve)-.25 G 2.5
-(ni).15 G 2.5(ft)224.22 132 S(he system crashes during the initial deli)232.83
-132 Q -.15(ve)-.25 G(ry).15 E(.)-.65 E(\(6\))107 148.2 Q F2(Sendmail)133.66
-148.2 Q F1 .197(uses the netw)2.696 F .197(orking support pro)-.1 F .197
-(vided by 4.2BSD to pro)-.15 F .197(vide a direct interf)-.15 F .197(ace net-)
--.1 F -.1(wo)133.66 160.2 S .07(rks such as the ARP).1 F .07
-(ANET and/or Ethernet using SMTP \(the Simple Mail T)-.92 F .07(ransfer Proto-)
--.35 F(col\) o)133.66 172.2 Q -.15(ve)-.15 G 2.5(raT).15 G(CP/IP connection.)
-184.73 172.2 Q F0 2.5(4.2. MMDF)87 196.2 R F1 .957(MMDF [Crock)127 212.4 R .957
-(er79] spans a wider problem set than)-.1 F F2(sendmail)3.458 E F1 5.958(.F)C
-.958(or e)395.058 212.4 R .958(xample, the domain of)-.15 F .721
-(MMDF includes a \231phone netw)102 224.4 R .721(ork\232 mailer)-.1 F 3.221(,w)
--.4 G(hereas)290.516 224.4 Q F2(sendmail)3.221 E F1 .721(calls on pree)3.221 F
-.72(xisting mailers in most)-.15 F(cases.)102 236.4 Q .175(MMDF and)127 252.6 R
-F2(sendmail)2.675 E F1 .175
-(both support aliasing, customized mailers, message batching, automatic)2.675 F
-(forw)102 264.6 Q .792(arding to g)-.1 F(ate)-.05 E -.1(wa)-.25 G .792
-(ys, queueing, and retransmission.).1 F .792(MMDF supports tw)5.792 F .792
-(o-stage timeout, which)-.1 F F2(sendmail)102 276.6 Q F1(does not support.)2.5
-E(The con\214guration for MMDF is compiled into the code)127 294.8 Q/F3 7
-/Times-Roman@0 SF(4)348.65 290.8 Q F1(.)352.15 294.8 Q .037
-(Since MMDF does not consider backw)127 311 R .037
-(ards compatibility as a design goal, the address parsing)-.1 F(is simpler b)
-102 323 Q(ut much less \215e)-.2 E(xible.)-.15 E 1.159(It is some)127 341.2 R
-1.159(what harder to inte)-.25 F 1.159(grate a ne)-.15 F 3.659(wc)-.25 G
-(hannel)302.802 341.2 Q F3(5)329.462 337.2 Q F1 1.159(into MMDF)336.621 341.2 R
-6.16(.I)-.8 G 3.66(np)397.59 341.2 S(articular)411.25 341.2 Q 3.66(,M)-.4 G
-1.16(MDF must)459.22 341.2 R(kno)102 353.2 Q 3.225(wt)-.25 G .725(he location \
-and format of host tables for all channels, and the channel must speak a speci\
-al)129.975 353.2 R 2.525(protocol. This)102 365.2 R(allo)2.525 E .025
-(ws MMDF to do additional v)-.25 F .025(eri\214cation \(such as v)-.15 F .025
-(erifying host names\) at submis-)-.15 F(sion time.)102 377.2 Q 1.761
-(MMDF strictly separates the submission and deli)127 393.4 R -.15(ve)-.25 G
-1.761(ry phases.).15 F(Although)6.761 E F2(sendmail)4.261 E F1 1.76(has the)
-4.261 F .784(concept of each of these stages, the)102 405.4 R 3.284(ya)-.15 G
-.784(re inte)260.068 405.4 R .785(grated into one program, whereas in MMDF the)
--.15 F 3.285(ya)-.15 G(re)496.23 405.4 Q(split into tw)102 417.4 Q 2.5(op)-.1 G
-(rograms.)162.19 417.4 Q F0 2.5(4.3. Message)87 441.4 R(Pr)2.5 E
-(ocessing Module)-.18 E F1 .925
-(The Message Processing Module \(MPM\) discussed by Postel [Postel79b] matches)
-127 457.6 R F2(sendmail)3.425 E F1 1.364
-(closely in terms of its basic architecture.)102 469.6 R(Ho)6.364 E(we)-.25 E
--.15(ve)-.25 G 2.164 -.4(r, l).15 H(ik).4 E 3.864(eM)-.1 G(MDF)347.526 469.6 Q
-3.864(,t)-.8 G 1.365(he MPM includes the netw)377.54 469.6 R(ork)-.1 E(interf)
-102 481.6 Q(ace softw)-.1 E(are as part of its domain.)-.1 E .408
-(MPM also postulates a duple)127 497.8 R 2.907(xc)-.15 G .407
-(hannel to the recei)256.937 497.8 R -.15(ve)-.25 G 1.207 -.4(r, a).15 H 2.907
-(sd).4 G .407(oes MMDF)365.362 497.8 R 2.907(,t)-.8 G .407(hus allo)419.546
-497.8 R .407(wing simpler)-.25 F .302
-(handling of errors by the mailer than is possible in)102 509.8 R F2(sendmail)
-2.802 E F1 5.302(.W)C .302(hen a message queued by)362.24 509.8 R F2(sendmail)
-2.802 E F1 .23(is sent, an)102 521.8 R 2.73(ye)-.15 G .23
-(rrors must be returned to the sender by the mailer itself.)154.2 521.8 R .229
-(Both MPM and MMDF mail-)5.229 F .883(ers can return an immediate error respon\
-se, and a single error processor can create an appropriate)102 533.8 R
-(response.)102 545.8 Q 2.24
-(MPM prefers passing the message as a structured object, with type-length-v)127
-564 R 2.24(alue tuples)-.25 F F3(6)498 560 Q F1(.)501.5 564 Q .874(Such a con)
-102 576 R -.15(ve)-.4 G .874(ntion requires a much higher de).15 F .875
-(gree of cooperation between mailers than is required)-.15 F(by)102 588 Q F2
-(sendmail)2.796 E F1 5.296(.M)C .296(PM also assumes a uni)167.592 588 R -.15
-(ve)-.25 G .296(rsally agreed upon internet name space \(with each address).15
-F(in the form of a net-host-user tuple\), which)102 600 Q F2(sendmail)2.5 E F1
-(does not.)2.5 E .32 LW 76 642 72 642 DL 80 642 76 642 DL 84 642 80 642 DL 88
-642 84 642 DL 92 642 88 642 DL 96 642 92 642 DL 100 642 96 642 DL 104 642 100
-642 DL 108 642 104 642 DL 112 642 108 642 DL 116 642 112 642 DL 120 642 116 642
-DL 124 642 120 642 DL 128 642 124 642 DL 132 642 128 642 DL 136 642 132 642 DL
-140 642 136 642 DL 144 642 140 642 DL 148 642 144 642 DL 152 642 148 642 DL 156
-642 152 642 DL 160 642 156 642 DL 164 642 160 642 DL 168 642 164 642 DL 172 642
-168 642 DL 176 642 172 642 DL 180 642 176 642 DL 184 642 180 642 DL 188 642 184
-642 DL 192 642 188 642 DL 196 642 192 642 DL 200 642 196 642 DL 204 642 200 642
-DL 208 642 204 642 DL 212 642 208 642 DL 216 642 212 642 DL/F4 5/Times-Roman@0
-SF(4)93.6 652.4 Q/F5 8/Times-Roman@0 SF .179
-(Dynamic con\214guration tables are currently being considered for MMDF; allo)
-3.2 J .18(wing the installer to select either compiled or dy-)-.2 F
-(namic tables.)72 665.2 Q F4(5)93.6 675.6 Q F5(The MMDF equi)3.2 I -.2(va)-.2 G
-(lent of a).2 E/F6 8/Times-Italic@0 SF(sendmail)2 E F5(\231mailer)2 E -.56
-<2e9a>-.44 G F4(6)93.6 689.2 Q F5(This is similar to the NBS standard.)3.2 I EP
-%%Page: 10 10
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 187.28(SMM:9-10 SENDMAIL)72 60 R 2.5<8a41>2.5 G 2.5(nI)
-383.99 60 S(nter)395.94 60 Q(netw)-.15 E(ork Mail Router)-.1 E 2.5(5. EV)72 96
-R(ALU)-1.35 E -.95(AT)-.6 G(IONS AND FUTURE PLANS).95 E/F1 10/Times-Italic@0 SF
-(Sendmail)112 112.2 Q/F2 10/Times-Roman@0 SF 1.851(is designed to w)4.351 F
-1.851(ork in a nonhomogeneous en)-.1 F 4.352(vironment. Ev)-.4 F 1.852
-(ery attempt is made to)-.15 F -.2(avo)87 124.2 S 1.037
-(id imposing unnecessary constraints on the underlying mailers.).2 F 1.036
-(This goal has dri)6.036 F -.15(ve)-.25 G 3.536(nm).15 G 1.036(uch of the)
-461.938 124.2 R 2.723(design. One)87 136.2 R .223(of the major problems has be\
-en the lack of a uniform address space, as postulated in [Pos-)2.723 F
-(tel79a] and [Postel79b].)87 148.2 Q 2.647(An)112 164.4 S .147(onuniform addre\
-ss space implies that a path will be speci\214ed in all addresses, either e)
-126.867 164.4 R(xplicitly)-.15 E .472
-(\(as part of the address\) or implicitly \(as with implied forw)87 176.4 R
-.473(arding to g)-.1 F(ate)-.05 E -.1(wa)-.25 G 2.973(ys\). This).1 F .473
-(restriction has the)2.973 F .493(unpleasant ef)87 188.4 R .493
-(fect of making replying to messages e)-.25 F .493(xceedingly dif)-.15 F .493
-(\214cult, since there is no one \231address\232)-.25 F(for an)87 200.4 Q 2.5
-(yp)-.15 G(erson, b)122.95 200.4 Q(ut only a w)-.2 E
-(ay to get there from where)-.1 E -.15(ve)-.25 G 2.5(ry).15 G(ou are.)324.7
-200.4 Q(Interf)112 216.6 Q .448(acing to mail programs that were not initially\
- intended to be applied in an internet en)-.1 F(viron-)-.4 E(ment has been ama\
-zingly successful, and has reduced the job to a manageable task.)87 228.6 Q F1
-(Sendmail)112 244.8 Q F2 2.906(has kno)5.406 F 2.906(wledge of a fe)-.25 F
-5.406(wd)-.25 G(if)271.126 244.8 Q 2.906(\214cult en)-.25 F 2.906(vironments b)
--.4 F 2.906(uilt in.)-.2 F 2.905(It generates ARP)7.906 F(ANET)-.92 E .648(FTP\
-/SMTP compatible error messages \(prepended with three-digit numbers [Neigus73\
-, Postel74, Pos-)87 256.8 R .771(tel82]\) as necessary)87 268.8 R 3.271(,o)-.65
-G .771(ptionally generates UNIX-style \231From\232 lines on the front of messa\
-ges for some)177.523 268.8 R 1.669(mailers, and kno)87 280.8 R 1.669(ws ho)-.25
-F 4.169(wt)-.25 G 4.169(op)195.666 280.8 S 1.669(arse the same lines on input.)
-209.835 280.8 R 1.67(Also, error handling has an option cus-)6.67 F
-(tomized for BerkNet.)87 292.8 Q 1.482(The decision to a)112 309 R -.2(vo)-.2 G
-1.482(id doing an).2 F 3.982(yt)-.15 G 1.481(ype of deli)254.222 309 R -.15(ve)
--.25 G 1.481(ry where possible \(e).15 F -.15(ve)-.25 G 1.481
-(n, or perhaps especially).15 F(,)-.65 E .574(local deli)87 321 R -.15(ve)-.25
-G .574(ry\) has turned out to be a good idea.).15 F(Ev)5.574 E .574
-(en with local deli)-.15 F -.15(ve)-.25 G(ry).15 E 3.074(,t)-.65 G .575
-(here are issues of the loca-)394.776 321 R .469(tion of the mailbox, the form\
-at of the mailbox, the locking protocol used, etc., that are best decided by)87
-333 R .038(other programs.)87 345 R .038(One surprisingly major anno)5.038 F
-.038(yance in man)-.1 F 2.538(yi)-.15 G .038
-(nternet mailers is that the location and for)333.684 345 R(-)-.2 E .138
-(mat of local mail is b)87 357 R .138(uilt in.)-.2 F .137
-(The feeling seems to be that local mail is so common that it should be ef)
-5.137 F<8c2d>-.25 E 3.045(cient. This)87 369 R .545
-(feeling is not born out by our e)3.045 F .545(xperience; on the contrary)-.15
-F 3.045(,t)-.65 G .545(he location and format of mail-)376.575 369 R(box)87 381
-Q(es seems to v)-.15 E(ary widely from system to system.)-.25 E .681
-(The ability to automatically generate a response to incoming mail \(by forw)
-112 397.2 R .68(arding mail to a pro-)-.1 F .435
-(gram\) seems useful \(\231I am on v)87 409.2 R .435
-(acation until late August....)-.25 F 2.935(\232\) b)-.7 F .435
-(ut can create problems such as forw)-.2 F(ard-)-.1 E .143(ing loops \(tw)87
-421.2 R 2.643(op)-.1 G .143(eople on v)152.609 421.2 R .143(acation whose prog\
-rams send notes back and forth, for instance\) if these pro-)-.25 F .732
-(grams are not well written.)87 433.2 R 3.232(Ap)5.732 G .732
-(rogram could be written to do standard tasks correctly)218.592 433.2 R 3.233
-(,b)-.65 G .733(ut this w)450.404 433.2 R(ould)-.1 E(solv)87 445.2 Q 2.5(et)
--.15 G(he general case.)113.24 445.2 Q .225
-(It might be desirable to implement some form of load limiting.)112 461.4 R
-2.725(Ia)5.225 G 2.724(mu)380.8 461.4 S(na)396.304 461.4 Q -.1(wa)-.15 G .224
-(re of an).1 F 2.724(ym)-.15 G .224(ail system)463.496 461.4 R
-(that addresses this problem, nor am I a)87 473.4 Q -.1(wa)-.15 G(re of an).1 E
-2.5(yr)-.15 G(easonable solution at this time.)294.05 473.4 Q .113(The con\214\
-guration \214le is currently practically inscrutable; considerable con)112
-489.6 R -.15(ve)-.4 G .114(nience could be real-).15 F(ized with a higher)87
-501.6 Q(-le)-.2 E -.15(ve)-.25 G 2.5(lf).15 G(ormat.)186.93 501.6 Q .778(It se\
-ems clear that common protocols will be changing soon to accommodate changing \
-require-)112 517.8 R 2.774(ments and en)87 529.8 R 5.274(vironments. These)-.4
-F 2.774(changes will include modi\214cations to the message header \(e.g.,)
-5.274 F .859([NBS80]\) or to the body of the message itself \(such as for mult\
-imedia messages [Postel80]\).)87 541.8 R(Experi-)5.859 E
-(ence indicates that these changes should be relati)87 553.8 Q -.15(ve)-.25 G
-(ly tri).15 E(vial to inte)-.25 E(grate into the e)-.15 E(xisting system.)-.15
-E .811(In tightly coupled en)112 570 R .812(vironments, it w)-.4 F .812
-(ould be nice to ha)-.1 F 1.112 -.15(ve a n)-.2 H .812(ame serv).15 F .812
-(er such as Grapvine [Bir)-.15 F(-)-.2 E .095(rell82] inte)87 582 R .095
-(grated into the mail system.)-.15 F .095(This w)5.095 F .095(ould allo)-.1 F
-2.594(was)-.25 G .094(ite such as \231Berk)330.768 582 R(ele)-.1 E .094
-(y\232 to appear as a single)-.15 F 2.606
-(host, rather than as a collection of hosts, and w)87 594 R 2.606(ould allo)-.1
-F 5.106(wp)-.25 G 2.606(eople to mo)352.786 594 R 2.906 -.15(ve t)-.15 H 2.606
-(ransparently among).15 F 1.664(machines without ha)87 606 R 1.664
-(ving to change their addresses.)-.2 F 1.664(Such a f)6.664 F 1.664(acility w)
--.1 F 1.663(ould require an automatically)-.1 F .428
-(updated database and some method of resolving con\215icts.)87 618 R .428
-(Ideally this w)5.428 F .428(ould be ef)-.1 F(fecti)-.25 E .728 -.15(ve e)-.25
-H -.15(ve)-.1 G 2.928(nw).15 G(ithout)480.66 618 Q .184
-(all hosts being under a single management.)87 630 R(Ho)5.184 E(we)-.25 E -.15
-(ve)-.25 G .984 -.4(r, i).15 H 2.684(ti).4 G 2.683(sn)317.576 630 S .183
-(ot clear whether this feature should be inte-)329.149 630 R
-(grated into the aliasing f)87 642 Q(acility or should be considered a \231v)
--.1 E(alue added\232 feature outside)-.25 E F1(sendmail)2.5 E F2(itself.)2.5 E
-.79(As a more interesting case, the CSNET name serv)112 658.2 R .791
-(er [Solomon81] pro)-.15 F .791(vides an f)-.15 F .791(acility that goes)-.1 F
-(be)87 670.2 Q .375(yond a single tightly-coupled en)-.15 F 2.875
-(vironment. Such)-.4 F 2.875(af)2.875 G .375(acility w)308.675 670.2 R .374
-(ould normally e)-.1 F .374(xist outside of)-.15 F F1(sendmail)2.874 E F2(ho)87
-682.2 Q(we)-.25 E -.15(ve)-.25 G -.55(r.).15 G EP
-%%Page: 11 11
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(SENDMAIL \212 An Inter)72 60 Q(netw)-.15 E
-(ork Mail Router)-.1 E(SMM:9-11)457.9 60 Q -.55(AC)72 96 S(KNO).55 E
-(WLEDGEMENTS)-.5 E/F1 10/Times-Roman@0 SF 1.203(Thanks are due to K)97 112.2 R
-1.204
-(urt Shoens for his continual cheerful assistance and good advice, Bill Jo)-.15
-F 3.704(yf)-.1 G(or)495.67 112.2 Q .102
-(pointing me in the correct direction \(o)72 124.2 R -.15(ve)-.15 G 2.602(ra)
-.15 G .102(nd o)244.324 124.2 R -.15(ve)-.15 G .102
-(r\), and Mark Horton for more advice, prodding, and man).15 F(y)-.15 E .453
-(of the good ideas.)72 136.2 R -.15(Ku)5.453 G .453
-(rt and Eric Schmidt are to be credited for using).15 F/F2 10/Times-Italic@0 SF
-(delivermail)2.953 E F1 .453(as a serv)2.953 F .453(er for their pro-)-.15 F
-1.663(grams \()72 148.2 R F2(Mail)A F1 1.663(and BerkNet respecti)4.163 F -.15
-(ve)-.25 G 1.663(ly\) before an).15 F 4.163(ys)-.15 G 1.663
-(ane person should ha)291.091 148.2 R -.15(ve)-.2 G 4.163(,a).15 G 1.662
-(nd making the necessary)400.423 148.2 R .078
-(modi\214cations promptly and happily)72 160.2 R 5.078(.E)-.65 G .078(ric g)
-228.332 160.2 R -2.25 -.2(av e)-.05 H .079
-(me considerable advice about the perils of netw)2.778 F .079(ork softw)-.1 F
-(are)-.1 E .179(which sa)72 172.2 R -.15(ve)-.2 G 2.679(dm).15 G 2.679(ea)
-131.998 172.2 S 2.679(nu)143.557 172.2 S(nkno)156.236 172.2 Q .178
-(wn amount of w)-.25 F .178(ork and grief.)-.1 F .178
-(Mark did the original implementation of the DBM)5.178 F -.15(ve)72 184.2 S
-.341(rsion of aliasing, installed the VFORK code, wrote the current v).15 F
-.341(ersion of)-.15 F F2(rmail)2.841 E F1 2.841(,a)C .341(nd w)411.083 184.2 R
-.342(as the person who)-.1 F .61(really con)72 196.2 R .61
-(vinced me to put the w)-.4 F .61(ork into)-.1 F F2(delivermail)3.109 E F1 .609
-(to turn it into)3.109 F F2(sendmail)3.109 E F1 5.609(.K)C .609(urt deserv)
-398.753 196.2 R .609(es accolades for)-.15 F(using)72 208.2 Q F2(sendmail)2.57
-E F1 .07(when I w)2.57 F .07(as myself afraid to tak)-.1 F 2.57(et)-.1 G .07
-(he risk; ho)271.01 208.2 R 2.57(wap)-.25 G .07
-(erson can continue to be so enthusiastic in)334.92 208.2 R(the f)72 220.2 Q
-(ace of so much bitter reality is be)-.1 E(yond me.)-.15 E -.15(Ku)97 236.4 S
-1.505(rt, Mark, Kirk McK).15 F 1.505(usick, Marvin Solomon, and man)-.15 F
-4.005(yo)-.15 G 1.504(thers ha)345.79 236.4 R 1.804 -.15(ve r)-.2 H -.25(ev).15
-G(ie).25 E 1.504(wed this paper)-.25 F 4.004(,g)-.4 G -.25(iv)483.69 236.4 S
-(ing).25 E(considerable useful advice.)72 248.4 Q .846
-(Special thanks are reserv)97 264.6 R .846(ed for Mik)-.15 F 3.346(eS)-.1 G
-(tonebrak)256.786 264.6 Q .846(er at Berk)-.1 F(ele)-.1 E 3.347(ya)-.15 G .847
-(nd Bob Epstein at Britton-Lee, who)356.995 264.6 R .542(both kno)72 276.6 R
-.542(wingly allo)-.25 F .542(wed me to put so much w)-.25 F .541
-(ork into this project when there were so man)-.1 F 3.041(yo)-.15 G .541
-(ther things I)454.588 276.6 R(really should ha)72 288.6 Q .3 -.15(ve b)-.2 H
-(een w).15 E(orking on.)-.1 E EP
-%%Page: 12 12
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman@0 SF(REFERENCES)256.605 132 Q 62.73([Birrell82] Birrell,)72
-148.2 R 1.084(A. D., Le)3.584 F 1.084(vin, R., Needham, R. M., and Schroeder)
--.25 F 3.584(,M)-.4 G 3.585(.D)433.49 148.2 S 1.085(., \231Grape)446.795 148.2
-R(vine:)-.25 E(An Ex)180 160.2 Q(ercise in Distrib)-.15 E(uted Computing.)-.2 E
-5<9a49>-.7 G(n)348.66 160.2 Q/F1 10/Times-Italic@0 SF(Comm. A.C.M. 25,)2.5 E F0
-(4, April 82.)2.5 E 59.4([Borden79] Borden,)72 176.4 R .796
-(S., Gaines, R. S., and Shapiro, N. Z.,)3.296 F F1 .795(The MH Messa)3.295 F
-.995 -.1(ge H)-.1 H .795(andling Sys-).1 F(tem: User)180 188.4 Q(s' Manual.)-.1
-E F0(R-2367-P)5 E(AF)-.92 E 5(.R)-.8 G(and Corporation.)332.06 188.4 Q
-(October 1979.)5 E([Crock)72 204.6 Q 52.29(er77a] Crock)-.1 F(er)-.1 E 2.508
-(,D)-.4 G 2.508(.H)223.938 204.6 S .008(., V)236.166 204.6 R .009
-(ittal, J. J., Pogran, K. T)-.6 F .009(., and Henderson, D. A. Jr)-.74 F(.,)
--.55 E F1(Standar)2.509 E 2.509(df)-.37 G(or)495.11 204.6 Q .955(the F)180
-216.6 R .955(ormat of ARP)-1.05 F 3.454(AN)-.9 G .954(etwork T)272.978 216.6 R
--.2(ex)-.92 G 3.454(tM).2 G(essa)331.536 216.6 Q -.1(ge)-.1 G(s.).1 E F0 .954
-(RFC 733, NIC 41952.)5.954 F .954(In [Fein-)5.954 F 2.5(ler78]. No)180 228.6 R
--.15(ve)-.15 G(mber 1977.).15 E([Crock)72 244.8 Q 51.73(er77b] Crock)-.1 F(er)
--.1 E 3.04(,D)-.4 G 3.04(.H)224.47 244.8 S(.,)237.23 244.8 Q F1 -1.55 -.55
-(Fr a)3.04 H(me).55 E .54(work and Functions of the MS P)-.15 F(er)-.8 E .54
-(sonal Messa)-.1 F .74 -.1(ge S)-.1 H(ystem.).1 E F0(R-2134-ARP)180 256.8 Q
-(A, Rand Corporation, Santa Monica, California.)-.92 E(1977.)5 E([Crock)72 273
-Q 56.73(er79] Crock)-.1 F(er)-.1 E 2.557(,D)-.4 G 2.557(.H)223.987 273 S .056
-(., Szurk)236.264 273 R -.25(ow)-.1 G .056(ski, E. S., and F).25 F(arber)-.15 E
-2.556(,D)-.4 G 2.556(.J)374.85 273 S(.,)383.796 273 Q F1 .056
-(An Internetwork Memo Dis-)2.556 F(trib)180 285 Q 1.341(ution F)-.2 F 1.341
-(acility \212 MMDF)-.75 F(.)-1.35 E F0 1.341
-(6th Data Communication Symposium, Asilomar)6.341 F(.)-.55 E(No)180 297 Q -.15
-(ve)-.15 G(mber 1979.).15 E([Crock)72 313.2 Q 56.73(er82] Crock)-.1 F(er)-.1 E
-3.383(,D)-.4 G 3.383(.H)224.813 313.2 S(.,)237.916 313.2 Q F1(Standar)3.383 E
-3.383(df)-.37 G .883(or the F)288.762 313.2 R .882(ormat of Arpa Internet T)
--1.05 F -.2(ex)-.92 G 3.382(tM).2 G(essa)446.368 313.2 Q -.1(ge)-.1 G(s.).1 E
-F0(RFC)5.882 E 4.197(822. Netw)180 325.2 R 1.697(ork Information Center)-.1 F
-4.197(,S)-.4 G 1.698(RI International, Menlo P)333.768 325.2 R 1.698
-(ark, California.)-.15 F(August 1982.)180 337.2 Q 53.3([Metcalfe76] Metcalfe,)
-72 353.4 R .727(R., and Boggs, D., \231Ethernet: Distrib)3.227 F .727(uted P)
--.2 F(ack)-.15 E .727(et Switching for Local)-.1 F(Computer Netw)180 365.4 Q
-(orks\232,)-.1 E F1(Communications of the A)2.5 E(CM 19,)-.3 E F0 2.5(7. July)
-2.5 F(1976.)2.5 E 60.51([Feinler78] Feinler)72 381.6 R 4.438(,E)-.4 G 1.938
-(., and Postel, J.)220.978 381.6 R(\(eds.\),)6.938 E F1(ARP)4.438 E 1.938
-(ANET Pr)-.9 F 1.938(otocol Handbook.)-.45 F F0 1.938(NIC 7104,)6.938 F(Netw)
-180 393.6 Q(ork Information Center)-.1 E 2.5(,S)-.4 G
-(RI International, Menlo P)304.48 393.6 Q(ark, California.)-.15 E(1978.)5 E
-69.39([NBS80] National)72 409.8 R 1.46(Bureau of Standards,)3.96 F F1 1.46
-(Speci\214cation of a Dr)3.96 F 1.46(aft Messa)-.15 F 1.66 -.1(ge F)-.1 H 1.46
-(ormat Stan-)-.95 F(dar)180 421.8 Q(d.)-.37 E F0(Report No. ICST/CBOS 80-2.)5 E
-(October 1980.)5 E 60.51([Neigus73] Neigus,)72 438 R(N.,)5.186 E F1 -.45(Fi)
-5.186 G 2.686(le T).45 F -.15(ra)-.55 G 2.686(nsfer Pr).15 F 2.686
-(otocol for the ARP)-.45 F 5.187(AN)-.9 G(etwork.)402.599 438 Q F0 2.687
-(RFC 542, NIC)7.687 F 2.5(17759. In)180 450 R 2.5([Feinler78]. August,)2.5 F
-(1973.)2.5 E([No)72 466.2 Q 55.21(witz78a] No)-.25 F 1.633
-(witz, D. A., and Lesk, M. E.,)-.25 F F1 4.132(AD)4.132 G 1.632
-(ial-Up Network of UNIX Systems.)338.9 466.2 R F0(Bell)6.632 E 5.403
-(Laboratories. In)180 478.2 R 2.904(UNIX Programmer')5.403 F 5.404(sM)-.55 G
-2.904(anual, Se)356.024 478.2 R -.15(ve)-.25 G 2.904(nth Edition, V).15 F 2.904
-(olume 2.)-1.29 F(August, 1978.)180 490.2 Q([No)72 506.4 Q 54.65(witz78b] No)
--.25 F .633(witz, D. A.,)-.25 F F1 .632(Uucp Implementation Description.)3.132
-F F0 .632(Bell Laboratories.)5.632 F .632(In UNIX)5.632 F(Programmer')180 518.4
-Q 2.5(sM)-.55 G(anual, Se)248.05 518.4 Q -.15(ve)-.25 G(nth Edition, V).15 E
-(olume 2.)-1.29 E(October)5 E 2.5(,1)-.4 G(978.)431.22 518.4 Q 64.39
-([Postel74] Postel,)72 534.6 R .24(J., and Neigus, N., Re)2.74 F .241
-(vised FTP Reply Codes.)-.25 F .241(RFC 640, NIC 30843.)5.241 F(In)5.241 E 2.5
-([Feinler78]. June,)180 546.6 R(1974.)2.5 E 64.39([Postel77] Postel,)72 562.8 R
-(J.,)2.5 E F1(Mail Pr)2.5 E(otocol.)-.45 E F0(NIC 29588.)5 E(In [Feinler78].)5
-E(No)5 E -.15(ve)-.15 G(mber 1977.).15 E 59.95([Postel79a] Postel,)72 579 R
-(J.,)3.144 E F1 .644(Internet Messa)3.144 F .844 -.1(ge P)-.1 H -.45(ro).1 G
-(tocol.).45 E F0 .644(RFC 753, IEN 85.)5.644 F(Netw)5.644 E .644
-(ork Information)-.1 F(Center)180 591 Q 2.5(,S)-.4 G(RI International, Menlo P)
-216.82 591 Q(ark, California.)-.15 E(March 1979.)5 E 59.39([Postel79b] Postel,)
-72 607.2 R 1.305(J. B.,)3.805 F F1 1.305(An Internetwork Messa)3.805 F 1.505
--.1(ge S)-.1 H(tructur).1 E -.15(e.)-.37 G F0(In)6.456 E F1(Pr)3.806 E 1.306
-(oceedings of the Sixth)-.45 F(Data Communications Symposium,)180 619.2 Q F0
-2.5(IEEE. Ne)2.5 F 2.5(wY)-.25 G 2.5(ork. No)379.74 619.2 R -.15(ve)-.15 G
-(mber 1979.).15 E 64.39([Postel80] Postel,)72 635.4 R .639(J. B.,)3.139 F F1
-3.139(AS)3.139 G(tructur)248.676 635.4 Q .639(ed F)-.37 F .639(ormat for T)
--1.05 F -.15(ra)-.55 G .639(nsmission of Multi-Media Documents.).15 F F0 .418
-(RFC 767.)180 647.4 R(Netw)5.419 E .419(ork Information Center)-.1 F 2.919(,S)
--.4 G .419(RI International, Menlo P)350.474 647.4 R .419(ark, Califor)-.15 F
-(-)-.2 E 2.5(nia. August)180 659.4 R(1980.)2.5 E 64.39([Postel82] Postel,)72
-675.6 R 2.05(J. B.,)4.55 F F1 2.05(Simple Mail T)4.55 F -.15(ra)-.55 G 2.05
-(nsfer Pr).15 F(otocol.)-.45 E F0 2.05(RFC821 \(obsoleting RFC788\).)7.05 F
-(Netw)180 687.6 Q .273(ork Information Center)-.1 F 2.774(,S)-.4 G .274
-(RI International, Menlo P)305.3 687.6 R .274(ark, California.)-.15 F(August)
-5.274 E(1982.)180 699.6 Q/F2 10/Times-Bold@0 SF 187.28(SMM:9-12 SENDMAIL)72 756
-R 2.5<8a41>2.5 G 2.5(nI)383.99 756 S(nter)395.94 756 Q(netw)-.15 E
-(ork Mail Router)-.1 E EP
-%%Page: 13 13
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(SENDMAIL \212 An Inter)72 60 Q(netw)-.15 E
-(ork Mail Router)-.1 E(SMM:9-13)457.9 60 Q/F1 10/Times-Roman@0 SF 55.5
-([Schmidt79] Schmidt,)72 96 R(E.,)2.972 E/F2 10/Times-Italic@0 SF .472(An Intr)
-2.972 F .472(oduction to the Berk)-.45 F(ele)-.1 E 2.972(yN)-.3 G(etwork.)
-369.664 96 Q F1(Uni)5.472 E -.15(ve)-.25 G .472(rsity of California,).15 F
-(Berk)180 108 Q(ele)-.1 E 2.5(yC)-.15 G 2.5(alifornia. 1979.)225.02 108 R 59.95
-([Shoens79] Shoens,)72 124.2 R(K.,)4.894 E F2 2.394(Mail Refer)4.894 F 2.394
-(ence Manual.)-.37 F F1(Uni)7.394 E -.15(ve)-.25 G 2.395
-(rsity of California, Berk).15 F(ele)-.1 E 6.195 -.65(y. I)-.15 H(n).65 E
-(UNIX Programmer')180 136.2 Q 2.5(sM)-.55 G(anual, Se)275.54 136.2 Q -.15(ve)
--.25 G(nth Edition, V).15 E(olume 2C.)-1.29 E(December 1979.)5 E 60.51
-([Sluizer81] Sluizer)72 152.4 R 2.872(,S)-.4 G .372(., and Postel, J. B.,)
-218.862 152.4 R F2 .372(Mail T)2.872 F -.15(ra)-.55 G .372(nsfer Pr).15 F
-(otocol.)-.45 E F1 .371(RFC 780.)5.371 F(Netw)5.371 E .371(ork Infor)-.1 F(-)
--.2 E(mation Center)180 164.4 Q 2.5(,S)-.4 G(RI International, Menlo P)247.1
-164.4 Q(ark, California.)-.15 E(May 1981.)5 E 52.72([Solomon81] Solomon,)72
-180.6 R .96(M., Landweber)3.46 F 3.46(,L)-.4 G .96
-(., and Neuhengen, D., \231The Design of the CSNET)296.08 180.6 R(Name Serv)180
-192.6 Q(er)-.15 E 3.9 -.7(.\232 C)-.55 H(S-DN-2, Uni).7 E -.15(ve)-.25 G
-(rsity of W).15 E(isconsin, Madison.)-.4 E(No)5 E -.15(ve)-.15 G(mber 1981.).15
-E 78.28([Su82] Su,)72 208.8 R(Za)4.344 E 1.844(w-Sing, and Postel, Jon,)-.15 F
-F2 1.844(The Domain Naming Con)4.344 F 1.844(vention for Internet)-.4 F 1.717
-(User Applications.)180 220.8 R F1 4.217(RFC819. Netw)6.717 F 1.717
-(ork Information Center)-.1 F 4.217(,S)-.4 G 1.718(RI International,)436.182
-220.8 R(Menlo P)180 232.8 Q(ark, California.)-.15 E(August 1982.)5 E([UNIX83])
-72 249 Q F2 2.12(The UNIX Pr)180 249 R -.1(og)-.45 G -.15(ra).1 G(mmer').15 E
-4.62(sM)-.4 G 2.12(anual, Se)298.3 249 R 2.12(venth Edition,)-.15 F F1 -.6(Vi)
-4.62 G 2.12(rtual V).6 F 2.12(AX-11 V)-1.35 F(ersion,)-1.11 E -1.29(Vo)180 261
-S 1.027(lume 1.)1.29 F 1.027(Bell Laboratories, modi\214ed by the Uni)6.027 F
--.15(ve)-.25 G 1.027(rsity of California, Berk).15 F(e-)-.1 E(le)180 273 Q 1.3
--.65(y, C)-.15 H 2.5(alifornia. March,).65 F(1983.)2.5 E EP
-%%Trailer
-end
-%%EOF
diff --git a/usr.sbin/sendmail/doc/op/Makefile b/usr.sbin/sendmail/doc/op/Makefile
new file mode 100644
index 000000000000..5e2e4a71d0f0
--- /dev/null
+++ b/usr.sbin/sendmail/doc/op/Makefile
@@ -0,0 +1,14 @@
+# @(#)Makefile 8.2 (Berkeley) 2/28/94
+
+DIR= smm/08.sendmailop
+SRCS= op.me
+MACROS= -me
+CLEANFILES= *.ps
+
+all: op.ps
+
+op.ps: ${SRCS}
+ rm -f ${.TARGET}
+ ${PIC} ${SRCS} | ${EQN} | ${ROFF} > ${.TARGET}
+
+.include <bsd.doc.mk>
diff --git a/usr.sbin/sendmail/doc/op/op.me b/usr.sbin/sendmail/doc/op/op.me
index 5a747c52ecc3..0e63aa3f6b65 100644
--- a/usr.sbin/sendmail/doc/op/op.me
+++ b/usr.sbin/sendmail/doc/op/op.me
@@ -30,13 +30,15 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)op.me 8.2 (Berkeley) 7/11/93
+.\" @(#)op.me 8.34 (Berkeley) 3/3/94
.\"
.\" eqn op.me | pic | troff -me
.eh 'SMM:08-%''Sendmail Installation and Operation Guide'
.oh 'Sendmail Installation and Operation Guide''SMM:08-%'
.\" SD is lib if sendmail is installed in /usr/lib, sbin if in /usr/sbin
.ds SD sbin
+.\" SB is bin if newaliases/mailq are installed in /usr/bin, ucb if in /usr/ucb
+.ds SB bin
.nr si 3n
.de $0
.(x
@@ -51,6 +53,7 @@
\\$1 \\$2. \\$3
.)x
..
+.sc
.+c
.(l C
.sz 16
@@ -66,9 +69,9 @@ University of California, Berkeley
Mammoth Project
eric@CS.Berkeley.EDU
.sp
-Version 8.2
+Version 8.34
.sp
-For Sendmail Version 8.2
+For Sendmail Version 8.6
.)l
.sp 2
.pp
@@ -76,7 +79,7 @@ For Sendmail Version 8.2
implements a general purpose internetwork mail routing facility
under the UNIX*
.(f
-*UNIX is a trademark of Bell Laboratories.
+*UNIX is a trademark of Unix Systems Laboratories.
.)f
operating system.
It is not tied to any one transport protocol \*-
@@ -142,18 +145,23 @@ file.
This section is for masochists
and people who must write their own configuration file.
Section six
+describes configuration that can be done at compile time.
+Section seven
gives a brief description of differences
in this version of
.i sendmail .
The appendixes give a brief
but detailed explanation of a number of features
not described in the rest of the paper.
-.bp 5
+.bp 7
.sh 1 "BASIC INSTALLATION"
.pp
-There are two basic steps to installing sendmail.
+There are two basic steps to installing
+.i sendmail .
The hard part is to build the configuration table.
-This is a file that sendmail reads when it starts up
+This is a file that
+.i sendmail
+reads when it starts up
that describes the mailers it knows about,
how to parse addresses,
how to rewrite the message header,
@@ -164,7 +172,8 @@ by adjusting an existing off-the-shelf configuration.
The second part is actually doing the installation,
i.e., creating the necessary files, etc.
.pp
-The remainder of this section will describe the installation of sendmail
+The remainder of this section will describe the installation of
+.i sendmail
assuming you can use one of the existing configurations
and that the standard installation parameters are acceptable.
All pathnames and examples
@@ -176,12 +185,14 @@ normally
on 4.4BSD.
.pp
If you are loading this off the tape,
-continue with the next session.
+continue with the next section.
If you have a running binary already on your system,
you should probably skip to section 1.2.
.sh 2 "Compiling Sendmail"
.pp
-All sendmail source is in the
+All
+.i sendmail
+source is in the
.i src
subdirectory.
If you are running on a 4.4BSD system,
@@ -231,7 +242,7 @@ if you do,
old databases are read,
but when a new database is created it will be in NEWDB format.
As a nasty hack,
-if you have NEWDB, NDBM, and YPCOMPAT defined,
+if you have NEWDB, NDBM, and NIS defined,
and if the file
.i /var/yp/Makefile
exists and is readable,
@@ -294,9 +305,9 @@ make install
This should install the binary in
/usr/\*(SD
and create links from
-/usr/bin/newaliases
+/usr/\*(SB/newaliases
and
-/usr/bin/mailq
+/usr/\*(SB/mailq
to
/usr/\*(SD/sendmail.
On 4.4BSD systems it will also format and install man pages.
@@ -341,7 +352,7 @@ I haven't tested these yet on an isolated LAN environment
with a single UUCP connection to the outside world.
If you are in such an environment,
please send comments to
-sendmail@okeeffe.CS.Berkeley.EDU.
+sendmail@CS.Berkeley.EDU.
.pp
Our configuration files are processed by
.i m4
@@ -349,7 +360,7 @@ to facilitate local customization;
the directory
.i cf
of the
-sendmail
+.i sendmail
distribution directory
contains the source files.
This directory contains several subdirectories:
@@ -400,7 +411,9 @@ These are referenced using the
macro.
An example feature is
use_cw_file
-(which tells sendmail to read an /etc/sendmail.cw file on startup
+(which tells
+.i sendmail
+to read an /etc/sendmail.cw file on startup
to find the set of local names).
.ip hack
Local hacks, referenced using the
@@ -505,11 +518,13 @@ file.
.pp
This subsection describes the files that
comprise the
-sendmail
+.i sendmail
installation.
.sh 3 "/usr/\*(SD/sendmail"
.pp
-The binary for sendmail is located in /usr/\*(SD\**.
+The binary for
+.i sendmail
+is located in /usr/\*(SD\**.
.(f
\**This is usually
/usr/sbin
@@ -533,13 +548,14 @@ and permissions are
.)f
.sh 3 "/etc/sendmail.cf"
.pp
-This is the configuration file for sendmail.
-This and the frozen configuration file
-are the only two non-library file names compiled into sendmail\**.
+This is the configuration file for
+.i sendmail .
+This is the only non-library file name compiled into
+.i sendmail \**.
.(f
\**The system libraries can reference other files;
in particular, system library subroutines that
-sendmail
+.i sendmail
calls probably reference
.i /etc/passwd
and
@@ -558,17 +574,15 @@ If you have a particularly unusual system configuration
you may need to create a special version.
The format of this file is detailed in later sections
of this document.
-.sh 3 "/usr/ucb/newaliases"
+.sh 3 "/usr/\*(SB/newaliases"
.pp
-If you are running delivermail,
-it is critical that the
+The
.i newaliases
-command be replaced.
-This can just be a link to
+command should just be a link to
.i sendmail :
.(b
-rm \-f /usr/ucb/newaliases
-ln /usr/\*(SD/sendmail /usr/ucb/newaliases
+rm \-f /usr/\*(SB/newaliases
+ln \-s /usr/\*(SD/sendmail /usr/\*(SB/newaliases
.)b
This can be installed in whatever search path you prefer
for your system.
@@ -634,32 +648,11 @@ is defined in the
option of the
.i sendmail.cf
file.
-.sh 3 "/etc/sendmail.fc"
-.pp
-If you intend to install the frozen version of the configuration file
-(for quick startup)
-you should create the file /etc/sendmail.fc
-and initialize it.
-This step may be safely skipped.
-.(b
-cp /dev/null /etc/sendmail.fc
-chmod 644 /etc/sendmail.fc
-/usr/\*(SD/sendmail \-bz
-.)b
-In general, freeze files are not worth doing
-unless your disks are much faster than your CPU;
-this is seldom true any more.
-.pp
-If your
-.i sendmail
-was not compiled with
-.sm FROZENCONFIG
-defined, the
-.b \-bz
-flag will be ignored.
.sh 3 "/etc/rc"
.pp
-It will be necessary to start up the sendmail daemon when your system reboots.
+It will be necessary to start up the
+.i sendmail
+daemon when your system reboots.
This daemon performs two functions:
it listens on the SMTP socket for connections
(to receive mail from a remote system)
@@ -724,17 +717,21 @@ do
rm \-f $tffile
fi
done
-# remove bogus qf files
+# remove df files with no corresponding qf files
for dffile in df*
do
qffile=`echo $dffile | sed 's/d/q/'`
if [ \-r $dffile \-a ! \-f $qffile ]
then
echo \-n " <incomplete: $dffile>" > /dev/console
- rm \-f $dffile
+ mv $dffile `echo $dffile | sed 's/d/D/'`
fi
done
-fi
+# announce files that have been saved during disaster recovery
+for xffile in [A-Z]f*
+do
+ echo \-n " <panic: $xffile>" > /dev/console
+done
.)b
.pp
If you are not running a version of UNIX
@@ -777,7 +774,7 @@ is defined in the
option of the
.i sendmail.cf
file.
-.sh 3 "/usr/ucb/newaliases"
+.sh 3 "/usr/\*(SB/newaliases"
.pp
If
.i sendmail
@@ -789,7 +786,7 @@ flag
(i.e., will rebuild the alias database;
see below).
This should be a link to /usr/\*(SD/sendmail.
-.sh 3 "/usr/ucb/mailq"
+.sh 3 "/usr/\*(SB/mailq"
.pp
If
.i sendmail
@@ -804,51 +801,16 @@ will print the contents of the mail queue;
see below).
This should be a link to /usr/\*(SD/sendmail.
.sh 1 "NORMAL OPERATIONS"
-.sh 2 "``Quick'' Configuration Startup"
-.pp
-if the
-.sm FROZENCONFIG
-option is included during compilation,
-a precompiled (``frozen'') version of the configuration file
-can be created using the
-.b \-bz
-flag.
-This is really only worthwhile doing
-if you are on a slow processor with a relatively fast I/O system
-(a VAX 11/750 is a good example).
-Since it creates other problems,
-I recommend against using the frozen configuration
-on most current architectures.
-.pp
-To create the freeze file, use
-.(b
-/usr/\*(SD/sendmail \-bz
-.)b
-This creates the frozen configuration file
-.i /etc/sendmail.fc .
-This file is an image of
-.i sendmail 's
-data space after reading in the configuration file.
-If this file exists,
-it is used instead of
-.i /etc/sendmail.cf
-.i sendmail.fc
-must be rebuilt manually every time
-.i sendmail.cf
-is changed.
-.pp
-The frozen configuration file will be ignored
-if a
-.b \-C
-flag is specified
-or if sendmail detects that it is out of date.
-However, the heuristics are not strong
-so this should not be trusted.
.sh 2 "The System Log"
.pp
The system log is supported by the
.i syslogd \|(8)
program.
+All messages from
+.i sendmail
+are logged under the
+.sm LOG_MAIL
+facility.
.sh 3 "Format"
.pp
Each line in the system log
@@ -890,7 +852,9 @@ However, you may find that manual intervention is sometimes necessary.
For example,
if a major host is down for a period of time
the queue may become clogged.
-Although sendmail ought to recover gracefully when the host comes up,
+Although
+.i sendmail
+ought to recover gracefully when the host comes up,
you may find performance unacceptably bad in the meantime.
.sh 3 "Printing the queue"
.pp
@@ -900,7 +864,8 @@ using the
command
(or by specifying the
.b \-bp
-flag to sendmail):
+flag to
+.i sendmail ):
.(b
mailq
.)b
@@ -1032,6 +997,16 @@ and then the map named
.q mail.aliases
in
.q my.nis.domain .
+Warning: if you build your own
+.sm NIS -based
+alias files,
+be sure to provide the
+.b \-l
+flag to
+.i makedbm (8)
+to map upper case letters in the keys to lower case;
+otherwise, aliases with upper case letters in their names
+won't match incoming addresses.
.pp
Additional flags can be added after the colon
exactly like a
@@ -1103,18 +1078,16 @@ it adds an alias of the form
@: @
.)b
(which is not normally legal).
-Before sendmail will access the database,
+Before
+.i sendmail
+will access the database,
it checks to insure that this entry exists\**.
.(f
\**The
.q a
option is required in the configuration
for this action to occur.
-This should normally be specified
-unless you are running
-.i delivermail
-in parallel with
-.i sendmail.
+This should normally be specified.
.)f
.sh 3 "List owners"
.pp
@@ -1220,7 +1193,19 @@ when the final delivery is complete,
that is,
when successfully delivered to a mailer with the
.b l
-flag (local delivery) set in the mailer descriptor.
+flag (local delivery) set in the mailer descriptor\**.
+.(f
+\**Some sites disable this header,
+and other (non-\c
+.i sendmail )
+systems do not implement it.
+Do not assume that a failure to get a return receipt
+means that the mail did not arrive.
+Also, do not assume that getting a return receipt
+means that the mail has been read;
+it just means that the message has been delivered
+to the recipient's mailbox.
+.)f
.sh 3 "Errors-To:"
.pp
If errors occur anywhere during processing,
@@ -1262,6 +1247,7 @@ it is in no sense perfect;
a determined forger can easily spoof the IDENT protocol.
The following description is excerpted from RFC 1413:
.ba +5
+.lp
6. Security Considerations
.lp
The information returned by this protocol is at most as trustworthy
@@ -1461,6 +1447,18 @@ All message traffic in and out of
.i sendmail ,
including the incoming SMTP traffic,
will be logged in this file.
+.sh 2 "Dumping State"
+.pp
+You can ask
+.i sendmail
+to log a dump of the open files
+and the connection cache
+by sending it a
+.sm SIGUSR1
+signal.
+The results are logged at
+.sm LOG_DEBUG
+priority.
.sh 1 "TUNING"
.pp
There are a number of configuration parameters
@@ -1575,6 +1573,9 @@ such as NOOP (no-operation) and VERB (go into verbose mode).
In server SMTP,
the time to wait for another command.
[1h, 5m].
+.ip ident
+The timeout waiting for a reply to an IDENT query
+[30s, unspecified].
.lp
For compatibility with old configuration files,
if no ``keyword='' is specified,
@@ -1719,7 +1720,7 @@ and 1800
(for the class factor).
The initial priority is:
.EQ
-pri = size - (class times bold z) + (nrcpt times bold y)
+pri = msgsize - (class times bold z) + (nrcpt times bold y)
.EN
(Remember, higher values for this parameter actually mean
that the job will be treated with lower priority.)
@@ -1768,15 +1769,17 @@ pri > { bold q } over { LA - { bold x } + 1 }
.EN
The
.b q
-option defaults to 200000,
-so each point of load average is worth 200000
+option defaults to 600000,
+so each point of load average is worth 600000
priority points
(as described above).
.pp
For drastic cases,
the
.b X
-option defines a load average at which sendmail will refuse
+option defines a load average at which
+.i sendmail
+will refuse
to accept network connections.
Locally generated mail
(including incoming UUCP mail)
@@ -1816,13 +1819,17 @@ if you have a mailer that takes a long time to deliver a message.
If you run in mode
.q q
(queue only)
+or
+.q b
+(deliver in background)
.i sendmail
will not expand aliases and follow .forward files
upon initial receipt of the mail.
This speeds up the response to RCPT commands.
.sh 2 "Log Level"
.pp
-The level of logging can be set for sendmail.
+The level of logging can be set for
+.i sendmail .
The default using a standard configuration table is level 9.
The levels are as follows:
.nr ii 0.5i
@@ -1956,7 +1963,7 @@ any intended changes will also be ignored or forgotten.
.sh 2 "Connection Caching"
.pp
When processing the queue,
-.b sendmail
+.i sendmail
will try to keep the last few open connections open
to avoid startup and shutdown costs.
This only applies to IPC connections.
@@ -1980,7 +1987,7 @@ connections will be closed as quickly as possible.
The default is one.
This should be set as appropriate for your system size;
it will limit the amount of system resources that
-.b sendmail
+.i sendmail
will use during queue runs.
.pp
The
@@ -1999,20 +2006,29 @@ The default is five minutes.
If your system supports the name server,
then the probability is that
.i sendmail
-will be using it regardless of how you configure sendmail.
-However, if you have nameserver support
-which you are not using,
-sendmail will get a
+will be using it regardless of how you configure
+.i sendmail .
+In particular, the system routine
+.i gethostbyname (3)
+is used to look up host names,
+and most vendor versions try some combination of DNS, NIS,
+and file lookup in /etc/hosts.
+.pp
+However, if you do not have a nameserver configured at all,
+such as at a UUCP-only site,
+.i sendmail
+will get a
.q "connection refused"
message when it tries to connect to the name server
-(either by calling
+(either indirectly by calling
.i gethostbyname
-or by trying to look up the MX records).
+or directly by looking up MX records).
If the
.b I
option is set,
.i sendmail
-will interpret this to mean a temporary failure;
+will interpret this to mean a temporary failure
+and will queue the mail for later processing;
otherwise, it ignores the name server data.
If your name server is running properly,
the setting of this option is not relevant;
@@ -2035,7 +2051,8 @@ and turns off the DNSRCH (search the domain path) options.
Most resolver libraries default DNSRCH, DEFNAMES, and RECURSE
flags on and all others off.
Note the use of the initial ``True'' \*-
-this is for compatibility with previous versions of sendmail,
+this is for compatibility with previous versions of
+.i sendmail ,
but is not otherwise necessary.
.pp
Version level 1 configurations
@@ -2144,6 +2161,14 @@ The
.q restrictmailq
option restricts printing the queue to the group that owns the queue directory.
It is absurd to set this if you don't also protect the logs.
+.pp
+The
+.q restrictqrun
+option restricts people running the queue
+(that is, using the
+.b \-q
+command line flag)
+to root and the owner of the queue directory.
.sh 2 "Send to Me Too"
.pp
Normally,
@@ -2377,7 +2402,7 @@ The
.b $)
syntax is a more general form of lookup;
it uses a named map instead of an implicit map.
-If no lookup is found, the indicted
+If no lookup is found, the indicated
.i default
is inserted;
if no default is specified and no lookup matches,
@@ -2399,9 +2424,12 @@ The
.b $#
syntax should
.i only
-be used in ruleset zero.
+be used in ruleset zero
+or a subroutine of ruleset zero.
It causes evaluation of the ruleset to terminate immediately,
-and signals to sendmail that the address has completely resolved.
+and signals to
+.i sendmail
+that the address has completely resolved.
The complete syntax is:
.(b
\fB$#\fP\fImailer\fP \fB$@\fP\fIhost\fP \fB$:\fP\fIuser\fP
@@ -2437,12 +2465,33 @@ the
may be a colon-separated list of hosts
that are searched in order for the first working address
(exactly like MX records).
+The
+.i user
+is later rewritten by the mailer-specific envelope rewriting set
+and assigned to the
+.b $u
+macro.
+As a special case, if the value to
+.b $#
+is
+.q local
+and the first character of the
+.b $:
+value is
+.q @ ,
+the
+.q @
+is stripped off, and a flag is set in the address descriptor
+that causes sendmail to not do ruleset 5 processing.
.pp
+Normally, a rule that matches is retried,
+that is,
+the rule loops until it fails.
A RHS may also be preceded by a
.b $@
or a
.b $:
-to control evaluation.
+to change this behavior.
A
.b $@
prefix causes the ruleset to return with the remainder of the RHS
@@ -2571,7 +2620,8 @@ corresponding to the
.i sending
mailer).
Ruleset three
-is applied by sendmail
+is applied by
+.i sendmail
before doing anything with any address.
.pp
Ruleset zero
@@ -2707,7 +2757,8 @@ clause may be omitted.
.pp
Lower case macro names are reserved to have
special semantics,
-used to pass information in or out of sendmail,
+used to pass information in or out of
+.i sendmail ,
and special characters are reserved to
provide conditionals, etc.
Upper case names
@@ -2717,38 +2768,76 @@ through
.b $Z )
are specifically reserved for configuration file authors.
.pp
-The following macros
-.i must
-be defined to transmit information into
-.i sendmail:
-.(b
-.ta 4n
-e The SMTP entry message
-j The \*(lqofficial\*(rq domain name for this site
-l The format of the UNIX from line
-n The name of the daemon (for error messages)
-o The set of "operators" in addresses
-q default format of sender address
-.)b
-The
-.b $e
-macro is printed out when SMTP starts up.
+The following macros are defined and/or used internally by
+.i sendmail
+for interpolation into argv's for mailers
+or for other contexts.
+The ones marked \(dg are information passed into sendmail\**,
+.(f
+\**As of version 8.6,
+all of these macros have reasonable defaults.
+Previous versions required that they be defined.
+.)f
+the ones marked \(dd are information passed both in and out of sendmail,
+and the unmarked macros are passed out of sendmail
+but are not otherwise used internally.
+These macros are:
+.nr ii 5n
+.ip $a
+.b "The origination date in RFC 822 format."
+.ip $b
+.b "The current date in RFC 822 format."
+.ip $c
+.b "The hop count."
+.ip $d
+.b "The current date in UNIX (ctime) format."
+.ip $e\(dg
+.b "The SMTP entry message."
+This is printed out when SMTP starts up.
The first word must be the
.b $j
-macro.
-The
+macro as specified by RFC821.
+Defaults to
+.q "$j Sendmail $v ready at $b" .
+Commonly redefined to include the configuration version number, e.g.,
+.q "$j Sendmail $v/$Z ready at $b"
+.ip $f
+.b "The sender (from) address."
+.ip $g
+.b "The sender address relative to the recipient."
+.ip $h
+.b "The recipient host."
+.ip $i
+.b "The queue id."
+.ip $j\(dd
+.b "The \*(lqofficial\*(rq domain name for this site."
+This is fully qualified if the full qualification can be found.
+It
+.i must
+be redefined to be the fully qualified domain name
+if your system is not configured so that information can find
+it automatically.
+.ip $k
+.b "The UUCP node name (from the uname system call)."
+.ip $l\(dg
+.b "The format of the UNIX from line."
+Unless you have changed the UNIX mailbox format,
+you should not change the default,
+which is
+.q "From $g $d" .
+.ip $m
+.b "The domain part of the \fIgethostname\fP return value."
+Under normal circumstances,
.b $j
-macro
-should be in RFC821 format.
-The
-.b $l
-and
-.b $n
-macros can be considered constants
-except under terribly unusual circumstances.
-The
-.b $o
-macro consists of a list of characters
+is equivalent to
+.b $w.$m .
+.ip $n\(dg
+.b "The name of the daemon (for error messages)."
+Defaults to
+.q MAILER-DAEMON .
+.ip $o\(dg
+.b "The set of \*(lqoperators\*(rq in addresses."
+A list of characters
which will be considered tokens
and which will separate tokens
when doing parsing.
@@ -2763,24 +2852,27 @@ would be scanned as three tokens:
.q @,
and
.q b.
-Finally, the
+Defaults to
+.q ".:@[]" ,
+which is the minimum set necessary to do RFC 822 parsing;
+a richer set of operators is
+.q ".:%@!/[]" ,
+which adds support for UUCP, the %-hack, and X.400 addresses.
+.ip $p
+.b "Sendmail's process id."
+.ip $q\(dg
+.b "Default format of sender address."
+The
.b $q
macro specifies how an address should appear in a message
when it is defaulted.
-For example, on our system these definitions are:
-.(b
-De$j Sendmail $v/$Z ready at $b
-DnMAILER-DAEMON
-DlFrom $g $d
-Do.:%@!^/[]
-Dq$?x$x <$g>$|$g$.
-Dj$w
-.)b
-An acceptable alternative for the
-.b $q
-macro is
-.q "$g$?x ($x)$." .
-These correspond to the following two formats:
+Defaults to
+.q "<$g>" .
+It is commonly redefined to be
+.q "$?x$x <$g>$|$g$."
+or
+.q "$g$?x ($x)$." ,
+corresponding to the following two formats:
.(b
Eric Allman <eric@CS.Berkeley.EDU>
eric@CS.Berkeley.EDU (Eric Allman)
@@ -2788,34 +2880,28 @@ eric@CS.Berkeley.EDU (Eric Allman)
.i Sendmail
properly quotes names that have special characters
if the first form is used.
+.ip $r
+.b "Protocol used to receive the message."
+.ip $s
+.b "Sender's host name."
+.ip $t
+.b "A numeric representation of the current time."
+.ip $u
+.b "The recipient user."
+.ip $v
+.b "The version number of \fIsendmail\fP."
+.ip $w\(dd
+.b "The hostname of this site."
.pp
-Some macros are defined by
-.i sendmail
-for interpolation into argv's for mailers
-or for other contexts.
-These macros are:
-.(b
-a The origination date in RFC 822 format
-b The current date in RFC 822 format
-c The hop count
-d The date in UNIX (ctime) format
-f The sender (from) address
-g The sender address relative to the recipient
-h The recipient host
-i The queue id
-k The UUCP node name (from the uname system call)
-m The domain part of the \fIgethostname\fP return value
-p Sendmail's pid
-r Protocol used to receive the message
-s Sender's host name
-t A numeric representation of the current time
-u The recipient user
-v The version number of sendmail
-w The hostname of this site
-x The full name of the sender
-z The home directory of the recipient
-_ The validated sender address
-.)b
+The
+.b $w
+macro is set to the root name of this host (but see below for caveats).
+.ip $x
+.b "The full name of the sender."
+.ip $z
+.b "The home directory of the recipient."
+.ip $_
+.b "The validated sender address."
.pp
There are three types of dates that can be used.
The
@@ -2845,6 +2931,59 @@ macro in UNIX
(ctime)
format.
.pp
+The macros
+.b $w ,
+.b $j ,
+and
+.b $m
+are set to the identity of this host.
+.i Sendmail
+tries to find the fully qualified name of the host
+if at all possible;
+it does this by calling
+.i gethostname (2)
+to get the current hostname
+and then passing that to
+.i gethostbyname (3)
+which is supposed to return the canonical version of that host name.\**
+.(f
+\**For example, on some systems
+.i gethostname
+might return
+.q foo
+which would be mapped to
+.q foo.bar.com
+by
+.i gethostbyname .
+.)f
+Assuming this is successful,
+.b $j
+is set to the fully qualified name
+and
+.b $m
+is set to the domain part of the name
+(everything after the first dot).
+The
+.b $w
+macro is set to the first word
+(everything before the first dot)
+if you have a level 5 or higher configuration file;
+otherwise, it is set to the same value as
+.b $j .
+If the canonification is not successful,
+it is imperative that the config file set
+.b $j
+to the fully qualified domain name\**.
+.(f
+\**Older versions of sendmail didn't pre-define
+.b $j
+at all, so up until 8.6,
+config files
+.i always
+had to define
+.b $j .
+.)f
+.pp
The
.b $f
macro is the id of the sender
@@ -2874,7 +3013,7 @@ The
macro is set to the full name of the sender.
This can be determined in several ways.
It can be passed as flag to
-.i sendmail.
+.i sendmail .
The second choice is the value of the
.q Full-name:
line in the header if it exists,
@@ -2922,10 +3061,7 @@ macro is set to be the version number of
.i sendmail ;
this is normally put in timestamps
and has been proven extremely useful for debugging.
-The
-.b $w
-macro is set to the name of this host
-if it can be determined.
+.pp
The
.b $c
field is set to the
@@ -2941,8 +3077,10 @@ The
.b $r
and
.b $s
-fields are set to the protocol used to communicate with sendmail
+fields are set to the protocol used to communicate with
+.i sendmail
and the sending hostname.
+.pp
The
.b $_
is set to a validated sender host name.
@@ -3013,6 +3151,27 @@ The class
is set to be the same as
.b $k ,
that is, the UUCP node name.
+.pp
+The class
+.b $=m
+is set to the set of domains by which this host is known,
+initially just
+.b $m .
+.pp
+.i Sendmail
+can be compiled to allow a
+.i scanf (3)
+string on the
+.b F
+line.
+This lets you do simplistic parsing of text files.
+For example, to read all the user names in your system
+.i /etc/passwd
+file into a class, use
+.(b
+FL/etc/passwd %[^:]
+.)b
+which reads every line up to the first colon.
.sh 3 "M \*- define mailer"
.pp
Programs and interfaces to mailers
@@ -3240,7 +3399,7 @@ Strip all output to seven bits.
This is the default if the
.b L
flag is set.
-Note that setting this is not
+Note that clearing this option is not
sufficient to get full eight bit data passed through
.i sendmail .
If the
@@ -3314,7 +3473,9 @@ Since the queue directory is not normally readable by normal users
scripts as recipients can fail.
.sh 3 "H \*- define header"
.pp
-The format of the header lines that sendmail inserts into the message
+The format of the header lines that
+.i sendmail
+inserts into the message
are defined by the
.b H
line.
@@ -3408,7 +3569,7 @@ where
.b :
is optional and defaults to ``implicit''.
Depending on how
-.b sendmail
+.i sendmail
is compiled, valid classes are
.q implicit
(search through a compiled-in list of alias file types,
@@ -3530,6 +3691,7 @@ for mailers to run in
to
.i n .
Defaults to 1.
+The value can also be given as a symbolic group name.
.ip G
Allow fuzzy matching on the GECOS field.
If this flag is set,
@@ -3599,8 +3761,10 @@ and then in
.ip k\fIN\fP
The maximum number of open connections that will be cached at a time.
The default is one.
-This delays closing the the current connection until
-either this invocation of sendmail needs to connect to another host
+This delays closing the current connection until
+either this invocation of
+.i sendmail
+needs to connect to another host
or it terminates.
Setting it to zero defaults to the old behavior,
that is, connections are closed immediately.
@@ -3611,7 +3775,7 @@ If this time is exceeded,
the connection is immediately closed.
This value should be small (on the order of ten minutes).
Before
-.b sendmail
+.i sendmail
uses a cached connection,
it always sends a NOOP (no operation) command
to check the connection;
@@ -3626,7 +3790,9 @@ If there is an
.q Errors-To:
header, send error messages to the addresses listed there.
They normally go to the envelope sender.
-Use of this option causes sendmail to violate RFC 1123.
+Use of this option causes
+.i sendmail
+to violate RFC 1123.
.ip L\fIn\fP
Set the default log level to
.i n .
@@ -3689,15 +3855,25 @@ noexpn Disallow EXPN entirely
needvrfyhelo Insist on HELO or EHLO command before VRFY
novrfy Disallow VRFY entirely
restrictmailq Restrict mailq command
+restrictqrun Restrict \-q command line flag
goaway Disallow essentially all SMTP status queries
+authwarnings Put X-Authentication-Warning: headers in messages
.)b
The
.q goaway
pseudo-flag sets all flags except
-.q restrictmailq .
+.q restrictmailq
+and
+.q restrictqrun .
If mailq is restricted,
only people in the same group as the queue directory
can print the queue.
+If queue runs are restricted,
+only root and the owner of the queue directory
+can run the queue.
+Authentication Warnings add warnings about various conditions
+that may indicate attempts to spoof the mail system,
+such as using an non-standard queue directory.
.ip P\fIpostmaster\fP
If set,
copies of error messages will be sent to the named
@@ -3748,6 +3924,7 @@ rset reply to RSET command [5m, none]
quit reply to QUIT command [2m, none]
misc reply to NOOP and VERB commands [2m, none]
command command read [1h, 5m]
+ident IDENT protocol timeout [30s, none]
.)b
All but
.q command
@@ -3783,18 +3960,20 @@ always instantiate the queue file,
even if you are going to attempt immediate delivery.
.i Sendmail
always instantiates the queue file
-before returning control the the client
+before returning control the client
under any circumstances.
.ip S\fIfile\fP
Log statistics in the named
.i file .
-.ip t\fIS,D\fP
-Set the local time zone name to
-.i S
-for standard time and
-.i D
-for daylight time;
-this is only used under version six.
+.ip t\fItzinfo\fP
+Set the local time zone info to
+.i tzinfo
+\*- for example,
+.q PST8PDT .
+Actually, if this is not set,
+the TZ environment variable is cleared (so the system default is used);
+if set but null, the user's TZ variable is used,
+and if set and non-null the TZ variable is set to this value.
.ip T\fIrtime/wtime\fP
Set the queue timeout to
.i rtime .
@@ -3815,6 +3994,7 @@ Mailers without the
flag in the mailer definition
will run as this user.
Defaults to 1.
+The value can also be given as a symbolic user name.
.ip U\fIudbspec\fP
The user database specification.
.ip v
@@ -3842,6 +4022,29 @@ If specified, the
acts like a very low priority MX
on every host.
This is intended to be used by sites with poor network connectivity.
+.ip w
+If you are the
+.q best
+(that is, lowest preference)
+MX for a given host,
+you should normally detect this situation
+and treat that condition specially,
+by forwarding the mail to a UUCP feed,
+treating it as local,
+or whatever.
+However, in some cases (such as Internet firewalls)
+you may want to try to connect directly to that host
+as though it had no MX records at all.
+Setting this option causes
+.i sendmail
+to try this.
+The downside is that errors in your configuration
+are likely to be diagnosed as
+.q "host unknown"
+or
+.q "message timed out"
+instead of something more meaningful.
+This option is disrecommended.
.ip x\fILA\fP
When the system load average exceeds
.i LA ,
@@ -3961,6 +4164,19 @@ These are not intended to be long term supports;
rather, they describe compatibility features
which will probably be removed in future releases.
.pp
+.b N.B.:
+these version
+.i levels
+have nothing
+to do with the version
+.i number
+on the files.
+For example,
+as of this writing
+version 8 config files
+(specifically, 8.6)
+used version level 5 configurations.
+.pp
.q Old
configuration files are defined as version level one.
Version level two files make the following changes:
@@ -4007,6 +4223,30 @@ Version level three files
allow # initiated comments on all lines.
Exceptions are backslash escaped # marks
and the $# syntax.
+.pp
+Version level four configurations
+are completely equivalent to level three
+for historical reasons.
+.pp
+Version level five configuration files
+change the default definition of
+.b $w
+to be just the first component of the hostname.
+.pp
+The
+.b V
+line may have an optional
+.b / \c
+.i vendor
+to indicate that this configuration file uses modifications
+specific to a particular vendor\**.
+.(f
+\**And of course, vendors are encouraged to add themselves
+to the list of recognized vendors by editing the routine
+.i setvendor
+in
+.i conf.c .
+.)f
.sh 3 "K \*- key file declaration"
.pp
Special maps can be defined using the line:
@@ -4019,7 +4259,8 @@ is the handle by which this map is referenced in the rewriting rules.
The
.i mapclass
is the name of a type of map;
-these are compiled in to sendmail.
+these are compiled in to
+.i sendmail .
The
.i arguments
are interpreted depending on the class;
@@ -4095,21 +4336,33 @@ There are four predefined database lookup classes:
.q hash ,
and
.q nis .
-The first requires that sendmail be compiled with the
+The first requires that
+.i sendmail
+be compiled with the
.b ndbm
library;
the second two require the
.b db
library,
-and the third requires that sendmail be compiled with NIS support.
-All four accept as arguments the some optional flags
-and a filename (or a mapname for NIS).
+and the third requires that
+.i sendmail
+be compiled with NIS support.
+All four accept as arguments the same optional flags
+and a filename
+(or a mapname for NIS;
+the filename is the root of the database path,
+so that
+.q .db
+or some other extension appropriate for the database type
+will be added to get the actual database name).
Known flags are:
.ip "\-o"
Indicates that this map is optional \*- that is,
if it cannot be opened,
no error is produced,
-and sendmail will behave as if the map existed but was empty.
+and
+.i sendmail
+will behave as if the map existed but was empty.
.ip "\-N"
Normally when maps are written,
the trailing null byte is not included as part of the key.
@@ -4141,14 +4394,14 @@ are specified,
will never try any matches at all \(em
that is, everything will appear to fail.
.ip "\-a\fIx\fP"
-Append the character
+Append the string
.i x
on successful matches.
For example, the default
.i host
map appends a dot on successful matches.
.ip "\-f"
-Fold upper to lower case before looking up the key.
+Do not fold upper to lower case before looking up the key.
.ip "\-m"
Match only (without replacing the value).
If you only care about the existence of a key and not the value
@@ -4171,13 +4424,24 @@ the two
.i db -based
maps append
.q \&.db .
+For example, the map specification
+.(b
+Kuucp dbm \-o \-N /usr/lib/uucpmap
+.)b
+specifies an optional map named
+.q uucp
+of class
+.q dbm ;
+it always has null bytes at the end of every string,
+and the data is located in
+/usr/lib/uucpmap.{dir,pag}.
.pp
The program
.i makemap (8)
can be used to build any of the three database-oriented maps.
It takes the following flags:
.ip \-f
-Do not fold upper to lower case in the map.
+Fold upper to lower case in the map.
.ip \-N
Include null bytes in keys.
.ip \-o
@@ -4187,6 +4451,21 @@ Allow replacement of existing keys;
normally, re-inserting an existing key is an error.
.ip \-v
Print what is happening.
+.lp
+The
+.i sendmail
+daemon does not have to be restarted to read the new maps
+as long as you change them in place;
+file locking is used so that the maps won't be read
+while they are being updated.\**
+.(f
+\**That is, don't create new maps and then use
+.i mv (1)
+to move them into place.
+I consider this a shortfall (a.k.a. bug) in
+.i sendmail
+which should be fixed in a future release.
+.)f
.pp
There are also two builtin maps that are,
strictly speaking,
@@ -4419,7 +4698,7 @@ This would require that each host
know exactly where each network connection is,
possibly including the names of each host on that network.
As long as the site remains small
-and the the configuration remains relatively static,
+and the configuration remains relatively static,
the update problem will probably not be too great.
.sh 4 "Single host"
.pp
@@ -4618,9 +4897,11 @@ a single word address
is probably going to print out several pages worth of information.
.pp
You should be warned that internally,
-.b sendmail
+.i sendmail
applies ruleset 3 to all addresses.
-In this version of sendmail, you will have to do that manually.
+In this version of
+.i sendmail ,
+you will have to do that manually.
For example, older versions allowed you to use
.(b
0 bruce@broadcast.sony.com
@@ -4659,7 +4940,7 @@ or
.b \-r
flag respectively.
These flags are only passed if they were passed to
-.i sendmail,
+.i sendmail ,
so that mailers that give errors under some circumstances
can be placated.
If the mailer is not picky
@@ -4745,8 +5026,10 @@ To: wnj@monet.CS.Berkeley.EDU, mckusick@vangogh.CS.Berkeley.EDU
.i "if and only if"
the
.q C
-flag is defined in the mailer corresponding to
-.q eric@vangogh.CS.Berkeley.EDU.
+flag is defined in the mailer resolved to
+by running
+.q eric@vangogh.CS.Berkeley.EDU
+through rulesets 3 and 0.
.pp
Other flags are described
in Appendix C.
@@ -4782,6 +5065,15 @@ These sets can also be used
to do special purpose output rewriting
in cooperation with ruleset four.
.pp
+The S and R fields
+can be specified as two numbers separated by a slash
+(e.g.,
+.q "S=10/11" ),
+meaning that all envelope addresses will be processed through ruleset 10
+and all header addresses will be processed through ruleset 11.
+With only one number specified,
+both envelope and header rewriting sets are set to the indicated ruleset.
+.pp
The E field defines the string to use
as an end-of-line indication.
A string containing only newline is the default.
@@ -4790,7 +5082,7 @@ The usual backslash escapes
may be used.
.pp
Finally,
-an argv template is given as the E field.
+an argv template is given as the A field.
It may have embedded spaces.
If there is no argv with a
.b $u
@@ -4857,7 +5149,9 @@ and recipient addresses by ruleset twenty-one.
There is a 100,000 byte limit on messages passed through this mailer.
.sh 2 "The User Database"
.pp
-If you have a version of sendmail with the user database package
+If you have a version of
+.i sendmail
+with the user database package
compiled in,
the handling of sender and recipient addresses
is modified.
@@ -4921,7 +5215,8 @@ In the University this is often just the name of their graduate advisor.
A pointer to a file from which plan information can be gathered.
.pp
As of this writing,
-only a few of these fields are actually being used by sendmail:
+only a few of these fields are actually being used by
+.i sendmail :
.i maildrop
and
.i mailname .
@@ -4964,7 +5259,7 @@ If a
.q maildrop
is found for the user,
but no corresponding
-.q maildrop
+.q mailname
record exists,
the record
.q :default:mailname
@@ -4976,6 +5271,38 @@ The effect is that anyone known in the database
gets their outgoing mail stamped as
.q user@CS.Berkeley.EDU ,
but people not listed in the database use the local hostname.
+.sh 3 "Creating the database\**"
+.(f
+\**These instructions are known to be incomplete.
+A future version of the user database is planned
+including things such as finger service \*- and good documentation.
+.)f
+.pp
+The user database is built from a text file
+using the
+.i makemap
+utility
+(in the distribution in the makemap subdirectory).
+The text file is a series of lines corresponding to userdb records;
+each line has a key and a value separated by white space.
+The key is always in the format described above \*-
+for example:
+.(b
+eric:maildrop
+.)b
+This file is normally installed in a system directory;
+for example, it might be called
+.i /etc/userdb .
+To make the database version of the map, run the program:
+.(b
+makemap btree /etc/userdb.db < /etc/userdb
+.)b
+Then create a config file that uses this.
+For example, using the V8 M4 configuration, include the
+following line in your .mc file:
+.(b
+define(\`confUSERDB_SPEC\', /etc/userdb.db)
+.)b
.sh 1 "OTHER CONFIGURATION"
.pp
There are some configuration changes that can be made by
@@ -4998,9 +5325,11 @@ a much less efficient method of alias lookup is used.
If set, use the new database package from Berkeley (from 4.4BSD).
This package is substantially faster than DBM or NDBM.
If NEWDB and NDBM are both set,
-sendmail will read DBM files,
+.i sendmail
+will read DBM files,
but will create and use NEWDB files.
-.ip YPCOMPAT
+.ip NIS
+Include support for NIS.
If set together with
.i both
NEWDB and NDBM,
@@ -5011,9 +5340,6 @@ exists and is readable.
This is intended for compatibility with Sun Microsystems'
.i mkalias
program used on YP masters.
-.ip _AIX3
-Compile for IBM AIX 3.x.
-This has only been tested on 3.2.3.
.ip SYSTEM5
Set all of the compilation parameters appropriate for System V.
.ip LOCKF
@@ -5062,15 +5388,13 @@ You should only set one of HASSTATFS or HASUSTAT;
the first is preferred.
.ip _PATH_SENDMAILCF
The pathname of the sendmail.cf file.
-.ip _PATH_SENDMAILFC
-The pathname of the sendmail.fc file.
.ip _PATH_SENDMAILPID
The pathname of the sendmail.pid file.
.ip LA_TYPE
The load average type.
Details are described below.
.lp
-The are four built-in ways of computing the load average.
+The are several built-in ways of computing the load average.
.i Sendmail
tries to auto-configure them based on imperfect guesses;
you can select one using the
@@ -5085,9 +5409,15 @@ is:
The kernel stores the load average in the kernel as an array of long integers.
The actual values are scaled by a factor FSCALE
(default 256).
+.ip LA_SHORT
+The kernel stores the load average in the kernel as an array of short integers.
+The actual values are scaled by a factor FSCALE
+(default 256).
.ip LA_FLOAT
The kernel stores the load average in the kernel as an array of
double precision floats.
+.ip LA_MACH
+Use MACH-style load averages.
.ip LA_SUBR
Call the
.i getloadavg
@@ -5097,7 +5427,8 @@ Always return zero as the load average.
This is the fallback case.
.lp
If type
-.sm LA_INT
+.sm LA_INT ,
+.sm LA_SHORT ,
or
.sm LA_FLOAT
is specified,
@@ -5111,6 +5442,14 @@ usually
.q _avenrun
or
.q avenrun ).
+.pp
+There are also several compilation flags to indicate the environment
+such as
+.q _AIX3
+and
+.q _SCO_unix_ .
+See the READ_ME
+file for the latest scoop on these flags.
.sh 2 "Parameters in src/conf.h"
.pp
Parameters and compilation options
@@ -5171,10 +5510,6 @@ The maximum number of entries that will be processed
in a single queue run.
.ip "MAXMXHOSTS [20]"
The maximum number of MX records we will accept for any single host.
-.ip "MAXIPADDR [16]"
-The maximum number of numeric IP addresses we will accept
-for this host.
-This does not limit the number the number of addresses for other hosts.
.lp
A number of other compilation options exist.
These specify whether or not specific code should be compiled in.
@@ -5193,7 +5528,7 @@ have turned it off and thus crippled debuggers.
If set,
support for Internet protocol networking is compiled in.
Previous versions of
-.b sendmail
+.i sendmail
referred to this as
.sm DAEMON ;
this old usage is now incorrect.
@@ -5341,7 +5676,7 @@ specifies a sender.
The order of these fields in the
.i HdrInfo
table specifies
-.i sendmail's
+.i sendmail 's
preference
for which field to return error messages to.
.nr ii 5n
@@ -5681,7 +6016,7 @@ We now recommend that you create a new keyed map instead.
.pp
The following summarizes changes
since the last commonly available version of
-.b sendmail
+.i sendmail
(5.67):
.sh 2 "Connection Caching"
.pp
@@ -5754,13 +6089,13 @@ and limited support for RFC 1426 (BODY).
.sh 2 "Eight-Bit Clean"
.pp
Previous versions of
-.b sendmail
+.i sendmail
used the 0200 bit for quoting.
This version avoids that use.
However, for compatibility with RFC 822,
you can set option `7' to get seven bit stripping.
.pp
-Individual mailers can still produce seven bit out put using the
+Individual mailers can still produce seven bit output using the
`7' mailer flag.
.sh 2 "User Database"
.pp
@@ -5776,14 +6111,15 @@ had a number of annoying
.q features
which have been removed in this release.
In particular,
-these more tightly bind (pun intended) the name server to sendmail,
+these more tightly bind (pun intended) the name server to
+.i sendmail ,
so that the name server resolution rules are incorporated directly into
.b sendmail .
.sh 2 "Keyed Files"
.pp
Generalized keyed files is an idea taken directly from
.sm IDA
-.b sendmail
+.i sendmail
(albeit with a completely different implementation).
They can be useful on large sites.
.pp
@@ -5925,7 +6261,8 @@ Connection cache lifetime.
Enable Errors-To: header.
These headers violate RFC 1123;
this option is included to provide back compatibility
-with old versions of sendmail.
+with old versions of
+.i sendmail .
.ip O
Set incoming SMTP daemon options, such as an alternate SMTP port.
.ip p
@@ -5938,6 +6275,9 @@ User database spec.
Fallback
.q MX
host.
+.ip w
+.q "Best MX"
+handling technique.
.ip 7
Do not run eight bit clean.
.sh 2 "Extended Options"
@@ -6036,9 +6376,10 @@ Previous versions of
treated VRFY and EXPN the same.
In this version,
VRFY doesn't expand aliases or follow .forward files.
+EXPN still does.
.pp
As an optimization, if you run with your default delivery mode being
-queue-only,
+queue-only or deliver-in-background,
the RCPT command will also not chase aliases and .forward files.
It will chase them when it processes the queue.
.sh 2 "[IPC] Mailers Allow Multiple Hosts"
@@ -6049,7 +6390,9 @@ as its
.q Path ,
the $@ part (host name)
can be a colon-separated list of hosts instead of a single hostname.
-This asks sendmail to search the list for the first entry that is available
+This asks
+.i sendmail
+to search the list for the first entry that is available
exactly as though it were an MX record.
The intent is to route internal traffic through internal networks
without publishing an MX record to the net.
@@ -6116,16 +6459,20 @@ The following people made notable contributions:
Keith Bostic, CSRG, University of California, Berkeley
Michael J. Corrigan, University of California, San Diego
Bryan Costales, International Computer Science Institute
-P{r (Pell) Emanuelsson
+Pa\*:r (Pell) Emanuelsson
Craig Everhart, Transarc Corporation
Tom Ivar Helbekkmo, Norwegian School of Economics
Allan E. Johannesen, WPI
-Takahiro Kanbe, FujiXerox
+Jonathan Kamens, OpenVision Technologies, Inc.
+Takahiro Kanbe, Fuji Xerox Information Systems Co., Ltd.
Brian Kantor, University of California, San Diego
+Murray S. Kucherawy, HookUp Communication Corp.
Bruce Lilly, Sony U.S.
+Karl London
Nakamura Motonori, Kyoto University
John Gardiner Myers, Carnegie Mellon University
Neil Rickert, Northern Illinois University
+Eric Schnoebelen, Convex Computer Corp.
Eric Wassenaar, National Institute for Nuclear and High Energy Physics, Amsterdam
Christophe Wolfhugel, Herve Schauer Consultants (Paris)
.)l
@@ -6153,7 +6500,6 @@ t Run in test mode
v Just verify addresses, don't collect or deliver
i Initialize the alias database
p Print the mail queue
-z Freeze the configuration file
.)b
.ip \-B\fItype\fP
Indicate body type.
@@ -6214,7 +6560,9 @@ this is equivalent to using \-p.)
.ip \-q\fItime\fP
Try to process the queued up mail.
If the time is given,
-a sendmail will run through the queue at the specified interval
+a
+.i sendmail
+will run through the queue at the specified interval
to deliver queued mail;
otherwise, it only runs once.
.ip \-q\fIXstring\fP
@@ -6247,15 +6595,15 @@ line will be deleted before sending.
Any addresses in the argument vector will be deleted
from the send list.
.ip "\-X \fIlogfile\fP"
-Log all traffic in and out of sendmail in the indicated
+Log all traffic in and out of
+.i sendmail
+in the indicated
.i logfile
for debugging mailer problems.
This produces a lot of data very quickly and should be used sparingly.
.pp
There are a number of options that may be specified as
-primitive flags
-(provided for compatibility with
-.i delivermail ).
+primitive flags.
These are the e, i, m, and v options.
Also,
the f option
@@ -6316,7 +6664,7 @@ due to a race condition.
It should exist for no more than a few milliseconds
at any given time.
[This is only used on old versions of
-sendmail;
+.i sendmail ;
it is not used
on newer versions.]
.ip q
@@ -6476,7 +6824,7 @@ check there to find the actual pathnames.
.ip "/usr/\*(SD/sendmail"
The binary of
.i sendmail .
-.ip /usr/bin/newaliases
+.ip /usr/\*(SB/newaliases
A link to /usr/\*(SD/sendmail;
causes the alias database to be rebuilt.
Running this program is completely equivalent to giving
@@ -6484,7 +6832,7 @@ Running this program is completely equivalent to giving
the
.b \-bi
flag.
-.ip /usr/bin/mailq
+.ip /usr/\*(SB/mailq
Prints a listing of the mail queue.
This program is equivalent to using the
.b \-bp
@@ -6493,9 +6841,6 @@ flag to
.ip /etc/sendmail.cf
The configuration file,
in textual form.
-.ip /etc/sendmail.fc
-The configuration file
-represented as a memory image.
.ip /usr/lib/sendmail.hf
The SMTP help file.
.ip /etc/sendmail.st
@@ -6542,10 +6887,15 @@ A transcript of the current session.
.\"Eric Allman
.\"Britton-Lee, Inc.
.\".sp
-.\"Version 8.2
+.\"Version 8.34
.\".ce 0
-.pn 2
-.bp
+.bp 2
+.rs
+.sp |4i
+.ce 2
+This page intentionally left blank;
+replace it with a blank sheet for double-sided output.
+.bp 3
.ce
.sz 12
TABLE OF CONTENTS
diff --git a/usr.sbin/sendmail/doc/op/op.ps b/usr.sbin/sendmail/doc/op/op.ps
deleted file mode 100644
index 45a80cdbc1e7..000000000000
--- a/usr.sbin/sendmail/doc/op/op.ps
+++ /dev/null
@@ -1,5173 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.08
-%%DocumentNeededResources: font Times-Bold
-%%+ font Times-Roman
-%%+ font Times-Italic
-%%+ font Symbol
-%%DocumentSuppliedResources: procset grops 1.08 0
-%%Pages: 61
-%%PageOrder: Ascend
-%%Orientation: Portrait
-%%EndComments
-%%BeginProlog
-%%BeginResource: procset grops 1.08 0
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}bind def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/FL{
-currentgray exch setgray fill setgray
-}bind def
-/BL/fill load def
-/LW/setlinewidth load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-}bind def
-/PEND{
-clear
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%IncludeResource: font Times-Bold
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Italic
-%%IncludeResource: font Symbol
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 def/PL
-792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron/scaron/zcaron
-/Ydieresis/trademark/quotesingle/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/space
-/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright/parenleft
-/parenright/asterisk/plus/comma/hyphen/period/slash/zero/one/two/three/four
-/five/six/seven/eight/nine/colon/semicolon/less/equal/greater/question/at/A/B/C
-/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash
-/bracketright/circumflex/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q
-/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase
-/guillemotleft/guillemotright/bullet/florin/fraction/perthousand/dagger
-/daggerdbl/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen/brokenbar
-/section/dieresis/copyright/ordfeminine/guilsinglleft/logicalnot/minus
-/registered/macron/degree/plusminus/twosuperior/threesuperior/acute/mu
-/paragraph/periodcentered/cedilla/onesuperior/ordmasculine/guilsinglright
-/onequarter/onehalf/threequarters/questiondown/Agrave/Aacute/Acircumflex/Atilde
-/Adieresis/Aring/AE/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute
-/Icircumflex/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls
-/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla/egrave/eacute
-/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis/eth/ntilde/ograve
-/oacute/ocircumflex/otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex
-/udieresis/yacute/thorn/ydieresis]def/Times-Italic@0 ENC0/Times-Italic RE
-/Times-Roman@0 ENC0/Times-Roman RE/Times-Bold@0 ENC0/Times-Bold RE
-%%EndProlog
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 16/Times-Bold@0 SF(SENDMAIL)244.888 143.4 Q/F1 12/Times-Bold@0 SF(INST)
-170.172 172.2 Q(ALLA)-1.08 E(TION AND OPERA)-1.14 E(TION GUIDE)-1.14 E/F2 10
-/Times-Roman@0 SF(Eric Allman)263.42 196.2 Q(Uni)219.725 208.2 Q -.15(ve)-.25 G
-(rsity of California, Berk).15 E(ele)-.1 E(y)-.15 E(Mammoth Project)251.75
-220.2 Q(eric@CS.Berk)239.41 232.2 Q(ele)-.1 E -.65(y.)-.15 G(EDU).65 E -1.11
-(Ve)265.225 256.2 S(rsion 8.2)1.11 E -.15(Fo)236.965 280.2 S 2.5(rS).15 G
-(endmail V)258.765 280.2 Q(ersion 8.2)-1.11 E/F3 10/Times-Italic@0 SF(Sendmail)
-97 324.6 Q F2 .699(implements a general purpose internetw)3.199 F .698
-(ork mail routing f)-.1 F .698(acility under the UNIX* operat-)-.1 F .378
-(ing system.)72 336.6 R .378(It is not tied to an)5.378 F 2.878(yo)-.15 G .378
-(ne transport protocol \212 its function may be lik)208.214 336.6 R .378
-(ened to a crossbar switch,)-.1 F 1.036
-(relaying messages from one domain into another)72 348.6 R 6.036(.I)-.55 G
-3.536(nt)284.502 348.6 S 1.036
-(he process, it can do a limited amount of message)295.818 348.6 R .604(header\
- editing to put the message into a format that is appropriate for the recei)72
-360.6 R .604(ving domain.)-.25 F .604(All of this is)5.604 F
-(done under the control of a con\214guration \214le.)72 372.6 Q .711
-(Due to the requirements of \215e)97 388.8 R .711(xibility for)-.15 F F3
-(sendmail)3.211 E F2 3.211(,t)C .71(he con\214guration \214le can seem some)
-311.688 388.8 R .71(what unap-)-.25 F 2.893(proachable. Ho)72 400.8 R(we)-.25 E
--.15(ve)-.25 G 1.193 -.4(r, t).15 H .393(here are only a fe).4 F 2.893(wb)-.25
-G .394(asic con\214gurations for most sites, for which standard con\214gu-)
-253.381 400.8 R .646(ration \214les ha)72 412.8 R .946 -.15(ve b)-.2 H .646
-(een supplied.).15 F .645(Most other con\214gurations can be b)5.646 F .645
-(uilt by adjusting an e)-.2 F .645(xisting con\214gura-)-.15 F
-(tion \214les incrementally)72 424.8 Q(.)-.65 E F3(Sendmail)97 441 Q F2 .15
-(is based on RFC822 \(Internet Mail F)2.65 F .15
-(ormat Protocol\), RFC821 \(Simple Mail T)-.15 F .15(ransport Pro-)-.35 F .129
-(tocol\), RFC1123 \(Internet Host Requirements\), and RFC1425 \(SMTP Service E\
-xtensions\).)72 453 R(Ho)5.129 E(we)-.25 E -.15(ve)-.25 G .929 -.4(r, s).15 H
-(ince).4 E F3(sendmail)72 465 Q F2 .749(is designed to w)3.249 F .749
-(ork in a wider w)-.1 F .749(orld, in man)-.1 F 3.25(yc)-.15 G .75
-(ases it can be con\214gured to e)309.31 465 R .75(xceed these proto-)-.15 F
-2.5(cols. These)72 477 R(cases are described herein.)2.5 E(Although)97 493.2 Q
-F3(sendmail)3.548 E F2 1.047(is intended to run without the need for monitorin\
-g, it has a number of features)3.548 F 1.972(that may be used to monitor or ad\
-just the operation under unusual circumstances.)72 505.2 R 1.972
-(These features are)6.972 F(described.)72 517.2 Q .817
-(Section one describes ho)97 533.4 R 3.317(wt)-.25 G 3.317(od)211.668 533.4 S
-3.317(oa)224.985 533.4 S(basic)-.001 E F3(sendmail)3.316 E F2 3.316
-(installation. Section)3.316 F(tw)3.316 E 3.316(oe)-.1 G .816
-(xplains the day-to-day)412.938 533.4 R .282(information you should kno)72
-545.4 R 2.782(wt)-.25 G 2.782(om)196.768 545.4 S .282
-(aintain your mail system.)212.33 545.4 R .282(If you ha)5.282 F .583 -.15
-(ve a r)-.2 H(elati).15 E -.15(ve)-.25 G .283(ly normal site, these tw).15 F(o)
--.1 E .635(sections should contain suf)72 557.4 R .635
-(\214cient information for you to install)-.25 F F3(sendmail)3.135 E F2 .634
-(and k)3.135 F .634(eep it happ)-.1 F 4.434 -.65(y. S)-.1 H .634(ection three)
-.65 F .925(describes some parameters that may be safely tweak)72 569.4 R 3.425
-(ed. Section)-.1 F .925(four has information re)3.425 F -.05(ga)-.15 G .925
-(rding the com-).05 F .886(mand line ar)72 581.4 R 3.386(guments. Section)-.18
-F<8c76>3.386 E 3.386(ec)-.15 G .885
-(ontains the nitty-gritty information about the con\214guration \214le.)221.92
-581.4 R(This)5.885 E .501
-(section is for masochists and people who must write their o)72 593.4 R .501
-(wn con\214guration \214le.)-.25 F .501(Section six gi)5.501 F -.15(ve)-.25 G
-3.002(sab).15 G(rief)490.12 593.4 Q .355(description of dif)72 605.4 R .355
-(ferences in this v)-.25 F .355(ersion of)-.15 F F3(sendmail)2.855 E F2 5.355
-(.T)C .355(he appendix)298.85 605.4 R .355(es gi)-.15 F .654 -.15(ve a b)-.25 H
-.354(rief b).15 F .354(ut detailed e)-.2 F(xplanation)-.15 E
-(of a number of features not described in the rest of the paper)72 617.4 Q(.)
--.55 E .32 LW 76 680.4 72 680.4 DL 80 680.4 76 680.4 DL 84 680.4 80 680.4 DL 88
-680.4 84 680.4 DL 92 680.4 88 680.4 DL 96 680.4 92 680.4 DL 100 680.4 96 680.4
-DL 104 680.4 100 680.4 DL 108 680.4 104 680.4 DL 112 680.4 108 680.4 DL 116
-680.4 112 680.4 DL 120 680.4 116 680.4 DL 124 680.4 120 680.4 DL 128 680.4 124
-680.4 DL 132 680.4 128 680.4 DL 136 680.4 132 680.4 DL 140 680.4 136 680.4 DL
-144 680.4 140 680.4 DL 148 680.4 144 680.4 DL 152 680.4 148 680.4 DL 156 680.4
-152 680.4 DL 160 680.4 156 680.4 DL 164 680.4 160 680.4 DL 168 680.4 164 680.4
-DL 172 680.4 168 680.4 DL 176 680.4 172 680.4 DL 180 680.4 176 680.4 DL 184
-680.4 180 680.4 DL 188 680.4 184 680.4 DL 192 680.4 188 680.4 DL 196 680.4 192
-680.4 DL 200 680.4 196 680.4 DL 204 680.4 200 680.4 DL 208 680.4 204 680.4 DL
-212 680.4 208 680.4 DL 216 680.4 212 680.4 DL/F4 8/Times-Roman@0 SF
-(*UNIX is a trademark of Bell Laboratories.)93.6 692.4 Q/F5 10/Times-Bold@0 SF
-(Sendmail Installation and Operation Guide)72 756 Q(SMM:08-1)457.9 756 Q EP
-%%Page: 5 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-5)457.9 60 Q 2.5(1. B)72 96 R(ASIC INST)-.3 E(ALLA)-.9 E(TION)-.95 E/F1
-10/Times-Roman@0 SF .233(There are tw)112 112.2 R 2.733(ob)-.1 G .233
-(asic steps to installing sendmail.)175.629 112.2 R .233(The hard part is to b)
-5.233 F .234(uild the con\214guration table.)-.2 F 1.186(This is a \214le that\
- sendmail reads when it starts up that describes the mailers it kno)87 124.2 R
-1.185(ws about, ho)-.25 F 3.685(wt)-.25 G(o)499 124.2 Q .714
-(parse addresses, ho)87 136.2 R 3.214(wt)-.25 G 3.214(or)178.312 136.2 S -.25
-(ew)189.856 136.2 S .715(rite the message header).25 F 3.215(,a)-.4 G .715
-(nd the settings of v)306.745 136.2 R .715(arious options.)-.25 F .715
-(Although the)5.715 F .852(con\214guration table is quite comple)87 148.2 R
-.852(x, a con\214guration can usually be b)-.15 F .852(uilt by adjusting an e)
--.2 F .852(xisting of)-.15 F(f-)-.25 E 1.077(the-shelf con\214guration.)87
-160.2 R 1.078(The second part is actually doing the installation, i.e., creati\
-ng the necessary)6.077 F(\214les, etc.)87 172.2 Q .192(The remainder of this s\
-ection will describe the installation of sendmail assuming you can use one)112
-188.4 R 1.431(of the e)87 200.4 R 1.432(xisting con\214gurations and that the \
-standard installation parameters are acceptable.)-.15 F 1.432(All path-)6.432 F
-8.62(names and e)87 212.4 R 8.62(xamples are gi)-.15 F -.15(ve)-.25 G 11.12(nf)
-.15 G 8.62(rom the root of the)257.57 212.4 R/F2 10/Times-Italic@0 SF(sendmail)
-378.16 212.4 Q F1 8.62(subtree, normally)425.39 212.4 R F2(/usr/sr)87 224.4 Q
-(c/usr)-.37 E(.sbin/sendmail)-1.11 E F1(on 4.4BSD.)2.5 E .511
-(If you are loading this of)112 240.6 R 3.011(ft)-.25 G .511
-(he tape, continue with the ne)222.576 240.6 R .511(xt session.)-.15 F .511
-(If you ha)5.511 F .811 -.15(ve a r)-.2 H .512(unning binary).15 F
-(already on your system, you should probably skip to section 1.2.)87 252.6 Q F0
-2.5(1.1. Compiling)87 276.6 R(Sendmail)2.5 E F1 .435
-(All sendmail source is in the)127 292.8 R F2(sr)2.935 E(c)-.37 E F1
-(subdirectory)2.934 E 5.434(.I)-.65 G 2.934(fy)321.658 292.8 S .434
-(ou are running on a 4.4BSD system, com-)332.922 292.8 R
-(pile by typing \231mak)102 304.8 Q 2.5(e\232. On)-.1 F
-(other systems, you may ha)2.5 E .3 -.15(ve t)-.2 H 2.5(om).15 G(ak)348.75
-304.8 Q 2.5(es)-.1 G(ome other adjustments.)368.92 304.8 Q F0 2.5(1.1.1. Old)
-102 328.8 R -.1(ve)2.5 G(rsions of mak).1 E(e)-.1 E F1
-(If you are not running the ne)142 345 Q 2.5(wv)-.25 G(ersion of)270.74 345 Q
-F0(mak)2.5 E(e)-.1 E F1(you will probably ha)2.5 E .3 -.15(ve t)-.2 H 2.5(ou)
-.15 G(se)444.16 345 Q(mak)157 361.2 Q 2.5<65ad>-.1 G 2.5(fM)186.7 361.2 S(ak)
-201.42 361.2 Q(e\214le.dist)-.1 E .885(This \214le does not assume se)117 377.4
-R -.15(ve)-.25 G .885(ral ne).15 F 3.385(ws)-.25 G(yntax)280.025 377.4 Q .885
-(es, including the \231+=\232 syntax in macro de\214nition)-.15 F
-(and the \231.include\232 syntax.)117 389.4 Q F0 2.5(1.1.2. Compilation)102
-413.4 R(\215ags)2.5 E F2(Sendmail)142 429.6 Q F1(supports tw)2.5 E 2.5(od)-.1 G
-(if)240.51 429.6 Q(ferent formats for the)-.25 E F2(aliases)2.5 E F1 2.5
-(database. These)2.5 F(formats are:)2.5 E 39.5(NDBM The)117 445.8 R -.74(``)
-3.167 G(ne).74 E 3.167(wD)-.25 G(BM')240.434 445.8 Q 3.167('f)-.74 G .667
-(ormat, a)268.411 445.8 R -.25(va)-.2 G .666
-(ilable on nearly all systems around today).25 F 5.666(.T)-.65 G(his)492.33
-445.8 Q -.1(wa)189 457.8 S 3.54(st).1 G 1.041
-(he preferred format prior to 4.4BSD.)210.77 457.8 R 1.041(It allo)6.041 F
-1.041(ws such comple)-.25 F 3.541(xt)-.15 G 1.041(hings as)470.459 457.8 R
-(multiple databases and closing a currently open database.)189 469.8 Q 32.84
-(NEWDB The)117 486 R(ne)3.324 E 3.324(wd)-.25 G .824(atabase package from Berk)
-232.608 486 R(ele)-.1 E 4.624 -.65(y. I)-.15 H 3.324(fy).65 G .824(ou ha)
-382.718 486 R 1.124 -.15(ve t)-.2 H .824(his, use it.).15 F .823(It allo)5.823
-F(ws)-.25 E .839
-(long records, multiple open databases, real in-memory caching, and so forth.)
-189 498 R -1.1(Yo)189 510 S 3.582(uc)1.1 G 1.081
-(an de\214ne this in conjunction with one of the other tw)213.142 510 R 1.081
-(o; if you do, old)-.1 F .692(databases are read, b)189 522 R .693
-(ut when a ne)-.2 F 3.193(wd)-.25 G .693
-(atabase is created it will be in NEWDB)341.679 522 R 4.286(format. As)189 534
-R 4.286(an)4.286 G 1.786(asty hack, if you ha)254.068 534 R 2.085 -.15(ve N)-.2
-H 1.785(EWDB, NDBM, and YPCOMP).15 F -1.11(AT)-.92 G 1.162
-(de\214ned, and if the \214le)189 546 R F2(/var/yp/Mak)3.663 E(e\214le)-.1 E F1
--.15(ex)3.663 G 1.163(ists and is readable,).15 F F2(sendmail)3.663 E F1(will)
-3.663 E .345(create both ne)189 558 R 2.845(wa)-.25 G .345(nd old v)260.035 558
-R .345(ersions of the alias \214le during a)-.15 F F2(ne)2.844 E(walias)-.15 E
-F1(command.)2.844 E 1.219
-(This is required because the Sun NIS/YP system reads the DBM v)189 570 R 1.22
-(ersion of)-.15 F(the alias \214le.)189 582 Q(It')5 E 2.5(su)-.55 G
-(gly as sin, b)265.11 582 Q(ut it w)-.2 E(orks.)-.1 E 1.112
-(If neither of these are de\214ned,)117 598.2 R F2(sendmail)3.612 E F1 1.112
-(reads the alias \214le into memory on e)3.612 F -.15(ve)-.25 G 1.112(ry in).15
-F -.2(vo)-.4 G(cation.).2 E(This can be slo)117 610.2 Q 2.5(wa)-.25 G
-(nd should be a)191.18 610.2 Q -.2(vo)-.2 G(ided.).2 E .719
-(System V based systems can de\214ne SYSTEM5 to mak)142 626.4 R 3.219(es)-.1 G
--2.15 -.25(ev e)378.081 626.4 T .719(ral small adjustments.).25 F(This)5.72 E
-1.076(changes the handling of timezones and uses the much less ef)117 638.4 R
-(\214cient)-.25 E F2(loc)3.576 E(kf)-.2 E F1 1.076(call in preference to)3.576
-F F2(\215oc)117 650.4 Q(k)-.2 E F1 7.224(.T)C 2.224(hese can be speci\214ed se\
-parately using the compilation \215ags SYS5TZ and LOCKF)151.514 650.4 R
-(respecti)117 662.4 Q -.15(ve)-.25 G(ly).15 E(.)-.65 E 1.647(If you don')142
-678.6 R 4.147(th)-.18 G -2.25 -.2(av e)202.031 678.6 T(the)4.347 E F2(unseten)
-4.147 E(v)-.4 E F1 1.647(routine in your system library)4.147 F 4.147(,d)-.65 G
-1.647(e\214ne the UNSETENV)411.277 678.6 R(compilation \215ag.)117 690.6 Q -1.1
-(Yo)142 706.8 S 3.854(um)1.1 G 1.354(ay also ha)169.754 706.8 R 1.654 -.15
-(ve t)-.2 H 3.854(od).15 G 1.355(e\214ne the compilation v)242.03 706.8 R 1.355
-(ariable LA_TYPE to describe ho)-.25 F 3.855(wy)-.25 G(our)490.67 706.8 Q
-(load a)117 718.8 Q -.15(ve)-.2 G(rage is computed.).15 E
-(This and other \215ags are detailed in section 6.1.)5 E EP
-%%Page: 6 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 198.36(SMM:08-6 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E 2.5(1.1.3. Compilation)102 96 R
-(and installation)2.5 E/F1 10/Times-Roman@0 SF .309
-(After making the local system con\214guration described abo)142 112.2 R -.15
-(ve)-.15 G 2.808(,Y).15 G .308(ou should be able to com-)398.86 112.2 R .87
-(pile and install the system.)117 126.2 R .87
-(Compilation can be performed using \231mak)5.87 F(e)-.1 E/F2 7/Times-Roman@0
-SF(1)412.24 122.2 Q F1 3.37<9a69>415.74 126.2 S 3.37(nt)426.33 126.2 S(he)
-437.48 126.2 Q F0(sendmail/sr)3.37 E(c)-.18 E F1(directory)117 138.2 Q 5(.Y)
--.65 G(ou may be able to install using)166.07 138.2 Q(mak)157 154.4 Q 2.5(ei)
--.1 G(nstall)183.84 154.4 Q 3.346
-(This should install the binary in /usr/sbin and create links from /usr/bin/ne)
-117 170.6 R -.1(wa)-.25 G 3.345(liases and).1 F 1.576
-(/usr/bin/mailq to /usr/sbin/sendmail.)117 182.6 R 1.577
-(On 4.4BSD systems it will also format and install man)6.576 F(pages.)117 194.6
-Q F0 2.5(1.2. Con\214guration)87 218.6 R(Files)2.5 E/F3 10/Times-Italic@0 SF
-(Sendmail)127 234.8 Q F1 .355(cannot operate without a con\214guration \214le.)
-2.855 F .355(The con\214guration de\214nes the mail sys-)5.355 F .286
-(tems understood at this site, ho)102 246.8 R 2.786(wt)-.25 G 2.786(oa)239.854
-246.8 S .286(ccess them, ho)252.08 246.8 R 2.786(wt)-.25 G 2.786(of)323.788
-246.8 S(orw)334.904 246.8 Q .286(ard email to remote mail systems, and)-.1 F
-3.114(an)102 258.8 S .614(umber of tuning parameters.)114.554 258.8 R .614
-(This con\214guration \214le is detailed in the later portion of this docu-)
-5.614 F(ment.)102 270.8 Q(The)127 287 Q F3(sendmail)2.764 E F1 .264
-(con\214guration can be daunting at \214rst.)2.764 F .264(The w)5.264 F .264
-(orld is comple)-.1 F .264(x, and the mail con-)-.15 F .109
-(\214guration re\215ects that.)102 299 R .109(The distrib)5.109 F .108
-(ution includes an m4-based con\214guration package that hides a lot)-.2 F
-(of the comple)102 311 Q(xity)-.15 E(.)-.65 E .47
-(These con\214guration \214les are simpler than old v)127 327.2 R .47
-(ersions lar)-.15 F .47(gely because the w)-.18 F .47(orld has become)-.1 F
-1.449(simpler; in particular)102 339.2 R 3.949(,t)-.4 G -.15(ex)197.607 339.2 S
-1.449(t-based host \214les are of).15 F 1.448(\214cially eliminated, ob)-.25 F
-1.448(viating the need to \231hide\232)-.15 F(hosts behind a re)102 351.2 Q
-(gistered internet g)-.15 E(ate)-.05 E -.1(wa)-.25 G -.65(y.).1 G .092(These \
-\214les also assume that most of your neighbors use domain-based UUCP addressi\
-ng; that)127 367.4 R .361(is, instead of naming hosts as \231host!user\232 the)
-102 379.4 R 2.861(yw)-.15 G .361(ill use \231host.domain!user\232.)299.438
-379.4 R .36(The con\214guration \214les)5.36 F(can be customized to w)102 391.4
-Q(ork around this, b)-.1 E(ut it is more comple)-.2 E(x.)-.15 E 2.828(Ih)127
-407.6 S -2.25 -.2(av e)138.158 407.6 T(n').2 E 2.828(tt)-.18 G .328
-(ested these yet on an isolated LAN en)168.226 407.6 R .328
-(vironment with a single UUCP connection to)-.4 F 4.409(the outside w)102 419.6
-R 6.909(orld. If)-.1 F 4.409(you are in such an en)6.909 F 4.408
-(vironment, please send comments to send-)-.4 F(mail@ok)102 431.6 Q(eef)-.1 E
-(fe.CS.Berk)-.25 E(ele)-.1 E -.65(y.)-.15 G(EDU.).65 E .657
-(Our con\214guration \214les are processed by)127 447.8 R F3(m4)3.158 E F1 .658
-(to f)3.158 F .658(acilitate local customization; the directory)-.1 F F3(cf)
-3.158 E F1 .397(of the sendmail distrib)102 459.8 R .396
-(ution directory contains the source \214les.)-.2 F .396
-(This directory contains se)5.396 F -.15(ve)-.25 G .396(ral sub-).15 F
-(directories:)102 471.8 Q 61.73(cf Both)102 488 R .56
-(site-dependent and site-independent descriptions of hosts.)3.06 F .56
-(These can be lit-)5.56 F .445(eral host names \(e.g., \231ucb)174 500 R -.25
-(va)-.15 G .445(x.mc\232\) when the hosts are g).25 F(ate)-.05 E -.1(wa)-.25 G
-.445(ys or more general).1 F 3.589(descriptions \(such as \231tcpproto.mc\232 \
-as a general description of an SMTP-)174 512 R .536(connected host or \231uucp\
-proto.mc\232 as a general description of a UUCP-connected)174 524 R 3.291
-(host\). Files)174 536 R(ending)3.291 E F0(.mc)3.291 E F1(\(`)3.291 E .791
-(`Master Con\214guration')-.74 F .791('\) are the input descriptions; the)-.74
-F 2.14(output is in the corresponding)174 548 R F0(.cf)4.64 E F1 4.64
-(\214le. The)4.64 F 2.14(general structure of these \214les is)4.64 F
-(described belo)174 560 Q -.65(w.)-.25 G 39.5(domain Site-dependent)102 576.2 R
-.428(subdomain descriptions.)2.928 F .428(These are tied to the w)5.428 F .428
-(ay your or)-.1 F -.05(ga)-.18 G(niza-).05 E .292(tion w)174 588.2 R .292
-(ants to do addressing.)-.1 F -.15(Fo)5.292 G 2.792(re).15 G(xample,)313.122
-588.2 Q F0(domain/cs.exposed.m4)2.792 E F1 .292(is our descrip-)2.792 F .442
-(tion for hosts in the CS.Berk)174 600.2 R(ele)-.1 E -.65(y.)-.15 G .443
-(EDU subdomain that w).65 F .443(ant their indi)-.1 F .443(vidual host-)-.25 F
-.963(name to be e)174 612.2 R .963(xternally visible;)-.15 F F0
-(domain/cs.hidden.m4)3.463 E F1 .963(is the same e)3.463 F .962(xcept that the)
--.15 F 2.627(hostname is hidden \(e)174 624.2 R -.15(ve)-.25 G 2.628
-(rything looks lik).15 F 5.128(ei)-.1 G 5.128(tc)362.036 624.2 S 2.628
-(omes from CS.Berk)374.384 624.2 R(ele)-.1 E -.65(y.)-.15 G(EDU\).).65 E
-(These are referenced using the)174 636.2 Q/F4 9/Times-Roman@0 SF(DOMAIN)2.5 E
-F0(m4)2.5 E F1(macro in the)2.5 E F0(.mc)2.5 E F1(\214le.)2.5 E 41.74
-(feature De\214nitions)102 652.4 R .728
-(of speci\214c features that some particular host in your site might w)3.229 F
-(ant.)-.1 E 2.466(These are referenced using the)174 664.4 R F4(FEA)4.966 E
-(TURE)-.999 E F0(m4)4.966 E F1 4.966(macro. An)4.966 F -.15(ex)4.967 G 2.467
-(ample feature is).15 F 1.316(use_cw_\214le \(which tells sendmail to read an \
-/etc/sendmail.cw \214le on startup to)174 676.4 R .32 LW 76 686 72 686 DL 80
-686 76 686 DL 84 686 80 686 DL 88 686 84 686 DL 92 686 88 686 DL 96 686 92 686
-DL 100 686 96 686 DL 104 686 100 686 DL 108 686 104 686 DL 112 686 108 686 DL
-116 686 112 686 DL 120 686 116 686 DL 124 686 120 686 DL 128 686 124 686 DL 132
-686 128 686 DL 136 686 132 686 DL 140 686 136 686 DL 144 686 140 686 DL 148 686
-144 686 DL 152 686 148 686 DL 156 686 152 686 DL 160 686 156 686 DL 164 686 160
-686 DL 168 686 164 686 DL 172 686 168 686 DL 176 686 172 686 DL 180 686 176 686
-DL 184 686 180 686 DL 188 686 184 686 DL 192 686 188 686 DL 196 686 192 686 DL
-200 686 196 686 DL 204 686 200 686 DL 208 686 204 686 DL 212 686 208 686 DL 216
-686 212 686 DL/F5 5/Times-Roman@0 SF(1)93.6 696.4 Q/F6 8/Times-Roman@0 SF
-(where you may ha)3.2 I .24 -.12(ve t)-.16 H 2(or).12 G(eplace \231mak)175.132
-699.6 Q(e\232 with \231mak)-.08 E 2<65ad>-.08 G 2(fM)267.452 699.6 S(ak)279.228
-699.6 Q(e\214le.dist\232 as appropriate.)-.08 E EP
-%%Page: 7 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-7)457.9 60 Q/F1 10/Times-Roman@0 SF(\214nd the set of local names\).)
-174 96 Q 50.62(hack Local)102 112.2 R 1.886(hacks, referenced using the)4.386 F
-/F2 9/Times-Roman@0 SF(HA)4.386 E(CK)-.36 E F0(m4)4.386 E F1 4.386(macro. T)
-4.386 F 1.886(ry to a)-.35 F -.2(vo)-.2 G 1.886(id these.).2 F(The)6.887 E
-(point of ha)174 124.2 Q(ving them here is to mak)-.2 E 2.5(ei)-.1 G 2.5(tc)
-325.91 124.2 S(lear that the)335.63 124.2 Q 2.5(ys)-.15 G(mell.)394.08 124.2 Q
-56.72(m4 Site-independent)102 140.4 R/F3 10/Times-Italic@0 SF(m4)2.538 E F1
-.038(\(1\) include \214les that ha)B .338 -.15(ve i)-.2 H .038
-(nformation common to all con\214gu-).15 F(ration \214les.)174 152.4 Q
-(This can be thought of as a \231#include\232 directory)5 E(.)-.65 E 43.95
-(mailer De\214nitions)102 168.6 R .917(of mailers, referenced using the)3.417 F
-F2(MAILER)3.417 E F0(m4)3.417 E F1 3.418(macro. De\214ned)3.418 F(mailer)3.418
-E(types in this distrib)174 180.6 Q(ution are f)-.2 E
-(ax, local, smtp, uucp, and usenet.)-.1 E 43.39(ostype De\214nitions)102 196.8
-R 1.157(describing v)3.657 F 1.157(arious operating system en)-.25 F 1.156
-(vironments \(such as the loca-)-.4 F(tion of support \214les\).)174 208.8 Q
-(These are referenced using the)5 E F2(OSTYPE)2.5 E F0(m4)2.5 E F1(macro.)2.5 E
-60.61(sh Shell)102 225 R(\214les used by the)2.5 E F0(m4)2.5 E F1 -.2(bu)2.5 G
-(ild process.).2 E -1.1(Yo)5 G 2.5(us)1.1 G(houldn')362.97 225 Q 2.5(th)-.18 G
--2.25 -.2(av e)404.18 225 T(to mess with these.)2.7 E 30.61(sitecon\214g Local)
-102 241.2 R .49(site con\214guration information, such as UUCP connecti)2.99 F
-(vity)-.25 E 5.49(.T)-.65 G(he)450.61 241.2 Q 2.99(yn)-.15 G(ormally)472.89
-241.2 Q(contain lists of site information, for e)174 253.2 Q(xample:)-.15 E
-(SITE\(contessa\))214 269.4 Q(SITE\(hoptoad\))214 281.4 Q(SITE\(nkainc\))214
-293.4 Q(SITE\(well\))214 305.4 Q(The)174 321.6 Q 2.5(ya)-.15 G
-(re referenced using the SITECONFIG macro:)201.34 321.6 Q
-(SITECONFIG\(site.con\214g.\214le, name_of_site, X\))214 337.8 Q(where)174 354
-Q F3(X)2.704 E F1 .204(is the macro/class name to use.)2.704 F .203
-(It can be U \(indicating locally connected)5.204 F(hosts\) or one of W)174 366
-Q 2.5(,X)-.92 G 2.5(,o)259.73 366 S 2.5(rYf)269.73 366 S
-(or up to three remote UUCP hubs.)288.61 366 Q .756(If you are in a ne)127
-382.2 R 3.256(wd)-.25 G .756(omain \(e.g., a compan)214.036 382.2 R .757
-(y\), you will probably w)-.15 F .757(ant to create a cf/domain)-.1 F .871
-(\214le for your domain.)102 394.2 R .871
-(This consists primarily of relay de\214nitions: for e)5.871 F .87
-(xample, Berk)-.15 F(ele)-.1 E(y')-.15 E 3.37(sd)-.55 G(omain)479 394.2 Q .16
-(de\214nition de\214nes relays for BitNET)102 406.2 R 2.66(,C)-.74 G(SNET)
-257.61 406.2 Q 2.66(,a)-.74 G .16(nd UUCP)291.47 406.2 R 5.16(.O)-1.11 G 2.66
-(ft)344.57 406.2 S .16(hese, only the UUCP relay is particu-)353.34 406.2 R .46
-(larly speci\214c to Berk)102 418.2 R(ele)-.1 E 4.26 -.65(y. A)-.15 H .46
-(ll of these are internet-style domain names.).65 F .46(Please check to mak)
-5.46 F 2.96(ec)-.1 G(er)493.1 418.2 Q(-)-.2 E(tain the)102 430.2 Q 2.5(ya)-.15
-G(re reasonable for your domain.)143.51 430.2 Q 1.406(Subdomains at Berk)127
-446.4 R(ele)-.1 E 3.906(ya)-.15 G 1.407
-(re also represented in the cf/domain directory)235.678 446.4 R 6.407(.F)-.65 G
-1.407(or e)439.406 446.4 R 1.407(xample, the)-.15 F 1.491(domain cs-e)102 458.4
-R 1.491(xposed is the Computer Science subdomain with the local hostname sho)
--.15 F 1.49(wn to other)-.25 F 1.41(users; cs-hidden mak)102 470.4 R 1.411
-(es users appear to be from the CS.Berk)-.1 F(ele)-.1 E -.65(y.)-.15 G 1.411
-(EDU subdomain \(with no local).65 F 1.084(host information included\).)102
-482.4 R -1.1(Yo)6.084 G 3.584(uw)1.1 G 1.084(ill probably ha)246.336 482.4 R
-1.384 -.15(ve t)-.2 H 3.584(ou).15 G 1.083
-(pdate this directory to be appropriate for)335.872 482.4 R(your domain.)102
-494.4 Q -1.1(Yo)127 510.6 S 4.372(uw)1.1 G 1.872(ill ha)154.712 510.6 R 2.172
--.15(ve t)-.2 H 4.372(ou).15 G 1.872(se or create)207.478 510.6 R F0(.mc)4.372
-E F1 1.872(\214les in the)4.372 F F3(cf/cf)4.372 E F1 1.873
-(subdirectory for your hosts.)4.373 F 1.873(This is)6.873 F
-(detailed in the cf/README \214le.)102 522.6 Q F0 2.5(1.3. Details)87 546.6 R
-(of Installation Files)2.5 E F1(This subsection describes the \214les that com\
-prise the sendmail installation.)127 562.8 Q F0 2.5(1.3.1. /usr/sbin/sendmail)
-102 586.8 R F1 .079(The binary for sendmail is located in /usr/sbin)142 605 R
-/F4 7/Times-Roman@0 SF(2)326.703 601 Q F1 5.079(.I)330.203 605 S 2.579(ts)
-341.112 605 S .08(hould be setuid root.)350.361 605 R -.15(Fo)5.08 G 2.58(rs)
-.15 G .08(ecurity rea-)458.11 605 R(sons, /, /usr)117 619 Q 2.5(,a)-.4 G
-(nd /usr/sbin should be o)171.6 619 Q(wned by root, mode 755)-.25 E F4(3)364.4
-615 Q F1(.)367.9 619 Q .32 LW 76 646 72 646 DL 80 646 76 646 DL 84 646 80 646
-DL 88 646 84 646 DL 92 646 88 646 DL 96 646 92 646 DL 100 646 96 646 DL 104 646
-100 646 DL 108 646 104 646 DL 112 646 108 646 DL 116 646 112 646 DL 120 646 116
-646 DL 124 646 120 646 DL 128 646 124 646 DL 132 646 128 646 DL 136 646 132 646
-DL 140 646 136 646 DL 144 646 140 646 DL 148 646 144 646 DL 152 646 148 646 DL
-156 646 152 646 DL 160 646 156 646 DL 164 646 160 646 DL 168 646 164 646 DL 172
-646 168 646 DL 176 646 172 646 DL 180 646 176 646 DL 184 646 180 646 DL 188 646
-184 646 DL 192 646 188 646 DL 196 646 192 646 DL 200 646 196 646 DL 204 646 200
-646 DL 208 646 204 646 DL 212 646 208 646 DL 216 646 212 646 DL/F5 5
-/Times-Roman@0 SF(2)93.6 656.4 Q/F6 8/Times-Roman@0 SF .385
-(This is usually /usr/sbin on 4.4BSD and ne)3.2 J .385(wer systems; man)-.2 F
-2.385(ys)-.12 G .385(ystems install it in /usr/lib)302.966 659.6 R 4.384(.I)
--.32 G .384(understand it is in /usr/ucblib on)398.744 659.6 R
-(System V Release 4.)72 669.2 Q F5(3)93.6 679.6 Q F6 .15(Some v)3.2 J .15
-(endors ship them o)-.12 F .15
-(wned by bin; this creates a security hole that is not actually related to)-.2
-F/F7 8/Times-Italic@0 SF(sendmail)2.15 E F6 4.15(.O)C .149(ther important di-)
-447.262 682.8 R(rectories that should ha)72 692.4 Q .24 -.12(ve r)-.16 H
-(estricti).12 E .24 -.12(ve o)-.2 H(wnerships and permissions are /bin, /usr/b\
-in, /etc, /usr/etc, /lib, and /usr/lib)-.08 E(.)-.32 E EP
-%%Page: 8 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 198.36(SMM:08-8 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E 2.5(1.3.2. /etc/sendmail.cf)102 96 R/F1
-10/Times-Roman@0 SF .78(This is the con\214guration \214le for sendmail.)142
-112.2 R .781(This and the frozen con\214guration \214le are the)5.781 F 2.178
-(only tw)117 126.2 R 4.678(on)-.1 G 2.178
-(on-library \214le names compiled into sendmail)164.036 126.2 R/F2 7
-/Times-Roman@0 SF(4)354.636 122.2 Q F1 7.179(.S)358.136 126.2 S 2.179
-(ome older systems install it in)373.375 126.2 R F0(/usr/lib/sendmail.cf)117
-138.2 Q F1(.)A(If you w)142 154.4 Q(ant to mo)-.1 E .3 -.15(ve t)-.15 H
-(his \214le, change).15 E/F3 10/Times-Italic@0 SF(sr)2.5 E(c/pathnames.h)-.37 E
-F1(.)A .721(The con\214guration \214le is normally created using the distrib)
-142 170.6 R .721(ution \214les described abo)-.2 F -.15(ve)-.15 G 5.72(.I).15 G
-(f)500.67 170.6 Q .64(you ha)117 182.6 R .94 -.15(ve a p)-.2 H .64
-(articularly unusual system con\214guration you may need to create a special v)
-.15 F(ersion.)-.15 E
-(The format of this \214le is detailed in later sections of this document.)117
-194.6 Q F0 2.5(1.3.3. /usr/ucb/newaliases)102 218.6 R F1 1.59
-(If you are running deli)142 234.8 R -.15(ve)-.25 G 1.589
-(rmail, it is critical that the).15 F F3(ne)4.089 E(waliases)-.15 E F1 1.589
-(command be replaced.)4.089 F(This can just be a link to)117 246.8 Q F3
-(sendmail)2.5 E F1(:)A(rm \255f /usr/ucb/ne)157 263 Q -.1(wa)-.25 G(liases).1 E
-(ln /usr/sbin/sendmail /usr/ucb/ne)157 275 Q -.1(wa)-.25 G(liases).1 E
-(This can be installed in whate)117 291.2 Q -.15(ve)-.25 G 2.5(rs).15 G
-(earch path you prefer for your system.)254.91 291.2 Q F0 2.5(1.3.4. /v)102
-315.2 R(ar/spool/mqueue)-.1 E F1 .217(The directory)142 331.4 R F3
-(/var/spool/mqueue)2.717 E F1 .218(should be created to hold the mail queue.)
-2.717 F .218(This directory)5.218 F(should be mode 700 and o)117 343.4 Q
-(wned by root.)-.25 E(The actual path of this directory is de\214ned in the)142
-359.6 Q F0(Q)2.5 E F1(option of the)2.5 E F3(sendmail.cf)2.5 E F1(\214le.)2.5 E
-F0 2.5(1.3.5. /etc/aliases*)102 383.6 R F1 1.493
-(The system aliases are held in \231/etc/aliases\232.)142 399.8 R 3.992(As)
-6.492 G 1.492(ample is gi)350.01 399.8 R -.15(ve)-.25 G 3.992(ni).15 G 3.992
-<6e99>417.696 399.8 S 1.492(lib/aliases\232 which)431.128 399.8 R
-(includes some aliases which)117 411.8 Q F3(must)2.5 E F1(be de\214ned:)2.5 E
-(cp lib/aliases /etc/aliases)157 428 Q F3(edit /etc/aliases)157 440 Q F1 -1.1
-(Yo)117 456.2 S 2.5(us)1.1 G(hould e)139.51 456.2 Q(xtend this \214le with an)
--.15 E 2.5(ya)-.15 G(liases that are apropos to your system.)267.54 456.2 Q
-(Normally)142 472.4 Q F3(sendmail)3.609 E F1 1.109(looks at a v)3.609 F 1.109
-(ersion of these \214les maintained by the)-.15 F F3(dbm)3.609 E F1 1.11
-(\(3\) or)1.666 F F3(db)3.61 E F1(\(3\))1.666 E 3.46(routines. These)117 484.4
-R .96(are stored either in \231/etc/aliases.dir\232 and \231/etc/aliases.pag\
-\232 or \231/etc/aliases.db\232)3.46 F 1.022
-(depending on which database package you are using.)117 496.4 R 1.022
-(These can initially be created as empty)6.022 F(\214les, b)117 508.4 Q(ut the)
--.2 E 2.5(yw)-.15 G(ill ha)180.54 508.4 Q .3 -.15(ve t)-.2 H 2.5(ob).15 G 2.5
-(ei)227.69 508.4 S(nitialized promptly)237.41 508.4 Q 5(.T)-.65 G
-(hese should be mode 644:)326.76 508.4 Q(cp /de)157 524.6 Q
-(v/null /etc/aliases.dir)-.25 E(cp /de)157 536.6 Q(v/null /etc/aliases.pag)-.25
-E(chmod 644 /etc/aliases.*)157 548.6 Q(ne)157 560.6 Q -.1(wa)-.25 G(liases).1 E
-(The)117 576.8 Q F3(db)2.79 E F1 .29(routines preset the mode reasonably)2.79 F
-2.79(,s)-.65 G 2.79(ot)301.68 576.8 S .29(his step can be skipped.)312.25 576.8
-R .29(The actual path of this)5.29 F(\214le is de\214ned in the)117 588.8 Q F0
-(A)2.5 E F1(option of the)2.5 E F3(sendmail.cf)2.5 E F1(\214le.)2.5 E F0 2.5
-(1.3.6. /etc/sendmail.fc)102 612.8 R F1 .609
-(If you intend to install the frozen v)142 629 R .61
-(ersion of the con\214guration \214le \(for quick startup\) you)-.15 F
-(should create the \214le /etc/sendmail.fc and initialize it.)117 641 Q
-(This step may be safely skipped.)5 E .32 LW 76 669.2 72 669.2 DL 80 669.2 76
-669.2 DL 84 669.2 80 669.2 DL 88 669.2 84 669.2 DL 92 669.2 88 669.2 DL 96
-669.2 92 669.2 DL 100 669.2 96 669.2 DL 104 669.2 100 669.2 DL 108 669.2 104
-669.2 DL 112 669.2 108 669.2 DL 116 669.2 112 669.2 DL 120 669.2 116 669.2 DL
-124 669.2 120 669.2 DL 128 669.2 124 669.2 DL 132 669.2 128 669.2 DL 136 669.2
-132 669.2 DL 140 669.2 136 669.2 DL 144 669.2 140 669.2 DL 148 669.2 144 669.2
-DL 152 669.2 148 669.2 DL 156 669.2 152 669.2 DL 160 669.2 156 669.2 DL 164
-669.2 160 669.2 DL 168 669.2 164 669.2 DL 172 669.2 168 669.2 DL 176 669.2 172
-669.2 DL 180 669.2 176 669.2 DL 184 669.2 180 669.2 DL 188 669.2 184 669.2 DL
-192 669.2 188 669.2 DL 196 669.2 192 669.2 DL 200 669.2 196 669.2 DL 204 669.2
-200 669.2 DL 208 669.2 204 669.2 DL 212 669.2 208 669.2 DL 216 669.2 212 669.2
-DL/F4 5/Times-Roman@0 SF(4)93.6 679.6 Q/F5 8/Times-Roman@0 SF .589
-(The system libraries can reference other \214les; in particular)3.2 J 2.589
-(,s)-.32 G .588
-(ystem library subroutines that sendmail calls probably reference)294.809 682.8
-R/F6 8/Times-Italic@0 SF(/etc/passwd)72 692.4 Q F5(and)2 E F6(/etc/r)2 E(esolv)
--.296 E(.conf)-.592 E F5(.)A EP
-%%Page: 9 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-9)457.9 60 Q/F1 10/Times-Roman@0 SF(cp /de)157 96 Q
-(v/null /etc/sendmail.fc)-.25 E(chmod 644 /etc/sendmail.fc)157 108 Q
-(/usr/sbin/sendmail \255bz)157 120 Q 1.028
-(In general, freeze \214les are not w)117 136.2 R 1.027
-(orth doing unless your disks are much f)-.1 F 1.027(aster than your CPU;)-.1 F
-(this is seldom true an)117 148.2 Q 2.5(ym)-.15 G(ore.)217.13 148.2 Q 1.32
-(If your)142 164.4 R/F2 10/Times-Italic@0 SF(sendmail)3.82 E F1 -.1(wa)3.821 G
-3.821(sn).1 G 1.321(ot compiled with)238.832 164.4 R/F3 9/Times-Roman@0 SF(FR)
-3.821 E(OZENCONFIG)-.36 E F1 1.321(de\214ned, the)3.821 F F0(\255bz)3.821 E F1
-1.321(\215ag will be)3.821 F(ignored.)117 176.4 Q F0 2.5(1.3.7. /etc/r)102
-200.4 R(c)-.18 E F1 .155(It will be necessary to start up the sendmail daemon \
-when your system reboots.)142 216.6 R .155(This dae-)5.155 F 1.537
-(mon performs tw)117 228.6 R 4.037(of)-.1 G 1.537
-(unctions: it listens on the SMTP sock)201.221 228.6 R 1.537
-(et for connections \(to recei)-.1 F 1.838 -.15(ve m)-.25 H(ail).15 E .442(fro\
-m a remote system\) and it processes the queue periodically to insure that mai\
-l gets deli)117 240.6 R -.15(ve)-.25 G(red).15 E(when hosts come up.)117 252.6
-Q .505(Add the follo)142 268.8 R .505(wing lines to \231/etc/rc\232 \(or \231/\
-etc/rc.local\232 as appropriate\) in the area where it)-.25 F
-(is starting up the daemons:)117 280.8 Q
-(if [ \255f /usr/sbin/sendmail \255a \255f /etc/sendmail.cf ]; then)157 297 Q
-(\(cd /v)193 309 Q(ar/spool/mqueue; rm \255f [lnx]f*\))-.25 E
-(/usr/sbin/sendmail \255bd \255q30m &)193 321 Q(echo \255n ' sendmail' >/de)193
-333 Q(v/console)-.25 E<8c>157 345 Q .174
-(The \231cd\232 and \231rm\232 commands insure that all lock \214les ha)117
-361.2 R .473 -.15(ve b)-.2 H .173(een remo).15 F -.15(ve)-.15 G .173(d; e).15 F
-.173(xtraneous lock \214les)-.15 F .004
-(may be left around if the system goes do)117 373.2 R .005
-(wn in the middle of processing a message.)-.25 F .005(The line that)5.005 F
-2.294(actually in)117 385.2 R -.2(vo)-.4 G -.1(ke).2 G(s).1 E F2(sendmail)4.794
-E F1 2.294(has tw)4.794 F 4.794<6f8d>-.1 G 2.293
-(ags: \231\255bd\232 causes it to listen on the SMTP port, and)272.94 385.2 R
-(\231\255q30m\232 causes it to run the queue e)117 397.2 Q -.15(ve)-.25 G
-(ry half hour).15 E(.)-.55 E .378(Some people use a more comple)142 413.4 R
-2.879(xs)-.15 G .379(tartup script, remo)285.209 413.4 R .379
-(ving zero length qf \214les and df \214les)-.15 F
-(for which there is no qf \214le.)117 425.4 Q -.15(Fo)5 G 2.5(re).15 G(xample:)
-253.9 425.4 Q EP
-%%Page: 10 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 193.36(SMM:08-10 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E/F1 10/Times-Roman@0 SF 2.5(#r)157 96 S
-(emo)167.83 96 Q .3 -.15(ve z)-.15 H(ero length qf \214les).15 E(for qf)157 108
-Q(\214le in qf*)-.25 E(do)157 120 Q(if [ \255r $qf)193 132 Q(\214le ])-.25 E
-(then)193 144 Q(if [ ! \255s $qf)229 156 Q(\214le ])-.25 E(then)229 168 Q
-(echo \255n " <zero: $qf)265 180 Q(\214le>" > /de)-.25 E(v/console)-.25 E
-(rm \255f $qf)265 192 Q(\214le)-.25 E<8c>229 204 Q<8c>193 216 Q(done)157 228 Q
-2.5(#r)157 240 S(ename tf \214les to be qf if the qf does not e)167.83 240 Q
-(xist)-.15 E(for tf)157 252 Q(\214le in tf*)-.25 E(do)157 264 Q(qf)193 276 Q
-(\214le=`echo $tf)-.25 E(\214le | sed ')-.25 E(s/t/q/'`)-.55 E(if [ \255r $tf)
-193 288 Q(\214le \255a ! \255f $qf)-.25 E(\214le ])-.25 E(then)193 300 Q
-(echo \255n " <reco)229 312 Q -.15(ve)-.15 G(ring: $tf).15 E(\214le>" > /de)
--.25 E(v/console)-.25 E(mv $tf)229 324 Q(\214le $qf)-.25 E(\214le)-.25 E(else)
-193 336 Q(echo \255n " <e)229 348 Q(xtra: $tf)-.15 E(\214le>" > /de)-.25 E
-(v/console)-.25 E(rm \255f $tf)229 360 Q(\214le)-.25 E<8c>193 372 Q(done)157
-384 Q 2.5(#r)157 396 S(emo)167.83 396 Q .3 -.15(ve b)-.15 H(ogus qf \214les).15
-E(for df)157 408 Q(\214le in df*)-.25 E(do)157 420 Q(qf)193 432 Q
-(\214le=`echo $df)-.25 E(\214le | sed ')-.25 E(s/d/q/'`)-.55 E(if [ \255r $df)
-193 444 Q(\214le \255a ! \255f $qf)-.25 E(\214le ])-.25 E(then)193 456 Q
-(echo \255n " <incomplete: $df)229 468 Q(\214le>" > /de)-.25 E(v/console)-.25 E
-(rm \255f $df)229 480 Q(\214le)-.25 E<8c>193 492 Q(done)157 504 Q<8c>157 516 Q
-.756(If you are not running a v)142 536.4 R .755
-(ersion of UNIX that supports Berk)-.15 F(ele)-.1 E 3.255(yT)-.15 G(CP/IP)
-416.725 536.4 Q 3.255(,d)-1.11 G 3.255(on)450.27 536.4 S .755(ot include)
-463.525 536.4 R(the)117 548.4 Q F0(\255bd)2.5 E F1(\215ag.)2.5 E F0 2.5
-(1.3.8. /usr/lib/sendmail.hf)102 572.4 R F1 2.078
-(This is the help \214le used by the SMTP)142 588.6 R F0(HELP)4.578 E F1 4.578
-(command. It)4.578 F 2.078(should be copied from)4.578 F
-(\231lib/sendmail.hf\232:)117 600.6 Q(cp lib/sendmail.hf /usr/lib)157 616.8 Q
-(The actual path of this \214le is de\214ned in the)117 633 Q F0(H)2.5 E F1
-(option of the)2.5 E/F2 10/Times-Italic@0 SF(sendmail.cf)2.5 E F1(\214le.)2.5 E
-F0 2.5(1.3.9. /etc/sendmail.st)102 657 R F1 3.04
-(If you wish to collect statistics about your mail traf)142 673.2 R 3.04
-(\214c, you should create the \214le)-.25 F(\231/etc/sendmail.st\232:)117 685.2
-Q(cp /de)157 701.4 Q(v/null /etc/sendmail.st)-.25 E(chmod 666 /etc/sendmail.st)
-157 713.4 Q EP
-%%Page: 11 8
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-11)452.9 60 Q/F1 10/Times-Roman@0 SF .715(This \214le does not gro)117
-96 R 4.516 -.65(w. I)-.25 H 3.216(ti).65 G 3.216(sp)231.502 96 S .716
-(rinted with the program \231mailstats/mailstats.c.)243.608 96 R 5.716<9a54>-.7
-G .716(he actual path)447.028 96 R(of this \214le is de\214ned in the)117 108 Q
-F0(S)2.5 E F1(option of the)2.5 E/F2 10/Times-Italic@0 SF(sendmail.cf)2.5 E F1
-(\214le.)2.5 E F0 2.5(1.3.10. /usr/ucb/newaliases)102 132 R F1(If)142 148.2 Q
-F2(sendmail)3.256 E F1 .756(is in)3.256 F -.2(vo)-.4 G -.1(ke).2 G 3.256(da).1
-G 3.256<7399>240.424 148.2 S(ne)252.01 148.2 Q -.1(wa)-.25 G(liases,).1 E 3.255
-<9a69>-.7 G 3.255(tw)307.255 148.2 S .755(ill simulate the)320.51 148.2 R F0
-(\255bi)3.255 E F1 .755(\215ag \(i.e., will reb)3.255 F .755(uild the)-.2 F
-(alias database; see belo)117 160.2 Q 2.5(w\). This)-.25 F
-(should be a link to /usr/sbin/sendmail.)2.5 E F0 2.5(1.3.11. /usr/ucb/mailq)
-102 184.2 R F1(If)142 200.4 Q F2(sendmail)3.439 E F1 .939(is in)3.439 F -.2(vo)
--.4 G -.1(ke).2 G 3.439(da).1 G 3.439<7399>241.156 200.4 S(mailq,)252.925 200.4
-Q 3.439<9a69>-.7 G 3.439(tw)288.164 200.4 S .939(ill simulate the)301.603 200.4
-R F0(\255bp)3.439 E F1 .94(\215ag \(i.e.,)3.44 F F2(sendmail)3.44 E F1 .94
-(will print)3.44 F(the contents of the mail queue; see belo)117 212.4 Q 2.5
-(w\). This)-.25 F(should be a link to /usr/sbin/sendmail.)2.5 E F0 2.5
-(2. NORMAL)72 236.4 R(OPERA)2.5 E(TIONS)-.95 E 2.5(2.1. `)87 260.4 R(`Quick')
--.63 E 2.5('C)-.63 G(on\214guration Startup)154.9 260.4 Q F1 .523(if the)127
-276.6 R/F3 9/Times-Roman@0 SF(FR)3.023 E(OZENCONFIG)-.36 E F1 .523
-(option is included during compilation, a precompiled \(`)3.023 F(`frozen')-.74
-E .522('\) v)-.74 F(er)-.15 E(-)-.2 E .068
-(sion of the con\214guration \214le can be created using the)102 288.6 R F0
-(\255bz)2.568 E F1 2.568(\215ag. This)2.568 F .069(is really only w)2.568 F
-.069(orthwhile doing)-.1 F .432(if you are on a slo)102 300.6 R 2.932(wp)-.25 G
-.432(rocessor with a relati)190.994 300.6 R -.15(ve)-.25 G .432(ly f).15 F .432
-(ast I/O system \(a V)-.1 F .432(AX 11/750 is a good e)-1.35 F(xample\).)-.15 E
-.131(Since it creates other problems, I recommend ag)102 312.6 R .132
-(ainst using the frozen con\214guration on most current)-.05 F(architectures.)
-102 324.6 Q 1.6 -.8(To c)127 340.8 T(reate the freeze \214le, use).8 E
-(/usr/sbin/sendmail \255bz)142 357 Q .762
-(This creates the frozen con\214guration \214le)102 373.2 R F2
-(/etc/sendmail.fc)3.262 E F1 5.761(.T)C .761(his \214le is an image of)348.403
-373.2 R F2(sendmail)3.261 E F1 1.861 -.55('s d)D(ata).55 E .692
-(space after reading in the con\214guration \214le.)102 385.2 R .693
-(If this \214le e)5.692 F .693(xists, it is used instead of)-.15 F F2
-(/etc/sendmail.cf)3.193 E(sendmail.fc)102 397.2 Q F1(must be reb)2.5 E
-(uilt manually e)-.2 E -.15(ve)-.25 G(ry time).15 E F2(sendmail.cf)2.5 E F1
-(is changed.)2.5 E .953(The frozen con\214guration \214le will be ignored if a)
-127 413.4 R F0<ad43>3.452 E F1 .952
-(\215ag is speci\214ed or if sendmail detects)3.452 F(that it is out of date.)
-102 425.4 Q(Ho)5 E(we)-.25 E -.15(ve)-.25 G .8 -.4(r, t).15 H
-(he heuristics are not strong so this should not be trusted.).4 E F0 2.5
-(2.2. The)87 449.4 R(System Log)2.5 E F1(The system log is supported by the)127
-465.6 Q F2(syslo)2.5 E(gd)-.1 E F1(\(8\) program.)1.666 E F0 2.5(2.2.1. F)102
-489.6 R(ormat)-.25 E F1 .574(Each line in the system log consists of a timesta\
-mp, the name of the machine that gener)142 505.8 R(-)-.2 E .849
-(ated it \(for logging from se)117 517.8 R -.15(ve)-.25 G .849(ral machines o)
-.15 F -.15(ve)-.15 G 3.349(rt).15 G .848(he local area netw)316.942 517.8 R
-.848(ork\), the w)-.1 F .848(ord \231sendmail:\232,)-.1 F(and a message.)117
-529.8 Q F0 2.5(2.2.2. Le)102 553.8 R -.1(ve)-.15 G(ls).1 E F1 .204(If you ha)
-142 570 R -.15(ve)-.2 G F2(syslo)2.854 E(gd)-.1 E F1 .204(\(8\) or an equi)
-1.666 F -.25(va)-.25 G .205(lent installed, you will be able to do logging.).25
-F .205(There is)5.205 F 2.788(al)117 582 S(ar)127.008 582 Q .287
-(ge amount of information that can be logged.)-.18 F .287
-(The log is arranged as a succession of le)5.287 F -.15(ve)-.25 G(ls.).15 E .65
-(At the lo)117 594 R .65(west le)-.25 F -.15(ve)-.25 G 3.15(lo).15 G .65(nly e)
-201.72 594 R .651(xtremely strange situations are logged.)-.15 F .651
-(At the highest le)5.651 F -.15(ve)-.25 G .651(l, e).15 F -.15(ve)-.25 G 3.151
-(nt).15 G(he)494.56 594 Q .826(most mundane and uninteresting e)117 606 R -.15
-(ve)-.25 G .825(nts are recorded for posterity).15 F 5.825(.A)-.65 G 3.325(sac)
-400.27 606 S(on)419.69 606 Q -.15(ve)-.4 G .825(ntion, log le).15 F -.15(ve)
--.25 G(ls).15 E .2(under ten are considered generally \231useful;\232 log le)
-117 618 R -.15(ve)-.25 G .201(ls abo).15 F .501 -.15(ve 6)-.15 H 2.701(4a).15 G
-.201(re reserv)381.566 618 R .201(ed for deb)-.15 F .201(ugging pur)-.2 F(-)-.2
-E 2.5(poses. Le)117 630 R -.15(ve)-.25 G(ls from 11\25564 are reserv).15 E
-(ed for v)-.15 E(erbose information that some sites might w)-.15 E(ant.)-.1 E
-2.5(Ac)142 646.2 S(omplete description of the log le)156.16 646.2 Q -.15(ve)
--.25 G(ls is gi).15 E -.15(ve)-.25 G 2.5(ni).15 G 2.5(ns)340.35 646.2 S
-(ection 4.6.)351.74 646.2 Q F0 2.5(2.3. The)87 670.2 R(Mail Queue)2.5 E F1 .263
-(The mail queue should be processed transparently)127 686.4 R 5.262(.H)-.65 G
--.25(ow)342.868 686.4 S -2.15 -.25(ev e).25 H 1.062 -.4(r, y).25 H .262
-(ou may \214nd that manual inter).4 F(-)-.2 E -.15(ve)102 698.4 S .081
-(ntion is sometimes necessary).15 F 5.081(.F)-.65 G .081(or e)240.254 698.4 R
-.081(xample, if a major host is do)-.15 F .081
-(wn for a period of time the queue)-.25 F .268(may become clogged.)102 710.4 R
-.268(Although sendmail ought to reco)5.268 F -.15(ve)-.15 G 2.768(rg).15 G .268
-(racefully when the host comes up, you)348.254 710.4 R
-(may \214nd performance unacceptably bad in the meantime.)102 722.4 Q EP
-%%Page: 12 9
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 193.36(SMM:08-12 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E 2.5(2.3.1. Printing)102 96 R(the queue)
-2.5 E/F1 10/Times-Roman@0 SF .526
-(The contents of the queue can be printed using the)142 112.2 R/F2 10
-/Times-Italic@0 SF(mailq)3.026 E F1 .526(command \(or by specifying the)3.026 F
-F0(\255bp)117 124.2 Q F1(\215ag to sendmail\):)2.5 E(mailq)157 140.4 Q 1.673
-(This will produce a listing of the queue id')117 156.6 R 1.673
-(s, the size of the message, the date the message)-.55 F
-(entered the queue, and the sender and recipients.)117 168.6 Q F0 2.5(2.3.2. F)
-102 192.6 R(or)-.25 E(cing the queue)-.18 E F2(Sendmail)142 208.8 Q F1 1.137
-(should run the queue automatically at interv)3.637 F 3.638(als. The)-.25 F
-1.138(algorithm is to read and)3.638 F .355
-(sort the queue, and then to attempt to process all jobs in order)117 220.8 R
-5.355(.W)-.55 G .355(hen it attempts to run the job,)384.37 220.8 R F2
-(sendmail)117 232.8 Q F1(\214rst checks to see if the job is lock)2.5 E 2.5
-(ed. If)-.1 F(so, it ignores the job)2.5 E(.)-.4 E .338
-(There is no attempt to insure that only one queue processor e)142 249 R .338
-(xists at an)-.15 F 2.838(yt)-.15 G .339(ime, since there)440.282 249 R .095
-(is no guarantee that a job cannot tak)117 261 R 2.595(ef)-.1 G(ore)272.07 261
-Q -.15(ve)-.25 G 2.595(rt).15 G 2.595(op)302.585 261 S .094(rocess \(ho)315.18
-261 R(we)-.25 E -.15(ve)-.25 G -.4(r,).15 G F2(sendmail)2.994 E F1 .094
-(does include heuris-)2.594 F 1.086
-(tics to try to abort jobs that are taking absurd amounts of time; technically)
-117 273 R 3.587(,t)-.65 G 1.087(his violates RFC)435.146 273 R .462(821, b)117
-285 R .461(ut is blessed by RFC 1123\).)-.2 F .461
-(Due to the locking algorithm, it is impossible for one job to)5.461 F 1.086
-(freeze the entire queue.)117 297 R(Ho)6.086 E(we)-.25 E -.15(ve)-.25 G 1.886
--.4(r, a).15 H 3.586(nu).4 G(ncooperati)279.346 297 Q 1.386 -.15(ve r)-.25 H
-1.086(ecipient host or a program recipient that).15 F(ne)117 309 Q -.15(ve)-.25
-G 3.351(rr).15 G .851(eturns can accumulate man)145.491 309 R 3.351(yp)-.15 G
-.851(rocesses in your system.)269.825 309 R(Unfortunately)5.851 E 3.351(,t)-.65
-G .85(here is no com-)439.52 309 R(pletely general w)117 321 Q(ay to solv)-.1 E
-2.5(et)-.15 G(his.)234.23 321 Q .082
-(In some cases, you may \214nd that a major host going do)142 337.2 R .083
-(wn for a couple of days may create)-.25 F 2.925(ap)117 349.2 S(rohibiti)
-129.365 349.2 Q -.15(ve)-.25 G .425(ly lar).15 F .425(ge queue.)-.18 F .424
-(This will result in)5.425 F F2(sendmail)2.924 E F1 .424
-(spending an inordinate amount of time)2.924 F 1.084(sorting the queue.)117
-361.2 R 1.084(This situation can be \214x)6.084 F 1.084(ed by mo)-.15 F 1.085
-(ving the queue to a temporary place and)-.15 F .023(creating a ne)117 373.2 R
-2.523(wq)-.25 G 2.523(ueue. The)182.629 373.2 R .022
-(old queue can be run later when the of)2.523 F .022
-(fending host returns to service.)-.25 F 1.6 -.8(To d)142 389.4 T 2.5(ot).8 G
-(his, it is acceptable to mo)170.09 389.4 Q .3 -.15(ve t)-.15 H
-(he entire queue directory:).15 E(cd /v)157 405.6 Q(ar/spool)-.25 E
-(mv mqueue omqueue; mkdir mqueue; chmod 700 mqueue)157 417.6 Q -1.1(Yo)117
-433.8 S 2.708(us)1.1 G .208(hould then kill the e)139.718 433.8 R .209
-(xisting daemon \(since it will still be processing in the old queue direc-)
--.15 F(tory\) and create a ne)117 445.8 Q 2.5(wd)-.25 G(aemon.)213.1 445.8 Q
-1.6 -.8(To r)142 462 T(un the old mail queue, run the follo).8 E(wing command:)
--.25 E(/usr/sbin/sendmail \255oQ/v)157 478.2 Q(ar/spool/omqueue \255q)-.25 E
-(The)117 494.4 Q F0(\255oQ)2.868 E F1 .367
-(\215ag speci\214es an alternate queue directory and the)2.868 F F0<ad71>2.867
-E F1 .367(\215ag says to just run e)2.867 F -.15(ve)-.25 G .367(ry job in).15 F
-.593(the queue.)117 506.4 R .593(If you ha)5.593 F .893 -.15(ve a t)-.2 H
-(endenc).15 E 3.093(yt)-.15 G -2.1 -.25(ow a)263.111 506.4 T .593(rd v).25 F
--.1(oy)-.2 G .593(eurism, you can use the).1 F F0<ad76>3.094 E F1 .594
-(\215ag to w)3.094 F .594(atch what is)-.1 F(going on.)117 518.4 Q
-(When the queue is \214nally emptied, you can remo)142 534.6 Q .3 -.15(ve t)
--.15 H(he directory:).15 E(rmdir /v)157 550.8 Q(ar/spool/omqueue)-.25 E F0 2.5
-(2.4. The)87 579 R(Alias Database)2.5 E F1 .361(The alias database e)127 595.2
-R .361(xists in tw)-.15 F 2.861(of)-.1 G 2.861(orms. One)261.116 595.2 R .361
-(is a te)2.861 F .36(xt form, maintained in the \214le)-.15 F F2(/etc/aliases.)
-2.86 E F1(The aliases are of the form)102 607.2 Q(name: name1, name2, ...)142
-623.4 Q(Only local names may be aliased; e.g.,)102 639.6 Q(eric@prep.ai.MIT)142
-655.8 Q(.EDU: eric@CS.Berk)-.74 E(ele)-.1 E -.65(y.)-.15 G(EDU).65 E .348
-(will not ha)102 672 R .648 -.15(ve t)-.2 H .348(he desired ef).15 F 2.849
-(fect. Aliases)-.25 F .349(may be continued by starting an)2.849 F 2.849(yc)
--.15 G .349(ontinuation lines with a)408.783 672 R(space or a tab)102 684 Q 5
-(.B)-.4 G(lank lines and lines be)170.47 684 Q
-(ginning with a sharp sign \(\231#\232\) are comments.)-.15 E 1.593
-(The second form is processed by the)127 700.2 R F2(dbm)4.093 E F1 1.593
-(\(3\) \(or)1.666 F F2(db)4.093 E F1 1.593(\(3\)\) library)1.666 F 6.593(.T)
--.65 G 1.593(his form is in the \214les)409.085 700.2 R F2(/etc/aliases.dir)102
-712.2 Q F1(and)3.028 E F2(/etc/aliases.pa)3.028 E -.15(g.)-.1 G F1 .528
-(This is the form that)5.678 F F2(sendmail)3.029 E F1 .529
-(actually uses to resolv)3.029 F 3.029(ea)-.15 G(liases.)479.28 712.2 Q
-(This technique is used to impro)102 724.2 Q .3 -.15(ve p)-.15 H(erformance.)
-.15 E EP
-%%Page: 13 10
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-13)452.9 60 Q/F1 10/Times-Roman@0 SF -1.1(Yo)127 96 S 2.5(uc)1.1 G
-(an also use)150.06 96 Q/F2 9/Times-Roman@0 SF(NIS)2.5 E F1
-(-based alias \214les.)A -.15(Fo)5 G 2.5(re).15 G(xample, the speci\214cation:)
-305.069 96 Q -.35(OA)142 112.2 S(/etc/aliases).35 E -.35(OA)142 124.2 S
-(nis:mail.aliases@my).35 E(.nis.domain)-.65 E(will \214rst search the /etc/ali\
-ases \214le and then the map named \231mail.aliases\232 in \231my)102 140.4 Q
-(.nis.domain\232.)-.65 E(Additional \215ags can be added after the colon e)127
-156.6 Q(xactly lik)-.15 E 2.5(ea)-.1 G F0(K)A F1(line \212 for e)2.5 E(xample:)
--.15 E -.35(OA)142 172.8 S(nis:-N mail.aliases@my).35 E(.nis.domain)-.65 E
-(will search the appropriate NIS map and al)102 189 Q -.1(wa)-.1 G
-(ys include null bytes in the k).1 E -.15(ey)-.1 G(.)-.5 E F0 2.5(2.4.1. Reb)
-102 213 R(uilding the alias database)-.2 E F1 .542(The DB or DBM v)142 229.2 R
-.542(ersion of the database may be reb)-.15 F .542(uilt e)-.2 F .542
-(xplicitly by e)-.15 F -.15(xe)-.15 G .542(cuting the com-).15 F(mand)117 241.2
-Q(ne)157 257.4 Q -.1(wa)-.25 G(liases).1 E(This is equi)117 273.6 Q -.25(va)
--.25 G(lent to gi).25 E(ving)-.25 E/F3 10/Times-Italic@0 SF(sendmail)2.5 E F1
-(the)2.5 E F0(\255bi)2.5 E F1(\215ag:)2.5 E(/usr/sbin/sendmail \255bi)157 289.8
-Q .259(If the \231D\232 option is speci\214ed in the con\214guration,)142 310.2
-R F3(sendmail)2.759 E F1 .26(will reb)2.759 F .26(uild the alias database)-.2 F
-1.921(automatically if possible when it is out of date.)117 322.2 R(Auto-reb)
-6.921 E 1.92(uild can be dangerous on hea)-.2 F(vily)-.2 E 1.45
-(loaded machines with lar)117 334.2 R 1.45(ge alias \214les; if it might tak)
--.18 F 3.951(em)-.1 G 1.451(ore than \214v)355.654 334.2 R 3.951(em)-.15 G
-1.451(inutes to reb)420.127 334.2 R 1.451(uild the)-.2 F
-(database, there is a chance that se)117 346.2 Q -.15(ve)-.25 G
-(ral processes will start the reb).15 E(uild process simultaneously)-.2 E(.)
--.65 E 1.77(If you ha)142 362.4 R 2.07 -.15(ve m)-.2 H 1.77
-(ultiple aliases databases speci\214ed, the).15 F F0(\255bi)4.27 E F1 1.77
-(\215ag reb)4.27 F 1.77(uilds all the database)-.2 F
-(types it understands \(for e)117 374.4 Q(xample, it can reb)-.15 E
-(uild dbm databases b)-.2 E(ut not nis databases\).)-.2 E F0 2.5(2.4.2. P)102
-398.4 R(otential pr)-.2 E(oblems)-.18 E F1 1.131
-(There are a number of problems that can occur with the alias database.)142
-414.6 R(The)6.131 E 3.631(ya)-.15 G 1.131(ll result)472.589 414.6 R 1.104
-(from a)117 426.6 R F3(sendmail)3.604 E F1 1.104(process accessing the DBM v)
-3.604 F 1.103(ersion while it is only partially b)-.15 F 3.603(uilt. This)-.2 F
-(can)3.603 E 1.248(happen under tw)117 438.6 R 3.748(oc)-.1 G 1.248
-(ircumstances: One process accesses the database while another process is)
-199.234 438.6 R(reb)117 450.6 Q .518(uilding it, or the process reb)-.2 F .518
-(uilding the database dies \(due to being killed or a system crash\))-.2 F
-(before completing the reb)117 462.6 Q(uild.)-.2 E .792(Sendmail has tw)142
-478.8 R 3.292(ot)-.1 G .792(echniques to try to relie)220.666 478.8 R 1.092
--.15(ve t)-.25 H .792(hese problems.).15 F .793(First, it ignores interrupts)
-5.793 F .045(while reb)117 490.8 R .045(uilding the database; this a)-.2 F -.2
-(vo)-.2 G .045(ids the problem of someone aborting the process lea).2 F .045
-(ving a)-.2 F(partially reb)117 502.8 Q(uilt database.)-.2 E
-(Second, at the end of the reb)5 E(uild it adds an alias of the form)-.2 E
-(@: @)157 519 Q .336(\(which is not normally le)117 535.2 R -.05(ga)-.15 G
-2.836(l\). Before).05 F .336
-(sendmail will access the database, it checks to insure that)2.836 F
-(this entry e)117 549.2 Q(xists)-.15 E/F4 7/Times-Roman@0 SF(5)179.63 545.2 Q
-F1(.)183.13 549.2 Q F0 2.5(2.4.3. List)102 573.2 R -.1(ow)2.5 G(ners).1 E F1 .4
-(If an error occurs on sending to a certain address, say \231)142 589.4 R F3(x)
-A F1<9a2c>A F3(sendmail)2.901 E F1 .401(will look for an alias)2.901 F .418
-(of the form \231o)117 601.4 R(wner)-.25 E(-)-.2 E F3(x)A F1 2.918<9a74>C 2.918
-(or)212.632 601.4 S(ecei)223.88 601.4 Q .718 -.15(ve t)-.25 H .418(he errors.)
-.15 F .417(This is typically useful for a mailing list where the)5.418 F 1.116
-(submitter of the list has no control o)117 613.4 R -.15(ve)-.15 G 3.617(rt).15
-G 1.117(he maintenance of the list itself; in this case the list)288.4 613.4 R
-(maintainer w)117 625.4 Q(ould be the o)-.1 E(wner of the list.)-.25 E -.15(Fo)
-5 G 2.5(re).15 G(xample:)309.38 625.4 Q .32 LW 76 669.2 72 669.2 DL 80 669.2 76
-669.2 DL 84 669.2 80 669.2 DL 88 669.2 84 669.2 DL 92 669.2 88 669.2 DL 96
-669.2 92 669.2 DL 100 669.2 96 669.2 DL 104 669.2 100 669.2 DL 108 669.2 104
-669.2 DL 112 669.2 108 669.2 DL 116 669.2 112 669.2 DL 120 669.2 116 669.2 DL
-124 669.2 120 669.2 DL 128 669.2 124 669.2 DL 132 669.2 128 669.2 DL 136 669.2
-132 669.2 DL 140 669.2 136 669.2 DL 144 669.2 140 669.2 DL 148 669.2 144 669.2
-DL 152 669.2 148 669.2 DL 156 669.2 152 669.2 DL 160 669.2 156 669.2 DL 164
-669.2 160 669.2 DL 168 669.2 164 669.2 DL 172 669.2 168 669.2 DL 176 669.2 172
-669.2 DL 180 669.2 176 669.2 DL 184 669.2 180 669.2 DL 188 669.2 184 669.2 DL
-192 669.2 188 669.2 DL 196 669.2 192 669.2 DL 200 669.2 196 669.2 DL 204 669.2
-200 669.2 DL 208 669.2 204 669.2 DL 212 669.2 208 669.2 DL 216 669.2 212 669.2
-DL/F5 5/Times-Roman@0 SF(5)93.6 679.6 Q/F6 8/Times-Roman@0 SF .389(The \231a\
-\232 option is required in the con\214guration for this action to occur)3.2 J
-4.389(.T)-.44 G .389(his should normally be speci\214ed unless you are run-)
-334.24 682.8 R(ning)72 692.4 Q/F7 8/Times-Italic@0 SF(delivermail)2 E F6
-(in parallel with)2 E F7(sendmail.)2 E EP
-%%Page: 14 11
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 193.36(SMM:08-14 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E/F1 10/Times-Roman@0 SF
-(unix-wizards: eric@ucbarpa, wnj@monet, nosuchuser)157 96 Q(,)-.4 E
-(sam@matisse)193 108 Q -.25(ow)157 120 S(ner).25 E(-unix-wizards: eric@ucbarpa)
--.2 E -.1(wo)117 136.2 S 1.959(uld cause \231eric@ucbarpa\232 to get the error\
- that will occur when someone sends to unix-).1 F
-(wizards due to the inclusion of \231nosuchuser\232 on the list.)117 148.2 Q
-.958(List o)142 164.4 R .958(wners also cause the en)-.25 F -.15(ve)-.4 G .959
-(lope sender address to be modi\214ed.).15 F .959(The contents of the)5.959 F
--.25(ow)117 176.4 S .429(ner alias are used if the).25 F 2.929(yp)-.15 G .429
-(oint to a single user)236.364 176.4 R 2.928(,o)-.4 G .428
-(therwise the name of the alias itself is used.)326.436 176.4 R -.15(Fo)117
-188.4 S 2.5(rt).15 G(his reason, and to obe)136.02 188.4 Q 2.5(yI)-.15 G
-(nternet con)233.63 188.4 Q -.15(ve)-.4 G(ntions, a typical scheme w).15 E
-(ould be:)-.1 E 18.49(list: some,)157 204.6 R(set, of, addresses)2.5 E 22.28
-(list-request: list-admin-1,)157 216.6 R(list-admin-2, ...)2.5 E -.25(ow)157
-228.6 S(ner).25 E 26.62(-list: list-request)-.2 F F0 2.5(2.5. User)87 256.8 R
-(Inf)2.5 E(ormation Database)-.25 E F1 1.059(If you ha)127 273 R 1.359 -.15
-(ve a ve)-.2 H 1.059(rsion of).15 F/F2 10/Times-Italic@0 SF(sendmail)3.559 E F1
-1.06(with the user information database compiled in, and you)3.559 F(ha)102 285
-Q 2.206 -.15(ve s)-.2 H 1.906(peci\214ed one or more databases using the).15 F
-F0(U)4.406 E F1 1.905(option, the databases will be searched for a)4.406 F F2
-(user)102 297 Q F1(:maildrop entry)A 5(.I)-.65 G 2.5(ff)191.34 297 S
-(ound, the mail will be sent to the speci\214ed address.)200.5 297 Q 1.288
-(If the \214rst tok)127 313.2 R 1.288(en passed to user part of the \231local\
-\232 mailer is an at sign, the at sign will be)-.1 F(stripped of)102 325.2 Q
-2.5(fa)-.25 G(nd this step will be skipped.)155.07 325.2 Q F0 2.5(2.6. P)87
-349.2 R(er)-.2 E(-User F)-.37 E(orwarding \(.f)-.25 E(orward Files\))-.25 E F1
-.121(As an alternati)127 365.4 R .421 -.15(ve t)-.25 H 2.621(ot).15 G .121
-(he alias database, an)210.404 365.4 R 2.621(yu)-.15 G .12
-(ser may put a \214le with the name \231.forw)304.878 365.4 R .12
-(ard\232 in his)-.1 F .205(or her home directory)102 377.4 R 5.205(.I)-.65 G
-2.705(ft)199.92 377.4 S .205(his \214le e)208.735 377.4 R(xists,)-.15 E F2
-(sendmail)2.705 E F1 .205
-(redirects mail for that user to the list of addresses)2.705 F .909
-(listed in the .forw)102 389.4 R .908(ard \214le.)-.1 F -.15(Fo)5.908 G 3.408
-(re).15 G .908
-(xample, if the home directory for user \231mckusick\232 has a .forw)233.98
-389.4 R(ard)-.1 E(\214le with contents:)102 401.4 Q(mckusick@ernie)142 417.6 Q
-(kirk@calder)142 429.6 Q(then an)102 445.8 Q 2.5(ym)-.15 G(ail arri)146.29
-445.8 Q
-(ving for \231mckusick\232 will be redirected to the speci\214ed accounts.)-.25
-E(Actually)127 462 Q 3.374(,t)-.65 G .874
-(he con\214guration \214le de\214nes a sequence of \214lenames to check.)
-169.444 462 R .875(By def)5.875 F .875(ault, this is)-.1 F .688(the user')102
-474 R 3.188(s.)-.55 G(forw)146.426 474 Q .688(ard \214le, b)-.1 F .687
-(ut can be de\214ned to be more generally using the)-.2 F F0(J)3.187 E F1 3.187
-(option. If)3.187 F .687(you change)3.187 F .393(this, you will ha)102 486 R
-.693 -.15(ve t)-.2 H 2.893(oi).15 G .393
-(nform your user base of the change; .forw)193.064 486 R .393
-(ard is pretty well incorporated into)-.1 F(the collecti)102 498 Q .3 -.15
-(ve s)-.25 H(ubconscious.).15 E F0 2.5(2.7. Special)87 522 R(Header Lines)2.5 E
-F1(Se)127 538.2 Q -.15(ve)-.25 G 1.898(ral header lines ha).15 F 2.197 -.15
-(ve s)-.2 H 1.897
-(pecial interpretations de\214ned by the con\214guration \214le.).15 F(Others)
-6.897 E(ha)102 550.2 Q 1.205 -.15(ve i)-.2 H .905(nterpretations b).15 F .905
-(uilt into)-.2 F F2(sendmail)3.405 E F1 .906
-(that cannot be changed without changing the code.)3.405 F(These)5.906 E -.2
-(bu)102 562.2 S(iltins are described here.).2 E F0 2.5(2.7.1. Retur)102 586.2 R
-(n-Receipt-T)-.15 E(o:)-.92 E F1 1.371
-(If this header is sent, a message will be sent to an)142 602.4 R 3.87(ys)-.15
-G 1.37(peci\214ed addresses when the \214nal)366.88 602.4 R(deli)117 614.4 Q
--.15(ve)-.25 G .367(ry is complete, that is, when successfully deli).15 F -.15
-(ve)-.25 G .368(red to a mailer with the).15 F F0(l)2.868 E F1 .368
-(\215ag \(local deli)2.868 F(v-)-.25 E(ery\) set in the mailer descriptor)117
-626.4 Q(.)-.55 E F0 2.5(2.7.2. Err)102 650.4 R(ors-T)-.18 E(o:)-.92 E F1 .22
-(If errors occur an)142 666.6 R .22
-(ywhere during processing, this header will cause error messages to go to)-.15
-F(the listed addresses.)117 678.6 Q(This is intended for mailing lists.)5 E
-.384(The Errors-T)142 694.8 R .384(o: header w)-.8 F .384
-(as created in the bad old days when UUCP didn')-.1 F 2.885(tu)-.18 G .385
-(nderstand the)450.015 694.8 R .89(distinction between an en)117 706.8 R -.15
-(ve)-.4 G .89(lope and a header; this w).15 F .889(as a hack to pro)-.1 F .889
-(vide what should no)-.15 F 3.389(wb)-.25 G(e)499.56 706.8 Q(passed as the en)
-117 718.8 Q -.15(ve)-.4 G(lope sender address.).15 E(It should go a)5 E -.1(wa)
--.15 G 3.8 -.65(y. I).1 H 2.5(ti).65 G 2.5(so)365.22 718.8 S(nly used if the)
-376.61 718.8 Q F0(l)2.5 E F1(option is set.)2.5 E EP
-%%Page: 15 12
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-15)452.9 60 Q 2.5(2.7.3. A)102 96 R(ppar)-.25 E(ently-T)-.18 E(o:)-.92
-E/F1 10/Times-Roman@0 SF .22
-(If a message comes in with no recipients listed in the message \(in a T)142
-112.2 R .22(o:, Cc:, or Bcc: line\))-.8 F(then)117 124.2 Q/F2 10/Times-Italic@0
-SF(sendmail)2.79 E F1 .29(will add an \231)2.79 F(Apparently-T)-.8 E .289
-(o:\232 header line for an)-.8 F 2.789(yr)-.15 G .289(ecipients it is a)378.086
-124.2 R -.1(wa)-.15 G .289(re of.).1 F .289(This is)5.289 F
-(not put in as a standard recipient line to w)117 136.2 Q(arn an)-.1 E 2.5(yr)
--.15 G(ecipients that the list is not complete.)319.77 136.2 Q
-(At least one recipient line is required under RFC 822.)142 152.4 Q F0 2.5
-(2.8. IDENT)87 176.4 R(Pr)2.5 E(otocol Support)-.18 E F2(Sendmail)127 192.6 Q
-F1 1.835(supports the IDENT protocol as de\214ned in RFC 1413.)4.335 F 1.835
-(Although this enhances)6.835 F .29
-(identi\214cation of the author of an email message by doing a `)102 204.6 R
-.289(`call back')-.74 F 2.789('t)-.74 G 2.789(ot)396.174 204.6 S .289
-(he originating system to)406.743 204.6 R .468(include the o)102 216.6 R .469(\
-wner of a particular TCP connection in the audit trail it is in no sense perfe\
-ct; a deter)-.25 F(-)-.2 E 1.294(mined for)102 228.6 R 1.294
-(ger can easily spoof the IDENT protocol.)-.18 F 1.294(The follo)6.294 F 1.294
-(wing description is e)-.25 F 1.293(xcerpted from)-.15 F(RFC 1413: 6.)102 240.6
-Q(Security Considerations)5 E .005
-(The information returned by this protocol is at most as trustw)127 256.8 R
-(orth)-.1 E 2.506(ya)-.05 G 2.506(st)400.5 256.8 S .006(he host pro)409.676
-256.8 R .006(viding it OR)-.15 F .274(the or)127 268.8 R -.05(ga)-.18 G .274
-(nization operating the host.).05 F -.15(Fo)5.274 G 2.774(re).15 G .273
-(xample, a PC in an open lab has fe)295.314 268.8 R 2.773(wi)-.25 G 2.773(fa)
-448.614 268.8 S .573 -.15(ny c)459.157 268.8 T(ontrols).15 E .986(on it to pre)
-127 280.8 R -.15(ve)-.25 G .986(nt a user from ha).15 F .986
-(ving this protocol return an)-.2 F 3.486(yi)-.15 G .987
-(denti\214er the user w)378.052 280.8 R 3.487(ants. Lik)-.1 F(e-)-.1 E 1.441(w\
-ise, if the host has been compromised the information returned may be complete\
-ly erro-)127 292.8 R(neous and misleading.)127 304.8 Q .521(The Identi\214cati\
-on Protocol is not intended as an authorization or access control protocol.)127
-321 R(At)5.521 E 1.037(best, it pro)127 333 R 1.037
-(vides some additional auditing information with respect to TCP connections.)
--.15 F(At)6.036 E -.1(wo)127 345 S(rst, it can pro).1 E
-(vide misleading, incorrect, or maliciously incorrect information.)-.15 E 1.006
-(The use of the information returned by this protocol for other than auditing \
-is strongly dis-)127 361.2 R 2.697(couraged. Speci\214cally)127 373.2 R 2.697
-(,u)-.65 G .197(sing Identi\214cation Protocol information to mak)228.114 373.2
-R 2.697(ea)-.1 G .197(ccess control deci-)429.186 373.2 R .514(sions - either \
-as the primary method \(i.e., no other checks\) or as an adjunct to other meth\
-ods)127 385.2 R(may result in a weak)127 397.2 Q(ening of normal host security)
--.1 E(.)-.65 E 1.779(An Identi\214cation serv)127 413.4 R 1.778(er may re)-.15
-F -.15(ve)-.25 G 1.778
-(al information about users, entities, objects or processes).15 F .336
-(which might normally be considered pri)127 425.4 R -.25(va)-.25 G 2.836
-(te. An).25 F .337(Identi\214cation serv)2.836 F .337(er pro)-.15 F .337
-(vides service which)-.15 F .806
-(is a rough analog of the CallerID services pro)127 437.4 R .806
-(vided by some phone companies and man)-.15 F 3.306(yo)-.15 G(f)500.67 437.4 Q
-1.397(the same pri)127 449.4 R -.25(va)-.25 G 1.697 -.15(cy c).25 H 1.397
-(onsiderations and ar).15 F 1.398
-(guments that apply to the CallerID service apply to)-.18 F 3.546
-(Identi\214cation. If)127 461.4 R 1.046(you w)3.546 F(ouldn')-.1 E 3.546(tr)
--.18 G 1.045(un a "\214nger" serv)260.334 461.4 R 1.045(er due to pri)-.15 F
--.25(va)-.25 G 1.345 -.15(cy c).25 H 1.045(onsiderations you may).15 F(not w)
-127 473.4 Q(ant to run this protocol.)-.1 E F0 2.5(3. ARGUMENTS)72 497.4 R F1
-.017(The complete list of ar)112 513.6 R .017(guments to)-.18 F F2(sendmail)
-2.517 E F1 .017(is described in detail in Appendix A.)2.517 F .018
-(Some important)5.018 F(ar)87 525.6 Q(guments are described here.)-.18 E F0 2.5
-(3.1. Queue)87 549.6 R(Inter)2.5 E -.1(va)-.1 G(l).1 E F1 .455(The amount of t\
-ime between forking a process to run through the queue is de\214ned by the)127
-565.8 R F0<ad71>2.955 E F1 2.705(\215ag. If)102 577.8 R .206(you run in mode)
-2.705 F F0(f)2.706 E F1(or)2.706 E F0(a)2.706 E F1 .206(this can be relati)
-2.706 F -.15(ve)-.25 G .206(ly lar).15 F .206(ge, since it will only be rele)
--.18 F -.25(va)-.25 G .206(nt when a host).25 F .07(that w)102 589.8 R .07
-(as do)-.1 F .07(wn comes back up.)-.25 F .07(If you run in)5.07 F F0(q)2.57 E
-F1 .07(mode it should be relati)2.57 F -.15(ve)-.25 G .07
-(ly short, since it de\214nes the).15 F
-(maximum amount of time that a message may sit in the queue.)102 601.8 Q 1.335
-(RFC 1123 section 5.3.1.1 says that this v)127 618 R 1.336
-(alue should be at least 30 minutes \(although that)-.25 F(probably doesn')102
-630 Q 2.5(tm)-.18 G(ak)179.59 630 Q 2.5(es)-.1 G(ense if you use `)199.76 630 Q
-(`queue-only')-.74 E 2.5('m)-.74 G(ode\).)329.08 630 Q F0 2.5(3.2. Daemon)87
-654 R(Mode)2.5 E F1 .085(If you allo)127 670.2 R 2.585(wi)-.25 G .085
-(ncoming mail o)181.165 670.2 R -.15(ve)-.15 G 2.585(ra).15 G 2.585(nI)263.61
-670.2 S .085(PC connection, you should ha)274.525 670.2 R .384 -.15(ve a d)-.2
-H .084(aemon running.).15 F(This)5.084 E .069(should be set by your)102 682.2 R
-F2(/etc/r)2.569 E(c)-.37 E F1 .069(\214le using the)2.569 F F0(\255bd)2.569 E
-F1 2.57(\215ag. The)2.569 F F0(\255bd)2.57 E F1 .07(\215ag and the)2.57 F F0
-<ad71>2.57 E F1 .07(\215ag may be combined)2.57 F(in one call:)102 694.2 Q
-(/usr/sbin/sendmail \255bd \255q30m)142 710.4 Q EP
-%%Page: 16 13
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 193.36(SMM:08-16 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E 2.5(3.3. F)87 96 R(or)-.25 E
-(cing the Queue)-.18 E/F1 10/Times-Roman@0 SF .04(In some cases you may \214nd\
- that the queue has gotten clogged for some reason.)127 112.2 R -1.1(Yo)5.04 G
-2.54(uc)1.1 G .04(an force)471.48 112.2 R 3.184(aq)102 124.2 S .684
-(ueue run using the)114.624 124.2 R F0<ad71>3.184 E F1 .684(\215ag \(with no v)
-3.184 F 3.184(alue\). It)-.25 F .684(is entertaining to use the)3.184 F F0
-<ad76>3.185 E F1 .685(\215ag \(v)3.185 F .685(erbose\) when)-.15 F
-(this is done to w)102 136.2 Q(atch what happens:)-.1 E
-(/usr/sbin/sendmail \255q \255v)142 152.4 Q -1.1(Yo)127 172.8 S 4.004(uc)1.1 G
-1.504(an also limit the jobs to those with a particular queue identi\214er)
-151.564 172.8 R 4.004(,s)-.4 G(ender)428.362 172.8 Q 4.004(,o)-.4 G 4.004(rr)
-461.676 172.8 S(ecipient)472.34 172.8 Q .686
-(using one of the queue modi\214ers.)102 184.8 R -.15(Fo)5.687 G 3.187(re).15 G
-.687(xample, \231\255qRberk)265.654 184.8 R(ele)-.1 E .687
-(y\232 restricts the queue run to jobs that)-.15 F(ha)102 196.8 Q .526 -.15
-(ve t)-.2 H .226(he string \231berk).15 F(ele)-.1 E .226(y\232 some)-.15 F .225
-(where in one of the recipient addresses.)-.25 F(Similarly)5.225 E 2.725<2c99>
--.65 G .225(\255qSstring\232 lim-)441.185 196.8 R(its the run to particular se\
-nders and \231\255qIstring\232 limits it to particular identi\214ers.)102 208.8
-Q F0 2.5(3.4. Deb)87 232.8 R(ugging)-.2 E F1 1.365(There are a f)127 249 R
-1.365(airly lar)-.1 F 1.365(ge number of deb)-.18 F 1.365(ug \215ags b)-.2 F
-1.365(uilt into)-.2 F/F2 10/Times-Italic@0 SF(sendmail)3.865 E F1 6.365(.E)C
-1.365(ach deb)417.65 249 R 1.365(ug \215ag has a)-.2 F 1.116(number and a le)
-102 261 R -.15(ve)-.25 G 1.116(l, where higher le).15 F -.15(ve)-.25 G 1.116
-(ls means to print out more information.).15 F 1.116(The con)6.116 F -.15(ve)
--.4 G 1.116(ntion is).15 F .293(that le)102 273 R -.15(ve)-.25 G .293
-(ls greater than nine are \231absurd,).15 F 2.794<9a69>-.7 G .294(.e., the)
-274.014 273 R 2.794(yp)-.15 G .294(rint out so much information that you w)
-313.612 273 R(ouldn')-.1 E(t)-.18 E .692(normally w)102 285 R .692
-(ant to see them e)-.1 F .692(xcept for deb)-.15 F .692
-(ugging that particular piece of code.)-.2 F(Deb)5.692 E .691
-(ug \215ags are set)-.2 F(using the)102 297 Q F0<ad64>2.5 E F1
-(option; the syntax is:)2.5 E(deb)142 313.2 Q(ug-\215ag:)-.2 E F0<ad64>200.13
-313.2 Q F1(deb)2.5 E(ug-list)-.2 E(deb)142 325.2 Q 13.05(ug-list: deb)-.2 F
-(ug-option [ , deb)-.2 E(ug-option ])-.2 E(deb)142 337.2 Q -.28(ug-option: deb)
--.2 F(ug-range [ . deb)-.2 E(ug-le)-.2 E -.15(ve)-.25 G 2.5(l]).15 G(deb)142
-349.2 Q 3.07(ug-range: inte)-.2 F(ger | inte)-.15 E(ger \255 inte)-.15 E(ger)
--.15 E(deb)142 361.2 Q(ug-le)-.2 E -.15(ve)-.25 G 6.24(l: inte).15 F(ger)-.15 E
-(where spaces are for reading ease only)102 377.4 Q 5(.F)-.65 G(or e)268.64
-377.4 Q(xample,)-.15 E 34.99(\255d12 Set)142 393.6 R(\215ag 12 to le)2.5 E -.15
-(ve)-.25 G 2.5(l1).15 G 27.49(\255d12.3 Set)142 405.6 R(\215ag 12 to le)2.5 E
--.15(ve)-.25 G 2.5(l3).15 G 26.66(\255d3-17 Set)142 417.6 R
-(\215ags 3 through 17 to le)2.5 E -.15(ve)-.25 G 2.5(l1).15 G 19.16
-(\255d3-17.4 Set)142 429.6 R(\215ags 3 through 17 to le)2.5 E -.15(ve)-.25 G
-2.5(l4).15 G -.15(Fo)102 445.8 S 4.065(rac).15 G 1.565(omplete list of the a)
-132.75 445.8 R -.25(va)-.2 G 1.565(ilable deb).25 F 1.565
-(ug \215ags you will ha)-.2 F 1.865 -.15(ve t)-.2 H 4.065(ol).15 G 1.566
-(ook at the code \(the)380.895 445.8 R 4.066(ya)-.15 G 1.566(re too)479.384
-445.8 R(dynamic to k)102 457.8 Q(eep this documentation up to date\).)-.1 E F0
-2.5(3.5. T)87 481.8 R(rying a Differ)-.74 E(ent Con\214guration File)-.18 E F1
-(An alternati)127 498 Q .3 -.15(ve c)-.25 H
-(on\214guration \214le can be speci\214ed using the).15 E F0<ad43>2.5 E F1
-(\215ag; for e)2.5 E(xample,)-.15 E(/usr/sbin/sendmail \255Ctest.cf)142 514.2 Q
-.429(uses the con\214guration \214le)102 530.4 R F2(test.cf)2.928 E F1 .428
-(instead of the def)2.928 F(ault)-.1 E F2(/etc/sendmail.cf)2.928 E(.)-.15 E F1
-.428(If the)5.428 F F0<ad43>2.928 E F1 .428(\215ag has no v)2.928 F(alue)-.25 E
-(it def)102 542.4 Q(aults to)-.1 E F2(sendmail.cf)2.5 E F1
-(in the current directory)2.5 E(.)-.65 E F0 2.5(3.6. Changing)87 566.4 R(the V)
-2.5 E(alues of Options)-.92 E F1(Options can be o)127 582.6 Q -.15(ve)-.15 G
-(rridden using the).15 E F0<ad6f>2.5 E F1 2.5(\215ag. F)2.5 F(or e)-.15 E
-(xample,)-.15 E(/usr/sbin/sendmail \255oT2m)142 598.8 Q(sets the)102 615 Q F0
-(T)2.5 E F1(\(timeout\) option to tw)2.5 E 2.5(om)-.1 G
-(inutes for this run only)246.63 615 Q(.)-.65 E .181(Some options ha)127 631.2
-R .481 -.15(ve s)-.2 H .181(ecurity implications.).15 F .181(Sendmail allo)
-5.181 F .182(ws you to set these, b)-.25 F .182(ut refuses to run)-.2 F
-(as root thereafter)102 643.2 Q(.)-.55 E F0 2.5(3.7. Logging)87 667.2 R -.74
-(Tr)2.5 G(af\214c).74 E F1(Man)127 683.4 Q 3.255(yS)-.15 G .754
-(MTP implementations do not fully implement the protocol.)158.995 683.4 R -.15
-(Fo)5.754 G 3.254(re).15 G .754(xample, some per)428.542 683.4 R(-)-.2 E 1.178
-(sonal computer based SMTPs do not understand continuation lines in reply code\
-s.)102 695.4 R 1.178(These can be)6.178 F -.15(ve)102 707.4 S .13
-(ry hard to trace.).15 F .13(If you suspect such a problem, you can set traf)
-5.13 F .13(\214c logging using the)-.25 F F0<ad58>2.63 E F1 2.63(\215ag. F)2.63
-F(or)-.15 E -.15(ex)102 719.4 S(ample,).15 E EP
-%%Page: 17 14
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-17)452.9 60 Q/F1 10/Times-Roman@0 SF
-(/usr/sbin/sendmail \255X /tmp/traf)142 96 Q(\214c -bd)-.25 E
-(will log all traf)102 112.2 Q(\214c in the \214le)-.25 E/F2 10/Times-Italic@0
-SF(/tmp/tr)2.5 E(af)-.15 E<8c63>-.18 E F1(.)A .128(This logs a lot of data v)
-127 128.4 R .128(ery quickly and should ne)-.15 F -.15(ve)-.25 G 2.628(rb).15 G
-2.628(eu)345.888 128.4 S .128(sed during normal operations.)357.956 128.4 R
-(After)5.129 E 1.326(starting up such a daemon, force the errant implementatio\
-n to send a message to your host.)102 140.4 R(All)6.326 E .504(message traf)102
-152.4 R .504(\214c in and out of)-.25 F F2(sendmail)3.004 E F1 3.004(,i)C .504
-(ncluding the incoming SMTP traf)265.258 152.4 R .505
-(\214c, will be logged in this)-.25 F(\214le.)102 164.4 Q F0 2.5(4. TUNING)72
-188.4 R F1 1.922(There are a number of con\214guration parameters you may w)112
-204.6 R 1.922(ant to change, depending on the)-.1 F .366
-(requirements of your site.)87 216.6 R .367
-(Most of these are set using an option in the con\214guration \214le.)5.366 F
--.15(Fo)5.367 G 2.867(re).15 G(xample,)472.06 216.6 Q(the line \231O)87 228.6 Q
-(T5d\232 sets option \231T\232 to the v)-.4 E(alue \2315d\232 \(\214v)-.25 E
-2.5(ed)-.15 G(ays\).)312.55 228.6 Q .735(Most of these options ha)112 244.8 R
-1.035 -.15(ve a)-.2 H .735(ppropriate def).15 F .735(aults for most sites.)-.1
-F(Ho)5.735 E(we)-.25 E -.15(ve)-.25 G 1.535 -.4(r, s).15 H .735(ites ha).4 F
-.735(ving v)-.2 F .735(ery high)-.15 F .045(mail loads may \214nd the)87 256.8
-R 2.545(yn)-.15 G .046(eed to tune them as appropriate for their mail load.)
-193.465 256.8 R .046(In particular)5.046 F 2.546(,s)-.4 G .046(ites e)459.394
-256.8 R(xperi-)-.15 E 1.088(encing a lar)87 268.8 R 1.088
-(ge number of small messages, man)-.18 F 3.588(yo)-.15 G 3.587(fw)294.504 268.8
-S 1.087(hich are deli)308.641 268.8 R -.15(ve)-.25 G 1.087(red to man).15 F
-3.587(yr)-.15 G 1.087(ecipients, may \214nd)425.996 268.8 R(that the)87 280.8 Q
-2.5(yn)-.15 G(eed to adjust the parameters dealing with queue priorities.)
-129.07 280.8 Q F0 2.5(4.1. T)87 304.8 R(imeouts)-.18 E F1 .582(All time interv)
-127 321 R .583(als are set using a scaled syntax.)-.25 F -.15(Fo)5.583 G 3.083
-(re).15 G .583(xample, \23110m\232 represents ten minutes,)346.138 321 R
-(whereas \2312h30m\232 represents tw)102 333 Q 2.5(oa)-.1 G(nd a half hours.)
-241.3 333 Q(The full set of scales is:)5 E 16.11(ss)142 349.2 S(econds)165.89
-349.2 Q 12.22(mm)142 361.2 S(inutes)169.78 361.2 Q 15(hh)142 373.2 S(ours)167
-373.2 Q 15(dd)142 385.2 S(ays)167 385.2 Q 12.78(ww)142 397.2 S(eeks)169.22
-397.2 Q F0 2.5(4.1.1. Queue)102 425.4 R(inter)2.5 E -.1(va)-.1 G(l).1 E F1 .18
-(The ar)142 441.6 R .18(gument to the)-.18 F F0<ad71>2.68 E F1 .18
-(\215ag speci\214es ho)2.68 F 2.68(wo)-.25 G .18
-(ften a sub-daemon will run the queue.)319.25 441.6 R .18(This is)5.18 F .967
-(typically set to between \214fteen minutes and one hour)117 453.6 R 5.968(.R)
--.55 G .968(FC 1123 section 5.3.1.1 recommends)350.968 453.6 R
-(that this be at least 30 minutes.)117 465.6 Q F0 2.5(4.1.2. Read)102 489.6 R
-(timeouts)2.5 E F1 .51(It is possible to time out when reading the standard in\
-put or when reading from a remote)142 505.8 R .324(SMTP serv)117 517.8 R(er)
--.15 E 5.324(.T)-.55 G .324(hese timeouts are set using the)183.608 517.8 R F0
-(r)2.824 E F1 .324(option in the con\214guration \214le.)2.824 F .324(The ar)
-5.324 F(gument)-.18 E .843(is a list of)117 529.8 R F2 -.1(ke)3.342 G(ywor)-.2
-E(d=value)-.37 E F1 3.342(pairs. The)3.342 F .842(recognized k)3.342 F -.15(ey)
--.1 G -.1(wo).15 G .842(rds, their def).1 F .842(ault v)-.1 F .842
-(alues, and the mini-)-.25 F(mum v)117 541.8 Q(alues allo)-.25 E
-(wed by RFC 1123 section 5.3.2 are:)-.25 E 46.16(initial The)117 558 R -.1(wa)
-2.5 G(it for the initial 220 greeting message [5m, 5m].).1 E 52.28(helo The)117
-574.2 R -.1(wa)4.226 G 1.727
-(it for a reply from a HELO or EHLO command [5m, unspeci\214ed].).1 F .1
-(This may require a host name lookup, so \214v)189 586.2 R 2.6(em)-.15 G .1
-(inutes is probably a reasonable)380.29 586.2 R(minimum.)189 598.2 Q 46.72
-(mail\207 The)117 614.4 R -.1(wa)2.5 G
-(it for a reply from a MAIL command [10m, 5m].).1 E 48.95(rcpt\207 The)117
-630.6 R -.1(wa)3.481 G .981(it for a reply from a RCPT command [1h, 5m].).1 F
-.982(This should be long)5.982 F
-(because it could be pointing at a list that tak)189 642.6 Q
-(es a long time to e)-.1 E(xpand.)-.15 E 34.5(datainit\207 The)117 658.8 R -.1
-(wa)2.5 G(it for a reply from a D).1 E -1.21 -1.11(AT A)-.4 H
-(command [5m, 2m].)3.61 E 25.62(datablock\207 The)117 675 R -.1(wa)2.696 G .196
-(it for reading a data block \(that is, the body of the message\).).1 F .196
-([1h, 3m].)5.196 F .621
-(This should be long because it also applies to programs piping input to)189
-687 R F2(send-)3.121 E(mail)189 699 Q F1(which ha)2.5 E .3 -.15(ve n)-.2 H 2.5
-(og).15 G(uarantee of promptness.)274.75 699 Q EP
-%%Page: 18 15
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 193.36(SMM:08-18 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E/F1 10/Times-Roman@0 SF 30.06
-(data\214nal\207 The)117 96 R -.1(wa)2.806 G .306
-(it for a reply from the dot terminating a message.).1 F .306([1h, 10m].)5.306
-F .306(If this is)5.306 F .883
-(shorter than the time actually needed for the recei)189 108 R -.15(ve)-.25 G
-3.384(rt).15 G 3.384(od)412.878 108 S(eli)426.262 108 Q -.15(ve)-.25 G 3.384
-(rt).15 G .884(he message,)454.796 108 R(duplicates will be generated.)189 120
-Q(This is discussed in RFC 1047.)5 E 55.06(rset The)117 136.2 R -.1(wa)2.5 G
-(it for a reply from a RSET command [5m, unspeci\214ed].).1 E 53.94(quit The)
-117 152.4 R -.1(wa)2.5 G(it for a reply from a Q).1 E
-(UIT command [2m, unspeci\214ed].)-.1 E 50.61(misc The)117 168.6 R -.1(wa)2.761
-G .261(it for a reply from miscellaneous \(b).1 F .261
-(ut short\) commands such as NOOP)-.2 F(\(no-operation\) and VERB \(go into v)
-189 180.6 Q(erbose mode\).)-.15 E([2m, unspeci\214ed].)5 E 25.06
-(command\207 In)117 196.8 R(serv)2.5 E(er SMTP)-.15 E 2.5(,t)-1.11 G
-(he time to w)259.4 196.8 Q(ait for another command.)-.1 E([1h, 5m].)5 E -.15
-(Fo)117 213 S 3.633(rc).15 G 1.134
-(ompatibility with old con\214guration \214les, if no `)138.813 213 R(`k)-.74 E
--.15(ey)-.1 G -.1(wo).15 G(rd=').1 E 3.634('i)-.74 G 3.634(ss)390.854 213 S
-1.134(peci\214ed, all the timeouts)402.268 213 R(mark)117 225 Q
-(ed with \207 are set to the indicated v)-.1 E(alue.)-.25 E(Man)142 241.2 Q
-2.501(yo)-.15 G 2.501(ft)172.681 241.2 S .001(he RFC 1123 minimum v)181.292
-241.2 R .001(alues may well be too short.)-.25 F/F2 10/Times-Italic@0 SF
-(Sendmail)5 E F1 -.1(wa)2.5 G 2.5(sd).1 G(esigned to)463.17 241.2 Q .066
-(the RFC 822 protocols, which did not specify read timeouts; hence,)117 253.2 R
-F2(sendmail)2.567 E F1 .067(does not guarantee)2.567 F .438
-(to reply to messages promptly)117 265.2 R 5.438(.I)-.65 G 2.938(np)249.92
-265.2 S(articular)262.858 265.2 Q 2.938(,a\231)-.4 G .438
-(RCPT\232 command specifying a mailing list will)313.034 265.2 R -.15(ex)117
-279.2 S .205(pand and v).15 F .205(erify the entire list; a lar)-.15 F .205
-(ge list on a slo)-.18 F 2.705(ws)-.25 G .205(ystem may tak)339.81 279.2 R
-2.705(em)-.1 G .205(ore than \214v)413.375 279.2 R 2.705(em)-.15 G(inutes)
-474.11 279.2 Q/F3 7/Times-Roman@0 SF(6)498 275.2 Q F1(.)501.5 279.2 Q 3.036(Ir)
-117 291.2 S .536(ecommend a one hour timeout \212 since this f)126.696 291.2 R
-.536(ailure is rare, a long timeout is not onerous and)-.1 F
-(may ultimately help reduce netw)117 303.2 Q(ork load.)-.1 E -.15(Fo)142 319.4
-S 2.5(re).15 G(xample, the line:)162.53 319.4 Q(Orcommand=25m,datablock=3h)157
-335.6 Q .344(sets the serv)117 351.8 R .344(er SMTP command timeout to 25 minu\
-tes and the input data block timeout to three)-.15 F(hours.)117 363.8 Q F0 2.5
-(4.1.3. Message)102 387.8 R(timeouts)2.5 E F1 .237
-(After sitting in the queue for a fe)142 404 R 2.737(wd)-.25 G .237
-(ays, a message will time out.)289.726 404 R .238(This is to insure that at)
-5.238 F .283(least the sender is a)117 416 R -.1(wa)-.15 G .282
-(re of the inability to send a message.).1 F .282
-(The timeout is typically set to three)5.282 F 2.5(days. This)117 428 R
-(timeout is set using the)2.5 E F0(T)2.5 E F1
-(option in the con\214guration \214le.)2.5 E .413(The time of submission is se\
-t in the queue, rather than the amount of time left until time-)142 444.2 R
-3.263(out. As)117 456.2 R 3.263(ar)3.263 G .763
-(esult, you can \215ush messages that ha)163.449 456.2 R 1.062 -.15(ve b)-.2 H
-.762(een hanging for a short period by running).15 F
-(the queue with a short message timeout.)117 468.2 Q -.15(Fo)5 G 2.5(re).15 G
-(xample,)302.79 468.2 Q(/usr/sbin/sendmail \255oT1d \255q)157 484.4 Q
-(will run the queue and \215ush an)117 500.6 Q(ything that is one day old.)-.15
-E 1.077(Since this option is global, and since you can not)142 516.8 R F2 3.577
-(ap)3.577 G(riori)364.395 516.8 Q F1(kno)3.577 E 3.577(wh)-.25 G 1.577 -.25
-(ow l)416.859 516.8 T 1.077(ong another host).25 F .476
-(outside your domain will be do)117 528.8 R .475(wn, a \214v)-.25 F 2.975(ed)
--.15 G .475(ay timeout is recommended.)291.785 528.8 R .475(This allo)5.475 F
-.475(ws a recipient)-.25 F 1.579(to \214x the problem e)117 540.8 R -.15(ve)
--.25 G 4.079(ni).15 G 4.079(fi)222.545 540.8 S 4.079(to)232.734 540.8 S 1.579
-(ccurs at the be)244.593 540.8 R 1.58(ginning of a long week)-.15 F 4.08
-(end. RFC)-.1 F 1.58(1123 section)4.08 F
-(5.3.1.1 says that this parameter should be `)117 552.8 Q
-(`at least 4\2555 days')-.74 E('.)-.74 E(The)142 569 Q F0(T)2.711 E F1 .211
-(option can also tak)2.711 F 2.711(eas)-.1 G .21
-(econd timeout indicating a time after which a w)263.637 569 R .21(arning mes-)
--.1 F(sage should be sent; the tw)117 581 Q 2.5(ot)-.1 G
-(imeouts are separated by a slash.)234.67 581 Q -.15(Fo)5 G 2.5(re).15 G
-(xample, the v)391.28 581 Q(alue)-.25 E(5d/4h)157 597.2 Q .971
-(causes email to f)117 613.4 R .971(ail after \214v)-.1 F 3.471(ed)-.15 G .971
-(ays, b)245.326 613.4 R .971(ut a w)-.2 F .971
-(arning message will be sent after four hours.)-.1 F(This)5.972 E
-(should be lar)117 625.4 Q(ge enough that the message will ha)-.18 E .3 -.15
-(ve b)-.2 H(een tried se).15 E -.15(ve)-.25 G(ral times.).15 E .32 LW 76 669.2
-72 669.2 DL 80 669.2 76 669.2 DL 84 669.2 80 669.2 DL 88 669.2 84 669.2 DL 92
-669.2 88 669.2 DL 96 669.2 92 669.2 DL 100 669.2 96 669.2 DL 104 669.2 100
-669.2 DL 108 669.2 104 669.2 DL 112 669.2 108 669.2 DL 116 669.2 112 669.2 DL
-120 669.2 116 669.2 DL 124 669.2 120 669.2 DL 128 669.2 124 669.2 DL 132 669.2
-128 669.2 DL 136 669.2 132 669.2 DL 140 669.2 136 669.2 DL 144 669.2 140 669.2
-DL 148 669.2 144 669.2 DL 152 669.2 148 669.2 DL 156 669.2 152 669.2 DL 160
-669.2 156 669.2 DL 164 669.2 160 669.2 DL 168 669.2 164 669.2 DL 172 669.2 168
-669.2 DL 176 669.2 172 669.2 DL 180 669.2 176 669.2 DL 184 669.2 180 669.2 DL
-188 669.2 184 669.2 DL 192 669.2 188 669.2 DL 196 669.2 192 669.2 DL 200 669.2
-196 669.2 DL 204 669.2 200 669.2 DL 208 669.2 204 669.2 DL 212 669.2 208 669.2
-DL 216 669.2 212 669.2 DL/F4 5/Times-Roman@0 SF(6)93.6 679.6 Q/F5 8
-/Times-Roman@0 SF .344(This v)3.2 J .344(eri\214cation includes looking up e)
--.12 F -.12(ve)-.2 G .344(ry address with the name serv).12 F .344(er; this in)
--.12 F -.16(vo)-.32 G(lv).16 E .344(es netw)-.12 F .343
-(ork delays, and can in some cases)-.08 F(can be considerable.)72 692.4 Q EP
-%%Page: 19 16
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-19)452.9 60 Q 2.5(4.2. F)87 96 R(orking During Queue Runs)-.25 E/F1 10
-/Times-Roman@0 SF .303(By setting the)127 112.2 R F0(Y)2.802 E F1(option,)2.802
-E/F2 10/Times-Italic@0 SF(sendmail)2.802 E F1 .302(will fork before each indi)
-2.802 F .302(vidual message while running the)-.25 F 2.513(queue. This)102
-124.2 R .013(will pre)2.513 F -.15(ve)-.25 G(nt).15 E F2(sendmail)2.513 E F1
-.013(from consuming lar)2.513 F .013(ge amounts of memory)-.18 F 2.513(,s)-.65
-G 2.513(oi)421.993 124.2 S 2.513(tm)432.286 124.2 S .014(ay be useful in)
-445.359 124.2 R .592(memory-poor en)102 136.2 R 3.092(vironments. Ho)-.4 F(we)
--.25 E -.15(ve)-.25 G 1.392 -.4(r, i).15 H 3.092(ft).4 G(he)275.388 136.2 Q F0
-(Y)3.092 E F1 .591(option is not set,)3.091 F F2(sendmail)3.091 E F1 .591
-(will k)3.091 F .591(eep track of hosts)-.1 F(that are do)102 148.2 Q
-(wn during a queue run, which can impro)-.25 E .3 -.15(ve p)-.15 H
-(erformance dramatically).15 E(.)-.65 E(If the)127 164.4 Q F0(Y)2.5 E F1
-(option is set,)2.5 E F2(sendmail)2.5 E F1(can not use connection caching.)2.5
-E F0 2.5(4.3. Queue)87 188.4 R(Priorities)2.5 E F1(Ev)127 204.6 Q 1.128(ery me\
-ssage is assigned a priority when it is \214rst instantiated, consisting of th\
-e message)-.15 F .003(size \(in bytes\) of)102 216.6 R .002
-(fset by the message class times the \231w)-.25 F .002(ork class f)-.1 F .002
-(actor\232 and the number of recipients)-.1 F .637(times the \231w)102 228.6 R
-.637(ork recipient f)-.1 F(actor)-.1 E 4.537 -.7(.\232 T)-.55 H .638
-(he priority is used to order the queue.).7 F .638(Higher numbers for the)5.638
-F(priority mean that the message will be processed later when running the queu\
-e.)102 240.6 Q .329(The message size is included so that lar)127 256.8 R .328
-(ge messages are penalized relati)-.18 F .628 -.15(ve t)-.25 H 2.828(os).15 G
-.328(mall messages.)443.122 256.8 R .285(The message class allo)102 268.8 R
-.285(ws users to send \231high priority\232 messages by including a \231Preced\
-ence:\232 \214eld)-.25 F .008(in their message; the v)102 280.8 R .008
-(alue of this \214eld is look)-.25 F .007(ed up in the)-.1 F F0(P)2.507 E F1
-.007(lines of the con\214guration \214le.)2.507 F .007(Since the)5.007 F 1.966
-(number of recipients af)102 292.8 R 1.967
-(fects the amount of load a message presents to the system, this is also)-.25 F
-(included into the priority)102 304.8 Q(.)-.65 E .895
-(The recipient and class f)127 321 R .895
-(actors can be set in the con\214guration \214le using the)-.1 F F0(y)3.394 E
-F1(and)3.394 E F0(z)3.394 E F1(options)3.394 E(respecti)102 333 Q -.15(ve)-.25
-G(ly).15 E 5.962(.T)-.65 G(he)163.842 333 Q 3.462(yd)-.15 G(ef)186.594 333 Q
-.962(ault to 30000 \(for the recipient f)-.1 F .963
-(actor\) and 1800 \(for the class f)-.1 F 3.463(actor\). The)-.1 F
-(initial priority is:)102 345 Q F2(pri)244.54 363 Q/F3 10/Symbol SF(=)3.16 E F1
-(\()2.8 E F2(class).2 E F3<b4>2.47 E F0(z\))2.2 E F3(+)2.2 E F1(\()2.2 E F2
-(nrcpt).36 E F3<b4>2.88 E F0(y\))2.2 E F1(\(Remember)102 381 Q 3.328(,h)-.4 G
-.828(igher v)159.638 381 R .828
-(alues for this parameter actually mean that the job will be treated with lo)
--.25 F(wer)-.25 E(priority)102 393 Q(.\))-.65 E 1.519(The priority of a job ca\
-n also be adjusted each time it is processed \(that is, each time an)127 409.2
-R .256(attempt is made to deli)102 421.2 R -.15(ve)-.25 G 2.756(ri).15 G .256
-(t\) using the \231w)212.04 421.2 R .256(ork time f)-.1 F(actor)-.1 E 1.656 -.7
-(,\232 s)-.4 H .256(et by the).7 F F0(Z)2.756 E F1 2.756(option. This)2.756 F
-.256(is added to the)2.756 F(priority)102 433.2 Q 2.702(,s)-.65 G 2.703(oi)
-140.442 433.2 S 2.703(tn)150.925 433.2 S .203
-(ormally decreases the precedence of the job, on the grounds that jobs that ha)
-161.408 433.2 R .503 -.15(ve f)-.2 H(ailed).05 E(man)102 445.2 Q 2.5(yt)-.15 G
-(imes will tend to f)129.35 445.2 Q(ail ag)-.1 E(ain in the future.)-.05 E(The)
-5 E F0(Z)2.5 E F1(option def)2.5 E(aults to 90000.)-.1 E F0 2.5(4.4. Load)87
-469.2 R(Limiting)2.5 E F2(Sendmail)127 485.4 Q F1 .102(can be ask)2.602 F .101
-(ed to queue \(b)-.1 F .101(ut not deli)-.2 F -.15(ve)-.25 G .101
-(r\) mail if the system load a).15 F -.15(ve)-.2 G .101(rage gets too high).15
-F .626(using the)102 497.4 R F0(x)3.126 E F1 3.126(option. When)3.126 F .626
-(the load a)3.126 F -.15(ve)-.2 G .626(rage e).15 F .626(xceeds the v)-.15 F
-.626(alue of the)-.25 F F0(x)3.126 E F1 .626(option, the deli)3.126 F -.15(ve)
--.25 G .627(ry mode is).15 F .987(set to)102 509.4 R F0(q)3.487 E F1 .987
-(\(queue only\) if the)3.487 F F2 .987(Queue F)3.487 F(actor)-.75 E F1(\()3.487
-E F0(q)A F1 .987(option\) di)3.487 F .986(vided by the dif)-.25 F .986
-(ference in the current load)-.25 F -2.25 -.2(av e)102 521.4 T 1.268
-(rage and the).2 F F0(x)3.769 E F1 1.269(option plus one e)3.769 F 1.269
-(xceeds the priority of the message \212 that is, the message is)-.15 F
-(queued if)102 533.4 Q(f:)-.25 E F2(pri)269.76 554.63 Q F1(>)3.16 E F0(q)312.48
-547.63 Q F2(LA)294.81 561.63 Q F3(-)2.23 E F0(x)2.2 E F3(+)2.2 E .4 LW 336.29
-552.03 294.23 552.03 DL F1(1)331.29 561.63 Q(The)102 576.13 Q F0(q)3.143 E F1
-.643(option def)3.143 F .642(aults to 200000, so each point of load a)-.1 F
--.15(ve)-.2 G .642(rage is w).15 F .642(orth 200000 priority points \(as)-.1 F
-(described abo)102 588.13 Q -.15(ve)-.15 G(\).).15 E -.15(Fo)127 604.33 S 2.886
-(rd).15 G .386(rastic cases, the)148.626 604.33 R F0(X)2.887 E F1 .387
-(option de\214nes a load a)2.887 F -.15(ve)-.2 G .387
-(rage at which sendmail will refuse to accept).15 F(netw)102 616.33 Q
-(ork connections.)-.1 E
-(Locally generated mail \(including incoming UUCP mail\) is still accepted.)5 E
-F0 2.5(4.5. Deli)87 640.33 R -.1(ve)-.1 G(ry Mode).1 E F1 .417
-(There are a number of deli)127 656.53 R -.15(ve)-.25 G .416(ry modes that).15
-F F2(sendmail)2.916 E F1 .416
-(can operate in, set by the \231d\232 con\214gura-)2.916 F(tion option.)102
-668.53 Q(These modes specify ho)5 E 2.5(wq)-.25 G(uickly mail will be deli)
-263.96 668.53 Q -.15(ve)-.25 G 2.5(red. Le).15 F -.05(ga)-.15 G 2.5(lm).05 G
-(odes are:)418.9 668.53 Q 17.22(id)142 684.73 S(eli)167 684.73 Q -.15(ve)-.25 G
-2.5(ri).15 G(nteracti)194.65 684.73 Q -.15(ve)-.25 G(ly \(synchronously\)).15 E
-15(bd)142 696.73 S(eli)167 696.73 Q -.15(ve)-.25 G 2.5(ri).15 G 2.5(nb)194.65
-696.73 S(ackground \(asynchronously\))207.15 696.73 Q 15(qq)142 708.73 S
-(ueue only \(don')167 708.73 Q 2.5(td)-.18 G(eli)240.42 708.73 Q -.15(ve)-.25 G
-(r\)).15 E 1.49(There are tradeof)102 724.93 R 3.99(fs. Mode)-.25 F 1.491
-(\231i\232 passes the maximum amount of information to the sender)3.99 F 3.991
-(,b)-.4 G 1.491(ut is)485.559 724.93 R EP
-%%Page: 20 17
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 193.36(SMM:08-20 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E/F1 10/Times-Roman@0 SF .433(hardly e)
-102 96 R -.15(ve)-.25 G 2.933(rn).15 G(ecessary)155.226 96 Q 5.433(.M)-.65 G
-.433(ode \231q\232 puts the minimum load on your machine, b)205.269 96 R .432
-(ut means that deli)-.2 F -.15(ve)-.25 G(ry).15 E .437
-(may be delayed for up to the queue interv)102 108 R 2.937(al. Mode)-.25 F .437
-(\231b\232 is probably a good compromise.)2.937 F(Ho)5.437 E(we)-.25 E -.15(ve)
--.25 G -.4(r,).15 G .033(this mode can cause lar)102 120 R .032
-(ge numbers of processes if you ha)-.18 F .332 -.15(ve a m)-.2 H .032
-(ailer that tak).15 F .032(es a long time to deli)-.1 F -.15(ve)-.25 G(r).15 E
-2.5(am)102 132 S(essage.)116.72 132 Q 1.208
-(If you run in mode \231q\232 \(queue only\))127 148.2 R/F2 10/Times-Italic@0
-SF(sendmail)3.708 E F1 1.208(will not e)3.708 F 1.208(xpand aliases and follo)
--.15 F 3.708(w.)-.25 G(forw)472.45 148.2 Q(ard)-.1 E
-(\214les upon initial receipt of the mail.)102 160.2 Q
-(This speeds up the response to RCPT commands.)5 E F0 2.5(4.6. Log)87 184.2 R
-(Le)2.5 E -.1(ve)-.15 G(l).1 E F1 .19(The le)127 200.4 R -.15(ve)-.25 G 2.69
-(lo).15 G 2.69(fl)171.97 200.4 S .189(ogging can be set for sendmail.)180.77
-200.4 R .189(The def)5.189 F .189(ault using a standard con\214guration table)
--.1 F(is le)102 212.4 Q -.15(ve)-.25 G 2.5(l9).15 G 5(.T)137.71 212.4 S(he le)
-151.32 212.4 Q -.15(ve)-.25 G(ls are as follo).15 E(ws:)-.25 E 31(0N)102 228.6
-S 2.5(ol)145.22 228.6 S(ogging.)155.5 228.6 Q 31(1S)102 244.8 S
-(erious system f)143.56 244.8 Q(ailures and potential security problems.)-.1 E
-31(2L)102 261 S(ost communications \(netw)144.11 261 Q
-(ork problems\) and protocol f)-.1 E(ailures.)-.1 E 31(3O)102 277.2 S
-(ther serious f)145.22 277.2 Q(ailures.)-.1 E 31(4M)102 293.4 S(inor f)146.89
-293.4 Q(ailures.)-.1 E 31(5M)102 309.6 S(essage collection statistics.)146.89
-309.6 Q 31(6C)102 325.8 S(reation of error messages, VRFY and EXPN commands.)
-144.67 325.8 Q 31(7D)102 342 S(eli)145.22 342 Q -.15(ve)-.25 G(ry f).15 E
-(ailures \(host or user unkno)-.1 E(wn, etc.\).)-.25 E 31(8S)102 358.2 S
-(uccessful deli)143.56 358.2 Q -.15(ve)-.25 G(ries.).15 E 31(9M)102 374.4 S
-(essages being deferred \(due to a host being do)146.89 374.4 Q(wn, etc.\).)
--.25 E 23.5(10 Database)102 390.6 R -.15(ex)2.5 G(pansion \(alias, forw).15 E
-(ard, and userdb lookups\).)-.1 E 23.5(15 Automatic)102 406.8 R
-(alias database reb)2.5 E(uilds.)-.2 E 23.5(20 Logs)102 423 R .603
-(attempts to run lock)3.102 F .603(ed queue \214les.)-.1 F .603
-(These are not errors, b)5.603 F .603(ut can be useful to note if)-.2 F
-(your queue appears to be clogged.)138 435 Q 23.5(30 Lost)102 451.2 R
-(locks \(only if using lockf instead of \215ock\).)2.5 E(Additionally)102 467.4
-Q 3.684(,v)-.65 G 1.184(alues abo)162.844 467.4 R 1.484 -.15(ve 6)-.15 H 3.684
-(4a).15 G 1.183(re reserv)232.466 467.4 R 1.183(ed for e)-.15 F 1.183
-(xtremely v)-.15 F 1.183(erbose deb)-.15 F 1.183(uggging output.)-.2 F 1.183
-(No normal)6.183 F(site w)102 479.4 Q(ould e)-.1 E -.15(ve)-.25 G 2.5(rs).15 G
-(et these.)168.99 479.4 Q F0 2.5(4.7. File)87 503.4 R(Modes)2.5 E F1 .813
-(There are a number of \214les that may ha)127 519.6 R 1.113 -.15(ve a n)-.2 H
-.813(umber of modes.).15 F .813(The modes depend on what)5.813 F
-(functionality you w)102 531.6 Q(ant and the le)-.1 E -.15(ve)-.25 G 2.5(lo).15
-G 2.5(fs)253.15 531.6 S(ecurity you require.)262.87 531.6 Q F0 2.5(4.7.1. T)102
-555.6 R 2.5(os)-.92 G(uid or not to suid?)146.64 555.6 Q F2(Sendmail)142 571.8
-Q F1 .934(can safely be made setuid to root.)3.434 F .934
-(At the point where it is about to)5.934 F F2 -.2(ex)3.433 G(ec).2 E F1 .933
-(\(2\) a)1.666 F(mailer)117 583.8 Q 2.582(,i)-.4 G 2.582(tc)150.012 583.8 S
-.082(hecks to see if the userid is zero; if so, it resets the userid and group\
-id to a def)159.814 583.8 R .083(ault \(set)-.1 F .577(by the)117 595.8 R F0(u)
-3.077 E F1(and)3.077 E F0(g)3.077 E F1 3.077(options\). \(This)3.077 F .576
-(can be o)3.076 F -.15(ve)-.15 G .576(rridden by setting the).15 F F0(S)3.076 E
-F1 .576(\215ag to the mailer for mailers)3.076 F 1.531
-(that are trusted and must be called as root.\))117 607.8 R(Ho)6.531 E(we)-.25
-E -.15(ve)-.25 G 2.331 -.4(r, t).15 H 1.532
-(his will cause mail processing to be).4 F(accounted \(using)117 619.8 Q F2(sa)
-2.5 E F1(\(8\)\) to root rather than to the user sending the mail.)1.666 E F0
-2.5(4.7.2. Should)102 643.8 R(my alias database be writable?)2.5 E F1 .058
-(At Berk)142 660 R(ele)-.1 E 2.558(yw)-.15 G 2.558(eh)200.186 660 S -2.25 -.2
-(av e)212.184 660 T .058(the alias database \(/etc/aliases*\) mode 644.)2.758 F
-.058(While this is not as \215e)5.058 F(x-)-.15 E 1.718
-(ible as if the database were more 666, it a)117 672 R -.2(vo)-.2 G 1.719
-(ids potential security problems with a globally).2 F(writable database.)117
-684 Q 1.191(The database that)142 700.2 R F2(sendmail)3.691 E F1 1.191
-(actually used is represented by the tw)3.691 F 3.69<6f8c>-.1 G(les)429.12
-700.2 Q F2(aliases.dir)3.69 E F1(and)3.69 E F2(aliases.pa)117 712.2 Q(g)-.1 E
-F1 .158(\(both in /etc\) \(or)2.658 F F2(aliases.db)2.658 E F1 .159
-(if you are running with the ne)2.659 F 2.659(wB)-.25 G(erk)412.852 712.2 Q
-(ele)-.1 E 2.659(yd)-.15 G .159(atabase prim-)449.691 712.2 R(iti)117 724.2 Q
--.15(ve)-.25 G 3.607(s\). The).15 F 1.107
-(mode on these \214les should match the mode on /etc/aliases.)3.607 F(If)6.106
-E F2(aliases)3.606 E F1 1.106(is writable)3.606 F EP
-%%Page: 21 18
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-21)452.9 60 Q/F1 10/Times-Roman@0 SF 1.624(and the DBM \214les \()117
-96 R/F2 10/Times-Italic@0 SF(aliases.dir)A F1(and)4.124 E F2(aliases.pa)4.124 E
-(g)-.1 E F1 4.124(\)a)C 1.624(re not, users will be unable to re\215ect their)
-324.648 96 R .72(desired changes through to the actual database.)117 108 R(Ho)
-5.719 E(we)-.25 E -.15(ve)-.25 G 1.519 -.4(r, i).15 H(f).4 E F2(aliases)3.219 E
-F1 .719(is read-only and the DBM)3.219 F(\214les are writable, a slightly soph\
-isticated user can arrange to steal mail an)117 120 Q(yw)-.15 E(ay)-.1 E(.)-.65
-E .62(If your DBM \214les are not writable by the w)142 136.2 R .621
-(orld or you do not ha)-.1 F .921 -.15(ve a)-.2 H(uto-reb).15 E .621
-(uild enabled)-.2 F .564(\(with the \231D\232 option\), then you must be caref\
-ul to reconstruct the alias database each time you)117 148.2 R(change the te)
-117 160.2 Q(xt v)-.15 E(ersion:)-.15 E(ne)157 176.4 Q -.1(wa)-.25 G(liases).1 E
-(If this step is ignored or for)117 192.6 Q(gotten an)-.18 E 2.5(yi)-.15 G
-(ntended changes will also be ignored or for)273.32 192.6 Q(gotten.)-.18 E F0
-2.5(4.8. Connection)87 216.6 R(Caching)2.5 E F1 .493
-(When processing the queue,)127 232.8 R F0(sendmail)2.993 E F1 .493
-(will try to k)2.993 F .493(eep the last fe)-.1 F 2.994(wo)-.25 G .494
-(pen connections open to)405.588 232.8 R -.2(avo)102 244.8 S
-(id startup and shutdo).2 E(wn costs.)-.25 E
-(This only applies to IPC connections.)5 E .286
-(When trying to open a connection the cache is \214rst searched.)127 261 R .286
-(If an open connection is found,)5.286 F .92
-(it is probed to see if it is still acti)102 273 R 1.22 -.15(ve b)-.25 H 3.42
-(ys).15 G .92(ending a)270.89 273 R/F3 9/Times-Roman@0 SF(NOOP)3.42 E F1 3.42
-(command. It)3.42 F .92(is not an error if this f)3.42 F(ails;)-.1 E
-(instead, the connection is closed and reopened.)102 285 Q -1 -.8(Tw o)127
-301.2 T .207(parameters control the connection cache.)3.507 F(The)5.207 E F0(k)
-2.707 E F1 .207(option de\214nes the number of simultane-)2.707 F 1.819
-(ous open connections that will be permitted.)102 313.2 R 1.82
-(If it is set to zero, connections will be closed as)6.819 F .796
-(quickly as possible.)102 325.2 R .796(The def)5.796 F .796(ault is one.)-.1 F
-.796(This should be set as appropriate for your system size; it)5.796 F
-(will limit the amount of system resources that)102 337.2 Q F0(sendmail)2.5 E
-F1(will use during queue runs.)2.5 E(The)127 353.4 Q F0(K)3.647 E F1 1.148
-(option speci\214es the maximum time that an)3.647 F 3.648(yc)-.15 G 1.148
-(ached connection will be permitted to)347.45 353.4 R 2.896(idle. When)102
-365.4 R .396(the idle time e)2.896 F .396(xceeds this v)-.15 F .396
-(alue the connection is closed.)-.25 F .395(This number should be small)5.395 F
-.162(\(under ten minutes\) to pre)102 377.4 R -.15(ve)-.25 G .163
-(nt you from grabbing too man).15 F 2.663(yr)-.15 G .163
-(esources from other hosts.)347.485 377.4 R .163(The def)5.163 F(ault)-.1 E
-(is \214v)102 389.4 Q 2.5(em)-.15 G(inutes.)136.3 389.4 Q F0 2.5(4.9. Name)87
-413.4 R(Ser)2.5 E -.1(ve)-.1 G 2.5(rA).1 G(ccess)172.33 413.4 Q F1 .422
-(If your system supports the name serv)127 429.6 R(er)-.15 E 2.921(,t)-.4 G
-.421(hen the probability is that)297.151 429.6 R F2(sendmail)2.921 E F1 .421
-(will be using it)2.921 F(re)102 441.6 Q -.05(ga)-.15 G .153(rdless of ho).05 F
-2.653(wy)-.25 G .153(ou con\214gure sendmail.)180.599 441.6 R(Ho)5.153 E(we)
--.25 E -.15(ve)-.25 G .954 -.4(r, i).15 H 2.654(fy).4 G .154(ou ha)331.956
-441.6 R .454 -.15(ve n)-.2 H(ameserv).15 E .154(er support which you are)-.15 F
-.979(not using, sendmail will get a \231connection refused\232 message when it\
- tries to connect to the name)102 453.6 R(serv)102 465.6 Q .591
-(er \(either by calling)-.15 F F2 -.1(ge)3.091 G(thostbyname).1 E F1 .591
-(or by trying to look up the MX records\).)3.091 F .591(If the)5.591 F F0(I)
-3.091 E F1 .592(option is)3.092 F(set,)102 477.6 Q F2(sendmail)3.34 E F1 .839
-(will interpret this to mean a temporary f)3.34 F .839
-(ailure; otherwise, it ignores the name serv)-.1 F(er)-.15 E 2.59(data. If)102
-489.6 R .09(your name serv)2.59 F .09(er is running properly)-.15 F 2.59(,t)
--.65 G .09(he setting of this option is not rele)291.6 489.6 R -.25(va)-.25 G
-.09(nt; ho).25 F(we)-.25 E -.15(ve)-.25 G .89 -.4(r, i).15 H 2.59(ti).4 G(s)
-500.11 489.6 Q(important that it be set properly to mak)102 501.6 Q 2.5(ee)-.1
-G(rror handling w)269.66 501.6 Q(ork properly)-.1 E(.)-.65 E .633
-(This option also allo)127 517.8 R .633(ws you to tweak name serv)-.25 F .633
-(er options.)-.15 F .632(The command line tak)5.633 F .632(es a series)-.1 F
-.442(of \215ags as documented in)102 529.8 R F2 -.37(re)2.942 G(solver).37 E F1
-.442(\(3\) \(with the leading \231RES_\232 deleted\).)B .442
-(Each can be preceded by)5.442 F(an optional `+' or `)102 541.8 Q/F4 10/Symbol
-SF(-)A F1 2.5('. F)B(or e)-.15 E(xample, the line)-.15 E(OIT)142 558 Q(rue +AA)
--.35 E(ONL)-.55 E(Y)-1 E F4(-)2.5 E F1(DNSRCH)A .862(turns on the AA)102 574.2
-R(ONL)-.55 E 3.362(Y\()-1 G .862(accept authoritati)201.658 574.2 R 1.162 -.15
-(ve a)-.25 H .861(nswers only\) and turns of).15 F 3.361(ft)-.25 G .861
-(he DNSRCH \(search the)402.827 574.2 R 2.039(domain path\) options.)102 586.2
-R 2.039(Most resolv)7.039 F 2.039(er libraries def)-.15 F 2.039
-(ault DNSRCH, DEFN)-.1 F 2.039(AMES, and RECURSE)-.35 F .187
-(\215ags on and all others of)102 598.2 R 2.687(f. Note)-.25 F .186
-(the use of the initial `)2.686 F(`T)-.74 E(rue')-.35 E 2.686('\212t)-.74 G
-.186(his is for compatibility with pre)365.82 598.2 R(vi-)-.25 E(ous v)102
-610.2 Q(ersions of sendmail, b)-.15 E(ut is not otherwise necessary)-.2 E(.)
--.65 E -1.11(Ve)127 626.4 S 2.256(rsion le)1.11 F -.15(ve)-.25 G 4.756(l1c).15
-G 2.256(on\214gurations turn DNSRCH and DEFN)200.298 626.4 R 2.257(AMES of)-.35
-F 4.757(fw)-.25 G 2.257(hen doing deli)424.896 626.4 R -.15(ve)-.25 G(ry).15 E
-2.06(lookups, b)102 638.4 R 2.06(ut lea)-.2 F 2.36 -.15(ve t)-.2 H 2.06
-(hem on e).15 F -.15(ve)-.25 G 2.06(rywhere else.).15 F -1.11(Ve)7.06 G 2.06
-(rsion 8 of)1.11 F F2(sendmail)4.56 E F1 2.06(ignores them when doing)4.56 F
-.313(canoni\214cation lookups \(that is, when using $[ ... $]\), and al)102
-650.4 R -.1(wa)-.1 G .313(ys does the search.).1 F .313(If you don')5.313 F
-2.813(tw)-.18 G(ant)491.78 650.4 Q(to do automatic name e)102 662.4 Q
-(xtension, don')-.15 E 2.5(tc)-.18 G(all $[ ... $].)261.93 662.4 Q .189
-(The search rules for $[ ... $] are some)127 678.6 R .189(what dif)-.25 F .189
-(ferent than usual.)-.25 F .189(If the name \(that is, the `)5.189 F(`...)-.74
-E -.74('')-.7 G(\)).74 E .109(has at least one dot, it al)102 690.6 R -.1(wa)
--.1 G .109(ys tries the unmodi\214ed name \214rst.).1 F .11(If that f)5.11 F
-.11(ails, it tries the reduced search)-.1 F .124
-(path, and lastly tries the unmodi\214ed name \(b)102 702.6 R .124
-(ut only for names without a dot, since names with a dot)-.2 F(ha)102 714.6 Q
-.788 -.15(ve a)-.2 H .488(lready been tried\).).15 F .488(This allo)5.488 F
-.489(ws names such as `)-.25 F(`utc.CS')-.74 E 2.989('t)-.74 G 2.989(om)362.805
-714.6 S .489(atch the site in Czechoslo)378.574 714.6 R -.25(va)-.15 G(kia).25
-E EP
-%%Page: 22 19
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 193.36(SMM:08-22 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E/F1 10/Times-Roman@0 SF 1.588
-(rather than the site in your local Computer Science department.)102 96 R 1.587
-(It also prefers A and CN)6.587 F(AME)-.35 E .512(records o)102 108 R -.15(ve)
--.15 G 3.012(rM).15 G 3.012(Xr)163.814 108 S .512
-(ecords \212 that is, if it \214nds an MX record it mak)177.376 108 R .513
-(es note of it, b)-.1 F .513(ut k)-.2 F .513(eeps looking.)-.1 F 1.542(This w)
-102 120 R(ay)-.1 E 4.042(,i)-.65 G 4.042(fy)149.054 120 S 1.541(ou ha)161.426
-120 R 1.841 -.15(ve a w)-.2 H 1.541
-(ildcard MX record matching your domain, it will not assume that all).15 F
-(names match.)102 132 Q F0 2.5(4.10. Mo)87 156 R(ving the P)-.1 E(er)-.2 E
-(-User F)-.37 E(orward Files)-.25 E F1 .772(Some sites mount each user')127
-172.2 R 3.272(sh)-.55 G .772(ome directory from a local disk on their w)256.13
-172.2 R .772(orkstation, so that)-.1 F .576(local access is f)102 184.2 R 3.076
-(ast. Ho)-.1 F(we)-.25 E -.15(ve)-.25 G 1.376 -.4(r, t).15 H .575
-(he result is that .forw).4 F .575(ard \214le lookups are slo)-.1 F 4.375 -.65
-(w. I)-.25 H 3.075(ns).65 G .575(ome cases, mail)439.25 184.2 R .216(can e)102
-196.2 R -.15(ve)-.25 G 2.716(nb).15 G 2.716(ed)144.792 196.2 S(eli)156.948
-196.2 Q -.15(ve)-.25 G .216
-(red on machines inappropriately because of a \214le serv).15 F .216
-(er being do)-.15 F 2.716(wn. The)-.25 F(perfor)2.716 E(-)-.2 E
-(mance can be especially bad if you run the automounter)102 208.2 Q(.)-.55 E
-(The)127 224.4 Q F0(J)2.5 E F1(option allo)2.5 E(ws you to set a path of forw)
--.25 E(ard \214les.)-.1 E -.15(Fo)5 G 2.5(re).15 G
-(xample, the con\214g \214le line)366.6 224.4 Q(OJ/v)142 240.6 Q(ar/forw)-.25 E
-(ard/$u:$z/.forw)-.1 E(ard)-.1 E -.1(wo)102 256.8 S .208
-(uld \214rst look for a \214le with the same name as the user').1 F 2.707(sl)
--.55 G .207(ogin in /v)343.191 256.8 R(ar/forw)-.25 E .207
-(ard; if that is not found)-.1 F .129
-(\(or is inaccessible\) the \214le \231.forw)102 268.8 R .129
-(ard\232 in the user')-.1 F 2.629(sh)-.55 G .13(ome directory is searched.)
-311.901 268.8 R 2.63(At)5.13 G .13(ruly perv)435.02 268.8 R .13(erse site)-.15
-F(could also search by sender by using $r)102 280.8 Q 2.5(,$)-.4 G(s, or $f.)
-269.07 280.8 Q .69(If you create a directory such as /v)127 297 R(ar/forw)-.25
-E .69(ard, it should be mode 1777 \(that is, the stick)-.1 F 3.19(yb)-.15 G(it)
-498.44 297 Q(should be set\).)102 309 Q
-(Users should create the \214les mode 644.)5 E F0 2.5(4.11. Fr)87 333 R
-(ee Space)-.18 E F1 1.122(On systems that ha)127 349.2 R 1.422 -.15(ve t)-.2 H
-(he).15 E/F2 10/Times-Italic@0 SF(statfs)3.622 E F1 1.123
-(\(2\) system call, you can specify a minimum number of free)B .61
-(blocks on the queue \214lesystem using the)102 361.2 R F0(b)3.11 E F1 3.11
-(option. If)3.11 F .61(there are fe)3.11 F .61
-(wer than the indicated number of)-.25 F .406
-(blocks free on the \214lesystem on which the queue is mounted the SMTP serv)
-102 373.2 R .407(er will reject mail with)-.15 F(the 452 error code.)102 385.2
-Q(This in)5 E(vites the SMTP client to try ag)-.4 E(ain later)-.05 E(.)-.55 E
-(Be)127 401.4 Q -.1(wa)-.25 G .746(re of setting this option too high; it can \
-cause rejection of email when that mail w).1 F(ould)-.1 E
-(be processed without dif)102 413.4 Q(\214culty)-.25 E(.)-.65 E 1.772
-(This option can also specify an adv)127 429.6 R 1.773
-(ertised \231maximum message size\232 for hosts that speak)-.15 F(ESMTP)102
-441.6 Q(.)-1.11 E F0 2.5(4.12. Pri)87 465.6 R -.1(va)-.1 G(cy Flags).1 E F1
-(The)127 481.8 Q F0(p)3.591 E F1 1.091(option allo)3.591 F 1.091
-(ws you to set certain `)-.25 F(`pri)-.74 E -.25(va)-.25 G -.15(cy).25 G 2.571
--.74('' \215).15 H 3.591(ags. Actually).74 F 3.59(,m)-.65 G(an)409.27 481.8 Q
-3.59(yo)-.15 G 3.59(ft)432.15 481.8 S 1.09(hem don')441.85 481.8 R 3.59(tg)-.18
-G -2.15 -.25(iv e)492.18 481.8 T .254(you an)102 493.8 R 2.754(ye)-.15 G .254
-(xtra pri)141.088 493.8 R -.25(va)-.25 G -.15(cy).25 G 2.754(,r)-.5 G .254
-(ather just insisting that client SMTP serv)196.666 493.8 R .254
-(ers use the HELO command before)-.15 F(using certain commands.)102 505.8 Q
-.124(The option tak)127 522 R .124
-(es a series of \215ag names; the \214nal pri)-.1 F -.25(va)-.25 G .424 -.15
-(cy i).25 H 2.624(st).15 G .124(he inclusi)367.708 522 R .424 -.15(ve o)-.25 H
-2.624(ro).15 G 2.624(ft)434.06 522 S .123(hose \215ags.)442.794 522 R -.15(Fo)
-5.123 G(r).15 E -.15(ex)102 534 S(ample:).15 E(Op needmailhelo, noe)142 550.2 Q
-(xpn)-.15 E .928(insists that the HELO or EHLO command be used before a MAIL c\
-ommand is accepted and dis-)102 566.4 R(ables the EXPN command.)102 578.4 Q
-.244(The \231restrictmailq\232 option restricts printing the queue to the grou\
-p that o)127 594.6 R .244(wns the queue direc-)-.25 F(tory)102 606.6 Q 5(.I)
--.65 G 2.5(ti)128.29 606.6 S 2.5(sa)136.35 606.6 S
-(bsurd to set this if you don')147.18 606.6 Q 2.5(ta)-.18 G
-(lso protect the logs.)266.72 606.6 Q F0 2.5(4.13. Send)87 630.6 R(to Me T)2.5
-E(oo)-.92 E F1(Normally)127 646.8 Q(,)-.65 E F2(sendmail)3.423 E F1 .923
-(deletes the \(en)3.423 F -.15(ve)-.4 G .923(lope\) sender from an).15 F 3.423
-(yl)-.15 G .924(ist e)375.484 646.8 R 3.424(xpansions. F)-.15 F .924(or e)-.15
-F .924(xample, if)-.15 F .761(\231matt\232 sends to a list that contains \231m\
-att\232 as one of the members he w)102 658.8 R(on')-.1 E 3.261(tg)-.18 G .761
-(et a cop)416.705 658.8 R 3.261(yo)-.1 G 3.261(ft)462.488 658.8 S .761(he mes-)
-471.859 658.8 R 3.066(sage. If)102 670.8 R(the)3.066 E F0<ad6d>3.066 E F1 .566
-(\(me too\) command line \215ag, or if the)3.066 F F0(m)3.067 E F1 .567
-(option is set in the con\214guration \214le, this)3.067 F(beha)102 682.8 Q
-(viour is supressed.)-.2 E(Some sites lik)5 E 2.5(et)-.1 G 2.5(or)265.58 682.8
-S(un the)276.41 682.8 Q/F3 9/Times-Roman@0 SF(SMTP)2.5 E F1(daemon with)2.5 E
-F0<ad6d>2.5 E F1(.)A EP
-%%Page: 23 20
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-23)452.9 60 Q 2.5(5. THE)72 96 R(WHOLE SCOOP ON THE CONFIGURA)2.5 E
-(TION FILE)-.95 E/F1 10/Times-Roman@0 SF .264(This section describes the con\
-\214guration \214le in detail, including hints on ho)112 112.2 R 2.764(wt)-.25
-G 2.763(ow)426.298 112.2 S .263(rite one of your)441.281 112.2 R -.25(ow)87
-124.2 S 2.5(ni).25 G 2.5(fy)109.25 124.2 S(ou ha)120.08 124.2 Q .3 -.15(ve t)
--.2 H(o.).15 E .648(There is one point that should be made clear immediately: \
-the syntax of the con\214guration \214le is)112 140.4 R 1.077
-(designed to be reasonably easy to parse, since this is done e)87 152.4 R -.15
-(ve)-.25 G 1.076(ry time).15 F/F2 10/Times-Italic@0 SF(sendmail)3.576 E F1
-1.076(starts up, rather than)3.576 F(easy for a human to read or write.)87
-164.4 Q
-(On the \231future project\232 list is a con\214guration-\214le compiler)5 E(.)
--.55 E(An o)112 180.6 Q -.15(ve)-.15 G(rvie).15 E 2.5(wo)-.25 G 2.5(ft)170.88
-180.6 S(he con\214guration \214le is gi)179.49 180.6 Q -.15(ve)-.25 G 2.5<6e8c>
-.15 G(rst, follo)301.59 180.6 Q(wed by details of the semantics.)-.25 E F0 2.5
-(5.1. Con\214guration)87 204.6 R(File Lines)2.5 E F1 1.315
-(The con\214guration \214le is or)127 220.8 R -.05(ga)-.18 G 1.316
-(nized as a series of lines, each of which be).05 F 1.316(gins with a single)
--.15 F .742(character de\214ning the semantics for the rest of the line.)102
-232.8 R .742(Lines be)5.742 F .741(ginning with a space or a tab are)-.15 F
-1.148
-(continuation lines \(although the semantics are not well de\214ned in man)102
-244.8 R 3.649(yp)-.15 G 3.649(laces\). Blank)407.513 244.8 R 1.149(lines and)
-3.649 F(lines be)102 256.8 Q(ginning with a sharp symbol \(`#'\) are comments.)
--.15 E F0 2.5(5.1.1. R)102 280.8 R(and S \212 r)2.5 E(ewriting rules)-.18 E F1
-.407(The core of address parsing are the re)142 297 R .406(writing rules.)-.25
-F .406(These are an ordered production sys-)5.406 F(tem.)117 309 Q F2(Sendmail)
-5.282 E F1 .282(scans through the set of re)2.782 F .283
-(writing rules looking for a match on the left hand side)-.25 F .132
-(\(LHS\) of the rule.)117 321 R .131(When a rule matches, the address is repla\
-ced by the right hand side \(RHS\) of)5.131 F(the rule.)117 333 Q 1.125
-(There are se)142 349.2 R -.15(ve)-.25 G 1.125(ral sets of re).15 F 1.126
-(writing rules.)-.25 F 1.126(Some of the re)6.126 F 1.126
-(writing sets are used internally)-.25 F .21(and must ha)117 361.2 R .51 -.15
-(ve s)-.2 H .21(peci\214c semantics.).15 F .21(Other re)5.21 F .21
-(writing sets do not ha)-.25 F .51 -.15(ve s)-.2 H .21
-(peci\214cally assigned seman-).15 F
-(tics, and may be referenced by the mailer de\214nitions or by other re)117
-373.2 Q(writing sets.)-.25 E(The syntax of these tw)142 389.4 Q 2.5(oc)-.1 G
-(ommands are:)244.38 389.4 Q F0(S)157 405.6 Q F2(n)A F1 .277
-(Sets the current ruleset being collected to)117 421.8 R F2(n)2.778 E F1 5.278
-(.I)C 2.778(fy)302.52 421.8 S .278(ou be)313.628 421.8 R .278
-(gin a ruleset more than once it deletes the)-.15 F(old de\214nition.)117 433.8
-Q F0(R)157 450 Q F2(lhs rhs comments)A F1 .303(The \214elds must be separated \
-by at least one tab character; there may be embedded spaces in the)117 466.2 R
-2.738(\214elds. The)117 478.2 R F2(lhs)2.738 E F1 .238
-(is a pattern that is applied to the input.)2.738 F .239
-(If it matches, the input is re)5.239 F .239(written to the)-.25 F F2(rhs)117
-490.2 Q F1 5(.T)C(he)143.39 490.2 Q F2(comments)2.5 E F1(are ignored.)2.5 E
-2.266(Macro e)142 506.4 R 2.266(xpansions of the form)-.15 F F0($)4.766 E F2(x)
-A F1 2.265(are performed when the con\214guration \214le is read.)4.765 F .08
-(Expansions of the form)117 518.4 R F0($&)2.58 E F2(x)A F1 .081
-(are performed at run time using a some)2.58 F .081
-(what less general algorithm.)-.25 F .639
-(This for is intended only for referencing internally de\214ned macros such as)
-117 530.4 R F0($h)3.138 E F1 .638(that are changed)3.138 F(at runtime.)117
-542.4 Q F0 2.5(5.1.1.1. The)117 566.4 R(left hand side)2.5 E F1 1.617
-(The left hand side of re)157 582.6 R 1.617(writing rules contains a pattern.)
--.25 F 1.617(Normal w)6.617 F 1.617(ords are simply)-.1 F(matched directly)132
-594.6 Q 5(.M)-.65 G(etasyntax is introduced using a dollar sign.)214.67 594.6 Q
-(The metasymbols are:)5 E F0($*)172 610.8 Q F1(Match zero or more tok)192.14
-610.8 Q(ens)-.1 E F0($+)172 622.8 Q F1(Match one or more tok)9.44 E(ens)-.1 E
-F0<24ad>172 634.8 Q F1(Match e)9.44 E(xactly one tok)-.15 E(en)-.1 E F0($=)172
-646.8 Q F2(x)A F1(Match an)5 E 2.5(yp)-.15 G(hrase in class)241.98 646.8 Q F2
-(x)2.5 E F0($~)172 658.8 Q F2(x)A F1(Match an)7.37 E 2.5(yw)-.15 G
-(ord not in class)244.1 658.8 Q F2(x)2.5 E F1 .499(If an)132 675 R 2.999(yo)
--.15 G 2.999(ft)163.948 675 S .499(hese match, the)173.057 675 R 2.999(ya)-.15
-G .499(re assigned to the symbol)248.274 675 R F0($)2.999 E F2(n)A F1 .498
-(for replacement on the right hand)2.999 F(side, where)132 687 Q F2(n)2.5 E F1
-(is the inde)2.5 E 2.5(xi)-.15 G 2.5(nt)238.78 687 S(he LHS.)249.06 687 Q -.15
-(Fo)5 G 2.5(re).15 G(xample, if the LHS:)307.92 687 Q($\255:$+)172 703.2 Q
-(is applied to the input:)132 719.4 Q EP
-%%Page: 24 21
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 193.36(SMM:08-24 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E/F1 10/Times-Roman@0 SF(UCB)172 96 Q
-(ARP)-.35 E(A:eric)-.92 E(the rule will match, and the v)132 112.2 Q
-(alues passed to the RHS will be:)-.25 E 7.5($1 UCB)172 128.4 R(ARP)-.35 E(A)
--.92 E 7.5($2 eric)172 140.4 R(Additionally)157 160.8 Q 3.398(,t)-.65 G .898
-(he LHS can include)215.588 160.8 R F0($@)3.398 E F1 .898(to match zero tok)
-3.398 F 3.398(ens. This)-.1 F(is)3.398 E/F2 10/Times-Italic@0 SF(not)3.398 E F1
-.898(bound to a)3.398 F F0($)132 172.8 Q F2(N)A F1 .837(on the RHS, and is nor\
-mally only used when it stands alone in order to match the null)3.338 F(input.)
-132 184.8 Q F0 2.5(5.1.1.2. The)117 208.8 R(right hand side)2.5 E F1 .525
-(When the left hand side of a re)157 225 R .526
-(writing rule matches, the input is deleted and replaced)-.25 F .932
-(by the right hand side.)132 237 R -.8(To)5.932 G -.1(ke).8 G .932
-(ns are copied directly from the RHS unless the).1 F 3.432(yb)-.15 G -.15(eg)
-457.848 237 S .931(in with a).15 F(dollar sign.)132 249 Q(Metasymbols are:)5 E
-F0($)172 265.2 Q F2(n)A F1(Substitute inde\214nite tok)222.55 265.2 Q(en)-.1 E
-F2(n)2.5 E F1(from LHS)2.5 E F0($[)172 277.2 Q F2(name)A F0($])A F1
-(Canonicalize)222.55 277.2 Q F2(name)2.5 E F0($\()172 289.2 Q F2(map k)A -.3
-(ey)-.1 G F0($@)2.8 E F2(ar)A(guments)-.37 E F0($:)2.5 E F2(default)A F0($\))
-2.5 E F1(Generalized k)222.55 301.2 Q -.15(ey)-.1 G(ed mapping function).15 E
-F0($>)172 313.2 Q F2(n)A F1(\231Call\232 ruleset)222.55 313.2 Q F2(n)2.5 E F0
-($#)172 325.2 Q F2(mailer)A F1(Resolv)222.55 325.2 Q 2.5(et)-.15 G(o)259.9
-325.2 Q F2(mailer)2.5 E F0($@)172 337.2 Q F2(host)A F1(Specify)222.55 337.2 Q
-F2(host)2.5 E F0($:)172 349.2 Q F2(user)A F1(Specify)222.55 349.2 Q F2(user)2.5
-E F1(The)157 369.6 Q F0($)3.012 E F2(n)A F1 .512
-(syntax substitutes the corresponding v)3.012 F .513(alue from a)-.25 F F0($+)
-3.013 E F1(,)A F0<24ad>3.013 E F1(,)A F0($*)3.013 E F1(,)A F0($=)3.013 E F1
-3.013(,o)C(r)461.874 369.6 Q F0($~)3.013 E F1(match)3.013 E(on the LHS.)132
-381.6 Q(It may be used an)5 E(ywhere.)-.15 E 2.701(Ah)157 397.8 S .201
-(ost name enclosed between)171.921 397.8 R F0($[)2.7 E F1(and)2.7 E F0($])2.7 E
-F1 .2(is look)2.7 F .2(ed up using the)-.1 F F2 -.1(ge)2.7 G(thostent).1 E F1
-.2(\(3\) routines)1.666 F 3.332(and replaced by the canonical name)132 411.8 R
-/F3 7/Times-Roman@0 SF(7)291.672 407.8 Q F1 8.333(.F)295.172 411.8 S 3.333
-(or e)311.415 411.8 R 3.333(xample, \231$[csam$]\232 might become \231lbl-)-.15
-F 1.924(csam.arpa\232 and \231$[[128.32.130.2]$]\232 w)132 423.8 R 1.923
-(ould become \231v)-.1 F(angogh.CS.Berk)-.25 E(ele)-.1 E -.65(y.)-.15 G(EDU.)
-.65 E<9a>-.7 E F2(Send-)6.923 E(mail)132 435.8 Q F1 .435(recognizes it')2.935 F
-2.935(sn)-.55 G .436(umeric IP address without calling the name serv)218.575
-435.8 R .436(er and replaces it with)-.15 F(it')132 447.8 Q 2.5(sc)-.55 G
-(anonical name.)151.17 447.8 Q(The)157 464 Q F0($\()2.862 E F1(...)2.862 E F0
-($\))5.361 E F1 .361
-(syntax is a more general form of lookup; it uses a named map instead of)2.861
-F .124(an implicit map.)132 476 R .125(If no lookup is found, the indicted)
-5.124 F F2(default)2.625 E F1 .125(is inserted; if no def)2.625 F .125
-(ault is speci-)-.1 F(\214ed and no lookup matches, the v)132 488 Q
-(alue is left unchanged.)-.25 E(The)157 504.2 Q F0($>)3.572 E F2(n)A F1 1.071
-(syntax causes the remainder of the line to be substituted as usual and then)
-3.572 F .571(passed as the ar)132 516.2 R .572(gument to ruleset)-.18 F F2(n)
-3.072 E F1 5.572(.T)C .572(he \214nal v)288.852 516.2 R .572(alue of ruleset)
--.25 F F2(n)3.072 E F1 .572(then becomes the substitu-)3.072 F
-(tion for this rule.)132 528.2 Q(The)157 544.4 Q F0($#)3.097 E F1 .597
-(syntax should)3.097 F F2(only)3.097 E F1 .597(be used in ruleset zero.)3.097 F
-.596(It causes e)5.597 F -.25(va)-.25 G .596(luation of the ruleset).25 F .606
-(to terminate immediately)132 556.4 R 3.106(,a)-.65 G .607
-(nd signals to sendmail that the address has completely resolv)243.158 556.4 R
-(ed.)-.15 E(The complete syntax is:)132 568.4 Q F0($#)172 584.6 Q F2(mailer)A
-F0($@)2.5 E F2(host)A F0($:)2.5 E F2(user)A F1 .394
-(This speci\214es the {mailer)132 600.8 R 2.894(,h)-.4 G .394
-(ost, user} 3-tuple necessary to direct the mailer)245.466 600.8 R 5.394(.I)
--.55 G 2.894(ft)447.548 600.8 S .394(he mailer is)456.552 600.8 R .136
-(local the host part may be omitted)132 614.8 R F3(8)268.916 610.8 Q F1 5.136
-(.T)272.416 614.8 S(he)286.162 614.8 Q F2(mailer)2.636 E F1 .135
-(must be a single w)2.636 F .135(ord, b)-.1 F .135(ut the)-.2 F F2(host)2.635 E
-F1(and)2.635 E F2(user)2.635 E F1 .251(may be multi-part.)132 626.8 R .252
-(If the)5.252 F F2(mailer)2.752 E F1 .252(is the b)2.752 F .252
-(uiltin IPC mailer)-.2 F 2.752(,t)-.4 G(he)369.72 626.8 Q F2(host)2.752 E F1
-.252(may be a colon-separated)2.752 F 2.439
-(list of hosts that are searched in order for the \214rst w)132 638.8 R 2.438
-(orking address \(e)-.1 F 2.438(xactly lik)-.15 F 4.938(eM)-.1 G(X)496.78 638.8
-Q(records\).)132 650.8 Q .32 LW 76 660.4 72 660.4 DL 80 660.4 76 660.4 DL 84
-660.4 80 660.4 DL 88 660.4 84 660.4 DL 92 660.4 88 660.4 DL 96 660.4 92 660.4
-DL 100 660.4 96 660.4 DL 104 660.4 100 660.4 DL 108 660.4 104 660.4 DL 112
-660.4 108 660.4 DL 116 660.4 112 660.4 DL 120 660.4 116 660.4 DL 124 660.4 120
-660.4 DL 128 660.4 124 660.4 DL 132 660.4 128 660.4 DL 136 660.4 132 660.4 DL
-140 660.4 136 660.4 DL 144 660.4 140 660.4 DL 148 660.4 144 660.4 DL 152 660.4
-148 660.4 DL 156 660.4 152 660.4 DL 160 660.4 156 660.4 DL 164 660.4 160 660.4
-DL 168 660.4 164 660.4 DL 172 660.4 168 660.4 DL 176 660.4 172 660.4 DL 180
-660.4 176 660.4 DL 184 660.4 180 660.4 DL 188 660.4 184 660.4 DL 192 660.4 188
-660.4 DL 196 660.4 192 660.4 DL 200 660.4 196 660.4 DL 204 660.4 200 660.4 DL
-208 660.4 204 660.4 DL 212 660.4 208 660.4 DL 216 660.4 212 660.4 DL/F4 5
-/Times-Roman@0 SF(7)93.6 670.8 Q/F5 8/Times-Roman@0 SF
-(This is actually completely equi)3.2 I -.2(va)-.2 G(lent to $\(host).2 E/F6 8
-/Times-Italic@0 SF(hostname)2 E F5 2($\). In)B(particular)2 E 2(,a)-.32 G/F7 8
-/Times-Bold@0 SF($:)A F5(def)2 E(ault can be used.)-.08 E F4(8)93.6 684.4 Q F5
--.88(Yo)3.2 K 2.207(um).88 G .207(ay w)117.427 687.6 R .208
-(ant to use it for special \231per user\232 e)-.08 F 2.208(xtensions. F)-.12 F
-.208(or e)-.12 F .208
-(xample, at CMU you can send email to \231jgm+foo\232; the part af-)-.12 F(ter\
- the plus sign is not part of the user name, and is passed to the local mailer\
- for local use.)72 697.2 Q EP
-%%Page: 25 22
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-25)452.9 60 Q/F1 10/Times-Roman@0 SF 3.794(AR)157 96 S 1.294
-(HS may also be preceded by a)174.684 96 R F0($@)3.795 E F1 1.295(or a)3.795 F
-F0($:)3.795 E F1 1.295(to control e)3.795 F -.25(va)-.25 G 3.795(luation. A).25
-F F0($@)3.795 E F1(pre\214x)3.795 E .611
-(causes the ruleset to return with the remainder of the RHS as the v)132 108 R
-3.11(alue. A)-.25 F F0($:)3.11 E F1 .61(pre\214x causes)3.11 F .431
-(the rule to terminate immediately)132 120 R 2.931(,b)-.65 G .431
-(ut the ruleset to continue; this can be used to a)276.625 120 R -.2(vo)-.2 G
-.432(id con-).2 F(tinued application of a rule.)132 132 Q
-(The pre\214x is stripped before continuing.)5 E(The)157 148.2 Q F0($@)2.5 E F1
-(and)2.5 E F0($:)2.5 E F1(pre\214x)2.5 E(es may precede a)-.15 E F0($>)2.5 E F1
-(spec; for e)2.5 E(xample:)-.15 E 20.19(R$+ $:)172 164.4 R($>7 $1)2.5 E .256
-(matches an)132 180.6 R .256(ything, passes that to ruleset se)-.15 F -.15(ve)
--.25 G .256(n, and continues; the).15 F F0($:)2.756 E F1 .256
-(is necessary to a)2.756 F -.2(vo)-.2 G .256(id an).2 F(in\214nite loop.)132
-192.6 Q .051(Substitution occurs in the order described, that is, parameters f\
-rom the LHS are substi-)157 208.8 R .556(tuted, hostnames are canonicalized, \
-\231subroutines\232 are called, and \214nally)132 220.8 R F0($#)3.056 E F1(,)A
-F0($@)3.056 E F1 3.056(,a)C(nd)467.348 220.8 Q F0($:)3.056 E F1(are)3.056 E
-(processed.)132 232.8 Q F0 2.5(5.1.1.3. Semantics)117 256.8 R(of r)2.5 E
-(ewriting rule sets)-.18 E F1 2.921(There are \214v)157 273 R 5.421(er)-.15 G
--.25(ew)226.973 273 S 2.922(riting sets that ha).25 F 3.222 -.15(ve s)-.2 H
-2.922(peci\214c semantics.).15 F 2.922(These are related as)7.922 F
-(depicted by \214gure 2.)132 285 Q 1.092
-(Ruleset three should turn the address into \231canonical form.)157 301.2 R
-6.091<9a54>-.7 G 1.091(his form should ha)416.917 301.2 R -.15(ve)-.2 G
-(the basic syntax:)132 313.2 Q(local-part@host-domain-spec)172 329.4 Q 1.295
-(If no \231@\232 sign is speci\214ed, then the host-domain-spec)132 345.6 R/F2
-10/Times-Italic@0 SF(may)3.796 E F1 1.296(be appended from the sender)3.796 F
-1.284(address \(if the)132 357.6 R F0(C)3.784 E F1 1.284
-(\215ag is set in the mailer de\214nition corresponding to the)3.784 F F2
-(sending)3.784 E F1(mailer\).)3.784 E
-(Ruleset three is applied by sendmail before doing an)132 369.6 Q
-(ything with an)-.15 E 2.5(ya)-.15 G(ddress.)411.39 369.6 Q .506(Ruleset zero \
-is applied after ruleset three to addresses that are going to actually spec-)
-157 385.8 R .296(ify recipients.)132 397.8 R .296(It must resolv)5.296 F 2.796
-(et)-.15 G 2.796(oa)258.04 397.8 S F2({mailer)A 2.796(,h)-1.11 G .296
-(ost, user})312.368 397.8 R F1 2.795(triple. The)2.796 F F2(mailer)2.795 E F1
-.295(must be de\214ned in)2.795 F .56
-(the mailer de\214nitions from the con\214guration \214le.)132 409.8 R(The)
-5.561 E F2(host)3.061 E F1 .561(is de\214ned into the)3.061 F F0($h)3.061 E F1
-.561(macro for)3.061 F(use in the ar)132 421.8 Q(gv e)-.18 E
-(xpansion of the speci\214ed mailer)-.15 E(.)-.55 E 1.357(Rulesets one and tw)
-157 438 R 3.857(oa)-.1 G 1.357
-(re applied to all sender and recipient addresses respecti)254.538 438 R -.15
-(ve)-.25 G(ly).15 E(.)-.65 E(The)132 450 Q 2.5(ya)-.15 G(re applied before an)
-159.34 450 Q 2.5(ys)-.15 G(peci\214cation in the mailer de\214nition.)250.27
-450 Q(The)5 E 2.5(ym)-.15 G(ust ne)429 450 Q -.15(ve)-.25 G 2.5(rr).15 G(esolv)
-470.81 450 Q(e.)-.15 E .4 LW 77 483.6 72 483.6 DL 79 483.6 74 483.6 DL 84 483.6
-79 483.6 DL 89 483.6 84 483.6 DL 94 483.6 89 483.6 DL 99 483.6 94 483.6 DL 104
-483.6 99 483.6 DL 109 483.6 104 483.6 DL 114 483.6 109 483.6 DL 119 483.6 114
-483.6 DL 124 483.6 119 483.6 DL 129 483.6 124 483.6 DL 134 483.6 129 483.6 DL
-139 483.6 134 483.6 DL 144 483.6 139 483.6 DL 149 483.6 144 483.6 DL 154 483.6
-149 483.6 DL 159 483.6 154 483.6 DL 164 483.6 159 483.6 DL 169 483.6 164 483.6
-DL 174 483.6 169 483.6 DL 179 483.6 174 483.6 DL 184 483.6 179 483.6 DL 189
-483.6 184 483.6 DL 194 483.6 189 483.6 DL 199 483.6 194 483.6 DL 204 483.6 199
-483.6 DL 209 483.6 204 483.6 DL 214 483.6 209 483.6 DL 219 483.6 214 483.6 DL
-224 483.6 219 483.6 DL 229 483.6 224 483.6 DL 234 483.6 229 483.6 DL 239 483.6
-234 483.6 DL 244 483.6 239 483.6 DL 249 483.6 244 483.6 DL 254 483.6 249 483.6
-DL 259 483.6 254 483.6 DL 264 483.6 259 483.6 DL 269 483.6 264 483.6 DL 274
-483.6 269 483.6 DL 279 483.6 274 483.6 DL 284 483.6 279 483.6 DL 289 483.6 284
-483.6 DL 294 483.6 289 483.6 DL 299 483.6 294 483.6 DL 304 483.6 299 483.6 DL
-309 483.6 304 483.6 DL 314 483.6 309 483.6 DL 319 483.6 314 483.6 DL 324 483.6
-319 483.6 DL 329 483.6 324 483.6 DL 334 483.6 329 483.6 DL 339 483.6 334 483.6
-DL 344 483.6 339 483.6 DL 349 483.6 344 483.6 DL 354 483.6 349 483.6 DL 359
-483.6 354 483.6 DL 364 483.6 359 483.6 DL 369 483.6 364 483.6 DL 374 483.6 369
-483.6 DL 379 483.6 374 483.6 DL 384 483.6 379 483.6 DL 389 483.6 384 483.6 DL
-394 483.6 389 483.6 DL 399 483.6 394 483.6 DL 404 483.6 399 483.6 DL 409 483.6
-404 483.6 DL 414 483.6 409 483.6 DL 419 483.6 414 483.6 DL 424 483.6 419 483.6
-DL 429 483.6 424 483.6 DL 434 483.6 429 483.6 DL 439 483.6 434 483.6 DL 444
-483.6 439 483.6 DL 449 483.6 444 483.6 DL 454 483.6 449 483.6 DL 459 483.6 454
-483.6 DL 464 483.6 459 483.6 DL 469 483.6 464 483.6 DL 474 483.6 469 483.6 DL
-479 483.6 474 483.6 DL 484 483.6 479 483.6 DL 489 483.6 484 483.6 DL 494 483.6
-489 483.6 DL 499 483.6 494 483.6 DL 504 483.6 499 483.6 DL(addr)91.915 578 Q
-133.2 576 111.6 576 DL 133.2 576 126 577.8 DL 133.2 576 126 574.2 DL(3)141.5
-578 Q 133.2 565.2 133.2 586.8 DL 154.8 565.2 133.2 565.2 DL 154.8 586.8 154.8
-565.2 DL 133.2 586.8 154.8 586.8 DL 176.4 576 154.8 576 DL 176.4 576 169.2
-577.8 DL 176.4 576 169.2 574.2 DL(D)183.59 578 Q 176.4 565.2 176.4 586.8 DL 198
-565.2 176.4 565.2 DL 198 586.8 198 565.2 DL 176.4 586.8 198 586.8 DL 219.6 576
-198 576 DL 277.2 558 255.6 558 DL 277.2 558 270 559.8 DL 277.2 558 270 556.2 DL
-(1)285.5 560 Q 277.2 547.2 277.2 568.8 DL 298.8 547.2 277.2 547.2 DL 298.8
-568.8 298.8 547.2 DL 277.2 568.8 298.8 568.8 DL 320.4 558 298.8 558 DL 320.4
-558 313.2 559.8 DL 320.4 558 313.2 556.2 DL(S)328.42 560 Q 320.4 547.2 320.4
-568.8 DL 342 547.2 320.4 547.2 DL 342 568.8 342 547.2 DL 320.4 568.8 342 568.8
-DL 363.6 558 342 558 DL 277.2 594 255.6 594 DL 277.2 594 270 595.8 DL 277.2 594
-270 592.2 DL(2)285.5 596 Q 277.2 583.2 277.2 604.8 DL 298.8 583.2 277.2 583.2
-DL 298.8 604.8 298.8 583.2 DL 277.2 604.8 298.8 604.8 DL 320.4 594 298.8 594 DL
-320.4 594 313.2 595.8 DL 320.4 594 313.2 592.2 DL(R)327.865 596 Q 320.4 583.2
-320.4 604.8 DL 342 583.2 320.4 583.2 DL 342 604.8 342 583.2 DL 320.4 604.8 342
-604.8 DL 363.6 594 342 594 DL 421.2 576 399.6 576 DL 421.2 576 414 577.8 DL
-421.2 576 414 574.2 DL(4)429.5 578 Q 421.2 565.2 421.2 586.8 DL 442.8 565.2
-421.2 565.2 DL 442.8 586.8 442.8 565.2 DL 421.2 586.8 442.8 586.8 DL 464.4 576
-442.8 576 DL 464.4 576 457.2 577.8 DL 464.4 576 457.2 574.2 DL(msg)466.865 578
-Q 255.6 558 219.6 576 DL 255.6 594 219.6 576 DL 399.6 576 363.6 558 DL 399.6
-576 363.6 594 DL 208.8 522 187.2 522 DL 208.8 522 201.6 523.8 DL 208.8 522
-201.6 520.2 DL(0)217.1 524 Q 208.8 511.2 208.8 532.8 DL 230.4 511.2 208.8 511.2
-DL 230.4 532.8 230.4 511.2 DL 208.8 532.8 230.4 532.8 DL 252 522 230.4 522 DL
-252 522 244.8 523.8 DL 252 522 244.8 520.2 DL(resolv)265.69 524 Q(ed address)
--.15 E 187.2 522 162 576 DL(Figure 2 \212 Re)216.045 624 Q
-(writing set semantics)-.25 E 2.5(D\212s)209.35 636 S(ender domain addition)
-235.46 636 Q 2.5(S\212m)209.35 648 S(ailer)237.69 648 Q(-speci\214c sender re)
--.2 E(writing)-.25 E 2.5(R\212m)209.35 660 S(ailer)238.8 660 Q
-(-speci\214c recipient re)-.2 E(writing)-.25 E 77 672 72 672 DL 79 672 74 672
-DL 84 672 79 672 DL 89 672 84 672 DL 94 672 89 672 DL 99 672 94 672 DL 104 672
-99 672 DL 109 672 104 672 DL 114 672 109 672 DL 119 672 114 672 DL 124 672 119
-672 DL 129 672 124 672 DL 134 672 129 672 DL 139 672 134 672 DL 144 672 139 672
-DL 149 672 144 672 DL 154 672 149 672 DL 159 672 154 672 DL 164 672 159 672 DL
-169 672 164 672 DL 174 672 169 672 DL 179 672 174 672 DL 184 672 179 672 DL 189
-672 184 672 DL 194 672 189 672 DL 199 672 194 672 DL 204 672 199 672 DL 209 672
-204 672 DL 214 672 209 672 DL 219 672 214 672 DL 224 672 219 672 DL 229 672 224
-672 DL 234 672 229 672 DL 239 672 234 672 DL 244 672 239 672 DL 249 672 244 672
-DL 254 672 249 672 DL 259 672 254 672 DL 264 672 259 672 DL 269 672 264 672 DL
-274 672 269 672 DL 279 672 274 672 DL 284 672 279 672 DL 289 672 284 672 DL 294
-672 289 672 DL 299 672 294 672 DL 304 672 299 672 DL 309 672 304 672 DL 314 672
-309 672 DL 319 672 314 672 DL 324 672 319 672 DL 329 672 324 672 DL 334 672 329
-672 DL 339 672 334 672 DL 344 672 339 672 DL 349 672 344 672 DL 354 672 349 672
-DL 359 672 354 672 DL 364 672 359 672 DL 369 672 364 672 DL 374 672 369 672 DL
-379 672 374 672 DL 384 672 379 672 DL 389 672 384 672 DL 394 672 389 672 DL 399
-672 394 672 DL 404 672 399 672 DL 409 672 404 672 DL 414 672 409 672 DL 419 672
-414 672 DL 424 672 419 672 DL 429 672 424 672 DL 434 672 429 672 DL 439 672 434
-672 DL 444 672 439 672 DL 449 672 444 672 DL 454 672 449 672 DL 459 672 454 672
-DL 464 672 459 672 DL 469 672 464 672 DL 474 672 469 672 DL 479 672 474 672 DL
-484 672 479 672 DL 489 672 484 672 DL 494 672 489 672 DL 499 672 494 672 DL 504
-672 499 672 DL EP
-%%Page: 26 23
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 193.36(SMM:08-26 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E/F1 10/Times-Roman@0 SF .265
-(Ruleset four is applied to all addresses in the message.)157 96 R .266
-(It is typically used to translate)5.265 F(internal to e)132 108 Q
-(xternal form.)-.15 E F0 2.5(5.1.1.4. IPC)117 132 R(mailers)2.5 E F1 .333
-(Some special processing occurs if the ruleset zero resolv)157 148.2 R .332
-(es to an IPC mailer \(that is, a)-.15 F .241
-(mailer that has \231[IPC]\232 listed as the P)132 160.2 R .241(ath in the)-.15
-F F0(M)2.741 E F1 .241(con\214guration line.)2.741 F .242(The host name passed)
-5.242 F .885(after \231$@\232 has MX e)132 172.2 R .885
-(xpansion performed; this looks the name up in DNS to \214nd alternate)-.15 F
-(deli)132 184.2 Q -.15(ve)-.25 G(ry sites.).15 E(The host name can also be pro)
-157 200.4 Q(vided as a dotted quad in square brack)-.15 E(ets; for e)-.1 E
-(xample:)-.15 E([128.32.149.78])172 216.6 Q(This causes direct con)132 232.8 Q
--.15(ve)-.4 G(rsion of the numeric v).15 E(alue to a TCP/IP host address.)-.25
-E .894(The host name passed in after the \231$@\232 may also be a colon-separa\
-ted list of hosts.)157 249 R .63(Each is separately MX e)132 261 R .629
-(xpanded and the results are concatenated to mak)-.15 F 3.129(e\()-.1 G .629
-(essentially\) one)440.881 261 R .378(long MX list.)132 273 R .378
-(The intent here is to create \231f)5.378 F(ak)-.1 E .378
-(e\232 MX records that are not published in DNS)-.1 F(for pri)132 285 Q -.25
-(va)-.25 G(te internal netw).25 E(orks.)-.1 E .17
-(As a \214nal special case, the host name can be passed in as a te)157 301.2 R
-.17(xt string in square brack-)-.15 F(ets:)132 313.2 Q([ucb)172 329.4 Q -.25
-(va)-.15 G(x.berk).25 E(ele)-.1 E -.65(y.)-.15 G(edu]).65 E 1.244(This form a)
-132 345.6 R -.2(vo)-.2 G 1.244(ids the MX mapping.).2 F F0(N.B.:)6.244 E F1
-1.245(This is intended only for situations where you)3.744 F(ha)132 357.6 Q
-.814 -.15(ve a n)-.2 H(etw).15 E .514(ork \214re)-.1 F -.1(wa)-.25 G .514
-(ll, so that your MX record points to a g).1 F(ate)-.05 E -.1(wa)-.25 G 3.014
-(ym).1 G .514(achine; this machine)420.762 357.6 R 1.603
-(could then do direct deli)132 369.6 R -.15(ve)-.25 G 1.604
-(ry to machines within your local domain.).15 F 1.604(Use of this feature)6.604
-F(directly violates RFC 1123 section 5.3.5: it should not be used lightly)132
-381.6 Q(.)-.65 E F0 2.5(5.1.2. D)102 405.6 R 2.5<8a64>2.5 G(e\214ne macr)157.28
-405.6 Q(o)-.18 E F1 .547(Macros are named with a single character)142 421.8 R
-5.546(.T)-.55 G .546(hese may be selected from the entire ASCII)325.498 421.8 R
-.892(set, b)117 433.8 R .892(ut user)-.2 F .892
-(-de\214ned macros should be selected from the set of upper case letters only)
--.2 F 5.892(.L)-.65 G -.25(ow)484.26 433.8 S(er).25 E
-(case letters and special symbols are used internally)117 445.8 Q(.)-.65 E
-(The syntax for macro de\214nitions is:)142 462 Q F0(D)157 478.2 Q/F2 10
-/Times-Italic@0 SF 1.666(xv)C(al)-1.666 E F1(where)117 494.4 Q F2(x)2.5 E F1
-(is the name of the macro and)2.5 E F2(val)2.5 E F1(is the v)2.5 E
-(alue it should ha)-.25 E -.15(ve)-.2 G(.).15 E 1.085
-(Macros are interpolated using the construct)142 510.6 R F0($)3.585 E F2(x)A F1
-3.585(,w)C(here)346.775 510.6 Q F2(x)3.585 E F1 1.085
-(is the name of the macro to be)3.585 F 3.45(interpolated. This)117 522.6 R .95
-(interpolation is done when the con\214guration \214le is read, e)3.45 F .95
-(xcept in)-.15 F F0(M)3.45 E F1(lines.)3.45 E(The special construct)117 534.6 Q
-F0($&)2.5 E F2(x)A F1(can be used in)2.5 E F0(R)2.5 E F1
-(lines to get deferred interpolation.)2.5 E
-(Conditionals can be speci\214ed using the syntax:)142 550.8 Q($?x te)157 567 Q
-(xt1 $| te)-.15 E(xt2 $.)-.15 E .246(This interpolates)117 583.2 R F2(te)2.746
-E(xt1)-.2 E F1 .246(if the macro)2.746 F F0($x)2.745 E F1 .245(is set, and)
-2.745 F F2(te)2.745 E(xt2)-.2 E F1 2.745(otherwise. The)2.745 F .245
-(\231else\232 \()2.745 F F0($|)A F1 2.745(\)c)C .245(lause may be)451.3 583.2 R
-(omitted.)117 595.2 Q(Lo)142 611.4 Q .261(wer case macro names are reserv)-.25
-F .261(ed to ha)-.15 F .562 -.15(ve s)-.2 H .262
-(pecial semantics, used to pass information).15 F 1.163
-(in or out of sendmail, and special characters are reserv)117 623.4 R 1.163
-(ed to pro)-.15 F 1.163(vide conditionals, etc.)-.15 F(Upper)6.162 E
-(case names \(that is,)117 635.4 Q F0($A)2.5 E F1(through)2.5 E F0($Z)2.5 E F1
-2.5(\)a)C(re speci\214cally reserv)267.53 635.4 Q
-(ed for con\214guration \214le authors.)-.15 E(The follo)142 651.6 Q
-(wing macros)-.25 E F2(must)2.5 E F1(be de\214ned to transmit information into)
-2.5 E F2(sendmail:)2.5 E EP
-%%Page: 27 24
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-27)452.9 60 Q/F1 10/Times-Roman@0 SF 15.56(eT)157 96 S
-(he SMTP entry message)183.11 96 Q 17.22(jT)157 108 S(he \231of)183.11 108 Q
-(\214cial\232 domain name for this site)-.25 E 17.22(lT)157 120 S
-(he format of the UNIX from line)183.11 120 Q 15(nT)157 132 S
-(he name of the daemon \(for error messages\))183.11 132 Q 15(oT)157 144 S
-(he set of "operators" in addresses)183.11 144 Q 15(qd)157 156 S(ef)182 156 Q
-(ault format of sender address)-.1 E(The)117 172.2 Q F0($e)2.656 E F1 .157
-(macro is printed out when SMTP starts up.)2.656 F .157(The \214rst w)5.157 F
-.157(ord must be the)-.1 F F0($j)2.657 E F1 2.657(macro. The)2.657 F F0($j)
-2.657 E F1 .536(macro should be in RFC821 format.)117 184.2 R(The)5.536 E F0
-($l)3.036 E F1(and)3.036 E F0($n)3.036 E F1 .536
-(macros can be considered constants e)3.036 F(xcept)-.15 E .782
-(under terribly unusual circumstances.)117 196.2 R(The)5.783 E F0($o)3.283 E F1
-.783(macro consists of a list of characters which will)3.283 F .498
-(be considered tok)117 208.2 R .498(ens and which will separate tok)-.1 F .498
-(ens when doing parsing.)-.1 F -.15(Fo)5.498 G 2.998(re).15 G .497
-(xample, if \231@\232)441.866 208.2 R .996(were in the)117 220.2 R F0($o)3.496
-E F1 .996(macro, then the input \231a@b\232 w)3.496 F .997
-(ould be scanned as three tok)-.1 F .997(ens: \231a,)-.1 F 3.497<9a99>-.7 G(@,)
-470.613 220.2 Q 3.497<9a61>-.7 G(nd)494 220.2 Q<9962>117 232.2 Q 5.595 -.7
-(.\232 F)-.4 H(inally).7 E 4.195(,t)-.65 G(he)176.14 232.2 Q F0($q)4.195 E F1
-1.695(macro speci\214es ho)4.195 F 4.194(wa)-.25 G 4.194(na)297.954 232.2 S
-1.694(ddress should appear in a message when it is)311.588 232.2 R(def)117
-244.2 Q 2.5(aulted. F)-.1 F(or e)-.15 E
-(xample, on our system these de\214nitions are:)-.15 E
-(De$j Sendmail $v/$Z ready at $b)157 260.4 Q(DnMAILER-D)157 272.4 Q(AEMON)-.4 E
-(DlFrom $g)157 284.4 Q($d)5 E(Do.:%@!^/[])157 296.4 Q(Dq$?x$x <$g>$|$g$.)157
-308.4 Q(Dj$w)157 320.4 Q .067(An acceptable alternati)117 336.6 R .367 -.15
-(ve f)-.25 H .067(or the).15 F F0($q)2.567 E F1 .067
-(macro is \231$g$?x \($x\)$.)2.567 F 2.567(\232. These)-.7 F .068
-(correspond to the follo)2.567 F(wing)-.25 E(tw)117 348.6 Q 2.5(of)-.1 G
-(ormats:)137.73 348.6 Q(Eric Allman <eric@CS.Berk)157 364.8 Q(ele)-.1 E -.65
-(y.)-.15 G(EDU>).65 E(eric@CS.Berk)157 376.8 Q(ele)-.1 E -.65(y.)-.15 G
-(EDU \(Eric Allman\)).65 E/F2 10/Times-Italic@0 SF(Sendmail)117 393 Q F1
-(properly quotes names that ha)2.5 E .3 -.15(ve s)-.2 H
-(pecial characters if the \214rst form is used.).15 E .24
-(Some macros are de\214ned by)142 409.2 R F2(sendmail)2.739 E F1 .239
-(for interpolation into ar)2.739 F(gv')-.18 E 2.739(sf)-.55 G .239
-(or mailers or for other)414.734 409.2 R(conte)117 421.2 Q 2.5(xts. These)-.15
-F(macros are:)2.5 E 15.56(aT)157 437.4 S(he origination date in RFC 822 format)
-183.11 437.4 Q 15(bT)157 449.4 S(he current date in RFC 822 format)183.11 449.4
-Q 15.56(cT)157 461.4 S(he hop count)183.11 461.4 Q 15(dT)157 473.4 S
-(he date in UNIX \(ctime\) format)183.11 473.4 Q 16.67(fT)157 485.4 S
-(he sender \(from\) address)183.11 485.4 Q 15(gT)157 497.4 S
-(he sender address relati)183.11 497.4 Q .3 -.15(ve t)-.25 H 2.5(ot).15 G
-(he recipient)301.29 497.4 Q 15(hT)157 509.4 S(he recipient host)183.11 509.4 Q
-17.22(iT)157 521.4 S(he queue id)183.11 521.4 Q 15(kT)157 533.4 S
-(he UUCP node name \(from the uname system call\))183.11 533.4 Q 12.22(mT)157
-545.4 S(he domain part of the)183.11 545.4 Q F2 -.1(ge)2.5 G(thostname).1 E F1
-(return v)2.5 E(alue)-.25 E 15(pS)157 557.4 S(endmail')182.56 557.4 Q 2.5(sp)
--.55 G(id)228.95 557.4 Q 16.67(rP)157 569.4 S(rotocol used to recei)182.56
-569.4 Q .3 -.15(ve t)-.25 H(he message).15 E 16.11(sS)157 581.4 S(ender')182.56
-581.4 Q 2.5(sh)-.55 G(ost name)218.94 581.4 Q 17.22(tA)157 593.4 S
-(numeric representation of the current time)186.72 593.4 Q 15(uT)157 605.4 S
-(he recipient user)183.11 605.4 Q 15(vT)157 617.4 S(he v)183.11 617.4 Q
-(ersion number of sendmail)-.15 E 12.78(wT)157 629.4 S
-(he hostname of this site)183.11 629.4 Q 15(xT)157 641.4 S
-(he full name of the sender)183.11 641.4 Q 15.56(zT)157 653.4 S
-(he home directory of the recipient)183.11 653.4 Q 15(_T)157 665.4 S(he v)
-183.11 665.4 Q(alidated sender address)-.25 E .918
-(There are three types of dates that can be used.)142 685.8 R(The)5.918 E F0
-($a)3.418 E F1(and)3.418 E F0($b)3.418 E F1 .918(macros are in RFC 822)3.418 F
-(format;)117 697.8 Q F0($a)3.047 E F1 .547(is the time as e)3.047 F .547
-(xtracted from the \231Date:\232 line of the message \(if there w)-.15 F .546
-(as one\), and)-.1 F F0($b)117 709.8 Q F1 .145
-(is the current date and time \(used for postmarks\).)2.645 F .145
-(If no \231Date:\232 line is found in the incoming)5.145 F(message,)117 721.8 Q
-F0($a)2.547 E F1 .047(is set to the current time also.)2.547 F(The)5.046 E F0
-($d)2.546 E F1 .046(macro is equi)2.546 F -.25(va)-.25 G .046(lent to the).25 F
-F0($b)2.546 E F1 .046(macro in UNIX)2.546 F EP
-%%Page: 28 25
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 193.36(SMM:08-28 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E/F1 10/Times-Roman@0 SF
-(\(ctime\) format.)117 96 Q(The)142 112.2 Q F0($f)3.114 E F1 .614(macro is the\
- id of the sender as originally determined; when mailing to a speci\214c)3.114
-F .602(host the)117 124.2 R F0($g)3.102 E F1 .602
-(macro is set to the address of the sender)3.102 F/F2 10/Times-Italic@0 SF -.37
-(re)3.101 G .601(lative to the r).37 F(ecipient.)-.37 E F1 -.15(Fo)5.601 G
-3.101(re).15 G .601(xample, if I)456.418 124.2 R 1.65
-(send to \231bollard@matisse.CS.Berk)117 136.2 R(ele)-.1 E -.65(y.)-.15 G 1.65
-(EDU\232 from the machine \231v).65 F(angogh.CS.Berk)-.25 E(ele)-.1 E -.65(y.)
--.15 G(EDU\232).65 E(the)117 148.2 Q F0($f)2.5 E F1
-(macro will be \231eric\232 and the)2.5 E F0($g)2.5 E F1
-(macro will be \231eric@v)2.5 E(angogh.CS.Berk)-.25 E(ele)-.1 E -.65(y.)-.15 G
-(EDU.).65 E<9a>-.7 E(The)142 164.4 Q F0($x)3.838 E F1 1.338
-(macro is set to the full name of the sender)3.838 F 6.337(.T)-.55 G 1.337
-(his can be determined in se)369.135 164.4 R -.15(ve)-.25 G(ral).15 E -.1(wa)
-117 176.4 S 2.952(ys. It).1 F .453(can be passed as \215ag to)2.953 F F2
-(sendmail.)2.953 E F1 .453(The second choice is the v)5.453 F .453
-(alue of the \231Full-name:\232)-.25 F .513(line in the header if it e)117
-188.4 R .512
-(xists, and the third choice is the comment \214eld of a \231From:\232 line.)
--.15 F .512(If all)5.512 F 1.148(of these f)117 200.4 R 1.148
-(ail, and if the message is being originated locally)-.1 F 3.648(,t)-.65 G
-1.149(he full name is look)369.678 200.4 R 1.149(ed up in the)-.1 F F2
-(/etc/passwd)117 212.4 Q F1(\214le.)2.5 E .439(When sending, the)142 228.6 R F0
-($h)2.939 E F1(,)A F0($u)2.939 E F1 2.938(,a)C(nd)256.964 228.6 Q F0($z)2.938 E
-F1 .438(macros get set to the host, user)2.938 F 2.938(,a)-.4 G .438
-(nd home directory \(if)417.426 228.6 R 1.454(local\) of the recipient.)117
-240.6 R 1.454(The \214rst tw)6.454 F 3.954(oa)-.1 G 1.454(re set from the)
-278.438 240.6 R F0($@)3.955 E F1(and)3.955 E F0($:)3.955 E F1 1.455
-(part of the re)3.955 F 1.455(writing rules,)-.25 F(respecti)117 252.6 Q -.15
-(ve)-.25 G(ly).15 E(.)-.65 E(The)142 268.8 Q F0($p)2.806 E F1(and)2.806 E F0
-($t)2.806 E F1 .306(macros are used to create unique strings \(e.g., for the \
-\231Message-Id:\232 \214eld\).)2.806 F(The)117 280.8 Q F0($i)2.537 E F1 .037(m\
-acro is set to the queue id on this host; if put into the timestamp line it ca\
-n be e)2.537 F(xtremely)-.15 E .407(useful for tracking messages.)117 292.8 R
-(The)5.407 E F0($v)2.907 E F1 .407(macro is set to be the v)2.907 F .407
-(ersion number of)-.15 F F2(sendmail)2.907 E F1 2.907(;t)C .407(his is)482.753
-292.8 R 2.109(normally put in timestamps and has been pro)117 304.8 R -.15(ve)
--.15 G 4.609(ne).15 G 2.109(xtremely useful for deb)334.512 304.8 R 4.61
-(ugging. The)-.2 F F0($w)4.61 E F1 1.222
-(macro is set to the name of this host if it can be determined.)117 316.8 R
-(The)6.221 E F0($c)3.721 E F1 1.221(\214eld is set to the \231hop)3.721 F
-(count,)117 328.8 Q 3.332<9a69>-.7 G .833
-(.e., the number of times this message has been processed.)151.572 328.8 R .833
-(This can be determined by)5.833 F(the)117 340.8 Q F0<ad68>2.5 E F1
-(\215ag on the command line or by counting the timestamps in the message.)2.5 E
-(The)142 357 Q F0($r)3.427 E F1(and)3.427 E F0($s)3.427 E F1 .926
-(\214elds are set to the protocol used to communicate with sendmail and the)
-3.427 F .968(sending hostname.)117 369 R(The)5.968 E F0($_)3.468 E F1 .969
-(is set to a v)3.469 F .969(alidated sender host name.)-.25 F .969
-(If the sender is running an)5.969 F(RFC 1413 compliant IDENT serv)117 381 Q
-(er)-.15 E 2.5(,i)-.4 G 2.5(tw)267.55 381 S
-(ill include the user name on that host.)280.05 381 Q F0 2.5(5.1.3. C)102 405 R
-(and F \212 de\214ne classes)2.5 E F1 .197
-(Classes of phrases may be de\214ned to match on the left hand side of re)142
-421.2 R .196(writing rules, where)-.25 F 2.79<6199>117 433.2 S .291
-(phrase\232 is a sequence of characters that do not contain space characters.)
-128.67 433.2 R -.15(Fo)5.291 G 2.791(re).15 G .291(xample a class)445.098 433.2
-R .356(of all local names for this site might be created so that attempts to s\
-end to oneself can be elimi-)117 445.2 R 2.89(nated. These)117 457.2 R .39(can\
- either be de\214ned directly in the con\214guration \214le or read in from an\
-other \214le.)2.89 F .797(Classes may be gi)117 469.2 R -.15(ve)-.25 G 3.297
-(nn).15 G .796(ames from the set of upper case letters.)213.668 469.2 R(Lo)
-5.796 E .796(wer case letters and special)-.25 F(characters are reserv)117
-481.2 Q(ed for system use.)-.15 E(The syntax is:)142 497.4 Q F0(C)157 513.6 Q
-F2 1.666(cp)C(hr)-1.666 E(ase1 phr)-.15 E(ase2...)-.15 E F0(F)157 525.6 Q F2
-1.666<638c>C(le)-1.666 E F1 1.114(The \214rst form de\214nes the class)117
-541.8 R F2(c)3.614 E F1 1.114(to match an)3.614 F 3.614(yo)-.15 G 3.615(ft)
-319.63 541.8 S 1.115(he named w)329.355 541.8 R 3.615(ords. It)-.1 F 1.115
-(is permissible to split)3.615 F(them among multiple lines; for e)117 553.8 Q
-(xample, the tw)-.15 E 2.5(of)-.1 G(orms:)317.57 553.8 Q(CHmonet ucbmonet)157
-570 Q(and)117 586.2 Q(CHmonet)157 602.4 Q(CHucbmonet)157 614.4 Q(are equi)117
-630.6 Q -.25(va)-.25 G 2.5(lent. The).25 F
-(second form reads the elements of the class)2.5 E F2(c)2.5 E F1
-(from the named)2.5 E F2(\214le)2.5 E F1(.)A(The)142 646.8 Q F0($~)3.113 E F1
-.613(\(match entries not in class\) only matches a single w)3.113 F .612
-(ord; multi-w)-.1 F .612(ord entries in the)-.1 F
-(class are ignored in this conte)117 658.8 Q(xt.)-.15 E .383(The class)142 675
-R F0($=w)2.883 E F1 .384(is set to be the set of all names this host is kno)
-2.883 F .384(wn by)-.25 F 5.384(.T)-.65 G .384(his can be used to)431.364 675 R
-(match local hostnames.)117 687 Q(The class)142 703.2 Q F0($=k)2.5 E F1
-(is set to be the same as)2.5 E F0($k)2.5 E F1 2.5(,t)C
-(hat is, the UUCP node name.)312.69 703.2 Q EP
-%%Page: 29 26
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-29)452.9 60 Q 2.5(5.1.4. M)102 96 R 2.5<8a64>2.5 G(e\214ne mailer)159.5
-96 Q/F1 10/Times-Roman@0 SF(Programs and interf)142 112.2 Q
-(aces to mailers are de\214ned in this line.)-.1 E(The format is:)5 E F0(M)157
-128.4 Q/F2 10/Times-Italic@0 SF(name)A F1 2.5(,{)C F2(\214eld)197.9 128.4 Q F1
-(=)A F2(value)A F1(}*)1.666 E(where)117 144.6 Q F2(name)3.244 E F1 .744(is the\
- name of the mailer \(used internally only\) and the \231\214eld=name\232 pair\
-s de\214ne)3.244 F(attrib)117 156.6 Q(utes of the mailer)-.2 E 5(.F)-.55 G
-(ields are:)220.13 156.6 Q -.15(Pa)157 172.8 S 51.87(th The).15 F
-(pathname of the mailer)2.5 E 47.83(Flags Special)157 184.8 R
-(\215ags for this mailer)2.5 E 41.73(Sender A)157 196.8 R(re)2.5 E
-(writing set for sender addresses)-.25 E 31.17(Recipient A)157 208.8 R(re)2.5 E
-(writing set for recipient addresses)-.25 E(Ar)157 220.8 Q 49.13(gv An)-.18 F
-(ar)2.5 E(gument v)-.18 E(ector to pass to this mailer)-.15 E 55.61(Eol The)157
-232.8 R(end-of-line string for this mailer)2.5 E 35.62(Maxsize The)157 244.8 R
-(maximum message length to this mailer)2.5 E 32.27(Linelimit The)157 256.8 R
-(maximum line length in the message body)2.5 E 31.18(Directory The)157 268.8 R
--.1(wo)2.5 G(rking directory for the mailer).1 E
-(Only the \214rst character of the \214eld name is check)117 285 Q(ed.)-.1 E
-1.144(The follo)142 301.2 R 1.144
-(wing \215ags may be set in the mailer description.)-.25 F(An)6.144 E 3.644(yo)
--.15 G 1.144(ther \215ags may be used)409.994 301.2 R(freely to conditionally \
-assign headers to messages destined for particular mailers.)117 313.2 Q 15.56
-(aR)117 329.4 S(un Extended SMTP \(ESMTP\) protocol \(de\214ned in RFCs 1425, \
-1426, and 1427\).)143.67 329.4 Q 15(bF)117 345.6 S .674
-(orce a blank line on the end of a message.)142.41 345.6 R .674
-(This is intended to w)5.674 F .674(ork around some stupid)-.1 F -.15(ve)137
-357.6 S .851(rsions of /bin/mail that require a blank line, b).15 F .851
-(ut do not pro)-.2 F .852(vide it themselv)-.15 F 3.352(es. It)-.15 F -.1(wo)
-3.352 G(uld).1 E(not normally be used on netw)137 369.6 Q(ork mail.)-.1 E 15.56
-(cD)117 385.8 S 4.166(on)144.22 385.8 S 1.666
-(ot include comments in addresses.)158.386 385.8 R 1.665
-(This should only be used if you ha)6.665 F 1.965 -.15(ve t)-.2 H 4.165(ow).15
-G(ork)490.67 385.8 Q(around a remote mailer that gets confused by comments.)137
-397.8 Q 13.33(CI)117 414 S 3.06(fm)140.33 414 S .56(ail is)154.5 414 R F2 -.37
-(re)3.06 G(ceived).37 E F1 .56(from a mailer with this \215ag set, an)3.06 F
-3.06(ya)-.15 G .56(ddresses in the header that do not)367.33 414 R(ha)137 426 Q
-.331 -.15(ve a)-.2 H 2.531(na).15 G 2.531(ts)174.472 426 S .031
-(ign \(\231@\232\) after being re)183.673 426 R .031
-(written by ruleset three will ha)-.25 F .33 -.15(ve t)-.2 H .03
-(he \231@domain\232 clause).15 F(from the sender tack)137 438 Q(ed on.)-.1 E
-(This allo)5 E(ws mail with headers of the form:)-.25 E(From: usera@hosta)177
-454.2 Q -.8(To)177 466.2 S 2.5(:u).8 G(serb@hostb, userc)197.59 466.2 Q
-(to be re)137 482.4 Q(written as:)-.25 E(From: usera@hosta)177 498.6 Q -.8(To)
-177 510.6 S 2.5(:u).8 G(serb@hostb, userc@hosta)197.59 510.6 Q(automatically)
-137 526.8 Q(.)-.65 E 12.78(DT)117 543 S(his mailer w)143.11 543 Q
-(ants a \231Date:\232 header line.)-.1 E 15.56(eT)117 559.2 S .562
-(his mailer is e)143.11 559.2 R(xpensi)-.15 E .862 -.15(ve t)-.25 H 3.062(oc)
-.15 G .562(onnect to, so try to a)253.97 559.2 R -.2(vo)-.2 G .562
-(id connecting normally; an).2 F 3.063(yn)-.15 G(ecessary)470.13 559.2 Q
-(connection will occur during a queue run.)137 571.2 Q 13.89(EE)117 587.4 S
-(scape lines be)143.11 587.4 Q
-(ginning with \231From\232 in the message with a `>' sign.)-.15 E 16.67(fT)117
-603.6 S .969(he mailer w)143.11 603.6 R .969(ants a)-.1 F F0<ad66>3.469 E F2
-(fr)3.469 E(om)-.45 E F1 .969(\215ag, b)3.469 F .969(ut only if this is a netw)
--.2 F .969(ork forw)-.1 F .968(ard operation \(i.e., the)-.1 F(mailer will gi)
-137 615.6 Q .3 -.15(ve a)-.25 H 2.5(ne).15 G(rror if the e)218.81 615.6 Q -.15
-(xe)-.15 G(cuting user does not ha).15 E .3 -.15(ve s)-.2 H
-(pecial permissions\).).15 E 14.44(FT)117 631.8 S(his mailer w)143.11 631.8 Q
-(ants a \231From:\232 header line.)-.1 E 15(gN)117 648 S(ormally)144.22 648 Q
-(,)-.65 E F2(sendmail)3.529 E F1 1.029
-(sends internally generated email \(e.g., error messages\) using the null)3.529
-F .006(return address)137 662 R/F3 7/Times-Roman@0 SF(9)193.376 658 Q F1 .006
-(as required by RFC 1123.)199.382 662 R(Ho)5.006 E(we)-.25 E -.15(ve)-.25 G
-.806 -.4(r, s).15 H .006(ome mailers don').4 F 2.505(ta)-.18 G .005
-(ccept a null return)431.505 662 R 5.372(address. If)137 674 R(necessary)5.372
-E 5.372(,y)-.65 G 2.872(ou can set the)240.486 674 R F0(g)5.372 E F1 2.872
-(\215ag to pre)5.372 F -.15(ve)-.25 G(nt).15 E F2(sendmail)5.372 E F1 2.873
-(from obe)5.372 F 2.873(ying the)-.15 F .32 LW 76 683.6 72 683.6 DL 80 683.6 76
-683.6 DL 84 683.6 80 683.6 DL 88 683.6 84 683.6 DL 92 683.6 88 683.6 DL 96
-683.6 92 683.6 DL 100 683.6 96 683.6 DL 104 683.6 100 683.6 DL 108 683.6 104
-683.6 DL 112 683.6 108 683.6 DL 116 683.6 112 683.6 DL 120 683.6 116 683.6 DL
-124 683.6 120 683.6 DL 128 683.6 124 683.6 DL 132 683.6 128 683.6 DL 136 683.6
-132 683.6 DL 140 683.6 136 683.6 DL 144 683.6 140 683.6 DL 148 683.6 144 683.6
-DL 152 683.6 148 683.6 DL 156 683.6 152 683.6 DL 160 683.6 156 683.6 DL 164
-683.6 160 683.6 DL 168 683.6 164 683.6 DL 172 683.6 168 683.6 DL 176 683.6 172
-683.6 DL 180 683.6 176 683.6 DL 184 683.6 180 683.6 DL 188 683.6 184 683.6 DL
-192 683.6 188 683.6 DL 196 683.6 192 683.6 DL 200 683.6 196 683.6 DL 204 683.6
-200 683.6 DL 208 683.6 204 683.6 DL 212 683.6 208 683.6 DL 216 683.6 212 683.6
-DL/F4 5/Times-Roman@0 SF(9)93.6 694 Q/F5 8/Times-Roman@0 SF(Actually)3.2 I 2
-(,t)-.52 G(his only applies to SMTP)129.356 697.2 Q 2(,w)-.888 G
-(hich uses the `)219.588 697.2 Q(`MAIL FR)-.592 E(OM:<>')-.32 E 2('c)-.592 G
-(ommand.)333.98 697.2 Q EP
-%%Page: 30 27
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 193.36(SMM:08-30 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E/F1 10/Times-Roman@0 SF .212
-(standards; error messages will be sent as from the MAILER-D)137 96 R .211
-(AEMON \(actually)-.4 F 2.711(,t)-.65 G .211(he v)470.439 96 R(alue)-.25 E
-(of the)137 108 Q F0($n)2.5 E F1(macro\).)2.5 E 15(hU)117 124.2 S
-(pper case should be preserv)144.22 124.2 Q(ed in host names for this mailer)
--.15 E(.)-.55 E 16.67(IT)117 140.4 S .092
-(his mailer will be speaking SMTP to another)143.11 140.4 R/F2 10
-/Times-Italic@0 SF(sendmail)2.592 E F1 2.593<8a61>2.593 G 2.593(ss)381.242
-140.4 S .093(uch it can use special proto-)391.615 140.4 R .319(col features.)
-137 152.4 R .319(This option is not required \(i.e., if this option is omitted\
- the transmission will)5.319 F(still operate successfully)137 164.4 Q 2.5(,a)
--.65 G(lthough perhaps not as ef)244.11 164.4 Q(\214ciently as possible\).)-.25
-E 17.22(lT)117 180.6 S(his mailer is local \(i.e., \214nal deli)143.11 180.6 Q
--.15(ve)-.25 G(ry will be performed\).).15 E 13.89(LL)117 196.8 S .69
-(imit the line lengths as speci\214ed in RFC821.)143.11 196.8 R .69
-(This deprecated option should be replaced)5.69 F(by the)137 208.8 Q F0(L=)2.5
-E F1(mail declaration.)2.5 E -.15(Fo)5 G 2.5(rh).15 G(istoric reasons, the)
-272.54 208.8 Q F0(L)2.5 E F1(\215ag also sets the)2.5 E F0(7)2.5 E F1(\215ag.)
-2.5 E 12.22(mT)117 225 S 1.273
-(his mailer can send to multiple users on the same host in one transaction.)
-143.11 225 R 1.273(When a)6.273 F F0($u)3.773 E F1 .621(macro occurs in the)137
-237 R F2(ar)3.121 E(gv)-.37 E F1 .621
-(part of the mailer de\214nition, that \214eld will be repeated as neces-)3.121
-F(sary for all qualifying users.)137 249 Q 11.11(MT)117 265.2 S(his mailer w)
-143.11 265.2 Q(ants a \231Message-Id:\232 header line.)-.1 E 15(nD)117 281.4 S
-2.5(on)144.22 281.4 S
-(ot insert a UNIX-style \231From\232 line on the front of the message.)156.72
-281.4 Q 15(pU)117 297.6 S .702(se the route-addr style re)144.22 297.6 R -.15
-(ve)-.25 G .702(rse-path in the SMTP \231MAIL FR).15 F .701
-(OM:\232 command rather than)-.4 F .421
-(just the return address; although this is required in RFC821 section 3.1, man)
-137 309.6 R 2.922(yh)-.15 G .422(osts do not)459.816 309.6 R(process re)137
-321.6 Q -.15(ve)-.25 G(rse-paths properly).15 E 5(.R)-.65 G -2.15 -.25(ev e)
-272.3 321.6 T(rse-paths are of).25 E(\214cially discouraged by RFC 1123.)-.25 E
-14.44(PT)117 337.8 S(his mailer w)143.11 337.8 Q(ants a \231Return-P)-.1 E
-(ath:\232 line.)-.15 E 16.67(rS)117 354 S(ame as)142.56 354 Q F0(f)2.5 E F1 2.5
-(,b)C(ut sends a)185.68 354 Q F0<ad72>2.5 E F1(\215ag.)2.5 E 16.11(sS)117 370.2
-S(trip quote characters of)142.56 370.2 Q 2.5(fo)-.25 G 2.5(ft)245.61 370.2 S
-(he address before calling the mailer)254.22 370.2 Q(.)-.55 E 14.44(SD)117
-386.4 S(on')144.22 386.4 Q 3.443(tr)-.18 G .943
-(eset the userid before calling the mailer)166.923 386.4 R 5.943(.T)-.55 G .943
-(his w)344.324 386.4 R .942(ould be used in a secure en)-.1 F(viron-)-.4 E .49
-(ment where)137 398.4 R F2(sendmail)2.99 E F1 .49(ran as root.)2.99 F .491
-(This could be used to a)5.491 F -.2(vo)-.2 G .491(id for).2 F .491
-(ged addresses.)-.18 F .491(This \215ag)5.491 F(is suppressed if gi)137 410.4 Q
--.15(ve)-.25 G 2.5(nf).15 G(rom an \231unsafe\232 en)228.81 410.4 Q
-(vironment \(e.g, a user')-.4 E 2.5(sm)-.55 G(ail.cf \214le\).)410.31 410.4 Q
-15(uU)117 426.6 S(pper case should be preserv)144.22 426.6 Q
-(ed in user names for this mailer)-.15 E(.)-.55 E 12.78(UT)117 442.8 S 2.997
-(his mailer w)143.11 442.8 R 2.996
-(ants Unix-style \231From\232 lines with the ugly UUCP-style \231remote from)
--.1 F(<host>\232 on the end.)137 454.8 Q 15(xT)117 471 S(his mailer w)143.11
-471 Q(ants a \231Full-Name:\232 header line.)-.1 E 12.78(XT)117 487.2 S 1.22
-(his mailer w)143.11 487.2 R 1.22
-(ant to use the hidden dot algorithm as speci\214ed in RFC821; basically)-.1 F
-3.72(,a)-.65 G -.15(ny)494.15 487.2 S .225(line be)137 499.2 R .225
-(ginning with a dot will ha)-.15 F .525 -.15(ve a)-.2 H 2.725(ne).15 G .224
-(xtra dot prepended \(to be stripped at the other end\).)296.47 499.2 R .525(T\
-his insures that lines in the message containing a dot will not terminate the \
-message pre-)137 511.2 R(maturely)137 523.2 Q(.)-.65 E 15(7S)117 539.4 S .152
-(trip all output to se)142.56 539.4 R -.15(ve)-.25 G 2.652(nb).15 G 2.652
-(its. This)240.42 539.4 R .152(is the def)2.652 F .152(ault if the)-.1 F F0(L)
-2.652 E F1 .152(\215ag is set.)2.652 F .152(Note that setting this is)5.152 F
-.078(not suf)137 551.4 R .079
-(\214cient to get full eight bit data passed through)-.25 F F2(sendmail)2.579 E
-F1 5.079(.I)C 2.579(ft)398.437 551.4 S(he)407.126 551.4 Q F0(7)2.579 E F1 .079
-(option is set, this is)2.579 F(essentially al)137 563.4 Q -.1(wa)-.1 G
-(ys set, since the eighth bit w).1 E(as stripped on input.)-.1 E 2.122(The mai\
-ler with the special name \231error\232 can be used to generate a user error)
-142 579.6 R 7.122(.T)-.55 G(he)494.56 579.6 Q .246
-(\(optional\) host \214eld is an e)117 591.6 R .247
-(xit status to be returned, and the user \214eld is a message to be printed.)
--.15 F .337(The e)117 603.6 R .337(xit status may be numeric or one of the v)
--.15 F .336(alues USA)-.25 F .336(GE, NOUSER, NOHOST)-.4 F 2.836(,U)-.74 G -.35
-(NA)465.4 603.6 S -1.35(VA)-1 G(IL-)1.35 E .828(ABLE, SOFTW)117 615.6 R .828
-(ARE, TEMPF)-1.2 F .828(AIL, PR)-.74 F -1.88 -.4(OT O)-.4 H .828
-(COL, or CONFIG to return the corresponding EX_).4 F -.15(ex)117 627.6 S
-(it code.).15 E -.15(Fo)5 G 2.5(re).15 G(xample, the entry:)181.26 627.6 Q
-($#error $@ NOHOST $: Host unkno)157 643.8 Q(wn in this domain)-.25 E .261(on \
-the RHS of a rule will cause the speci\214ed error to be generated and the \
-\231Host unkno)117 660 R .261(wn\232 e)-.25 F(xit)-.15 E
-(status to be returned if the LHS matches.)117 672 Q
-(This mailer is only functional in ruleset zero.)5 E 1.563
-(The mailer named \231local\232)142 688.2 R F2(must)4.063 E F1 1.564
-(be de\214ned in e)4.063 F -.15(ve)-.25 G 1.564(ry con\214guration \214le.).15
-F 1.564(This is used to)6.564 F(deli)117 700.2 Q -.15(ve)-.25 G 4.039(rl).15 G
-1.539(ocal mail, and is treated specially in se)151.189 700.2 R -.15(ve)-.25 G
-1.538(ral w).15 F 4.038(ays. Additionally)-.1 F 4.038(,t)-.65 G 1.538
-(hree other mailers)428.724 700.2 R 1.367(named \231prog\232, \231*\214le*\232\
-, and \231*include*\232 may be de\214ned to tune the deli)117 712.2 R -.15(ve)
--.25 G 1.368(ry of messages to).15 F
-(programs, \214les, and :include: lists respecti)117 724.2 Q -.15(ve)-.25 G(ly)
-.15 E 5(.T)-.65 G(he)315.38 724.2 Q 2.5(yd)-.15 G(ef)337.17 724.2 Q(ault to:)
--.1 E EP
-%%Page: 31 28
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-31)452.9 60 Q/F1 10/Times-Roman@0 SF
-(Mprog, P=/bin/sh, F=lsD, A=sh \255c $u)157 96 Q(M*\214le*, P=/de)157 108 Q
-(v/null, F=lsDFMPEu, A=FILE)-.25 E(M*include*, P=/de)157 120 Q
-(v/null, F=su, A=INCLUDE)-.25 E 1.264(The Sender and Recipient re)142 140.4 R
-1.263(writing sets may either be a simple inte)-.25 F 1.263(ger or may be tw)
--.15 F(o)-.1 E(inte)117 152.4 Q .046
-(gers separated by a slash; if so, the \214rst re)-.15 F .047
-(writing set is applied to en)-.25 F -.15(ve)-.4 G .047(lope addresses and the)
-.15 F(second is applied to headers.)117 164.4 Q 1.259
-(The Directory is actually a colon-separated path of directories to try)142
-180.6 R 6.258(.F)-.65 G 1.258(or e)439.704 180.6 R 1.258(xample, the)-.15 F
-.143(de\214nition \231D=$z:/\232 \214rst tries to e)117 192.6 R -.15(xe)-.15 G
-.143(cute in the recipient').15 F 2.643(sh)-.55 G .144
-(ome directory; if that is not a)353.327 192.6 R -.25(va)-.2 G(ilable,).25 E
-.781(it tries to e)117 204.6 R -.15(xe)-.15 G .781
-(cute in the root of the \214lesystem.).15 F .78
-(This is intended to be used only on the \231prog\232)5.781 F(mailer)117 216.6
-Q 2.898(,s)-.4 G .398(ince some shells \(such as)151.438 216.6 R/F2 10
-/Times-Italic@0 SF(csh)2.898 E F1 2.898(\)r)C .398(efuse to e)279.356 216.6 R
--.15(xe)-.15 G .398(cute if the).15 F 2.898(yc)-.15 G .398
-(annot read the home directory)380.586 216.6 R(.)-.65 E .416
-(Since the queue directory is not normally readable by normal users)117 228.6 R
-F2(csh)2.916 E F1 .416(scripts as recipients can)2.916 F -.1(fa)117 240.6 S
-(il.).1 E F0 2.5(5.1.5. H)102 264.6 R 2.5<8a64>2.5 G(e\214ne header)157.84
-264.6 Q F1 .198(The format of the header lines that sendmail inserts into the \
-message are de\214ned by the)142 280.8 R F0(H)2.699 E F1 2.5(line. The)117
-292.8 R(syntax of this line is:)2.5 E F0(H)157 309 Q F1([)A F0(?)A F2(m\215a)A
-(gs)-.1 E F0(?)A F1(])A F2(hname)A F0(:)A F2(htemplate)2.5 E F1 .691(Continuat\
-ion lines in this spec are re\215ected directly into the outgoing message.)117
-325.2 R(The)5.69 E F2(htemplate)3.19 E F1 1.566(is macro e)117 337.2 R 1.567
-(xpanded before insertion into the message.)-.15 F 1.567(If the)6.567 F F2
-(m\215a)4.067 E(gs)-.1 E F1 1.567(\(surrounded by question)4.067 F .219(marks\
-\) are speci\214ed, at least one of the speci\214ed \215ags must be stated in \
-the mailer de\214nition for)117 349.2 R .093
-(this header to be automatically output.)117 361.2 R .093
-(If one of these headers is in the input it is re\215ected to the)5.093 F
-(output re)117 373.2 Q -.05(ga)-.15 G(rdless of these \215ags.).05 E
-(Some headers ha)142 389.4 Q .3 -.15(ve s)-.2 H
-(pecial semantics that will be described belo).15 E -.65(w.)-.25 G F0 2.5
-(5.1.6. O)102 413.4 R 2.5<8a73>2.5 G(et option)156.17 413.4 Q F1 .045(There ar\
-e a number of \231random\232 options that can be set from a con\214guration \
-\214le.)142 429.6 R(Options)5.045 E(are represented by single characters.)117
-441.6 Q(The syntax of this line is:)5 E F0(O)157 457.8 Q F2 1.666(ov)C(alue)
--1.666 E F1 1.054(This sets option)117 474 R F2(o)3.554 E F1 1.054(to be)3.554
-F F2(value)3.554 E F1 6.054(.D)C 1.054(epending on the option,)256.318 474 R F2
-(value)3.555 E F1 1.055(may be a string, an inte)3.555 F(ger)-.15 E 3.555(,a)
--.4 G(boolean \(with le)117 486 Q -.05(ga)-.15 G 2.5(lv).05 G
-(alues \231t\232, \231T\232, \231f\232, or \231F\232; the def)201.26 486 Q
-(ault is TR)-.1 E(UE\), or a time interv)-.4 E(al.)-.25 E
-(The options supported are:)142 502.2 Q(a)117 518.4 Q F2(N)A F1 .655(If set, w)
-189 518.4 R .655(ait up to)-.1 F F2(N)3.155 E F1 .655
-(minutes for an \231@:@\232 entry to e)3.155 F .655(xist in the alias database)
--.15 F .474(before starting up.)189 530.4 R .474(If it does not appear in)5.474
-F F2(N)2.974 E F1 .475(minutes, reb)2.974 F .475(uild the database \(if)-.2 F
-(the)189 542.4 Q F0(D)2.5 E F1(option is also set\) or issue a w)2.5 E(arning.)
--.1 E(A)117 558.6 Q F2 .507(spec, spec, ...)B F1 .507
-(Specify possible alias \214le\(s\).)190.014 558.6 R(Each)5.507 E F2(spec)3.006
-E F1 .506(should be in the format `)3.006 F(`)-.74 E F2(class)A F0(:)A F2
-(\214le)3.006 E F1 -.74('')C(where)189 570.6 Q F2(class)2.947 E F0(:)A F1 .447
-(is optional and def)2.947 F .447(aults to `)-.1 F(`implicit')-.74 E 2.947
-('. Depending)-.74 F .448(on ho)2.948 F(w)-.25 E F0(send-)2.948 E(mail)189
-582.6 Q F1 1.224(is compiled, v)3.724 F 1.224
-(alid classes are \231implicit\232 \(search through a compiled-in)-.25 F .193
-(list of alias \214le types, for back compatibility\), \231hash\232 \(if)189
-594.6 R/F3 9/Times-Roman@0 SF(NEWDB)2.693 E F1 .193(is speci\214ed\),)2.693 F
-.882(\231dbm\232 \(if)189 606.6 R F3(NDBM)3.382 E F1 .882
-(is speci\214ed\), \231stab\232 \(internal symbol table \212 not normally)3.382
-F .475(used unless you ha)189 618.6 R .775 -.15(ve n)-.2 H 2.975(oo).15 G .476
-(ther database lookup\), or \231nis\232 \(if)295.735 618.6 R F3(NIS)2.976 E F1
-.476(is speci\214ed\).)2.976 F(If a list of)189 630.6 Q F2(spec)2.5 E F1 2.5
-(sa)C(re pro)259.26 630.6 Q(vided,)-.15 E F2(sendmail)2.5 E F1
-(searches them in order)2.5 E(.)-.55 E(b)117 646.8 Q F2(N)A F1(/)A F2(M)A F1
-1.589(Insist on at least)189 646.8 R F2(N)4.089 E F1 1.588
-(blocks free on the \214lesystem that holds the queue \214les)4.089 F .19
-(before accepting email via SMTP)189 658.8 R 5.19(.I)-1.11 G 2.69(ft)334.09
-658.8 S .19(here is insuf)342.89 658.8 R .19(\214cient space)-.25 F F2
-(sendmail)2.69 E F1(gi)2.69 E -.15(ve)-.25 G(s).15 E 3.67(a4)189 670.8 S 1.17
-(52 response to the MAIL command.)202.11 670.8 R 1.17(This in)6.17 F 1.17
-(vites the sender to try ag)-.4 F(ain)-.05 E(later)189 682.8 Q 5.986(.T)-.55 G
-.986(he optional)220.816 682.8 R F2(M)3.486 E F1 .987
-(is a maximum message size adv)3.486 F .987(ertised in the ESMTP)-.15 F
-(EHLO response.)189 694.8 Q(It is currently otherwise unused.)5 E(B)117 711 Q
-F2(c)A F1 1.445(Set the blank substitution character to)189 711 R F2(c)3.945 E
-F1 6.444(.U)C 1.444(nquoted spaces in addresses are)371.594 711 R
-(replaced by this character)189 723 Q 5(.D)-.55 G(ef)305.63 723 Q
-(aults to space \(i.e., no change is made\).)-.1 E EP
-%%Page: 32 29
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 193.36(SMM:08-32 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E/F1 10/Times-Roman@0 SF 67.56(cI)117 96
-S 3.892(fa)192.33 96 S 3.892(no)203.992 96 S 1.393(utgoing mailer is mark)
-217.884 96 R 1.393(ed as being e)-.1 F(xpensi)-.15 E -.15(ve)-.25 G 3.893(,d)
-.15 G(on')415.294 96 Q 3.893(tc)-.18 G 1.393(onnect immedi-)439.557 96 R(ately)
-189 108 Q 6.164(.T)-.65 G 1.164
-(his requires that queueing be compiled in, since it will depend on a)222.564
-108 R(queue run process to actually send the mail.)189 120 Q(C)117 136.2 Q/F2
-10/Times-Italic@0 SF(N)A F1 1.49(Checkpoints the queue e)189 136.2 R -.15(ve)
--.25 G(ry).15 E F2(N)3.99 E F1(\(def)3.99 E 1.49(ault 10\) addresses sent.)-.1
-F 1.49(If your system)6.49 F .785(crashes during deli)189 148.2 R -.15(ve)-.25
-G .785(ry to a lar).15 F .785(ge list, this pre)-.18 F -.15(ve)-.25 G .785
-(nts retransmission to an).15 F 3.285(yb)-.15 G(ut)496.22 148.2 Q
-(the last recipients.)189 160.2 Q(d)117 176.4 Q F2(x)A F1(Deli)189 176.4 Q -.15
-(ve)-.25 G 2.5(ri).15 G 2.5(nm)223.87 176.4 S(ode)239.15 176.4 Q F2(x)2.5 E F1
-5(.L)C -2.25 -.15(eg a)274.14 176.4 T 2.5(lm).15 G(odes are:)300.88 176.4 Q
-17.22(iD)229 192.6 S(eli)256.22 192.6 Q -.15(ve)-.25 G 2.5(ri).15 G(nteracti)
-283.87 192.6 Q -.15(ve)-.25 G(ly \(synchronously\)).15 E 15(bD)229 204.6 S(eli)
-256.22 204.6 Q -.15(ve)-.25 G 2.5(ri).15 G 2.5(nb)283.87 204.6 S
-(ackground \(asynchronously\))296.37 204.6 Q 15(qJ)229 216.6 S
-(ust queue the message \(deli)252.89 216.6 Q -.15(ve)-.25 G 2.5(rd).15 G
-(uring queue run\))382.74 216.6 Q(Def)189 232.8 Q 1.32(aults to `)-.1 F(`b')
--.74 E 3.82('i)-.74 G 3.82(fn)261.64 232.8 S 3.82(oo)273.79 232.8 S 1.32
-(ption is speci\214ed, `)287.61 232.8 R(`i')-.74 E 3.82('i)-.74 G 3.82(fi)
-385.57 232.8 S 3.82(ti)395.5 232.8 S 3.82(ss)404.88 232.8 S 1.32(peci\214ed b)
-416.48 232.8 R 1.32(ut gi)-.2 F -.15(ve)-.25 G 3.82(nn).15 G(o)499 232.8 Q(ar)
-189 244.8 Q(gument \(i.e., `)-.18 E(`Od')-.74 E 2.5('i)-.74 G 2.5(se)278.98
-244.8 S(qui)289.81 244.8 Q -.25(va)-.25 G(lent to `).25 E(`Odi')-.74 E('\).)
--.74 E 64.78(DI)117 261 S 2.736(fs)192.33 261 S .236(et, reb)202.286 261 R .236
-(uild the alias database if necessary and possible.)-.2 F .235
-(If this option is not)5.236 F(set,)189 273 Q F2(sendmail)3.385 E F1 .885
-(will ne)3.385 F -.15(ve)-.25 G 3.385(rr).15 G(eb)292.96 273 Q .885
-(uild the alias database unless e)-.2 F .885(xplicitly requested)-.15 F(using)
-189 285 Q F0(\255bi)2.5 E F1(.)A(e)117 301.2 Q F2(x)A F1
-(Dispose of errors using mode)189 301.2 Q F2(x)2.5 E F1 5(.T)C(he v)327.31
-301.2 Q(alues for)-.25 E F2(x)2.5 E F1(are:)2.5 E 15(pP)229 317.4 S
-(rint error messages \(def)254.56 317.4 Q(ault\))-.1 E 15(qN)229 329.4 S 2.5
-(om)256.22 329.4 S(essages, just gi)271.5 329.4 Q .3 -.15(ve ex)-.25 H
-(it status).15 E 12.22(mM)229 341.4 S(ail back errors)257.89 341.4 Q 12.78(wW)
-229 353.4 S(rite back errors \(mail if user not logged in\))258.44 353.4 Q
-15.56(eM)229 365.4 S(ail back errors and gi)257.89 365.4 Q .3 -.15(ve z)-.25 H
-(ero e).15 E(xit stat al)-.15 E -.1(wa)-.1 G(ys).1 E(E)117 385.8 Q F2
-(\214le/messa)A -.1(ge)-.1 G F1 .549
-(Prepend error messages with the indicated message.)189 385.8 R .549(If it be)
-5.549 F .549(gins with a slash,)-.15 F .107(it is assumed to be the pathname o\
-f a \214le containing a message \(this is the rec-)189 397.8 R 1.317
-(ommended setting\).)189 409.8 R 1.316(Otherwise, it is a literal message.)
-6.317 F 1.316(The error \214le might)6.316 F .99
-(contain the name, email address, and/or phone number of a local postmaster)189
-421.8 R .429(who could pro)189 433.8 R .429(vide assistance in to end users.)
--.15 F .428(If the option is missing or null,)5.429 F .342
-(or if it names a \214le which does not e)189 445.8 R .342
-(xist or which is not readable, no message)-.15 F(is printed.)189 457.8 Q 68.67
-(fS)117 474 S -2.25 -.2(av e)194.56 474 T 2.399
-(Unix-style \231From\232 lines at the front of headers.)5.1 F 2.399
-(Normally the)7.399 F 4.899(ya)-.15 G(re)496.23 474 Q
-(assumed redundant and discarded.)189 486 Q(F)117 502.2 Q F2(mode)A F1
-(The \214le mode for queue \214les.)189 502.2 Q(g)117 518.4 Q F2(n)A F1
-(Set the def)189 518.4 Q(ault group id for mailers to run in to)-.1 E F2(n)2.5
-E F1 5(.D)C(ef)397.77 518.4 Q(aults to 1.)-.1 E 64.78(GA)117 534.6 S(llo)196.22
-534.6 Q 3.491(wf)-.25 G .991(uzzy matching on the GECOS \214eld.)220.571 534.6
-R .992(If this \215ag is set, and the usual)5.991 F .794(user name lookups f)
-189 546.6 R .793(ail \(that is, there is no alias with this name and a)-.1 F F2
--.1(ge)3.293 G(tpw-).1 E(nam)189 558.6 Q F1 -.1(fa)3.701 G 1.201
-(ils\), sequentially search the passw).1 F 1.202
-(ord \214le for a matching entry in the)-.1 F 1.446(GECOS \214eld.)189 570.6 R
-1.446(This also requires that MA)6.446 F 1.446(TCHGECOS be turned on during)
--1.11 F 2.5(compilation. This)189 582.6 R(option is not recommended.)2.5 E(h)
-117 598.8 Q F2(N)A F1 1.273(The maximum hop count.)189 598.8 R 1.274
-(Messages that ha)6.273 F 1.574 -.15(ve b)-.2 H 1.274(een processed more than)
-.15 F F2(N)3.774 E F1(times are assumed to be in a loop and are rejected.)189
-610.8 Q(Def)5 E(aults to 25.)-.1 E(H)117 627 Q F2(\214le)A F1
-(Specify the help \214le for SMTP)189 627 Q(.)-1.11 E 69.22(iI)117 643.2 S
-1.015(gnore dots in incoming messages.)192.33 643.2 R 1.014(This is al)6.014 F
--.1(wa)-.1 G 1.014(ys disabled \(that is, dots are).1 F(al)189 655.2 Q -.1(wa)
--.1 G(ys accepted\) when reading SMTP mail.).1 E 68.67(II)117 671.4 S .619
-(nsist that the BIND name serv)192.33 671.4 R .619(er be running to resolv)-.15
-F 3.119(eh)-.15 G .62(ost names.)421.52 671.4 R .62(If this is)5.62 F .945
-(not set and the name serv)189 683.4 R .945(er is not running, the)-.15 F F2
-(/etc/hosts)3.445 E F1 .945(\214le will be consid-)3.445 F .187(ered complete.)
-189 695.4 R .188(In general, you do w)5.187 F .188
-(ant to set this option if your)-.1 F F2(/etc/hosts)2.688 E F1(\214le)2.688 E
-.412(does not include all hosts kno)189 707.4 R .412
-(wn to you or if you are using the MX \(mail for)-.25 F(-)-.2 E -.1(wa)189
-719.4 S 2.03(rding\) feature of the BIND name serv).1 F(er)-.15 E 7.03(.T)-.55
-G 2.03(he name serv)385.96 719.4 R 2.03(er will still be)-.15 F EP
-%%Page: 33 30
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-33)452.9 60 Q/F1 10/Times-Roman@0 SF .56(consulted e)189 96 R -.15(ve)
--.25 G 3.06(ni).15 G 3.06(ft)254.71 96 S .56(his option is not set, b)263.88 96
-R(ut)-.2 E/F2 10/Times-Italic@0 SF(sendmail)3.06 E F1 .56
-(will feel free to resort to)3.06 F(reading)189 108 Q F2(/etc/hosts)3.052 E F1
-.552(if the name serv)3.052 F .553(er is not a)-.15 F -.25(va)-.2 G 3.053
-(ilable. Thus,).25 F .553(you should)3.053 F F2(ne)3.053 E(ver)-.15 E F1
-(set this option if you do not run the name serv)189 120 Q(er)-.15 E(.)-.55 E
-69.22(jI)117 136.2 S 3.129(fs)192.33 136.2 S .628
-(et, send error messages in MIME format \(see RFC1341 and RFC1344 for)202.679
-136.2 R(details\).)189 148.2 Q(J)117 164.4 Q F2(path)A F1 4.923
-(Set the path for searching for users' .forw)189 164.4 R 4.923(ard \214les.)-.1
-F 4.923(The def)9.923 F 4.923(ault is)-.1 F(\231$z/.forw)189 176.4 Q 2.869
-(ard\232. Some)-.1 F .368
-(sites that use the automounter may prefer to change this)2.869 F .676
-(to \231/v)189 188.4 R(ar/forw)-.25 E .676
-(ard/$u\232 to search a \214le with the same name as the user in a sys-)-.1 F
-.925(tem directory)189 200.4 R 5.925(.I)-.65 G 3.425(tc)254.63 200.4 S .924
-(an also be set to a sequence of paths separated by colons;)265.275 200.4 R F2
-(sendmail)189 212.4 Q F1 .645
-(stops at the \214rst \214le it can successfully and safely open.)3.145 F -.15
-(Fo)5.646 G 3.146(re).15 G(xam-)483.45 212.4 Q 1.535(ple, \231/v)189 224.4 R
-(ar/forw)-.25 E(ard/$u:$z/.forw)-.1 E 1.535(ard\232 will search \214rst in /v)
--.1 F(ar/forw)-.25 E(ard/)-.1 E F2(username)A F1(and then in)189 236.4 Q F2
-(~username)2.5 E F1(/.forw)A(ard \(b)-.1 E
-(ut only if the \214rst \214le does not e)-.2 E(xist\).)-.15 E(k)117 252.6 Q F2
-(N)A F1 .196
-(The maximum number of open connections that will be cached at a time.)189
-252.6 R(The)5.197 E(def)189 264.6 Q .567(ault is one.)-.1 F .567
-(This delays closing the the current connection until either this)5.567 F(in)
-189 276.6 Q -.2(vo)-.4 G .516
-(cation of sendmail needs to connect to another host or it terminates.).2 F
-(Set-)5.516 E 1.959(ting it to zero def)189 288.6 R 1.959
-(aults to the old beha)-.1 F(vior)-.2 E 4.458(,t)-.4 G 1.958
-(hat is, connections are closed)379.248 288.6 R(immediately)189 300.6 Q(.)-.65
-E(K)117 316.8 Q F2(timeout)A F1 .882
-(The maximum amount of time a cached connection will be permitted to idle)189
-316.8 R 2.746(without acti)189 328.8 R(vity)-.25 E 7.746(.I)-.65 G 5.246(ft)
-267.482 328.8 S 2.746(his time is e)278.838 328.8 R 2.746
-(xceeded, the connection is immediately)-.15 F 4.422(closed. This)189 340.8 R
--.25(va)4.422 G 1.923(lue should be small \(on the order of ten minutes\).).25
-F(Before)6.923 E F0(sendmail)189 352.8 Q F1 1.084
-(uses a cached connection, it al)3.584 F -.1(wa)-.1 G 1.083
-(ys sends a NOOP \(no operation\)).1 F 2.058
-(command to check the connection; if this f)189 364.8 R 2.058
-(ails, it reopens the connection.)-.1 F .478(This k)189 376.8 R .478
-(eeps your end from f)-.1 F .478(ailing if the other end times out.)-.1 F .478
-(The point of this)5.478 F 3.099(option is to be a good netw)189 388.8 R 3.099
-(ork neighbor and a)-.1 F -.2(vo)-.2 G 3.1(id using up e).2 F(xcessi)-.15 E
--.15(ve)-.25 G(resources on the other end.)189 400.8 Q(The def)5 E
-(ault is \214v)-.1 E 2.5(em)-.15 G(inutes.)383.99 400.8 Q 69.22(lI)117 417 S
-3.14(ft)192.33 417 S .64(here is an \231Errors-T)201.58 417 R .64
-(o:\232 header)-.8 F 3.14(,s)-.4 G .64
-(end error messages to the addresses listed)333.53 417 R 3.95(there. The)189
-429 R 3.95(yn)-.15 G 1.451(ormally go to the en)247.29 429 R -.15(ve)-.4 G
-1.451(lope sender).15 F 6.451(.U)-.55 G 1.451(se of this option causes)405.426
-429 R(sendmail to violate RFC 1123.)189 441 Q(L)117 457.2 Q F2(n)A F1
-(Set the def)189 457.2 Q(ault log le)-.1 E -.15(ve)-.25 G 2.5(lt).15 G(o)288.77
-457.2 Q F2(n)2.5 E F1 5(.D)C(ef)315.99 457.2 Q(aults to 9.)-.1 E 64.22(mS)117
-473.4 S(end to me too, e)194.56 473.4 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(fIa)
-278.04 473.4 S 2.5(mi)294.14 473.4 S 2.5(na)307.2 473.4 S 2.5(na)319.14 473.4 S
-(lias e)331.08 473.4 Q(xpansion.)-.15 E(M)117 489.6 Q F2 1.666(xv)C(alue)-1.666
-E F1 1.313(Set the macro)189 489.6 R F2(x)3.812 E F1(to)3.812 E F2(value)3.812
-E F1 6.312(.T)C 1.312(his is intended only for use from the command)306.854
-489.6 R(line.)189 501.6 Q 67(nV)117 517.8 S
-(alidate the RHS of aliases when reb)195.11 517.8 Q
-(uilding the alias database.)-.2 E 67(oA)117 534 S 1.786
-(ssume that the headers may be in old format, i.e., spaces delimit names.)
-196.22 534 R .433(This actually turns on an adapti)189 546 R .733 -.15(ve a)
--.25 H .433(lgorithm: if an).15 F 2.932(yr)-.15 G .432
-(ecipient address contains)403.156 546 R 5.089(ac)189 558 S 2.589
-(omma, parenthesis, or angle brack)202.969 558 R 2.589
-(et, it will be assumed that commas)-.1 F .485(already e)189 570 R 2.985
-(xist. If)-.15 F .485(this \215ag is not on, only commas delimit names.)2.985 F
-.484(Headers are)5.484 F(al)189 582 Q -.1(wa)-.1 G
-(ys output with commas between the names.).1 E(O)117 598.2 Q F2(options)A F1
-(Set serv)189 598.2 Q(er SMTP options.)-.15 E(The options are)5 E F2 -.1(ke)2.5
-G(y=value)-.2 E F1 2.5(pairs. Kno)2.5 F(wn k)-.25 E -.15(ey)-.1 G 2.5(sa).15 G
-(re:)488.82 598.2 Q 52.83(Port Name/number)229 614.4 R(of listening port \(def)
-2.5 E(aults to "smtp"\))-.1 E 48.95(Addr Address)229 626.4 R(mask \(def)2.5 E
-(aults IN)-.1 E(ADDR_ANY\))-.35 E -.15(Fa)229 638.4 S 41.31(mily Address).15 F
--.1(fa)2.5 G(mily \(def).1 E(aults to INET\))-.1 E 44.5(Listen Size)229 650.4 R
-(of listen queue \(def)2.5 E(aults to 10\))-.1 E(The)189 666.6 Q F2(Addr)4.113
-E F1 1.614(ess mask may be a numeric address in dot notation or a netw)B(ork)
--.1 E(name.)189 678.6 Q(p)117 694.8 Q F2(opt,opt,...)1.666 E F1 1.221
-(Set the pri)189 694.8 R -.25(va)-.25 G -.15(cy).25 G F2(opt)3.871 E F1 3.721
-(ions. `)B(`Pri)-.74 E -.25(va)-.25 G -.15(cy).25 G 2.701 -.74('' i).15 H 3.721
-(sr).74 G 1.221(eally a misnomer; man)351.856 694.8 R 3.721(yo)-.15 G 3.72(ft)
-460.47 694.8 S 1.22(hese are)470.3 694.8 R 2.418(just a w)189 706.8 R 2.418
-(ay of insisting on stricter adherence to the SMTP protocol.)-.1 F(The)7.419 E
-F2(opt)189 718.8 Q F1(ions can be selected from:)A EP
-%%Page: 34 31
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 193.36(SMM:08-34 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E/F1 10/Times-Roman@0 SF 40.26
-(public Allo)229 96 R 2.5(wo)-.25 G(pen access)329.01 96 Q 11.38
-(needmailhelo Insist)229 108 R(on HELO or EHLO command before MAIL)2.5 E(neede)
-229 120 Q 9.87(xpnhelo Insist)-.15 F(on HELO or EHLO command before EXPN)2.5 E
-(noe)229 132 Q 35.97(xpn Disallo)-.15 F 2.5(wE)-.25 G(XPN entirely)341.23 132 Q
-12.5(needvrfyhelo Insist)229 144 R(on HELO or EHLO command before VRFY)2.5 E
-(no)229 156 Q 38.75(vrfy Disallo)-.15 F 2.5(wV)-.25 G(RFY entirely)342.34 156 Q
-14.71(restrictmailq Restrict)229 168 R(mailq command)2.5 E(goa)229 180 Q -.1
-(wa)-.15 G 36.91(yD).1 G(isallo)303.98 180 Q 2.5(we)-.25 G
-(ssentially all SMTP status queries)339.56 180 Q 1.768(The \231goa)189 196.2 R
--.1(wa)-.15 G 1.768(y\232 pseudo-\215ag sets all \215ags e).1 F 1.768
-(xcept \231restrictmailq\232.)-.15 F 1.768(If mailq is)6.768 F .688(restricted\
-, only people in the same group as the queue directory can print the)189 208.2
-R(queue.)189 220.2 Q(P)117 236.4 Q/F2 10/Times-Italic@0 SF(postmaster)A F1
-1.115(If set, copies of error messages will be sent to the named)189 236.4 R F2
-(postmaster)3.614 E F1 6.114(.O)C(nly)491.22 236.4 Q .397(the header of the f)
-189 248.4 R .398(ailed message is sent.)-.1 F .398
-(Since most errors are user problems,)5.398 F .564
-(this is probably not a good idea on lar)189 260.4 R .563(ge sites, and ar)-.18
-F .563(guably contains all sorts)-.18 F .05(of pri)189 272.4 R -.25(va)-.25 G
-.35 -.15(cy v).25 H .05(iolations, b).15 F .05
-(ut it seems to be popular with certain operating systems)-.2 F -.15(ve)189
-284.4 S(ndors.).15 E(q)117 300.6 Q F2(factor)A F1(Use)189 300.6 Q F2(factor)
-3.098 E F1 .597
-(as the multiplier in the map function to decide when to just queue)3.098 F
-.425(up jobs rather than run them.)189 312.6 R .425(This v)5.425 F .425
-(alue is di)-.25 F .426(vided by the dif)-.25 F .426(ference between)-.25 F
-1.064(the current load a)189 324.6 R -.15(ve)-.2 G 1.064(rage and the load a)
-.15 F -.15(ve)-.2 G 1.064(rage limit \().15 F F0(x)A F1 1.063
-(\215ag\) to determine the)3.564 F(maximum message priority that will be sent.)
-189 336.6 Q(Def)5 E(aults to 600000.)-.1 E(Q)117 352.8 Q F2(dir)A F1
-(Use the named)189 352.8 Q F2(dir)2.5 E F1(as the queue directory)2.5 E(.)-.65
-E(r)117 369 Q F2(timeouts)1.666 E F1 -.35(Ti)189 369 S 3.938(meout reads after)
-.35 F F2(time)6.438 E F1(interv)6.438 E 6.438(al. The)-.25 F F2(timeouts)6.438
-E F1(ar)6.438 E 3.938(gument is a list of)-.18 F F2 -.1(ke)189 381 S(ywor)-.2 E
-(d=value)-.37 E F1 3.61(pairs. The)3.61 F 1.11
-(recognized timeouts and their def)3.61 F 1.11(ault v)-.1 F 1.11(alues, and)
--.25 F(their minimum v)189 393 Q
-(alues speci\214ed in RFC 1123 section 5.3.2 are:)-.25 E 23.6(initial w)229
-409.2 R(ait for initial greeting message [5m, 5m])-.1 E 29.72(helo reply)229
-421.2 R(to HELO or EHLO command [5m, none])2.5 E 29.16(mail reply)229 433.2 R
-(to MAIL command [10m, 5m])2.5 E 31.39(rcpt reply)229 445.2 R
-(to RCPT command [1h, 5m])2.5 E 16.94(datainit reply)229 457.2 R(to D)2.5 E
--1.21 -1.11(AT A)-.4 H(command [5m, 2m])3.61 E 8.06(datablock data)229 469.2 R
-(block read [1h, 3m])2.5 E 12.5(data\214nal reply)229 481.2 R(to \214nal `)2.5
-E(`.)-.74 E 1.48 -.74('' i)-.7 H 2.5(nd).74 G(ata [1h, 10m])363.47 481.2 Q 32.5
-(rset reply)229 493.2 R(to RSET command [5m, none])2.5 E 31.38(quit reply)229
-505.2 R(to Q)2.5 E(UIT command [2m, none])-.1 E 28.05(misc reply)229 517.2 R
-(to NOOP and VERB commands [2m, none])2.5 E 7.5(command command)229 529.2 R
-(read [1h, 5m])2.5 E .798(All b)189 545.4 R .798
-(ut \231command\232 apply to client SMTP)-.2 F 5.798(.F)-1.11 G .798
-(or back compatibility)373.406 545.4 R 3.299(,at)-.65 G(imeout)476.22 545.4 Q
-(with no `)189 557.4 Q(`k)-.74 E -.15(ey)-.1 G -.1(wo).15 G(rd=').1 E 2.5('p)
--.74 G(art will set all of the longer v)281.4 557.4 Q(alues.)-.25 E 65.33(RN)
-117 573.6 S(ormally)196.22 573.6 Q(,)-.65 E F2(sendmail)4.154 E F1 1.653
-(tries to eliminate an)4.154 F 4.153(yu)-.15 G 1.653(nnecessary e)371.721 573.6
-R 1.653(xplicit routes when)-.15 F .931
-(sending an error message \(as discussed in RFC 1123 \247 5.2.6\).)189 585.6 R
--.15(Fo)5.931 G 3.431(re).15 G(xample,)472.06 585.6 Q
-(when sending an error message to)189 597.6 Q(<@kno)229 613.8 Q(wn1,@kno)-.25 E
-(wn2,@unkno)-.25 E(wn:user@kno)-.25 E(wn3>)-.25 E F2(sendmail)189 630 Q F1 .46
-(will strip of)2.96 F 2.96(ft)-.25 G .46(he \231@kno)284.48 630 R .46
-(wn1\232 in order to mak)-.25 F 2.96(et)-.1 G .46(he route as direct as)422.74
-630 R 3.429(possible. Ho)189 642 R(we)-.25 E -.15(ve)-.25 G 1.729 -.4(r, i).15
-H 3.429(ft).4 G(he)284.057 642 Q F0(R)3.429 E F1 .929
-(option is set, this will be disabled, and the mail)3.429 F .362
-(will be sent to the \214rst address in the route, e)189 654 R -.15(ve)-.25 G
-2.862(ni).15 G 2.862(fl)391.452 654 S .362(ater addresses are kno)400.424 654 R
-(wn.)-.25 E(This may be useful if you are caught behind a \214re)189 666 Q -.1
-(wa)-.25 G(ll.).1 E 68.11(sB)117 682.2 S 2.729(es)195.67 682.2 S(uper)206.729
-682.2 Q .229(-safe when running things, i.e., al)-.2 F -.1(wa)-.1 G .229
-(ys instantiate the queue \214le, e).1 F -.15(ve)-.25 G(n).15 E .739
-(if you are going to attempt immediate deli)189 694.2 R -.15(ve)-.25 G(ry).15 E
-(.)-.65 E F2(Sendmail)5.739 E F1(al)3.239 E -.1(wa)-.1 G .739(ys instantiates)
-.1 F(the queue \214le before returning control the the client under an)189
-706.2 Q 2.5(yc)-.15 G(ircumstances.)444.07 706.2 Q EP
-%%Page: 35 32
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-35)452.9 60 Q/F1 10/Times-Roman@0 SF(S)117 96 Q/F2 10/Times-Italic@0 SF
-(\214le)A F1(Log statistics in the named)189 96 Q F2(\214le)2.5 E F1(.)A(t)117
-112.2 Q F2(S,D)A F1 .798(Set the local time zone name to)189 112.2 R F2(S)3.299
-E F1 .799(for standard time and)3.299 F F2(D)3.299 E F1 .799
-(for daylight time;)3.299 F(this is only used under v)189 124.2 Q(ersion six.)
--.15 E(T)117 140.4 Q F2(rtime/wtime)A F1 1.604(Set the queue timeout to)189
-140.4 R F2(rtime)4.103 E F1 6.603(.A)C 1.603(fter this interv)334.172 140.4 R
-1.603(al, messages that ha)-.25 F 1.903 -.15(ve n)-.2 H(ot).15 E 1.251
-(been successfully sent will be returned to the sender)189 152.4 R 6.252(.D)
--.55 G(ef)422.724 152.4 Q 1.252(aults to \214v)-.1 F 3.752(ed)-.15 G(ays.)
-488.17 152.4 Q .546(The optional)189 164.4 R F2(wtime)3.046 E F1 .546
-(is the time after which a w)3.046 F .546(arning message is sent.)-.1 F .546
-(If it is)5.546 F(missing or zero then no w)189 176.4 Q
-(arning messages are sent.)-.1 E(u)117 192.6 Q F2(n)A F1 .175(Set the def)189
-192.6 R .175(ault userid for mailers to)-.1 F F2(n)2.675 E F1 5.175(.M)C .175
-(ailers without the)355.28 192.6 R F2(S)2.676 E F1 .176(\215ag in the mailer)
-2.676 F(de\214nition will run as this user)189 204.6 Q 5(.D)-.55 G(ef)322.34
-204.6 Q(aults to 1.)-.1 E(U)117 220.8 Q F2(udbspec)A F1
-(The user database speci\214cation.)189 220.8 Q 67(vR)117 237 S .412(un in v)
-195.67 237 R .412(erbose mode.)-.15 F .412(If this is set,)5.412 F F2(sendmail)
-2.911 E F1 .411(adjusts options)2.911 F F0(c)2.911 E F1(\(don')2.911 E 2.911
-(tc)-.18 G(onnect)477.34 237 Q .427(to e)189 249 R(xpensi)-.15 E .727 -.15
-(ve m)-.25 H .427(ailers\) and).15 F F0(d)2.927 E F1(\(deli)2.928 E -.15(ve)
--.25 G .428(ry mode\) so that all mail is deli).15 F -.15(ve)-.25 G .428
-(red com-).15 F .048
-(pletely in a single job so that you can see the entire deli)189 261 R -.15(ve)
--.25 G .048(ry process.).15 F(Option)5.048 E F0(v)2.548 E F1(should)189 273 Q
-F2(ne)3.389 E(ver)-.15 E F1 .889
-(be set in the con\214guration \214le; it is intended for command line)3.389 F
-(use only)189 285 Q(.)-.65 E(V)117 301.2 Q F2(fallbac)A(khost)-.2 E F1 .964
-(If speci\214ed, the)189 301.2 R F2(fallbac)3.464 E(khost)-.2 E F1 .964
-(acts lik)3.464 F 3.464(eav)-.1 G .964(ery lo)358.608 301.2 R 3.464(wp)-.25 G
-.964(riority MX on e)398.056 301.2 R -.15(ve)-.25 G .963(ry host.).15 F
-(This is intended to be used by sites with poor netw)189 313.2 Q(ork connecti)
--.1 E(vity)-.25 E(.)-.65 E(x)117 329.4 Q F2(LA)A F1 .108
-(When the system load a)189 329.4 R -.15(ve)-.2 G .108(rage e).15 F(xceeds)-.15
-E F2(LA)2.608 E F1 2.608(,j)C .109(ust queue messages \(i.e., don')367.546
-329.4 R 2.609(tt)-.18 G(ry)495.67 329.4 Q(to send them\).)189 341.4 Q(Def)5 E
-(aults to 8.)-.1 E(X)117 357.6 Q F2(LA)A F1 1.251(When the system load a)189
-357.6 R -.15(ve)-.2 G 1.251(rage e).15 F(xceeds)-.15 E F2(LA)3.751 E F1 3.751
-(,r)C 1.251(efuse incoming SMTP connec-)376.097 357.6 R 2.5(tions. Def)189
-369.6 R(aults to 12.)-.1 E(y)117 385.8 Q F2(fact)A F1 .621(The indicated)189
-385.8 R F2(fact)3.121 E F1 .621(or is added to the priority \(thus)B F2
-(lowering)3.122 E F1 .622(the priority of the)3.122 F 1.384
-(job\) for each recipient, i.e., this v)189 397.8 R 1.383
-(alue penalizes jobs with lar)-.25 F 1.383(ge numbers of)-.18 F 2.5
-(recipients. Def)189 409.8 R(aults to 30000.)-.1 E 64.78(YI)117 426 S 3.346(fs)
-192.33 426 S .846(et, deli)202.896 426 R -.15(ve)-.25 G 3.346(re).15 G .847
-(ach job that is run from the queue in a separate process.)251.118 426 R(Use)
-5.847 E .037(this option if you are short of memory)189 438 R 2.536(,s)-.65 G
-.036(ince the def)350.024 438 R .036(ault tends to consume con-)-.1 F
-(siderable amounts of memory while the queue is being processed.)189 450 Q(z)
-117 466.2 Q F2(fact)A F1 1.644(The indicated)189 466.2 R F2(fact)4.144 E F1
-1.645(or is multiplied by the message class \(determined by the)B .923
-(Precedence: \214eld in the user header and the)189 478.2 R F0(P)3.423 E F1
-.923(lines in the con\214guration \214le\))3.423 F .819
-(and subtracted from the priority)189 490.2 R 5.819(.T)-.65 G .819
-(hus, messages with a higher Priority: will)333.255 490.2 R(be f)189 502.2 Q
--.2(avo)-.1 G 2.5(red. Def).2 F(aults to 1800.)-.1 E(Z)117 518.4 Q F2(fact)A F1
-(The)189 518.4 Q F2(fact)3.346 E F1 .846(or is added to the priority e)B -.15
-(ve)-.25 G .846(ry time a job is processed.).15 F .845(Thus, each)5.845 F .942
-(time a job is processed, its priority will be decreased by the indicated v)189
-530.4 R(alue.)-.25 E .297(In most en)189 542.4 R .296
-(vironments this should be positi)-.4 F -.15(ve)-.25 G 2.796(,s).15 G .296
-(ince hosts that are do)378.614 542.4 R .296(wn are all)-.25 F(too often do)189
-554.4 Q(wn for a long time.)-.25 E(Def)5 E(aults to 90000.)-.1 E 67(7S)117
-570.6 S .278(trip input to se)194.56 570.6 R -.15(ve)-.25 G 2.778(nb).15 G .278
-(its for compatibility with old systems.)275.272 570.6 R .279(This shouldn')
-5.279 F 2.779(tb)-.18 G(e)499.56 570.6 Q(necessary)189 582.6 Q(.)-.65 E .78
-(All options can be speci\214ed on the command line using the \255o \215ag, b)
-117 598.8 R .779(ut most will cause)-.2 F F2(send-)3.279 E(mail)117 610.8 Q F1
-.324(to relinquish its setuid permissions.)2.824 F .325
-(The options that will not cause this are b, d, e, E, i, L,)5.325 F .217
-(m, o, p, r)117 622.8 R 2.717(,s)-.4 G 2.717(,v)162.468 622.8 S 2.717(,C)
-172.035 622.8 S 2.717(,a)183.922 622.8 S .217(nd 7.)193.579 622.8 R .216
-(Also, M \(de\214ne macro\) when de\214ning the r or s macros is also consid-)
-5.216 F(ered \231safe\232.)117 634.8 Q F0 2.5(5.1.7. P)102 658.8 R 2.5<8a70>2.5
-G -.18(re)156.17 658.8 S(cedence de\214nitions).18 E F1 -1.11(Va)142 675 S .304
-(lues for the \231Precedence:\232 \214eld may be de\214ned using the)1.11 F F0
-(P)2.805 E F1 .305(control line.)2.805 F .305(The syntax of)5.305 F
-(this \214eld is:)117 687 Q F0(P)157 703.2 Q F2(name)A F0(=)A F2(num)A F1 1.779
-(When the)117 719.4 R F2(name)4.279 E F1 1.779
-(is found in a \231Precedence:\232 \214eld, the message class is set to)4.279 F
-F2(num)4.278 E F1 6.778(.H)C(igher)483.45 719.4 Q EP
-%%Page: 36 33
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 193.36(SMM:08-36 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E/F1 10/Times-Roman@0 SF .81
-(numbers mean higher precedence.)117 96 R .81(Numbers less than zero ha)5.81 F
-1.11 -.15(ve t)-.2 H .81(he special property that if an).15 F .486(error occur\
-s during processing the body of the message will not be returned; this is e)117
-108 R .485(xpected to)-.15 F 1.704(be used for \231b)117 120 R 1.705
-(ulk\232 mail such as through mailing lists.)-.2 F 1.705(The def)6.705 F 1.705
-(ault precedence is zero.)-.1 F -.15(Fo)6.705 G(r).15 E -.15(ex)117 132 S
-(ample, our list of precedences is:).15 E(P\214rst-class=0)157 148.2 Q
-(Pspecial-deli)157 160.2 Q -.15(ve)-.25 G(ry=100).15 E(Plist=\25530)157 172.2 Q
-(Pb)157 184.2 Q(ulk=\25560)-.2 E(Pjunk=\255100)157 196.2 Q .8
-(People writing mailing list e)117 212.4 R .799
-(xploders are encouraged to use \231Precedence: list\232.)-.15 F .799(Older v)
-5.799 F(ersions)-.15 E(of)117 224.4 Q/F2 10/Times-Italic@0 SF(sendmail)3.759 E
-F1 1.259(\(which discarded all error returns for ne)3.759 F -.05(ga)-.15 G(ti)
-.05 E 1.559 -.15(ve p)-.25 H 1.259(recedences\) didn').15 F 3.76(tr)-.18 G 1.26
-(ecognize this)450.25 224.4 R .255(name, gi)117 236.4 R .255(ving it a def)-.25
-F .255(ault precedence of zero.)-.1 F .254(This allo)5.254 F .254
-(ws list maintainers to see error returns on)-.25 F(both old and ne)117 248.4 Q
-2.5(wv)-.25 G(ersions of)193.26 248.4 Q F2(sendmail)2.5 E F1(.)A F0 2.5
-(5.1.8. V)102 272.4 R 2.5<8a63>2.5 G(on\214guration v)156.16 272.4 Q(ersion le)
--.1 E -.1(ve)-.15 G(l).1 E F1 2.11 -.8(To p)142 288.6 T(ro).8 E .51
-(vide compatibility with old con\214guration \214les, the)-.15 F F0(V)3.01 E F1
-.51(line has been added to de\214ne)3.01 F .173(some v)117 300.6 R .173
-(ery basic semantics of the con\214guration \214le.)-.15 F .172
-(These are not intended to be long term sup-)5.173 F 1.84(ports; rather)117
-312.6 R 4.34(,t)-.4 G(he)176.66 312.6 Q 4.34(yd)-.15 G 1.84
-(escribe compatibility features which will probably be remo)200.29 312.6 R -.15
-(ve)-.15 G 4.34(di).15 G 4.34(nf)470.78 312.6 S(uture)483.45 312.6 Q(releases.)
-117 324.6 Q .031(\231Old\232 con\214guration \214les are de\214ned as v)142
-340.8 R .031(ersion le)-.15 F -.15(ve)-.25 G 2.531(lo).15 G 2.531(ne. V)359.438
-340.8 R .031(ersion le)-1.11 F -.15(ve)-.25 G 2.53(lt).15 G .23 -.1(wo \214)
-433.84 340.8 T .03(les mak).1 F 2.53(et)-.1 G(he)494.56 340.8 Q(follo)117 352.8
-Q(wing changes:)-.25 E 12.5(\(1\) Host)122 369 R .757(name canoni\214cation \(\
-$[ ... $]\) appends a dot if the name is recognized; this gi)3.256 F -.15(ve)
--.25 G(s).15 E .903(the con\214g \214le a w)148.66 381 R .903
-(ay of \214nding out if an)-.1 F .903(ything matched.)-.15 F(\(Actually)5.903 E
-3.403(,t)-.65 G .902(his just initializes)432.186 381 R .424
-(the \231host\232 map with the \231\255a.)148.66 393 R 5.424<9a8d>-.7 G .424
-(ag \212 you can reset it to an)280.014 393 R .424(ything you prefer by declar)
--.15 F(-)-.2 E(ing the map e)148.66 405 Q(xplicitly)-.15 E(.\))-.65 E 12.5
-(\(2\) Def)122 421.2 R .436(ault host name e)-.1 F .435
-(xtension is consistent throughout processing; v)-.15 F .435(ersion le)-.15 F
--.15(ve)-.25 G 2.935(lo).15 G .435(ne con-)473.855 421.2 R .828
-(\214gurations turned of)148.66 433.2 R 3.328(fd)-.25 G .828(omain e)243.384
-433.2 R .828(xtension \(that is, adding the local domain name\) during)-.15 F
-.597(certain points in processing.)148.66 445.2 R -1.11(Ve)5.597 G .597
-(rsion le)1.11 F -.15(ve)-.25 G 3.097(lt).15 G .797 -.1(wo c)326.822 445.2 T
-.597(on\214gurations are e).1 F .596(xpected to include a)-.15 F
-(trailing dot to indicate that the name is already canonical.)148.66 457.2 Q
-12.5(\(3\) Local)122 473.4 R .176
-(names that are not aliases are passed through a ne)2.675 F 2.676(wd)-.25 G
-.176(istinguished ruleset \214v)388.892 473.4 R .176(e; this)-.15 F .797
-(can be used to append a local relay)148.66 485.4 R 5.797(.T)-.65 G .797
-(his beha)307.676 485.4 R .796(viour can be pre)-.2 F -.15(ve)-.25 G .796
-(nted by resolving the).15 F .62(local name with an initial `@'.)148.66 497.4 R
-.621(That is, something that resolv)5.62 F .621(es to a local mailer and a)-.15
-F .844(user name of \231vikki\232 will be passed through ruleset \214v)148.66
-509.4 R .843(e, b)-.15 F .843(ut a user name of \231@vikki\232)-.2 F .328
-(will ha)148.66 521.4 R .628 -.15(ve t)-.2 H .328
-(he `@' stripped, will not be passed through ruleset \214v).15 F .328(e, b)-.15
-F .328(ut will otherwise be)-.2 F 1.509(treated the same as the prior e)148.66
-533.4 R 4.009(xample. The)-.15 F -.15(ex)4.009 G 1.508
-(pectation is that this might be used to).15 F .907(implement a polic)148.66
-545.4 R 3.407(yw)-.15 G .907(here mail sent to \231vikki\232 w)238.171 545.4 R
-.908(as handled by a central hub, b)-.1 F .908(ut mail)-.2 F
-(sent to \231vikki@localhost\232 w)148.66 557.4 Q(as deli)-.1 E -.15(ve)-.25 G
-(red directly).15 E(.)-.65 E -1.11(Ve)142 573.6 S .229(rsion le)1.11 F -.15(ve)
--.25 G 2.729(lt).15 G .229(hree \214les allo)199.828 573.6 R 2.729(w#i)-.25 G
-.228(nitiated comments on all lines.)274.374 573.6 R .228
-(Exceptions are backslash)5.228 F(escaped # marks and the $# syntax.)117 585.6
-Q F0 2.5(5.1.9. K)102 609.6 R 2.5<8a6b>2.5 G(ey \214le declaration)157.74 609.6
-Q F1(Special maps can be de\214ned using the line:)142 625.8 Q
-(Kmapname mapclass ar)157 642 Q(guments)-.18 E(The)117 658.2 Q F2(mapname)3.443
-E F1 .944(is the handle by which this map is referenced in the re)3.443 F .944
-(writing rules.)-.25 F(The)5.944 E F2(map-)3.444 E(class)117 670.2 Q F1 .301
-(is the name of a type of map; these are compiled in to sendmail.)2.801 F(The)
-5.3 E F2(ar)2.8 E(guments)-.37 E F1 .3(are inter)2.8 F(-)-.2 E .569
-(preted depending on the class; typically)117 682.2 R 3.069(,t)-.65 G .569
-(here w)286.134 682.2 R .569(ould be a single ar)-.1 F .57
-(gument naming the \214le con-)-.18 F(taining the map.)117 694.2 Q
-(Maps are referenced using the syntax:)142 710.4 Q EP
-%%Page: 37 34
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-37)452.9 60 Q/F1 10/Times-Roman@0 SF($\()157 96 Q/F2 10/Times-Italic@0
-SF(map k)2.5 E -.3(ey)-.1 G F1($@)2.8 E F2(ar)2.5 E(guments)-.37 E F1($:)2.5 E
-F2(default)2.5 E F1($\))2.5 E .797(where either or both of the)117 112.2 R F2
-(ar)3.297 E(guments)-.37 E F1(or)3.297 E F2(default)3.297 E F1 .796
-(portion may be omitted.)3.297 F(The)5.796 E F2(ar)3.296 E(guments)-.37 E F1
-(may)3.296 E .205(appear more than once.)117 124.2 R .205(The indicated)5.205 F
-F2 -.1(ke)2.705 G(y)-.2 E F1(and)2.705 E F2(ar)2.705 E(guments)-.37 E F1 .205
-(are passed to the appropriate mapping)2.705 F 2.503(function. If)117 136.2 R
-.003(it returns a v)2.503 F .003(alue, it replaces the input.)-.25 F .003
-(If it does not return a v)5.003 F .003(alue and the)-.25 F F2(default)2.503 E
-F1(is)2.503 E(speci\214ed, the)117 148.2 Q F2(default)2.5 E F1
-(replaces the input.)2.5 E(Otherwise, the input is unchanged.)5 E .159
-(During replacement of either a map v)142 164.4 R .159(alue or def)-.25 F .159
-(ault the string \231%)-.1 F F2(n)A F1 2.66<9a28>C(where)421.82 164.4 Q F2(n)
-2.66 E F1 .16(is a digit\) is)2.66 F .204(replaced by the corresponding)117
-176.4 R F2(ar)2.704 E(gument)-.37 E F1 5.204(.A)C -.18(rg)294 176.4 S .204
-(ument zero is al).18 F -.1(wa)-.1 G .204(ys the database k).1 F -.15(ey)-.1 G
-5.203(.F)-.5 G .203(or e)468.127 176.4 R(xam-)-.15 E(ple, the rule)117 188.4 Q
-(R$- ! $+)157 204.6 Q($: $\(uucp $1 $@ $2 $: %1 @ %0 . UUCP $\))265 204.6 Q
-.436(Looks up the UUCP name in a \(user de\214ned\) UUCP map; if not found it \
-turns it into \231.UUCP\232)117 220.8 R 2.5(form. The)117 232.8 R
-(database might contain records lik)2.5 E(e:)-.1 E(decv)157 249 Q 77.43
-(ax %1@%0.DEC.COM)-.25 F 72.19(research %1@%0.A)157 261 R(TT)-1.11 E(.COM)-.74
-E 2.065(The b)142 281.4 R 2.064(uilt in map with both name and class \231host\
-\232 is the host name canonicalization)-.2 F 2.5(lookup. Thus,)117 293.4 R
-(the syntax:)2.5 E($\(host)157 309.6 Q F2(hostname)2.5 E F1($\))A(is equi)117
-325.8 Q -.25(va)-.25 G(lent to:).25 E($[)157 342 Q F2(hostname)A F1($])A 1.783
-(There are four prede\214ned database lookup classes: \231dbm\232, \231btree\
-\232, \231hash\232, and \231nis\232.)142 362.4 R .569
-(The \214rst requires that sendmail be compiled with the)117 374.4 R F0(ndbm)
-3.069 E F1 .568(library; the second tw)3.069 F 3.068(or)-.1 G .568(equire the)
-463.722 374.4 R F0(db)117 386.4 Q F1(library)3.198 E 3.198(,a)-.65 G .698
-(nd the third requires that sendmail be compiled with NIS support.)167.466
-386.4 R .698(All four accept)5.698 F(as ar)117 398.4 Q
-(guments the some optional \215ags and a \214lename \(or a mapname for NIS\).)
--.18 E(Kno)5 E(wn \215ags are:)-.25 E 58.86(\255o Indicates)117 414.6 R .21
-(that this map is optional \212 that is, if it cannot be opened, no error is)
-2.71 F(produced, and sendmail will beha)189 426.6 Q .3 -.15(ve a)-.2 H 2.5(si)
-.15 G 2.5(ft)348.9 426.6 S(he map e)357.51 426.6 Q(xisted b)-.15 E(ut w)-.2 E
-(as empty)-.1 E(.)-.65 E 56.64(\255N Normally)117 442.8 R .515
-(when maps are written, the trailing null byte is not included as part)3.015 F
-.8(of the k)189 454.8 R -.15(ey)-.1 G 5.8(.I)-.5 G 3.3(ft)241.32 454.8 S .799
-(his \215ag is indicated it will be included.)250.73 454.8 R .799
-(During lookups, only)5.799 F(the null-byte-included form will be searched.)189
-466.8 Q(See also)5 E F0(\255O.)2.5 E F1 56.64(\255O If)117 483 R(neither)4.388
-E F0<ad4e>4.388 E F1(or)4.388 E F0<ad4f>4.388 E F1 1.888(are speci\214ed,)4.388
-F F2(sendmail)4.388 E F1 1.889(uses an adapti)4.388 F 2.189 -.15(ve a)-.25 H
-1.889(lgorithm to).15 F 1.025
-(decide whether or not to look for null bytes on the end of k)189 495 R -.15
-(ey)-.1 G 3.525(s. It).15 F 1.025(starts by)3.525 F .922
-(trying both; if it \214nds an)189 507 R 3.422(yk)-.15 G 1.222 -.15(ey w)304.29
-507 T .922(ith a null byte it ne).15 F -.15(ve)-.25 G 3.422(rt).15 G .922
-(ries ag)422.684 507 R .922(ain without a)-.05 F .124(null byte and vice v)189
-519 R 2.623(ersa. If)-.15 F .123(this \215ag is speci\214ed, it ne)2.623 F -.15
-(ve)-.25 G 2.623(rt).15 G .123(ries with a null byte;)421.288 519 R .748
-(this can speed matches b)189 531 R .748(ut is ne)-.2 F -.15(ve)-.25 G 3.249
-(rn).15 G(ecessary)341.667 531 Q 5.749(.I)-.65 G 3.249(fb)386.466 531 S(oth)
-398.045 531 Q F0<ad4e>3.249 E F1(and)3.249 E F0<ad4f>3.249 E F1 .749
-(are speci-)3.249 F(\214ed,)189 543 Q F2(sendmail)4.349 E F1 1.849(will ne)
-4.349 F -.15(ve)-.25 G 4.349(rt).15 G 1.849(ry an)300.156 543 R 4.349(ym)-.15 G
-1.848(atches at all \212 that is, e)339.254 543 R -.15(ve)-.25 G 1.848
-(rything will).15 F(appear to f)189 555 Q(ail.)-.1 E<ad61>117 571.2 Q F2(x)A F1
-.649(Append the character)189 571.2 R F2(x)3.149 E F1 .649
-(on successful matches.)3.149 F -.15(Fo)5.649 G 3.149(re).15 G .649
-(xample, the def)406.052 571.2 R(ault)-.1 E F2(host)3.15 E F1
-(map appends a dot on successful matches.)189 583.2 Q 60.53(\255f F)117 599.4 R
-(old upper to lo)-.15 E(wer case before looking up the k)-.25 E -.15(ey)-.1 G
-(.)-.5 E 56.08(\255m Match)117 615.6 R .085(only \(without replacing the v)
-2.585 F 2.585(alue\). If)-.25 F .085(you only care about the e)2.585 F
-(xistence)-.15 E 2.618(of a k)189 627.6 R 2.918 -.15(ey a)-.1 H 2.618
-(nd not the v).15 F 2.619(alue \(as you might when searching the NIS map)-.25 F
-.447(\231hosts.byname\232 for e)189 639.6 R .447(xample\), this \215ag pre)-.15
-F -.15(ve)-.25 G .447(nts the map from substituting the).15 F -.25(va)189 651.6
-S 4.935(lue. Ho).25 F(we)-.25 E -.15(ve)-.25 G 3.235 -.4(r, T).15 H 2.436
-(he \255a ar).4 F 2.436(gument is still appended on a match, and the)-.18 F
-(def)189 663.6 Q(ault is still tak)-.1 E(en if the match f)-.1 E(ails.)-.1 E
-(The)142 679.8 Q F2(dbm)3.874 E F1 1.374
-(map appends the strings \231.pag\232 and \231.dir\232 to the gi)3.874 F -.15
-(ve)-.25 G 3.874<6e8c>.15 G 1.374(lename; the tw)420.268 679.8 R(o)-.1 E F2(db)
-3.874 E F1(-)A(based maps append \231.db\232.)117 691.8 Q .022(The program)142
-708 R F2(mak)2.522 E(emap)-.1 E F1 .023(\(8\) can be used to b)B .023(uild an)
--.2 F 2.523(yo)-.15 G 2.523(ft)353.095 708 S .023
-(he three database-oriented maps.)361.728 708 R(It)5.023 E(tak)117 720 Q
-(es the follo)-.1 E(wing \215ags:)-.25 E EP
-%%Page: 38 35
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 193.36(SMM:08-38 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E/F1 10/Times-Roman@0 SF 60.53(\255f Do)
-117 96 R(not fold upper to lo)2.5 E(wer case in the map.)-.25 E 56.64
-(\255N Include)117 112.2 R(null bytes in k)2.5 E -.15(ey)-.1 G(s.).15 E 58.86
-(\255o Append)117 128.4 R(to an e)2.5 E(xisting \(old\) \214le.)-.15 E 60.53
-(\255r Allo)117 144.6 R 3.479(wr)-.25 G .979(eplacement of e)220.559 144.6 R
-.979(xisting k)-.15 F -.15(ey)-.1 G .979(s; normally).15 F 3.479(,r)-.65 G .979
-(e-inserting an e)385.494 144.6 R .979(xisting k)-.15 F 1.279 -.15(ey i)-.1 H
-(s).15 E(an error)189 156.6 Q(.)-.55 E 58.86(\255v Print)117 172.8 R
-(what is happening.)2.5 E(There are also tw)142 189 Q 2.5(ob)-.1 G
-(uiltin maps that are, strictly speaking, not database lookups.)223.34 189 Q
-1.563(The \231host\232 map does host domain canoni\214cation; gi)142 205.2 R
--.15(ve)-.25 G 4.063(nah).15 G 1.563(ost name it calls the name)392.585 205.2 R
-(serv)117 217.2 Q(er to \214nd the canonical name for that host.)-.15 E .106
-(The \231dequote\232 map strips double quotes \("\) from a name.)142 233.4 R
-.106(It does not strip backslashes.)5.106 F(It)5.106 E 1.838
-(will not strip quotes if the resulting string w)117 245.4 R 1.838
-(ould contain unscannable syntax \(that is, basic)-.1 F .601(errors lik)117
-257.4 R 3.101(eu)-.1 G .601(nbalanced angle brack)166.422 257.4 R .601
-(ets; more sophisticated errors such as unkno)-.1 F .6(wn hosts are not)-.25 F
-(check)117 269.4 Q 3.398(ed\). The)-.1 F .899
-(intent is for use when trying to accept mail from systems such as DECnet that)
-3.398 F(routinely quote odd syntax such as)117 281.4 Q("49ers::ubell")157 297.6
-Q 2.5(At)117 313.8 S(ypical usage is probably something lik)129.5 313.8 Q(e:)
--.1 E(Kdequote dequote)157 330 Q(...)157 354 Q 88.19(R$\255 $:)157 378 R
-($\(dequote $1 $\))2.5 E(R$\255 $+)157 390 Q($: $>3 $1 $2)265 390 Q
-(Care must be tak)117 406.2 Q(en to pre)-.1 E -.15(ve)-.25 G(nt une).15 E
-(xpected results; for e)-.15 E(xample,)-.15 E("|someprogram < input > output")
-157 422.4 Q .084(will ha)117 438.6 R .384 -.15(ve q)-.2 H .083
-(uotes stripped, b).15 F .083
-(ut the result is probably not what you had in mind.)-.2 F -.15(Fo)5.083 G .083
-(rtunately these).15 F(cases are rare.)117 450.6 Q(Ne)142 466.8 Q 2.5(wc)-.25 G
-(lasses can be added in the routine)167.57 466.8 Q F0(setupmaps)2.5 E F1
-(in \214le)2.5 E F0(conf)2.5 E(.c)-.15 E F1(.)A F0 2.5(5.2. Building)87 490.8 R
-2.5(aC)2.5 G(on\214guration File Fr)160.91 490.8 Q(om Scratch)-.18 E F1 1.517
-(Building a con\214guration table from scratch is an e)127 507 R 1.518
-(xtremely dif)-.15 F 1.518(\214cult job)-.25 F 6.518(.F)-.4 G(ortunately)
-441.334 507 Q 4.018(,i)-.65 G 4.018(ti)490.532 507 S(s)500.11 507 Q 1.855
-(almost ne)102 519 R -.15(ve)-.25 G 4.355(rn).15 G 1.855
-(ecessary to do so; nearly e)164.19 519 R -.15(ve)-.25 G 1.855
-(ry situation that may come up may be resolv).15 F 1.855(ed by)-.15 F .416
-(changing an e)102 531 R .416(xisting table.)-.15 F .416(In an)5.416 F 2.916
-(yc)-.15 G .416
-(ase, it is critical that you understand what it is that you are try-)248.616
-531 R 1.151(ing to do and come up with a philosoph)102 543 R 3.651(yf)-.05 G
-1.151(or the con\214guration table.)281.472 543 R 1.151
-(This section is intended to)6.151 F -.15(ex)102 555 S .67
-(plain what the real purpose of a con\214guration table is and to gi).15 F .97
--.15(ve y)-.25 H .67(ou some ideas for what your).15 F(philosoph)102 567 Q 2.5
-(ym)-.05 G(ight be.)156.68 567 Q F0 1.32(Do not e)127 583.2 R -.1(ve)-.15 G
-3.82(nc).1 G(onsider)188.2 583.2 Q F1 1.32(writing your o)3.82 F 1.32
-(wn con\214guration \214le without carefully studying RFC)-.25 F
-(821, 822, and 1123.)102 595.2 Q -1.1(Yo)5 G 2.5(us)1.1 G
-(hould also read RFC 976 if you are doing UUCP e)208.95 595.2 Q(xchange.)-.15 E
-F0 2.5(5.2.1. What)102 619.2 R -.25(yo)2.5 G 2.5(ua).25 G .36 -.18(re t)178.7
-619.2 T(rying to do).18 E F1 .82
-(The con\214guration table has three major purposes.)142 635.4 R .821
-(The \214rst and simplest is to set up the)5.821 F(en)117 647.4 Q .35
-(vironment for)-.4 F/F2 10/Times-Italic@0 SF(sendmail)2.85 E F1 5.35(.T)C .35
-(his in)234.58 647.4 R -.2(vo)-.4 G(lv).2 E .35
-(es setting the options, de\214ning a fe)-.15 F 2.85(wc)-.25 G .35
-(ritical macros, etc.)429.43 647.4 R(Since these are described in other places\
-, we will not go into more detail here.)117 659.4 Q .283
-(The second purpose is to re)142 675.6 R .284(write addresses in the message.)
--.25 F .284(This should typically be done)5.284 F .214(in tw)117 687.6 R 2.714
-(op)-.1 G 2.713(hases. The)150.108 687.6 R .213
-(\214rst phase maps addresses in an)2.713 F 2.713(yf)-.15 G .213
-(ormat into a canonical form.)337.182 687.6 R .213(This should)5.213 F .156
-(be done in ruleset three.)117 699.6 R .157
-(The second phase maps this canonical form into the syntax appropriate)5.156 F
-1.998(for the recei)117 711.6 R 1.997(ving mailer)-.25 F(.)-.55 E F2(Sendmail)
-6.997 E F1 1.997(does this in three subphases.)4.497 F 1.997
-(Rulesets one and tw)6.997 F 4.497(oa)-.1 G(re)496.23 711.6 Q .043
-(applied to all sender and recipient addresses respecti)117 723.6 R -.15(ve)
--.25 G(ly).15 E 5.043(.A)-.65 G .043(fter this, you may specify per)357.904
-723.6 R(-mailer)-.2 E EP
-%%Page: 39 36
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-39)452.9 60 Q/F1 10/Times-Roman@0 SF 2.723
-(rulesets for both sender and recipient addresses; this allo)117 96 R 2.723
-(ws mailer)-.25 F 2.723(-speci\214c customization.)-.2 F(Finally)117 108 Q 2.5
-(,r)-.65 G(uleset four is applied to do an)153.02 108 Q 2.5(yd)-.15 G(ef)283.69
-108 Q(ault con)-.1 E -.15(ve)-.4 G(rsion to e).15 E(xternal form.)-.15 E .785(\
-The third purpose is to map addresses into the actual set of instructions nece\
-ssary to get)142 124.2 R .154(the message deli)117 136.2 R -.15(ve)-.25 G 2.654
-(red. Ruleset).15 F .154(zero must resolv)2.654 F 2.654(et)-.15 G 2.654(ot)
-321.658 136.2 S .153(he internal form, which is in turn used as a)332.092 136.2
-R .446(pointer to a mailer descriptor)117 148.2 R 5.446(.T)-.55 G .446
-(he mailer descriptor describes the interf)248.38 148.2 R .447
-(ace requirements of the)-.1 F(mailer)117 160.2 Q(.)-.55 E F0 2.5
-(5.2.2. Philosoph)102 184.2 R(y)-.15 E F1 1.481(The particular philosoph)142
-200.4 R 3.981(yy)-.05 G 1.481(ou choose will depend hea)257.213 200.4 R 1.481
-(vily on the size and structure of)-.2 F .55(your or)117 212.4 R -.05(ga)-.18 G
-3.05(nization. I).05 F .55(will present a fe)3.05 F 3.05(wp)-.25 G .55
-(ossible philosophies here.)283.39 212.4 R .55(There are as man)5.55 F 3.05(yp)
--.15 G(hiloso-)476.22 212.4 Q
-(phies as there are con\214g designers; feel free to de)117 224.4 Q -.15(ve)
--.25 G(lop your o).15 E(wn.)-.25 E .388
-(One general point applies to all of these philosophies: it is almost al)142
-240.6 R -.1(wa)-.1 G .388(ys a mistak).1 F 2.888(et)-.1 G 2.888(ot)485.002
-240.6 S(ry)495.67 240.6 Q .176(to do full host route resolution.)117 252.6 R
--.15(Fo)5.176 G 2.676(re).15 G .176
-(xample, if you are on a UUCP-only site and you are trying)267.652 252.6 R
-1.223(to get names of the form \231user@host\232 to the Internet, it does not \
-pay to route them to \231xyz-)117 264.6 R -.25(va)117 276.6 S(x!decv).25 E
-(ax!ucb)-.25 E -.25(va)-.15 G .304
-(x!c70!user@host\232 since you then depend on se).25 F -.15(ve)-.25 G .305
-(ral links not under your con-).15 F .996(trol, some of which are lik)117 288.6
-R .996(ely to misparse it an)-.1 F(yw)-.15 E(ay)-.1 E 5.996(.T)-.65 G .996
-(he best approach to this problem is to)347.32 288.6 R 1.048(simply forw)117
-300.6 R 1.048(ard the message for \231user@host\232 to \231xyzv)-.1 F 1.049
-(ax\232 and let xyzv)-.25 F 1.049(ax w)-.25 F 1.049(orry about it from)-.1 F
-3.606(there. In)117 312.6 R(summary)3.606 E 3.606(,j)-.65 G 1.106
-(ust get the message closer to the destination, rather than determining the)
-202.988 312.6 R(full path.)117 324.6 Q F0 2.5(5.2.2.1. Lar)117 348.6 R
-(ge site, many hosts \212 minimum inf)-.1 E(ormation)-.25 E F1(Berk)157 364.8 Q
-(ele)-.1 E 3.018(yi)-.15 G 3.018(sa)198.648 364.8 S 3.018(ne)209.996 364.8 S
-.518(xample of a lar)222.304 364.8 R .518(ge site, i.e., more than tw)-.18 F
-3.018(oo)-.1 G 3.018(rt)400.266 364.8 S .519(hree hosts and multiple)409.394
-364.8 R .444(mail connections.)132 376.8 R 2.044 -.8(We h)5.444 H -2.25 -.2
-(av e).8 H .443(decided that the only reasonable philosoph)3.144 F 2.943(yi)
--.05 G 2.943(no)429.634 376.8 S .443(ur en)442.577 376.8 R(vironment)-.4 E .312
-(is to designate one host as the guru for our site.)132 388.8 R .312
-(It must be able to resolv)5.312 F 2.812(ea)-.15 G .612 -.15(ny p)438.504 388.8
-T .312(iece of mail).15 F 1.083(it recei)132 400.8 R -.15(ve)-.25 G 3.583
-(s. The).15 F 1.083(other sites should ha)3.583 F 1.383 -.15(ve t)-.2 H 1.083
-(he minimum amount of information the).15 F 3.582(yc)-.15 G 1.082(an get)
-478.758 400.8 R -2.3 -.15(aw a)132 412.8 T 2.635(yw).15 G 2.635(ith. In)162.705
-412.8 R .135(addition, an)2.635 F 2.635(yi)-.15 G .135(nformation the)249.485
-412.8 R 2.635(yd)-.15 G 2.635(oh)321.265 412.8 S -2.25 -.2(av e)333.9 412.8 T
-.136(should be hints rather than solid infor)2.835 F(-)-.2 E(mation.)132 424.8
-Q -.15(Fo)157 441 S 6.71(re).15 G 4.209
-(xample, a typical site on our local ether netw)181.74 441 R 4.209
-(ork is \231monet\232 \(actually)-.1 F(\231monet.CS.Berk)132 453 Q(ele)-.1 E
--.65(y.)-.15 G 3.887(EDU\232\). When).65 F 1.387(monet recei)3.887 F -.15(ve)
--.25 G 3.887(sm).15 G 1.387(ail for deli)354.258 453 R -.15(ve)-.25 G(ry).15 E
-3.887(,i)-.65 G 3.887(tc)424.579 453 S 1.387(hecks whether it)435.686 453 R
-(kno)132 465 Q 1.342(ws that the destination host is directly reachable; if so\
-, mail is sent to that host.)-.25 F 1.342(If it)6.342 F(recei)132 477 Q -.15
-(ve)-.25 G 2.915(sm).15 G .415(ail for an)175.055 477 R 2.915(yu)-.15 G(nkno)
-224.75 477 Q .415(wn host, it just passes it directly to \231ucb)-.25 F -.25
-(va)-.15 G(x.CS.Berk).25 E(ele)-.1 E -.65(y.)-.15 G(EDU\232,).65 E .178
-(our master host.)132 489 R(Ucb)5.178 E -.25(va)-.15 G 2.678(xm).25 G .177
-(ay determine that the host name is ille)242.852 489 R -.05(ga)-.15 G 2.677(la)
-.05 G .177(nd reject the message,)415.159 489 R .754(or may be able to do deli)
-132 501 R -.15(ve)-.25 G(ry).15 E 5.754(.H)-.65 G -.25(ow)268.146 501 S -2.15
--.25(ev e).25 H 1.554 -.4(r, i).25 H 3.254(ti).4 G 3.254(si)313.874 501 S .754
-(mportant to note that when a ne)323.798 501 R 3.254(wm)-.25 G .754(ail con-)
-472.976 501 R .164(nection is added, the only host that)132 513 R/F2 10
-/Times-Italic@0 SF(must)2.664 E F1(ha)2.664 E .464 -.15(ve i)-.2 H .164
-(ts tables updated is ucb).15 F -.25(va)-.15 G .164(x; the others).25 F F2(may)
-2.664 E F1(be)2.664 E(updated if con)132 525 Q -.15(ve)-.4 G(nient, b).15 E
-(ut this is not critical.)-.2 E 2.121
-(This picture is slightly muddied due to netw)157 541.2 R 2.122
-(ork connections that are not actually)-.1 F 2.362(located on ucb)132 553.2 R
--.25(va)-.15 G 4.862(x. F).25 F 2.362(or e)-.15 F 2.362
-(xample, some UUCP connections are currently on \231ucbarpa.)-.15 F<9a>-.7 E
-(Ho)132 565.2 Q(we)-.25 E -.15(ve)-.25 G 1.044 -.4(r, m).15 H(onet).4 E F2 .244
-(does not)2.744 F F1(kno)2.744 E 2.744(wa)-.25 G .245
-(bout this; the information is hidden totally between ucb)266.34 565.2 R -.25
-(va)-.15 G(x).25 E 1.045(and ucbarpa.)132 577.2 R 1.045
-(Mail going from monet to a UUCP host is transferred via the ethernet from)
-6.045 F 1.43(monet to ucb)132 589.2 R -.25(va)-.15 G 1.43
-(x, then via the ethernet from ucb).25 F -.25(va)-.15 G 3.931(xt).25 G 3.931
-(ou)355.704 589.2 S 1.431(cbarpa, and then is submitted to)369.635 589.2 R
-(UUCP)132 601.2 Q 5(.A)-1.11 G(lthough this in)172.28 601.2 Q -.2(vo)-.4 G(lv)
-.2 E(es some e)-.15 E(xtra hops, we feel this is an acceptable tradeof)-.15 E
-(f.)-.25 E .826(An interesting point is that it w)157 617.4 R .826
-(ould be possible to update monet to send appropriate)-.1 F .127
-(UUCP mail directly to ucbarpa if the load got too high; if monet f)132 629.4 R
-.127(ailed to note a host as con-)-.1 F .353(nected to ucbarpa it w)132 641.4 R
-.353(ould go via ucb)-.1 F -.25(va)-.15 G 2.853(xa).25 G 2.852(sb)305.954 641.4
-S .352(efore, and if monet incorrectly sent a message)317.696 641.4 R .395
-(to ucbarpa it w)132 653.4 R .396(ould still be sent by ucbarpa to ucb)-.1 F
--.25(va)-.15 G 2.896(xa).25 G 2.896(sb)356.654 653.4 S 2.896(efore. The)368.44
-653.4 R .396(only problem that can)2.896 F .901(occur is loops, for e)132 665.4
-R .901(xample, if ucbarpa thought that ucb)-.15 F -.25(va)-.15 G 3.401(xh).25 G
-.9(ad the UUCP connection and)383.75 665.4 R(vice v)132 677.4 Q 2.5(ersa. F)
--.15 F(or this reason, updates should)-.15 E F2(always)2.5 E F1
-(happen to the master host \214rst.)2.5 E .144(This philosoph)157 693.6 R 2.644
-(yr)-.05 G .145(esults as much from the need to ha)227.798 693.6 R .445 -.15
-(ve a s)-.2 H .145(ingle source for the con\214gu-).15 F .289
-(ration \214les \(typically b)132 705.6 R .289(uilt using)-.2 F F2(m4)2.789 E
-F1 .289(\(1\) or some similar tool\) as an)1.666 F 2.789(yl)-.15 G .288
-(ogical need.)410.664 705.6 R(Maintain-)5.288 E
-(ing more than three separate tables by hand is essentially an impossible job)
-132 717.6 Q(.)-.4 E EP
-%%Page: 40 37
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 193.36(SMM:08-40 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E 2.5(5.2.2.2. Small)117 96 R
-(site \212 complete inf)2.5 E(ormation)-.25 E/F1 10/Times-Roman@0 SF 3.356(As)
-157 112.2 S .856(mall site \(tw)171.466 112.2 R 3.356(oo)-.1 G 3.356(rt)236.434
-112.2 S .856(hree hosts and fe)245.9 112.2 R 3.356(we)-.25 G .856
-(xternal connections\) may \214nd it more rea-)330.564 112.2 R .435
-(sonable to ha)132 124.2 R .735 -.15(ve c)-.2 H .435
-(omplete information at each host.).15 F .435(This w)5.435 F .435
-(ould require that each host kno)-.1 F(w)-.25 E -.15(ex)132 136.2 S .185
-(actly where each netw).15 F .185
-(ork connection is, possibly including the names of each host on that)-.1 F
-(netw)132 148.2 Q 4.341(ork. As)-.1 F 1.841
-(long as the site remains small and the the con\214guration remains relati)
-4.341 F -.15(ve)-.25 G(ly).15 E
-(static, the update problem will probably not be too great.)132 160.2 Q F0 2.5
-(5.2.2.3. Single)117 184.2 R(host)2.5 E F1 .117(This is in some sense the tri)
-157 200.4 R .117(vial case.)-.25 F .117
-(The only major issue is trying to insure that you)5.117 F(don')132 212.4 Q
-3.425(th)-.18 G -2.25 -.2(av e)161.355 212.4 T .925(to kno)3.625 F 3.425(wt)
--.25 G .925(oo much about your en)217.69 212.4 R 3.425(vironment. F)-.4 F .925
-(or e)-.15 F .924(xample, if you ha)-.15 F 1.224 -.15(ve a U)-.2 H(UCP).15 E
-.614(connection you might \214nd it useful to kno)132 224.4 R 3.115(wa)-.25 G
-.615(bout the names of hosts connected directly to)318.885 224.4 R(you, b)132
-236.4 Q
-(ut this is really not necessary since this may be determined from the syntax.)
--.2 E F0 2.5(5.2.2.4. A)117 260.4 R(completely differ)2.5 E(ent philosoph)-.18
-E(y)-.15 E F1(This is adapted from Bruce Lilly)157 276.6 Q 5(.A)-.65 G .3 -.15
-(ny e)301.89 276.6 T(rrors in interpretation are mine.).15 E .065
-(Do minimal changes in ruleset 3: \214x some common b)157 292.8 R .064
-(ut unambiguous errors \(e.g. trail-)-.2 F 2.758
-(ing dot on domains\) and hide bang paths foo!bar into bar@foo.UUCP)132 304.8 R
-7.759(.T)-1.11 G 2.759(he resulting)454.301 304.8 R("canonical" form is an)132
-316.8 Q 2.5(yv)-.15 G(alid RFC822/RFC1123/RFC976 address.)233.63 316.8 Q 1.388
-(Ruleset 0 does the b)157 333 R 1.387(ulk of the w)-.2 F 3.887(ork. It)-.1 F
-(remo)3.887 E -.15(ve)-.15 G 3.887(st).15 G 1.387
-(he trailing "@.UUCP" that hides)367.472 333 R .66(bang paths, strips an)132
-345 R .661(ything not needed to resolv)-.15 F .661
-(e, e.g. the phrase from phrase <route-addr>)-.15 F .497
-(and from named groups, rejects unparseable addresses using $#error)132 357 R
-2.996(,a)-.4 G .496(nd \214nally resolv)419.052 357 R .496(es to)-.15 F 4.324
-(am)132 369 S 1.824(ailer/host/user triple.)148.544 369 R 1.824
-(Ruleset 0 is rather length)6.824 F 4.325(ya)-.05 G 4.325(si)360.965 369 S
-4.325(th)371.96 369 S 1.825(as to handle 3 basic address)384.065 369 R 5.373
-(forms: RFC976 bang paths, RFC1123 %-hacks \(including v)132 381 R 5.373
-(anilla RFC822 local-)-.25 F .136(part@domain\), and RFC822 source routes.)132
-393 R(It')5.137 E 2.637(sa)-.55 G .137(lso complicated by ha)329.508 393 R .137
-(ving to handle named)-.2 F(lists.)132 405 Q .617(The header re)157 421.2 R
-.616(writing rulesets 1 and 2 remo)-.25 F .916 -.15(ve t)-.15 H .616
-(he trailing "@.UUCP" that hides bang).15 F 2.5(paths. Ruleset)132 433.2 R 2.5
-(2a)2.5 G(lso strips the $# mailer $@ host \(for test mode\).)205.05 433.2 Q
-(Ruleset 4 does absolutely nothing.)157 449.4 Q 1.316(The per)157 465.6 R 1.316
-(-mailer re)-.2 F 1.316(writing rulesets conform the en)-.25 F -.15(ve)-.4 G
-1.317(lope and header addresses to the).15 F
-(requirements of the speci\214c mailer)132 477.6 Q(.)-.55 E
-(Lots of rulesets-as-subroutines are used.)157 493.8 Q .35(As a result, header\
- addresses are subject to minimal munging \(per RFC1123\), and the)157 510 R
-(general plan is per RFC822 sect. 3.4.10.)132 522 Q F0 2.5(5.2.3. Rele)102 546
-R -.1(va)-.15 G(nt issues).1 E F1 .584(The canonical form you use should almos\
-t certainly be as speci\214ed in the Internet proto-)142 562.2 R 2.604
-(cols RFC819 and RFC822.)117 574.2 R 2.604(Copies of these RFC')7.604 F 5.104
-(sa)-.55 G 2.603(re included on the)347.852 574.2 R/F2 10/Times-Italic@0 SF
-(sendmail)5.103 E F1 2.603(tape as)5.103 F F2(doc/rfc819.lpr)117 586.2 Q F1
-(and)2.5 E F2(doc/rfc822.lpr)2.5 E F1(.)A 2.04
-(RFC822 describes the format of the mail message itself.)142 602.4 R F2
-(Sendmail)7.04 E F1(follo)4.54 E 2.04(ws this RFC)-.25 F(closely)117 614.4 Q
-2.984(,t)-.65 G 2.984(ot)152.944 614.4 S .483(he e)163.708 614.4 R .483
-(xtent that man)-.15 F 2.983(yo)-.15 G 2.983(ft)251.44 614.4 S .483
-(he standards described in this document can not be changed)260.533 614.4 R
-(without changing the code.)117 626.4 Q(In particular)5 E 2.5(,t)-.4 G
-(he follo)286.85 626.4 Q(wing characters ha)-.25 E .3 -.15(ve s)-.2 H
-(pecial interpretations:).15 E 2.5(<>\(\)"\\)157 642.6 S(An)117 658.8 Q 3.036
-(ya)-.15 G .537(ttempt to use these characters for other than their RFC822 pur\
-pose in addresses is proba-)141.546 658.8 R(bly doomed to disaster)117 670.8 Q
-(.)-.55 E 1.327
-(RFC819 describes the speci\214cs of the domain-based addressing.)142 687 R
-1.326(This is touched on in)6.327 F 1.439(RFC822 as well.)117 699 R 1.439
-(Essentially each host is gi)6.439 F -.15(ve)-.25 G 3.939(nan).15 G 1.44
-(ame which is a right-to-left dot quali\214ed)333.711 699 R .232
-(pseudo-path from a distinguished root.)117 711 R .232
-(The elements of the path need not be ph)5.232 F .232(ysical hosts; the)-.05 F
-2.365(domain is logical rather than ph)117 723 R 4.866(ysical. F)-.05 F 2.366
-(or e)-.15 F 2.366(xample, at Berk)-.15 F(ele)-.1 E 4.866(yo)-.15 G 2.366
-(ne le)406.406 723 R -.05(ga)-.15 G 4.866(lh).05 G 2.366(ost might be)449.818
-723 R EP
-%%Page: 41 38
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-41)452.9 60 Q/F1 10/Times-Roman@0 SF(\231a.CC.Berk)117 96 Q(ele)-.1 E
--.65(y.)-.15 G .366
-(EDU\232; reading from right to left, \231EDU\232 is a top le).65 F -.15(ve)
--.25 G 2.865(ld).15 G .365(omain comprising edu-)410.5 96 R .561
-(cational institutions, \231Berk)117 108 R(ele)-.1 E .562
-(y\232 is a logical domain name, \231CC\232 represents the Computer Cen-)-.15 F
-(ter)117 120 Q 2.5(,\()-.4 G(in this case a strictly logical entity\), and \
-\231a\232 is a host in the Computer Center)135.48 120 Q(.)-.55 E(Be)142 136.2 Q
--.1(wa)-.25 G(re when reading RFC819 that there are a number of errors in it.)
-.1 E F0 2.5(5.2.4. Ho)102 160.2 R 2.5(wt)-.1 G 2.5(op)155.23 160.2 S -.18(ro)
-168.29 160.2 S(ceed).18 E F1 .335(Once you ha)142 176.4 R .635 -.15(ve d)-.2 H
-.335(ecided on a philosoph).15 F 1.635 -.65(y, i)-.05 H 2.835(ti).65 G 2.834
-(sw)319.44 176.4 S .334(orth e)333.284 176.4 R .334(xamining the a)-.15 F -.25
-(va)-.2 G .334(ilable con\214guration).25 F .174(tables to decide if an)117
-188.4 R 2.674(yo)-.15 G 2.674(ft)212.98 188.4 S .174
-(hem are close enough to steal major parts of.)221.764 188.4 R(Ev)5.174 E .175
-(en under the w)-.15 F .175(orst of)-.1 F(conditions, there is a f)117 200.4 Q
-(air amount of boiler plate that can be collected safely)-.1 E(.)-.65 E .33
-(The ne)142 216.6 R .33(xt step is to b)-.15 F .33(uild ruleset three.)-.2 F
-.329(This will be the hardest part of the job)5.33 F 5.329(.B)-.4 G -2.1 -.25
-(ew a)469.321 216.6 T .329(re of).25 F .781
-(doing too much to the address in this ruleset, since an)117 228.6 R .781
-(ything you do will re\215ect through to the)-.15 F 2.744(message. In)117 240.6
-R(particular)2.744 E 2.744(,s)-.4 G .243
-(tripping of local domains is best deferred, since this can lea)216.752 240.6 R
-.543 -.15(ve y)-.2 H .243(ou with).15 F 1.234
-(addresses with no domain spec at all.)117 252.6 R(Since)6.235 E/F2 10
-/Times-Italic@0 SF(sendmail)3.735 E F1(lik)3.735 E 1.235
-(es to append the sending domain to)-.1 F .83
-(addresses with no domain, this can change the semantics of addresses.)117
-264.6 R .83(Also try to a)5.83 F -.2(vo)-.2 G .83(id fully).2 F .342
-(qualifying domains in this ruleset.)117 276.6 R .342(Although technically le)
-5.342 F -.05(ga)-.15 G .343(l, this can lead to unpleasantly and).05 F 1.287
-(unnecessarily long addresses re\215ected into messages.)117 288.6 R 1.287
-(The Berk)6.287 F(ele)-.1 E 3.787(yc)-.15 G 1.287
-(on\214guration \214les de\214ne)406.426 288.6 R .093
-(ruleset nine to qualify domain names and strip local domains.)117 300.6 R .093
-(This is called from ruleset zero to)5.093 F
-(get all addresses into a cleaner form.)117 312.6 Q .318(Once you ha)142 328.8
-R .618 -.15(ve r)-.2 H .318
-(uleset three \214nished, the other rulesets should be relati).15 F -.15(ve)
--.25 G .318(ly tri).15 F 2.817(vial. If)-.25 F(you)2.817 E(need hints, e)117
-340.8 Q(xamine the supplied con\214guration tables.)-.15 E F0 2.5(5.2.5. T)102
-364.8 R(esting the r)-.92 E(ewriting rules \212 the \255bt \215ag)-.18 E F1
-1.075(When you b)142 381 R 1.075(uild a con\214guration table, you can do a ce\
-rtain amount of testing using the)-.2 F(\231test mode\232 of)117 393 Q F2
-(sendmail)2.5 E F1 5(.F)C(or e)226.84 393 Q(xample, you could in)-.15 E -.2(vo)
--.4 G -.1(ke).2 G F2(sendmail)2.6 E F1(as:)2.5 E(sendmail \255bt \255Ctest.cf)
-157 409.2 Q .904(which w)117 425.4 R .903
-(ould read the con\214guration \214le \231test.cf\232 and enter test mode.)-.1
-F .903(In this mode, you enter)5.903 F(lines of the form:)117 437.4 Q
-(rwset address)157 453.6 Q(where)117 469.8 Q F2(rwset)3.376 E F1 .876
-(is the re)3.376 F .876(writing set you w)-.25 F .876(ant to use and)-.1 F F2
-(addr)3.376 E(ess)-.37 E F1 .877(is an address to apply the set to.)3.376 F -.7
-(Te)117 481.8 S .17(st mode sho).7 F .17(ws you the steps it tak)-.25 F .169
-(es as it proceeds, \214nally sho)-.1 F .169(wing you the address it ends up)
--.25 F 3.635(with. Y)117 493.8 R 1.135(ou may use a comma separated list of rw\
-sets for sequential application of rules to an)-1.1 F 2.5(input. F)117 505.8 R
-(or e)-.15 E(xample:)-.15 E(3,1,21,4 monet:bollard)157 522 Q .386
-(\214rst applies ruleset three to the input \231monet:bollard.)117 538.2 R
-5.385<9a52>-.7 G .385(uleset one is then applied to the output)347.145 538.2 R
-(of ruleset three, follo)117 550.2 Q
-(wed similarly by rulesets twenty-one and four)-.25 E(.)-.55 E .202(If you nee\
-d more detail, you can also use the \231\255d21\232 \215ag to turn on more deb)
-142 566.4 R 2.702(ugging. F)-.2 F(or)-.15 E -.15(ex)117 578.4 S(ample,).15 E
-(sendmail \255bt \255d21.99)157 594.6 Q .754
-(turns on an incredible amount of information; a single w)117 610.8 R .753
-(ord address is probably going to print)-.1 F(out se)117 622.8 Q -.15(ve)-.25 G
-(ral pages w).15 E(orth of information.)-.1 E -1.1(Yo)142 639 S 3.075(us)1.1 G
-.575(hould be w)165.085 639 R .575(arned that internally)-.1 F(,)-.65 E F0
-(sendmail)3.075 E F1 .575(applies ruleset 3 to all addresses.)3.075 F .575
-(In this)5.575 F -.15(ve)117 651 S 1.23(rsion of sendmail, you will ha).15 F
-1.53 -.15(ve t)-.2 H 3.73(od).15 G 3.73(ot)281.21 651 S 1.23(hat manually)
-292.72 651 R 6.23(.F)-.65 G 1.23(or e)359.38 651 R 1.23(xample, older v)-.15 F
-1.23(ersions allo)-.15 F(wed)-.25 E(you to use)117 663 Q 2.5(0b)157 679.2 S
-(ruce@broadcast.son)169.5 679.2 Q -.65(y.)-.15 G(com).65 E(This v)117 695.4 Q
-(ersion requires that you use:)-.15 E(3,0 bruce@broadcast.son)157 711.6 Q -.65
-(y.)-.15 G(com).65 E EP
-%%Page: 42 39
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 193.36(SMM:08-42 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E 2.5(5.2.6. Building)102 96 R
-(mailer descriptions)2.5 E/F1 10/Times-Roman@0 SF 1.886 -.8(To a)142 112.2 T
-.287(dd an outgoing mailer to your mail system, you will ha).8 F .587 -.15
-(ve t)-.2 H 2.787(od).15 G .287(e\214ne the characteristics)409.566 112.2 R
-(of the mailer)117 124.2 Q(.)-.55 E 1.481(Each mailer must ha)142 140.4 R 1.781
--.15(ve a)-.2 H 3.981(ni).15 G 1.481(nternal name.)257.645 140.4 R 1.481
-(This can be arbitrary)6.481 F 3.98(,e)-.65 G 1.48(xcept that the names)417.63
-140.4 R(\231local\232 and \231prog\232 must be de\214ned.)117 152.4 Q .127
-(The pathname of the mailer must be gi)142 168.6 R -.15(ve)-.25 G 2.628(ni).15
-G 2.628(nt)317.038 168.6 S .128(he P \214eld.)327.446 168.6 R .128
-(If this mailer should be accessed)5.128 F
-(via an IPC connection, use the string \231[IPC]\232 instead.)117 180.6 Q .021
-(The F \214eld de\214nes the mailer \215ags.)142 196.8 R -1.1(Yo)5.021 G 2.521
-(us)1.1 G .021(hould specify an \231f\232 or \231r\232 \215ag to pass the name)
-311.06 196.8 R .465(of the sender as a)117 208.8 R F0<ad66>2.965 E F1(or)2.965
-E F0<ad72>2.965 E F1 .465(\215ag respecti)2.965 F -.15(ve)-.25 G(ly).15 E 5.465
-(.T)-.65 G .465(hese \215ags are only passed if the)306.95 208.8 R 2.966(yw)
--.15 G .466(ere passed to)451.418 208.8 R/F2 10/Times-Italic@0 SF(sendmail,)117
-220.8 Q F1 1.705(so that mailers that gi)4.205 F 2.005 -.15(ve e)-.25 H 1.705
-(rrors under some circumstances can be placated.).15 F 1.705(If the)6.705 F
-1.362(mailer is not pick)117 232.8 R 3.862(yy)-.15 G 1.362
-(ou can just specify \231\255f $g\232 in the ar)204.518 232.8 R 1.362
-(gv template.)-.18 F 1.363(If the mailer must be)6.362 F 1.708(called as)117
-244.8 R F0 -.18(ro)4.207 G(ot).18 E F1 1.707(the \231S\232 \215ag should be gi)
-4.207 F -.15(ve)-.25 G 1.707
-(n; this will not reset the userid before calling the).15 F(mailer)117 258.8 Q
-/F3 7/Times-Roman@0 SF(10)142.55 254.8 Q F1 5.112(.I)149.55 258.8 S 2.612(ft)
-160.492 258.8 S .112(his mailer is local \(i.e., will perform \214nal deli)
-169.214 258.8 R -.15(ve)-.25 G .112(ry rather than another netw).15 F .112
-(ork hop\))-.1 F .728(the \231l\232 \215ag should be gi)117 270.8 R -.15(ve)
--.25 G 3.227(n. Quote).15 F .727
-(characters \(backslashes and " marks\) can be stripped from)3.227 F .268
-(addresses if the \231s\232 \215ag is speci\214ed; if this is not gi)117 282.8
-R -.15(ve)-.25 G 2.769(nt).15 G(he)344.247 282.8 Q 2.769(ya)-.15 G .269
-(re passed through.)365.746 282.8 R .269(If the mailer is)5.269 F .67(capable \
-of sending to more than one user on the same host in a single transaction the \
-\231m\232 \215ag)117 294.8 R 1.176(should be stated.)117 306.8 R 1.176
-(If this \215ag is on, then the ar)6.176 F 1.177(gv template containing)-.18 F
-F0($u)3.677 E F1 1.177(will be repeated for)3.677 F .089
-(each unique user on a gi)117 318.8 R -.15(ve)-.25 G 2.589(nh).15 G 2.589
-(ost. The)235.994 318.8 R .089
-(\231e\232 \215ag will mark the mailer as being \231e)2.589 F(xpensi)-.15 E
--.15(ve)-.25 G 1.488 -.7(,\232 w).15 H(hich).7 E(will cause)117 332.8 Q F2
-(sendmail)2.5 E F1(to defer connection until a queue run)2.5 E F3(11)345.57
-328.8 Q F1(.)352.57 332.8 Q 2.037(An unusual case is the \231C\232 \215ag.)142
-349 R 2.037(This \215ag applies to the mailer that the message is)7.037 F
-(recei)117 361 Q -.15(ve)-.25 G 2.654(df).15 G .153(rom, rather than the maile\
-r being sent to; if set, the domain spec of the sender \(i.e., the)156.454 361
-R 1.519(\231@host.domain\232 part\) is sa)117 373 R -.15(ve)-.2 G 4.019(da).15
-G 1.519(nd is appended to an)252.746 373 R 4.019(ya)-.15 G 1.52
-(ddresses in the message that do not)354.341 373 R
-(already contain a domain spec.)117 385 Q -.15(Fo)5 G 2.5(re).15 G
-(xample, a message of the form:)266.11 385 Q(From: eric@v)157 401.2 Q
-(angogh.CS.Berk)-.25 E(ele)-.1 E -.65(y.)-.15 G(EDU).65 E -.8(To)157 413.2 S
-2.5(:w).8 G(nj@monet.CS.Berk)179.81 413.2 Q(ele)-.1 E -.65(y.)-.15 G
-(EDU, mckusick).65 E(will be modi\214ed to:)117 429.4 Q(From: eric@v)157 445.6
-Q(angogh.CS.Berk)-.25 E(ele)-.1 E -.65(y.)-.15 G(EDU).65 E -.8(To)157 457.6 S
-2.5(:w).8 G(nj@monet.CS.Berk)179.81 457.6 Q(ele)-.1 E -.65(y.)-.15 G
-(EDU, mckusick@v).65 E(angogh.CS.Berk)-.25 E(ele)-.1 E -.65(y.)-.15 G(EDU).65 E
-F2 9.365(if and only if)117 473.8 R F1 9.364
-(the \231C\232 \215ag is de\214ned in the mailer corresponding to)207.8 473.8 R
-(\231eric@v)117 485.8 Q(angogh.CS.Berk)-.25 E(ele)-.1 E -.65(y.)-.15 G(EDU.).65
-E<9a>-.7 E(Other \215ags are described in Appendix C.)142 502 Q .538
-(The S and R \214elds in the mailer description are per)142 518.2 R .538
-(-mailer re)-.2 F .538(writing sets to be applied to)-.25 F 2.253
-(sender and recipient addresses respecti)117 530.2 R -.15(ve)-.25 G(ly).15 E
-7.253(.T)-.65 G 2.252(hese are applied after the sending domain is)312.995
-530.2 R .546(appended and the general re)117 542.2 R .547
-(writing sets \(numbers one and tw)-.25 F .547(o\) are applied, b)-.1 F .547
-(ut before the out-)-.2 F .458(put re)117 554.2 R .458
-(write \(ruleset four\) is applied.)-.25 F 2.958(At)5.458 G .457
-(ypical use is to append the current domain to addresses)279.646 554.2 R
-(that do not already ha)117 566.2 Q .3 -.15(ve a d)-.2 H 2.5(omain. F).15 F
-(or e)-.15 E(xample, a header of the form:)-.15 E(From: eric)157 582.4 Q
-(might be changed to be:)117 598.6 Q(From: eric@v)157 614.8 Q(angogh.CS.Berk)
--.25 E(ele)-.1 E -.65(y.)-.15 G(EDU).65 E(or)117 631 Q(From: ucb)157 647.2 Q
--.25(va)-.15 G(x!eric).25 E 1.312
-(depending on the domain it is being shipped into.)117 663.4 R 1.313
-(These sets can also be used to do special)6.312 F .32 LW 76 673 72 673 DL 80
-673 76 673 DL 84 673 80 673 DL 88 673 84 673 DL 92 673 88 673 DL 96 673 92 673
-DL 100 673 96 673 DL 104 673 100 673 DL 108 673 104 673 DL 112 673 108 673 DL
-116 673 112 673 DL 120 673 116 673 DL 124 673 120 673 DL 128 673 124 673 DL 132
-673 128 673 DL 136 673 132 673 DL 140 673 136 673 DL 144 673 140 673 DL 148 673
-144 673 DL 152 673 148 673 DL 156 673 152 673 DL 160 673 156 673 DL 164 673 160
-673 DL 168 673 164 673 DL 172 673 168 673 DL 176 673 172 673 DL 180 673 176 673
-DL 184 673 180 673 DL 188 673 184 673 DL 192 673 188 673 DL 196 673 192 673 DL
-200 673 196 673 DL 204 673 200 673 DL 208 673 204 673 DL 212 673 208 673 DL 216
-673 212 673 DL/F4 5/Times-Roman@0 SF(10)93.6 683.4 Q/F5 8/Times-Italic@0 SF
-(Sendmail)3.2 I/F6 8/Times-Roman@0 SF
-(must be running setuid to root for this to w)2 E(ork.)-.08 E F4(11)93.6 697 Q
-F6(The \231c\232 con\214guration option must be gi)3.2 I -.12(ve)-.2 G 2(nf).12
-G(or this to be ef)242.04 700.2 Q(fecti)-.2 E -.12(ve)-.2 G(.).12 E EP
-%%Page: 43 40
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-43)452.9 60 Q/F1 10/Times-Roman@0 SF(purpose output re)117 96 Q
-(writing in cooperation with ruleset four)-.25 E(.)-.55 E .228
-(The E \214eld de\214nes the string to use as an end-of-line indication.)142
-112.2 R 2.728(As)5.228 G .228(tring containing only)419.654 112.2 R(ne)117
-124.2 Q(wline is the def)-.25 E 2.5(ault. The)-.1 F
-(usual backslash escapes \(\\r)2.5 E 2.5(,\\)-.4 G(n, \\f, \\b\) may be used.)
-342.87 124.2 Q(Finally)142 140.4 Q 2.648(,a)-.65 G 2.648(na)179.278 140.4 S
--.18(rg)191.366 140.4 S 2.648(vt).18 G .149(emplate is gi)209.944 140.4 R -.15
-(ve)-.25 G 2.649(na).15 G 2.649(st)282.481 140.4 S .149(he E \214eld.)291.8
-140.4 R .149(It may ha)5.149 F .449 -.15(ve e)-.2 H .149(mbedded spaces.).15 F
-.149(If there is)5.149 F .204(no ar)117 152.4 R .204(gv with a)-.18 F F0($u)
-2.704 E F1 .204(macro in it,)2.704 F/F2 10/Times-Italic@0 SF(sendmail)2.704 E
-F1 .204(will speak SMTP to the mailer)2.704 F 5.203(.I)-.55 G 2.703(ft)412.648
-152.4 S .203(he pathname for this)421.461 152.4 R(mailer is \231[IPC],)117
-164.4 Q 2.5<9a74>-.7 G(he ar)192.4 164.4 Q(gv should be)-.18 E(IPC $h [)157
-180.6 Q F2(port)2.5 E F1(])2.5 E(where)117 196.8 Q F2(port)2.5 E F1
-(is the optional port number to connect to.)2.5 E -.15(Fo)142 213 S 2.5(re).15
-G(xample, the speci\214cations:)162.53 213 Q(Mlocal, P=/bin/mail, F=rlsm)157
-229.2 Q(S=10, R=20, A=mail \255d $u)5 E(Mether)157 241.2 Q 2.35(,P)-.4 G 13.9
-(=[IPC], F=meC,)195.89 241.2 R(S=11, R=21, A=IPC $h, M=100000)1.39 E 1.643
-(speci\214es a mailer to do local deli)117 257.4 R -.15(ve)-.25 G 1.644
-(ry and a mailer for ethernet deli).15 F -.15(ve)-.25 G(ry).15 E 6.644(.T)-.65
-G 1.644(he \214rst is called)436.018 257.4 R(\231local,)117 269.4 Q 2.649<9a69>
--.7 G 2.649(sl)152.549 269.4 S .149(ocated in the \214le \231/bin/mail,)161.868
-269.4 R 2.649<9a74>-.7 G(ak)283.573 269.4 Q .149(es a pick)-.1 F(y)-.15 E F0
-<ad72>2.649 E F1 .148(\215ag, does local deli)2.649 F -.15(ve)-.25 G(ry).15 E
-2.648(,q)-.65 G .148(uotes should)453.572 269.4 R 1.016
-(be stripped from addresses, and multiple users can be deli)117 281.4 R -.15
-(ve)-.25 G 1.017(red at once; ruleset ten should be).15 F 1.417(applied to sen\
-der addresses in the message and ruleset twenty should be applied to recipient)
-117 293.4 R .122(addresses; the ar)117 305.4 R .123
-(gv to send to a message will be the w)-.18 F .123(ord \231mail,)-.1 F 2.623
-<9a74>-.7 G .123(he w)383.125 305.4 R .123(ord \231\255d,)-.1 F 2.623<9a61>-.7
-G .123(nd w)446.644 305.4 R .123(ords con-)-.1 F 1.484
-(taining the name of the recei)117 317.4 R 1.484(ving user)-.25 F 6.484(.I)-.55
-G 3.984(fa)288.498 317.4 S F0<ad72>A F1 1.484
-(\215ag is inserted it will be between the w)3.984 F(ords)-.1 E .288
-(\231mail\232 and \231\255d.)117 329.4 R 5.288<9a54>-.7 G .289
-(he second mailer is called \231ether)196.394 329.4 R 1.689 -.7(,\232 i)-.4 H
-2.789(ts).7 G .289(hould be connected to via an IPC con-)348.947 329.4 R .932(\
-nection, it can handle multiple users at once, connections should be deferred,\
- and an)117 341.4 R 3.432(yd)-.15 G(omain)479 341.4 Q 1.458
-(from the sender address should be appended to an)117 353.4 R 3.958(yr)-.15 G
-(ecei)340.2 353.4 Q -.15(ve)-.25 G 3.958(rn).15 G 1.458
-(ame without a domain; sender)377.628 353.4 R .74
-(addresses should be processed by ruleset ele)117 365.4 R -.15(ve)-.25 G 3.24
-(na).15 G .74(nd recipient addresses by ruleset twenty-one.)320.34 365.4 R
-(There is a 100,000 byte limit on messages passed through this mailer)117 377.4
-Q(.)-.55 E F0 2.5(5.3. The)87 401.4 R(User Database)2.5 E F1 .108(If you ha)127
-417.6 R .408 -.15(ve a ve)-.2 H .109
-(rsion of sendmail with the user database package compiled in, the handling of)
-.15 F(sender and recipient addresses is modi\214ed.)102 429.6 Q
-(The location of this database is controlled with the)127 445.8 Q F0(U)2.5 E F1
-(option.)2.5 E F0 2.5(5.3.1. Structur)102 469.8 R 2.5(eo)-.18 G 2.5(ft)177.92
-469.8 S(he user database)187.08 469.8 Q F1(The database is a sorted \(BT)142
-486 Q(ree-based\) structure.)-.35 E(User records are stored with the k)5 E -.15
-(ey)-.1 G(:).15 E F2(user)157 502.2 Q(-name)-.2 E F0(:)A F2(\214eld-name)A F1
-.128
-(The sorted database format ensures that user records are clustered together)
-117 518.4 R 5.128(.M)-.55 G .128(eta-information is)432.492 518.4 R(al)117
-530.4 Q -.1(wa)-.1 G(ys stored with a leading colon.).1 E
-(Field names de\214ne both the syntax and semantics of the v)142 546.6 Q 2.5
-(alue. De\214ned)-.25 F(\214elds include:)2.5 E 33.39(maildrop The)117 562.8 R
-(deli)4.872 E -.15(ve)-.25 G 2.372(ry address for this user).15 F 7.372(.T)-.55
-G 2.373(here may be multiple v)349.472 562.8 R 2.373(alues of this)-.25 F 2.675
-(record. In)189 574.8 R(particular)2.675 E 2.675(,m)-.4 G .175
-(ailing lists will ha)284.095 574.8 R .475 -.15(ve o)-.2 H(ne).15 E F2(maildr)
-2.675 E(op)-.45 E F1 .175(record for each user)2.675 F(on the list.)189 586.8 Q
-30.06(mailname The)117 603 R 1.026(outgoing mailname for this user)3.526 F
-6.026(.F)-.55 G 1.027(or each outgoing name, there should)353.336 603 R .08
-(be an appropriate)189 615 R F2(maildr)2.58 E(op)-.45 E F1 .08
-(record for that name to allo)2.58 F 2.58(wr)-.25 G .08(eturn mail.)422.38 615
-R .08(See also)5.08 F F2(:default:mailname)189 627 Q F1(.)A 25.62
-(mailsender Changes)117 643.2 R(an)3.447 E 3.447(ym)-.15 G .947
-(ail sent to this address to ha)252.404 643.2 R 1.248 -.15(ve t)-.2 H .948
-(he indicated en).15 F -.15(ve)-.4 G .948(lope sender).15 F(.)-.55 E .498(This\
- is intended for mailing lists, and will normally be the name of an appro-)189
-655.2 R .754(priate -request address.)189 667.2 R .754(It is v)5.754 F .755
-(ery similar to the o)-.15 F(wner)-.25 E(-)-.2 E F2(list)A F1 .755
-(syntax in the alias)3.255 F(\214le.)189 679.2 Q 33.95(fullname The)117 695.4 R
-(full name of the user)2.5 E(.)-.55 E(of)117 711.6 Q 13.66(\214ce-address The)
--.25 F(of)2.5 E(\214ce address for this user)-.25 E(.)-.55 E EP
-%%Page: 44 41
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 193.36(SMM:08-44 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E/F1 10/Times-Roman@0 SF(of)117 96 Q
-19.21(\214ce-phone The)-.25 F(of)2.5 E(\214ce phone number for this user)-.25 E
-(.)-.55 E(of)117 112.2 Q(\214ce-f)-.25 E 30.98(ax The)-.1 F(of)2.5 E(\214ce F)
--.25 E(AX number for this user)-.74 E(.)-.55 E 13.96(home-address The)117 128.4
-R(home address for this user)2.5 E(.)-.55 E 19.51(home-phone The)117 144.6 R
-(home phone number for this user)2.5 E(.)-.55 E(home-f)117 160.8 Q 31.28
-(ax The)-.1 F(home F)2.5 E(AX number for this user)-.74 E(.)-.55 E 41.73
-(project A)117 177 R .856
-(\(short\) description of the project this person is af)3.356 F .855
-(\214liated with.)-.25 F .855(In the Uni-)5.855 F -.15(ve)189 189 S
-(rsity this is often just the name of their graduate advisor).15 E(.)-.55 E
-52.28(plan A)117 205.2 R
-(pointer to a \214le from which plan information can be g)2.5 E(athered.)-.05 E
-.924(As of this writing, only a fe)142 221.4 R 3.424(wo)-.25 G 3.424(ft)273.208
-221.4 S .925(hese \214elds are actually being used by sendmail:)282.742 221.4 R
-/F2 10/Times-Italic@0 SF(mail-)3.425 E(dr)117 233.4 Q(op)-.45 E F1(and)2.5 E F2
-(mailname)2.5 E F1 5(.A)C F2(\214ng)211.54 233.4 Q(er)-.1 E F1
-(program that uses the other \214elds is planned.)2.5 E F0 2.5(5.3.2. User)102
-257.4 R(database semantics)2.5 E F1 .996(When the re)142 273.6 R .995
-(writing rules submit an address to the local mailer)-.25 F 3.495(,t)-.4 G .995
-(he user name is passed)408.93 273.6 R .78(through the alias \214le.)117 285.6
-R .781
-(If no alias is found \(or if the alias points back to the same address\), the)
-5.78 F 1.778(name \(with \231:maildrop\232 appended\) is then used as a k)117
-297.6 R 2.077 -.15(ey i)-.1 H 4.277(nt).15 G 1.777(he user database.)375.985
-297.6 R 1.777(If no match)6.777 F
-(occurs \(or if the maildrop points at the same address\), forw)117 309.6 Q
-(arding is tried.)-.1 E .55(If the \214rst tok)142 325.8 R .551(en of the user\
- name returned by ruleset 0 is an \231@\232 sign, the user database)-.1 F .626
-(lookup is skipped.)117 337.8 R .625
-(The intent is that the user database will act as a set of def)5.626 F .625
-(aults for a cluster)-.1 F 1.533(\(in our case, the Computer Science Di)117
-349.8 R 1.533(vision\); mail sent to a speci\214c machine should ignore)-.25 F
-(these def)117 361.8 Q(aults.)-.1 E .351
-(When mail is sent, the name of the sending user is look)142 378 R .351
-(ed up in the database.)-.1 F .351(If that user)5.351 F .04
-(has a \231mailname\232 record, the v)117 390 R .041
-(alue of that record is used as their outgoing name.)-.25 F -.15(Fo)5.041 G
-2.541(re).15 G .041(xample, I)466.189 390 R(might ha)117 402 Q .3 -.15(ve a r)
--.2 H(ecord:).15 E 25.94(eric:mailname Eric.Allman@CS.Berk)157 418.2 R(ele)-.1
-E -.65(y.)-.15 G(EDU).65 E(This w)117 434.4 Q
-(ould cause my outgoing mail to be sent as Eric.Allman.)-.1 E .757
-(If a \231maildrop\232 is found for the user)142 450.6 R 3.257(,b)-.4 G .757
-(ut no corresponding \231maildrop\232 record e)301.588 450.6 R .757(xists, the)
--.15 F 1.127(record \231:def)117 462.6 R 1.127(ault:mailname\232 is consulted.)
--.1 F 1.127(If present, this is the name of a host to o)6.127 F -.15(ve)-.15 G
-1.128(rride the).15 F .625(local host.)117 474.6 R -.15(Fo)5.625 G 3.125(re).15
-G .625(xample, in our case we w)185.515 474.6 R .625
-(ould set it to \231CS.Berk)-.1 F(ele)-.1 E -.65(y.)-.15 G 3.125(EDU\232. The)
-.65 F(ef)3.125 E .625(fect is that)-.25 F(an)117 486.6 Q .881(yone kno)-.15 F
-.882(wn in the database gets their outgoing mail stamped as \231user@CS.Berk)
--.25 F(ele)-.1 E -.65(y.)-.15 G(EDU\232,).65 E -.2(bu)117 498.6 S 2.5(tp).2 G
-(eople not listed in the database use the local hostname.)137.08 498.6 Q F0 2.5
-(6. O)72 522.6 R(THER CONFIGURA)-.4 E(TION)-.95 E F1 .907
-(There are some con\214guration changes that can be made by recompiling)112
-538.8 R F2(sendmail)3.407 E F1 5.907(.T)C .906(his section)460.594 538.8 R
-(describes what changes can be made and what has to be modi\214ed to mak)87
-550.8 Q 2.5(et)-.1 G(hem.)387.95 550.8 Q F0 2.5(6.1. P)87 574.8 R
-(arameters in sr)-.1 E(c/Mak)-.18 E(e\214le)-.1 E F1 .92
-(These parameters are intended to describe the compilation en)127 591 R .92
-(vironment, not site polic)-.4 F 2.22 -.65(y, a)-.15 H(nd).65 E
-(should normally be de\214ned in src/Mak)102 603 Q(e\214le.)-.1 E 39.5(NDBM If)
-102 619.2 R .665(set, the ne)3.165 F 3.165(wv)-.25 G .664
-(ersion of the DBM library that allo)240.41 619.2 R .664
-(ws multiple databases will be)-.25 F 2.542(used. If)174 631.2 R .042
-(neither NDBM nor NEWDB are set, a much less ef)2.542 F .043
-(\214cient method of alias)-.25 F(lookup is used.)174 643.2 Q 32.84(NEWDB If)
-102 659.4 R .142(set, use the ne)2.642 F 2.642(wd)-.25 G .142
-(atabase package from Berk)254.44 659.4 R(ele)-.1 E 2.641(y\()-.15 G .141
-(from 4.4BSD\).)385.817 659.4 R .141(This package)5.141 F .266
-(is substantially f)174 671.4 R .267(aster than DBM or NDBM.)-.1 F .267
-(If NEWDB and NDBM are both set,)5.267 F(sendmail will read DBM \214les, b)174
-683.4 Q(ut will create and use NEWDB \214les.)-.2 E(YPCOMP)102 699.6 Q 19.3
--1.11(AT I)-.92 H 3.684(fs)1.11 G 1.184(et together with)188.234 699.6 R F2
-(both)3.684 E F1 1.183(NEWDB and NDBM,)3.683 F F2(sendmail)3.683 E F1 1.183
-(will create both DBM)3.683 F 1.067
-(and NEWDB \214les if and only if the \214le /v)174 711.6 R(ar/yp/Mak)-.25 E
-1.067(e\214le e)-.1 F 1.067(xists and is readable.)-.15 F .501
-(This is intended for compatibility with Sun Microsystems')174 723.6 R F2
-(mkalias)3.001 E F1 .501(program used)3.001 F EP
-%%Page: 45 42
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-45)452.9 60 Q/F1 10/Times-Roman@0 SF(on YP masters.)174 96 Q 41.73
-(_AIX3 Compile)102 112.2 R(for IBM AIX 3.x.)2.5 E
-(This has only been tested on 3.2.3.)5 E 25.05(SYSTEM5 Set)102 128.4 R
-(all of the compilation parameters appropriate for System V)2.5 E(.)-1.29 E
-36.72(LOCKF Use)102 144.6 R .299(System V)2.799 F F0(lockf)2.799 E F1 .299
-(instead of Berk)2.799 F(ele)-.1 E(y)-.15 E F0(\215ock)2.799 E F1 5.299(.D)C .3
-(ue to the highly unusual seman-)375.012 144.6 R .052
-(tics of locks across forks in)174 156.6 R F0(lockf)2.552 E F1 2.551(,t)C .051
-(his should ne)314.903 156.6 R -.15(ve)-.25 G 2.551(rb).15 G 2.551(eu)387.706
-156.6 S .051(sed unless absolutely nec-)399.697 156.6 R(essary)174 168.6 Q 5
-(.S)-.65 G(et by def)211.4 168.6 Q(ault if SYSTEM5 is set.)-.1 E 33.94
-(SYS5TZ Use)102 184.8 R(System V time zone semantics.)2.5 E(HASINITGR)102 201 Q
-(OUPS)-.4 E .812(Set this if your system has the)174 213 R/F2 10/Times-Italic@0
-SF(initgr)3.312 E(oups\(\))-.45 E F1 .812(call \(if you ha)3.312 F 1.112 -.15
-(ve m)-.2 H .813(ultiple group sup-).15 F 2.5(port\). This)174 225 R
-(is the def)2.5 E(ault if SYSTEM5 is)-.1 E F2(not)2.5 E F1
-(de\214ned or if you are on HPUX.)2.5 E(HASUN)102 241.2 Q 13.19(AME Set)-.35 F
-.89(this if you ha)3.39 F 1.19 -.15(ve t)-.2 H(he).15 E F2(uname)3.39 E F1 .89
-(\(2\) system call \(or corresponding library routine\).)B(Set by def)174 253.2
-Q(ault if SYSTEM5 is set.)-.1 E(HASST)102 269.4 Q -1.11(AT)-.93 G 15.42(FS Set)
-1.11 F .202(this if you ha)2.701 F .502 -.15(ve t)-.2 H(he).15 E F2(statfs)
-2.702 E F1 .202(\(2\) system call.)B .202(This will allo)5.202 F 2.702(wy)-.25
-G .202(ou to gi)425.822 269.4 R .502 -.15(ve a t)-.25 H(empo-).15 E .108
-(rary f)174 281.4 R .108(ailure message to incoming SMTP email when you are lo)
--.1 F 2.608(wo)-.25 G 2.608(nd)441.188 281.4 S .107(isk space.)453.796 281.4 R
-(It)5.107 E(is set by def)174 293.4 Q(ault on 4.4BSD and OSF/1 systems.)-.1 E
-(HASUST)102 309.6 Q 21.54 -1.11(AT S)-.93 H .593(et if you ha)1.11 F .894 -.15
-(ve t)-.2 H(he).15 E F2(ustat)3.094 E F1 .594(\(2\) system call.)B .594
-(This is an alternati)5.594 F .894 -.15(ve i)-.25 H .594(mplementation of).15 F
-.525(disk space control.)174 321.6 R -1.1(Yo)5.525 G 3.025(us)1.1 G .525
-(hould only set one of HASST)278.32 321.6 R -1.11(AT)-.93 G .525(FS or HASUST)
-1.11 F -.83 -1.11(AT ;)-.93 H(the)4.135 E(\214rst is preferred.)174 333.6 Q(_P)
-102 349.8 Q -1.11(AT)-.92 G(H_SENDMAILCF)1.11 E
-(The pathname of the sendmail.cf \214le.)174 361.8 Q(_P)102 378 Q -1.11(AT)-.92
-G(H_SENDMAILFC)1.11 E(The pathname of the sendmail.fc \214le.)174 390 Q(_P)102
-406.2 Q -1.11(AT)-.92 G(H_SENDMAILPID)1.11 E
-(The pathname of the sendmail.pid \214le.)174 418.2 Q 26.17(LA_TYPE The)102
-434.4 R(load a)2.5 E -.15(ve)-.2 G(rage type.).15 E(Details are described belo)
-5 E -.65(w.)-.25 G 1.146(The are four b)102 450.6 R 1.146(uilt-in w)-.2 F 1.146
-(ays of computing the load a)-.1 F -.15(ve)-.2 G(rage.).15 E F2(Sendmail)6.147
-E F1 1.147(tries to auto-con\214gure them)3.647 F .267
-(based on imperfect guesses; you can select one using the)102 462.6 R F2(cc)
-2.766 E F1(option)2.766 E F0(\255DLA_TYPE=)2.766 E F2(type)A F1 2.766(,w)C
-(here)467.364 462.6 Q F2(type)2.766 E F1(is:)102 474.6 Q 34.51(LA_INT The)102
-490.8 R -.1(ke)2.978 G .478(rnel stores the load a).1 F -.15(ve)-.2 G .479
-(rage in the k).15 F .479(ernel as an array of long inte)-.1 F 2.979(gers. The)
--.15 F(actual v)174 502.8 Q(alues are scaled by a f)-.25 E(actor FSCALE \(def)
--.1 E(ault 256\).)-.1 E(LA_FLO)102 519 Q 22.63 -1.11(AT T)-.35 H 1.118(he k)
-1.11 F 1.117(ernel stores the load a)-.1 F -.15(ve)-.2 G 1.117(rage in the k)
-.15 F 1.117(ernel as an array of double precision)-.1 F(\215oats.)174 531 Q
-25.05(LA_SUBR Call)102 547.2 R(the)2.5 E F2 -.1(ge)2.5 G(tloadavg).1 E F1
-(routine to get the load a)2.5 E -.15(ve)-.2 G(rage as an array of doubles.).15
-E(LA_ZER)102 563.4 Q 27.96(OA)-.4 G -.1(lwa)181.22 563.4 S
-(ys return zero as the load a).1 E -.15(ve)-.2 G 2.5(rage. This).15 F(is the f)
-2.5 E(allback case.)-.1 E .738(If type)102 579.6 R/F3 9/Times-Roman@0 SF
-(LA_INT)3.238 E F1(or)3.238 E F3(LA_FLO)3.238 E -.999(AT)-.315 G F1 .738
-(is speci\214ed, you may also need to specify)4.237 F F3(_P)3.239 E -.999(AT)
--.828 G(H_UNIX).999 E F1 .739(\(the path to)3.239 F .269
-(your system binary\) and)102 591.6 R F3(LA_A)2.769 E(VENR)-1.215 E(UN)-.36 E
-F1 .269(\(the name of the v)2.769 F .269(ariable containing the load a)-.25 F
--.15(ve)-.2 G .269(rage in the).15 F -.1(ke)102 603.6 S(rnel; usually \231_a).1
-E -.15(ve)-.2 G(nrun\232 or \231a).15 E -.15(ve)-.2 G(nrun\232\).).15 E F0 2.5
-(6.2. P)87 627.6 R(arameters in sr)-.1 E(c/conf)-.18 E(.h)-.15 E F1 -.15(Pa)127
-643.8 S .895(rameters and compilation options are de\214ned in conf.h.).15 F
-.896(Most of these need not normally)5.895 F .193(be tweak)102 655.8 R .192
-(ed; common parameters are all in sendmail.cf.)-.1 F(Ho)5.192 E(we)-.25 E -.15
-(ve)-.25 G .992 -.4(r, t).15 H .192(he sizes of certain primiti).4 F .492 -.15
-(ve ve)-.25 H(c-).15 E(tors, etc., are included in this \214le.)102 667.8 Q
-(The numbers follo)5 E(wing the parameters are their def)-.25 E(ault v)-.1 E
-(alue.)-.25 E 1.909(MAXLINE [1024])102 684 R 1.909
-(The maximum line length of an)190.309 684 R 4.409(yi)-.15 G 1.909(nput line.)
-338.273 684 R 1.91(If message lines e)6.909 F 1.91(xceed this)-.15 F .575
-(length the)188.4 696 R 3.075(yw)-.15 G .575
-(ill still be processed correctly; ho)243.84 696 R(we)-.25 E -.15(ve)-.25 G
-1.375 -.4(r, h).15 H .575(eader lines, con\214gura-).4 F
-(tion \214le lines, alias lines, etc., must \214t within this limit.)188.4 708
-Q EP
-%%Page: 46 43
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 193.36(SMM:08-46 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E/F1 10/Times-Roman@0 SF(MAXN)102 96 Q
-(AME [256])-.35 E(The maximum length of an)9.82 E 2.5(yn)-.15 G
-(ame, such as a host or a user name.)309.63 96 Q .23(MAXPV [40])102 112.2 R
-.231(The maximum number of parameters to an)188.63 112.2 R 2.731(ym)-.15 G
-(ailer)376.455 112.2 Q 5.231(.T)-.55 G .231(his limits the number of)407.516
-112.2 R .376(recipients that may be passed in one transaction.)188.4 124.2 R
-.375(It can be set to an)5.376 F 2.875(ya)-.15 G(rbitrary)474.01 124.2 Q .875
-(number abo)188.4 136.2 R 1.175 -.15(ve a)-.15 H .876(bout 10, since).15 F/F2
-10/Times-Italic@0 SF(sendmail)3.376 E F1 .876(will break up a deli)3.376 F -.15
-(ve)-.25 G .876(ry into smaller).15 F .887(batches as needed.)188.4 148.2 R
-3.387(Ah)5.887 G .887(igher number may reduce load on your system, ho)285.808
-148.2 R(w-)-.25 E -2.15 -.25(ev e)188.4 160.2 T -.55(r.).25 G(MAXA)102 176.4 Q
--.18(TO)-1.11 G 2.558(M[).18 G 8.26(100] The)159.368 176.4 R .058
-(maximum number of atoms \(tok)2.558 F .059(ens\) in a single address.)-.1 F
--.15(Fo)5.059 G 2.559(re).15 G .059(xample, the)457.281 176.4 R
-(address \231eric@CS.Berk)188.4 188.4 Q(ele)-.1 E -.65(y.)-.15 G(EDU\232 is se)
-.65 E -.15(ve)-.25 G 2.5(na).15 G(toms.)367.93 188.4 Q .113(MAXMAILERS [25])102
-204.6 R .112(The maximum number of mailers that may be de\214ned in the con\
-\214guration \214le.).02 F(MAXR)102 220.8 Q(WSETS [100])-.55 E
-(The maximum number of re).01 E(writing sets that may be de\214ned.)-.25 E
-(MAXPRIORITIES [25])102 237 Q 2.481(The maximum number of v)188.4 249 R 2.482
-(alues for the \231Precedence:\232 \214eld that may be)-.25 F
-(de\214ned \(using the)188.4 261 Q F0(P)2.5 E F1(line in sendmail.cf\).)2.5 E
-(MAXUSERENVIR)102 277.2 Q(ON [40])-.4 E .399
-(The maximum number of items in the user en)188.4 289.2 R .399
-(vironment that will be passed to)-.4 F(subordinate mailers.)188.4 301.2 Q -.1
-(QU)102 317.4 S(EUESIZE [1000]).1 E
-(The maximum number of entries that will be processed in a single queue run.)
-2.35 E(MAXMXHOSTS [20])102 333.6 Q
-(The maximum number of MX records we will accept for an)188.4 345.6 Q 2.5(ys)
--.15 G(ingle host.)439.03 345.6 Q(MAXIP)102 361.8 Q .968(ADDR [16])-.92 F .968
-(The maximum number of numeric IP addresses we will accept for this host.)7.61
-F(This does not limit the number the number of addresses for other hosts.)188.4
-373.8 Q 2.851(An)102 390 S .351(umber of other compilation options e)117.071
-390 R 2.851(xist. These)-.15 F .35
-(specify whether or not speci\214c code should be)2.851 F(compiled in.)102 402
-Q(DEB)102 418.2 Q 49.56(UG If)-.1 F 1.226(set, deb)3.726 F 1.226
-(ugging information is compiled in.)-.2 F 2.827 -.8(To a)6.226 H 1.227
-(ctually get the deb).8 F(ugging)-.2 E .4(output, the)188.4 430.2 R F0<ad64>2.9
-E F1 .4(\215ag must be used.)2.9 F F0 .4(WE STR)5.4 F(ONGL)-.3 E 2.9(YR)-.92 G
-.4(ECOMMEND THA)412.05 430.2 R(T)-.95 E .97(THIS BE LEFT ON.)188.4 442.2 R F1
-.97(Some people, belie)5.97 F .97(ving that it w)-.25 F .97
-(as a security hole \(it)-.1 F -.1(wa)188.4 454.2 S(s, once\) ha).1 E .3 -.15
-(ve t)-.2 H(urned it of).15 E 2.5(fa)-.25 G(nd thus crippled deb)309.05 454.2 Q
-(uggers.)-.2 E 41.69(NETINET If)102 470.4 R .829
-(set, support for Internet protocol netw)3.33 F .829(orking is compiled in.)-.1
-F(Pre)5.829 E .829(vious v)-.25 F(er)-.15 E(-)-.2 E .006(sions of)188.4 482.4 R
-F0(sendmail)2.506 E F1 .006(referred to this as)2.506 F/F3 9/Times-Roman@0 SF
--.36(DA)2.506 G(EMON).36 E F1 2.506(;t)C .006(his old usage is no)382.57 482.4
-R 2.506(wi)-.25 G(ncorrect.)468.74 482.4 Q 48.35(NETISO If)102 498.6 R .143
-(set, support for ISO protocol netw)2.643 F .142
-(orking is compiled in \(it may be appropri-)-.1 F
-(ate to #de\214ne this in the Mak)188.4 510.6 Q(e\214le instead of conf.h\).)
--.1 E 63.35(LOG If)102 526.8 R .5(set, the)3 F F2(syslo)3 E(g)-.1 E F1 .5
-(routine in use at some sites is used.)3 F .5(This mak)5.5 F .5(es an informa-)
--.1 F .504(tional log record for each message processed, and mak)188.4 538.8 R
-.504(es a higher priority log)-.1 F(record for internal system errors.)188.4
-550.8 Q(MA)102 567 Q 16.12(TCHGECOS Compile)-1.11 F 3.555(in the code to do `)
-6.055 F 3.555(`fuzzy matching')-.74 F 6.055('o)-.74 G 6.055(nt)404.22 567 S
-3.555(he GECOS \214eld in)418.055 567 R 2.5(/etc/passwd. This)188.4 579 R
-(also requires that option G be turned on.)2.5 E -.35(NA)102 595.2 S 18.15
-(MED_BIND Compile).35 F .413(in code to use the Berk)2.913 F(ele)-.1 E 2.912
-(yI)-.15 G .412(nternet Name Domain \(BIND\) serv)342.41 595.2 R .412(er to)
--.15 F(resolv)188.4 607.2 Q 2.5(eT)-.15 G(CP/IP host names.)225.74 607.2 Q(NO)
-102 623.4 Q 38.76(TUNIX If)-.4 F .247
-(you are using a non-UNIX mail format, you can set this \215ag to turn of)2.747
-F 2.748(fs)-.25 G(pe-)491.23 623.4 Q
-(cial processing of UNIX-style \231From \232 lines.)188.4 635.4 Q -.1(QU)102
-651.6 S 50.12(EUE This).1 F 1.559
-(\215ag should be set to compile in the queueing code.)4.06 F 1.559
-(If this is not set,)6.559 F
-(mailers must accept the mail immediately or it will be returned to the sender)
-188.4 663.6 Q(.)-.55 E(SETPR)102 679.8 Q 12.63(OCTITLE If)-.4 F(de\214ned,)3.88
-E F2(sendmail)3.88 E F1 1.381(will change its)3.881 F F2(ar)3.881 E(gv)-.37 E
-F1 1.381(array to indicate its current status.)3.881 F .207
-(This can be used in conjunction with the)188.4 691.8 R F2(ps)2.707 E F1 .206
-(command to \214nd out just what it')2.707 F(s)-.55 E(up to.)188.4 703.8 Q EP
-%%Page: 47 44
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-47)452.9 60 Q/F1 10/Times-Roman@0 SF 57.78(SMTP If)102 96 R .756
-(set, the code to handle user and serv)3.256 F .756
-(er SMTP will be compiled in.)-.15 F .756(This is)5.756 F 2.507
-(only necessary if your machine has some mailer that speaks SMTP \(this)188.4
-108 R(means most machines e)188.4 120 Q -.15(ve)-.25 G(rywhere\).).15 E(UGL)102
-136.2 Q 30.46(YUUCP If)-1 F 1.023(you ha)3.523 F 1.323 -.15(ve a U)-.2 H 1.024
-(UCP host adjacent to you which is not running a reasonable).15 F -.15(ve)188.4
-148.2 S .112(rsion of).15 F/F2 10/Times-Italic@0 SF(rmail)2.612 E F1 2.612(,y)C
-.112(ou will ha)263.026 148.2 R .412 -.15(ve t)-.2 H 2.612(os).15 G .112
-(et this \215ag to include the \231remote from sys-)329.234 148.2 R .031
-(name\232 info on the from line.)188.4 160.2 R .032
-(Otherwise, UUCP gets confused about where the)5.032 F(mail came from.)188.4
-172.2 Q 44.45(USERDB Include)102 188.4 R(the)3.449 E F0(experimental)3.449 E F1
-(Berk)3.449 E(ele)-.1 E 3.449(yu)-.15 G .949(ser information database package.)
-341.356 188.4 R(This)5.948 E .27(adds a ne)188.4 200.4 R 2.77(wl)-.25 G -2.15
--.25(ev e)238.67 200.4 T 2.77(lo).25 G 2.77(fl)262.7 200.4 S .27(ocal name e)
-271.58 200.4 R .27(xpansion between aliasing and forw)-.15 F 2.77(arding. It)
--.1 F(also uses the NEWDB package.)188.4 212.4 Q
-(This may change in future releases.)5 E(IDENTPR)102 228.6 Q -1.88 -.4(OT O)-.4
-H .376(Compile in the IDENT protocol as de\214ned in RFC 1413.)188.4 228.6 R
-.375(This def)5.375 F .375(aults on for)-.1 F 1.053(all systems e)188.4 240.6 R
-1.053(xcept Ultrix, which apparently has the interesting \231feature\232 that)
--.15 F .83(when it recei)188.4 252.6 R -.15(ve)-.25 G 3.33(sa\231).15 G .83
-(host unreachable\232 message it closes all open connections)270.18 252.6 R
-1.921(to that host.)188.4 264.6 R 1.921(Since some \214re)6.921 F -.1(wa)-.25 G
-1.922(ll g).1 F(ate)-.05 E -.1(wa)-.25 G 1.922
-(ys send this error code when you).1 F 2.055
-(access an unauthorized port \(such as 113, used by IDENT\), Ultrix cannot)
-188.4 276.6 R(recei)188.4 288.6 Q .3 -.15(ve e)-.25 H(mail from such hosts.).15
-E F0 2.5(6.3. Con\214guration)87 312.6 R(in sr)2.5 E(c/conf)-.18 E(.c)-.15 E F1
-(The follo)127 328.8 Q(wing changes can be made in conf.c.)-.25 E F0 2.5
-(6.3.1. Built-in)102 352.8 R(Header Semantics)2.5 E F1 1.248
-(Not all header semantics are de\214ned in the con\214guration \214le.)142 369
-R 1.248(Header lines that should)6.248 F .305(only be included by certain mail\
-ers \(as well as other more obscure semantics\) must be speci\214ed)117 381 R
-.046(in the)117 393 R F2(HdrInfo)2.546 E F1 .046(table in)2.546 F F2(conf)2.546
-E(.c)-.15 E F1 5.046(.T)C .047
-(his table contains the header name \(which should be in all lo)246.836 393 R
-(wer)-.25 E(case\) and a set of header control \215ags \(described belo)117 405
-Q(w\), The \215ags are:)-.25 E(H_A)117 421.2 Q 30.97(CHECK Normally)-.4 F .007
-(when the check is made to see if a header line is compatible with)2.508 F 2.94
-(am)203.4 433.2 S(ailer)218.56 433.2 Q(,)-.4 E F2(sendmail)2.94 E F1 .441
-(will not delete an e)2.94 F .441(xisting line.)-.15 F .441
-(If this \215ag is set,)5.441 F F2(send-)2.941 E(mail)203.4 445.2 Q F1 .152
-(will delete e)2.652 F -.15(ve)-.25 G 2.652(ne).15 G .152
-(xisting header lines.)293.998 445.2 R .152
-(That is, if this bit is set and the)5.152 F 1.425(mailer does not ha)203.4
-457.2 R 1.725 -.15(ve \215)-.2 H 1.425
-(ag bits set that intersect with the required mailer).15 F 2.204
-(\215ags in the header de\214nition in sendmail.cf, the header line is)203.4
-469.2 R F2(always)4.703 E F1(deleted.)203.4 481.2 Q 51.13(H_EOH If)117 497.4 R
-.206(this header \214eld is set, treat it lik)2.705 F 2.706(eab)-.1 G .206
-(lank line, i.e., it will signal the end)363.948 497.4 R
-(of the header and the be)203.4 509.4 Q(ginning of the message te)-.15 E(xt.)
--.15 E 39.45(H_FORCE Add)117 525.6 R 2.039(this header entry e)4.539 F -.15(ve)
--.25 G 4.539(ni).15 G 4.539(fo)326.225 525.6 S 2.038(ne e)339.094 525.6 R 2.038
-(xisted in the message before.)-.15 F 2.038(If a)7.038 F 2.188
-(header entry does not ha)203.4 537.6 R 2.488 -.15(ve t)-.2 H 2.188
-(his bit set,).15 F F2(sendmail)4.688 E F1 2.189(will not add another)4.689 F
-.62(header line if a header line of this name already e)203.4 549.6 R 3.12
-(xisted. This)-.15 F -.1(wo)3.12 G .62(uld nor).1 F(-)-.2 E
-(mally be used to stamp the message by e)203.4 561.6 Q -.15(ve)-.25 G
-(ryone who handled it.).15 E(H_TRA)117 577.8 Q 39.3(CE If)-.4 F 1.043
-(set, this is a timestamp \(trace\) \214eld.)3.543 F 1.044
-(If the number of trace \214elds in a)6.043 F .706(message e)203.4 589.8 R .705
-(xceeds a preset amount the message is returned on the assump-)-.15 F
-(tion that it has an aliasing loop.)203.4 601.8 Q 46.67(H_RCPT If)117 618 R
-.332(set, this \214eld contains recipient addresses.)2.832 F .332
-(This is used by the)5.332 F F0<ad74>2.832 E F1 .333(\215ag to)2.833 F 1.349
-(determine who to send to when it is collecting recipients from the mes-)203.4
-630 R(sage.)203.4 642 Q(H_FR)117 658.2 Q 43.74(OM This)-.4 F 1.673
-(\215ag indicates that this \214eld speci\214es a sender)4.173 F 6.674(.T)-.55
-G 1.674(he order of these)432.058 658.2 R .883(\214elds in the)203.4 670.2 R F2
-(HdrInfo)3.383 E F1 .883(table speci\214es)3.383 F F2(sendmail')3.383 E(s)-.4 E
-F1 .883(preference for which \214eld)3.383 F(to return error messages to.)203.4
-682.2 Q(Let')117 698.4 Q 2.5(sl)-.55 G(ook at a sample)142.28 698.4 Q F2
-(HdrInfo)2.5 E F1(speci\214cation:)2.5 E EP
-%%Page: 48 45
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 193.36(SMM:08-48 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E/F1 10/Times-Roman@0 SF(struct hdrinfo)
-157 96 Q(HdrInfo[] =)258.19 96 Q({)157 108 Q
-(/* originator \214elds, most to least signi\214cant)189.5 120 Q(*/)5 E 14.72
-("resent-sender", H_FR)177 132 R(OM,)-.4 E 21.38("resent-from", H_FR)177 144 R
-(OM,)-.4 E 41.93("sender", H_FR)177 156 R(OM,)-.4 E 48.59("from", H_FR)177 168
-R(OM,)-.4 E 29.15("full-name", H_A)177 180 R(CHECK,)-.4 E
-(/* destination \214elds */)189.5 192 Q 60.25("to", H_RCPT)177 204 R(,)-.74 E
-33.04("resent-to", H_RCPT)177 216 R(,)-.74 E 59.15("cc", H_RCPT)177 228 R(,)
--.74 E(/* message identi\214cation and control */)189.5 240 Q 34.15
-("message", H_EOH,)177 252 R("te)177 264 Q 53.18(xt", H_EOH,)-.15 F
-(/* trace \214elds */)189.5 276 Q("recei)177 288 Q -.15(ve)-.25 G 34.56
-(d", H_TRA).15 F(CE|H_FORCE,)-.4 E 49.53(NULL, 0,)177 312 R(};)157 324 Q 2.435
-(This structure indicates that the \231T)117 340.2 R 2.435
-(o:\232, \231Resent-T)-.8 F 2.435
-(o:\232, and \231Cc:\232 \214elds all specify recipient)-.8 F 3.162
-(addresses. An)117 352.2 R 3.162<7999>-.15 G .661(Full-Name:\232 \214eld will \
-be deleted unless the required mailer \215ag \(indicated in)188.154 352.2 R
-.245(the con\214guration \214le\) is speci\214ed.)117 364.2 R .245
-(The \231Message:\232 and \231T)5.245 F -.15(ex)-.7 G .246
-(t:\232 \214elds will terminate the header;).15 F 1.936
-(these are used by random dissenters around the netw)117 376.2 R 1.936(ork w)
--.1 F 4.436(orld. The)-.1 F(\231Recei)4.436 E -.15(ve)-.25 G 1.936
-(d:\232 \214eld will).15 F(al)117 388.2 Q -.1(wa)-.1 G
-(ys be added, and can be used to trace messages.).1 E .445
-(There are a number of important points here.)142 404.4 R .446
-(First, header \214elds are not added automati-)5.446 F .657
-(cally just because the)117 416.4 R 3.157(ya)-.15 G .657(re in the)216.678
-416.4 R/F2 10/Times-Italic@0 SF(HdrInfo)3.157 E F1 .657(structure; the)3.157 F
-3.157(ym)-.15 G .656(ust be speci\214ed in the con\214guration)358.23 416.4 R
-.727(\214le in order to be added to the message.)117 428.4 R(An)5.728 E 3.228
-(yh)-.15 G .728(eader \214elds mentioned in the con\214guration \214le)312.982
-428.4 R -.2(bu)117 440.4 S 3.24(tn).2 G .74(ot mentioned in the)137.82 440.4 R
-F2(HdrInfo)3.24 E F1 .74(structure ha)3.24 F 1.04 -.15(ve d)-.2 H(ef).15 E .74
-(ault processing performed; that is, the)-.1 F 3.24(ya)-.15 G(re)496.23 440.4 Q
-1.374(added unless the)117 452.4 R 3.874(yw)-.15 G 1.374
-(ere in the message already)201.792 452.4 R 6.375(.S)-.65 G 1.375(econd, the)
-326.595 452.4 R F2(HdrInfo)3.875 E F1 1.375(structure only speci\214es)3.875 F
-.324
-(cliched processing; certain headers are processed specially by ad hoc code re)
-117 464.4 R -.05(ga)-.15 G .324(rdless of the sta-).05 F .48
-(tus speci\214ed in)117 476.4 R F2(HdrInfo)2.98 E F1 5.48(.F)C .481(or e)226.55
-476.4 R .481(xample, the \231Sender:\232 and \231From:\232 \214elds are al)-.15
-F -.1(wa)-.1 G .481(ys scanned on).1 F(ARP)117 490.4 Q .75
-(ANET mail to determine the sender)-.92 F/F3 7/Times-Roman@0 SF(12)282.31 486.4
-Q F1 3.251(;t)289.31 490.4 S .751
-(his is used to perform the \231return to sender\232 func-)298.121 490.4 R
-2.977(tion. The)117 502.4 R .476(\231From:\232 and \231Full-Name:\232 \214elds\
- are used to determine the full name of the sender if)2.977 F
-(possible; this is stored in the macro)117 514.4 Q F0($x)2.5 E F1
-(and used in a number of w)2.5 E(ays.)-.1 E F0 2.5(6.3.2. Restricting)102 538.4
-R(Use of Email)2.5 E F1 .149
-(If it is necessary to restrict mail through a relay)142 554.6 R 2.649(,t)-.65
-G(he)339.75 554.6 Q F2 -.15(ch)2.65 G(ec).15 E(kcompat)-.2 E F1 .15
-(routine can be modi\214ed.)2.65 F .163(This routine is called for e)117 566.6
-R -.15(ve)-.25 G .163(ry recipient address.).15 F .163(It returns an e)5.163 F
-.163(xit status indicating the status of)-.15 F .895(the message.)117 578.6 R
-.895(The status)5.895 F/F4 9/Times-Roman@0 SF(EX_OK)3.395 E F1 .895
-(accepts the address,)3.395 F F4(EX_TEMPF)3.395 E(AIL)-.666 E F1 .895
-(queues the message for a)3.395 F .264(later try)117 590.6 R 2.764(,a)-.65 G
-.264(nd other v)157.698 590.6 R .264(alues \(commonly)-.25 F F4(EX_UN)2.764 E
--1.215(AVA)-.315 G(ILABLE)1.215 E F1 2.764(\)r)C .264(eject the message.)
-358.375 590.6 R .263(It is up to)5.264 F F2 -.15(ch)2.763 G(ec).15 E(k-)-.2 E
-(compat)117 602.6 Q F1 .429(to print an error message \(using)2.929 F F2(usr)
-2.929 E(err)-.37 E F1 2.929(\)i)C 2.929(ft)315.032 602.6 S .43
-(he message is rejected.)324.071 602.6 R -.15(Fo)5.43 G 2.93(re).15 G(xample,)
-443.39 602.6 Q F2 -.15(ch)2.93 G(ec).15 E(k-)-.2 E(compat)117 614.6 Q F1
-(could read:)2.5 E .32 LW 76 669.2 72 669.2 DL 80 669.2 76 669.2 DL 84 669.2 80
-669.2 DL 88 669.2 84 669.2 DL 92 669.2 88 669.2 DL 96 669.2 92 669.2 DL 100
-669.2 96 669.2 DL 104 669.2 100 669.2 DL 108 669.2 104 669.2 DL 112 669.2 108
-669.2 DL 116 669.2 112 669.2 DL 120 669.2 116 669.2 DL 124 669.2 120 669.2 DL
-128 669.2 124 669.2 DL 132 669.2 128 669.2 DL 136 669.2 132 669.2 DL 140 669.2
-136 669.2 DL 144 669.2 140 669.2 DL 148 669.2 144 669.2 DL 152 669.2 148 669.2
-DL 156 669.2 152 669.2 DL 160 669.2 156 669.2 DL 164 669.2 160 669.2 DL 168
-669.2 164 669.2 DL 172 669.2 168 669.2 DL 176 669.2 172 669.2 DL 180 669.2 176
-669.2 DL 184 669.2 180 669.2 DL 188 669.2 184 669.2 DL 192 669.2 188 669.2 DL
-196 669.2 192 669.2 DL 200 669.2 196 669.2 DL 204 669.2 200 669.2 DL 208 669.2
-204 669.2 DL 212 669.2 208 669.2 DL 216 669.2 212 669.2 DL/F5 5/Times-Roman@0
-SF(12)93.6 679.6 Q/F6 8/Times-Roman@0 SF(Actually)3.2 I 2.632(,t)-.52 G .632
-(his is no longer true in SMTP; this information is contained in the en)132.488
-682.8 R -.12(ve)-.32 G 2.631(lope. The).12 F .631(older ARP)2.631 F .631
-(ANET protocols did)-.736 F(not completely distinguish en)72 692.4 Q -.12(ve)
--.32 G(lope from header).12 E(.)-.44 E EP
-%%Page: 49 46
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-49)452.9 60 Q/F1 9/Times-Roman@0 SF(int)157 94.8 Q
-(checkcompat\(to, e\))157 105.6 Q(re)175 116.4 Q(gister ADDRESS *to;)-.135 E
-(re)175 127.2 Q(gister ENVELOPE *e;)-.135 E({)157 138 Q(re)175 148.8 Q
-(gister ST)-.135 E(AB *s;)-.837 E 2.25(s=s)175 170.4 S(tab\("pri)191.578 170.4
-Q -.225(va)-.225 G(te", ST_MAILER, ST_FIND\);).225 E
-(if \(s != NULL && e\255>e_from.q_mailer != LocalMailer &&)175 181.2 Q
-(to->q_mailer == s->s_mailer\))184 192 Q({)175 202.8 Q(usrerr\("No pri)193
-213.6 Q -.225(va)-.225 G(te net mail allo).225 E(wed through this machine"\);)
--.225 E(return \(EX_UN)193 224.4 Q -1.215(AVA)-.315 G(ILABLE\);)1.215 E(})175
-235.2 Q(if \(MsgSize > 50000 && to\255>q_mailer != LocalMailer\))175 246 Q({)
-175 256.8 Q(usrerr\("Message too lar)193 267.6 Q(ge for non-local deli)-.162 E
--.135(ve)-.225 G(ry"\);).135 E(NoReturn = TR)193 278.4 Q(UE;)-.36 E
-(return \(EX_UN)193 289.2 Q -1.215(AVA)-.315 G(ILABLE\);)1.215 E(})175 300 Q
-(return \(EX_OK\);)175 310.8 Q(})157 321.6 Q/F2 10/Times-Roman@0 SF .205
-(This w)117 337.8 R .205
-(ould reject messages greater than 50000 bytes unless the)-.1 F 2.705(yw)-.15 G
-.205(ere local.)387.09 337.8 R(The)5.205 E/F3 10/Times-Italic@0 SF(NoReturn)
-2.705 E F2(\215ag)2.705 E 1.196(can be sent to suppress the return of the actu\
-al body of the message in the error return.)117 349.8 R(The)6.197 E(actual use\
- of this routine is highly dependent on the implementation, and use should be \
-limited.)117 361.8 Q F0 2.5(6.3.3. Load)102 385.8 R -.6 -1(Av e)2.5 H
-(rage Computation)1 E F2 .18(The routine)142 402 R F3 -.1(ge)2.68 G(tla).1 E F2
-.18(should return an approximation of the current system load a)2.68 F -.15(ve)
--.2 G .18(rage as an).15 F(inte)117 414 Q(ger)-.15 E 5(.T)-.55 G
-(here are four v)157.68 414 Q
-(ersions included on compilation \215ags as described abo)-.15 E -.15(ve)-.15 G
-(.).15 E F0 2.5(6.3.4. New)102 438 R(Database Map Classes)2.5 E F2(Ne)142 454.2
-Q 2.875(wk)-.25 G .675 -.15(ey m)168.405 454.2 T .375(aps can be added by crea\
-ting a class initialization function and a lookup func-).15 F 2.5(tion. These)
-117 466.2 R(are then added to the routine)2.5 E F3(setupmaps.)2.5 E F2
-(The initialization function is called as)142 482.4 Q F3(xxx)157 498.6 Q F2
-(_map_init\(MAP *map, char *mapname, char *ar)A(gs\))-.18 E(The)117 514.8 Q F3
-(map)2.555 E F2 .055(is an internal data structure.)2.555 F(The)5.055 E F3
-(mapname)2.555 E F2 .054(is the name of the map \(used for error mes-)2.554 F
-2.819(sages\). The)117 526.8 R F3(ar)2.819 E(gs)-.37 E F2 .32(is a pointer to \
-the rest of the con\214guration \214le line; \215ags and \214lenames can be)
-2.819 F -.15(ex)117 538.8 S .675(tracted from this line.).15 F .675
-(The initialization function must return)5.675 F F1(TR)3.175 E(UE)-.36 E F2
-.674(if it successfully opened)3.174 F(the map,)117 550.8 Q F1 -.666(FA)2.5 G
-(LSE).666 E F2(otherwise.)2.5 E(The lookup function is called as)142 567 Q F3
-(xxx)157 583.2 Q F2(_map_lookup\(MAP *map, char b)A(uf[], int b)-.2 E
-(ufsize, char **a)-.2 E 1.3 -.65(v, i)-.2 H(nt *statp\)).65 E(The)117 599.4 Q
-F3(map)3.475 E F2 .975(de\214nes the map internally)3.475 F 5.975(.T)-.65 G
-.975(he parameters)277.18 599.4 R F3 -.2(bu)3.475 G(f).2 E F2(and)3.475 E F3
--.2(bu)3.475 G(fsize).2 E F2(ha)3.476 E 1.276 -.15(ve t)-.2 H .976(he input k)
-.15 F -.15(ey)-.1 G 5.976(.T)-.5 G(his)492.33 599.4 Q .043
-(may be \(and often is\) used destructi)117 611.4 R -.15(ve)-.25 G(ly).15 E
-5.043(.T)-.65 G(he)289.831 611.4 Q F3(av)2.543 E F2 .043(is a list of ar)2.543
-F .042(guments passed in from the re)-.18 F(write)-.25 E 3.654(line. The)117
-623.4 R 1.154(lookup function should return a pointer to the ne)3.654 F 3.655
-(wv)-.25 G 3.655(alue. IF)378.335 623.4 R 1.155(the map lookup f)3.655 F(ails,)
--.1 E F3(*statp)117 635.4 Q F2 1.272(should be set to an e)3.772 F 1.272
-(xit status code; in particular)-.15 F 3.772(,i)-.4 G 3.771(ts)357.652 635.4 S
-1.271(hould be set to)368.093 635.4 R F1(EX_TEMPF)3.771 E(AIL)-.666 E F2(if)
-3.771 E(reco)117 647.4 Q -.15(ve)-.15 G(ry is to be attempted by the higher le)
-.15 E -.15(ve)-.25 G 2.5(lc).15 G(ode.)308.76 647.4 Q F0 2.5(6.3.5. Queueing)
-102 671.4 R(Function)2.5 E F2 .782(The routine)142 687.6 R F3(shouldqueue)3.282
-E F2 .783(is called to decide if a message should be queued or processed)3.283
-F(immediately)117 699.6 Q 6.619(.T)-.65 G 1.618
-(ypically this compares the message priority to the current load a)180.779
-699.6 R -.15(ve)-.2 G 4.118(rage. The).15 F(def)117 711.6 Q
-(ault de\214nition is:)-.1 E EP
-%%Page: 50 47
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 193.36(SMM:08-50 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E/F1 10/Times-Roman@0 SF(bool)157 96 Q
-(shouldqueue\(pri, ctime\))157 108 Q(long pri;)175 120 Q(time_t ctime;)175 132
-Q({)157 144 Q(if \(CurrentLA < QueueLA\))175 156 Q(return \(F)193 168 Q
-(ALSE\);)-.74 E(if \(CurrentLA >= RefuseLA\))175 180 Q(return \(TR)193 192 Q
-(UE\);)-.4 E(return \(pri > \(QueueF)175 204 Q
-(actor / \(CurrentLA \255 QueueLA + 1\)\)\);)-.15 E(})157 216 Q 2.062
-(If the current load a)117 232.2 R -.15(ve)-.2 G 2.062(rage \(global v).15 F
-(ariable)-.25 E/F2 10/Times-Italic@0 SF(Curr)4.562 E(entLA)-.37 E F1 4.562(,w)C
-2.062(hich is set before this function is)361.636 232.2 R 1.058
-(called\) is less than the lo)117 244.2 R 3.558(wt)-.25 G 1.058
-(hreshold load a)234.198 244.2 R -.15(ve)-.2 G 1.058(rage \(option).15 F F0(x)
-3.557 E F1 3.557(,v)C(ariable)375.526 244.2 Q F2(QueueLA)3.557 E F1(\),)A F2
-(shouldqueue)3.557 E F1(returns)117 256.2 Q/F3 9/Times-Roman@0 SF -.666(FA)
-2.586 G(LSE).666 E F1 .086(immediately \(that is, it should)2.586 F F2(not)
-2.586 E F1 2.586(queue\). If)2.586 F .086(the current load a)2.586 F -.15(ve)
--.2 G .087(rage e).15 F .087(xceeds the)-.15 F .588(high threshold load a)117
-268.2 R -.15(ve)-.2 G .588(rage \(option).15 F F0(X)3.087 E F1 3.087(,v)C
-(ariable)281.846 268.2 Q F2(RefuseLA)3.087 E F1(\),)A F2(shouldqueue)3.087 E F1
-(returns)3.087 E F3(TR)3.087 E(UE)-.36 E F1(immedi-)3.087 E(ately)117 280.2 Q
-7.125(.O)-.65 G 2.125
-(therwise, it computes the function based on the message priority)152.635 280.2
-R 4.626(,t)-.65 G 2.126(he queue f)438.208 280.2 R(actor)-.1 E(\(option)117
-292.2 Q F0(q)2.5 E F1 2.5(,g)C(lobal v)163.95 292.2 Q(ariable)-.25 E F2(QueueF)
-2.5 E(actor)-.75 E F1(\), and the current and threshold load a)A -.15(ve)-.2 G
-(rages.).15 E 1.067(An implementation wishing to tak)142 308.4 R 3.567(et)-.1 G
-1.066(he actual age of the message into account can also)293.625 308.4 R 1.41
-(use the)117 320.4 R F2(ctime)3.91 E F1(parameter)3.91 E 3.91(,w)-.4 G 1.41
-(hich is the time that the message w)229.15 320.4 R 1.41
-(as \214rst submitted to)-.1 F F2(sendmail)3.91 E F1(.)A .929(Note that the)117
-332.4 R F2(pri)3.428 E F1 .928
-(parameter is already weighted by the number of times the message has been)
-3.428 F .395(tried \(although this tends to lo)117 344.4 R .395
-(wer the priority of the message with time\); the e)-.25 F .395
-(xpectation is that)-.15 F(the)117 356.4 Q F2(ctime)2.674 E F1 -.1(wo)2.674 G
-.174(uld be used as an \231escape clause\232 to ensure that messages are e).1 F
--.15(ve)-.25 G .174(ntually processed.).15 F F0 2.5(6.3.6. Refusing)102 380.4 R
-(Incoming SMTP Connections)2.5 E F1 1.148(The function)142 396.6 R F2 -.37(re)
-3.648 G(fuseconnections).37 E F1(returns)3.648 E F3(TR)3.648 E(UE)-.36 E F1
-1.148(if incoming SMTP connections should be)3.648 F 3.564(refused. The)117
-408.6 R 1.063(current implementation is based e)3.563 F(xclusi)-.15 E -.15(ve)
--.25 G 1.063(ly on the current load a).15 F -.15(ve)-.2 G 1.063(rage and the)
-.15 F(refuse load a)117 420.6 Q -.15(ve)-.2 G(rage option \(option).15 E F0(X)
-2.5 E F1 2.5(,g)C(lobal v)273.56 420.6 Q(ariable)-.25 E F2(RefuseLA)2.5 E F1
-(\):)A(bool)157 436.8 Q(refuseconnections\(\))157 448.8 Q({)157 460.8 Q
-(return \(CurrentLA >= RefuseLA\);)175 472.8 Q(})157 484.8 Q 2.5(Am)117 501 S
-(ore cle)134.5 501 Q -.15(ve)-.25 G 2.5(ri).15 G
-(mplementation could look at more system resources.)179.08 501 Q F0 2.5
-(6.3.7. Load)102 525 R -.6 -1(Av e)2.5 H(rage Computation)1 E F1 .243
-(The routine)142 541.2 R F2 -.1(ge)2.743 G(tla).1 E F1 .243
-(returns the current load a)2.743 F -.15(ve)-.2 G .243
-(rage \(as a rounded inte).15 F 2.743(ger\). The)-.15 F(distrib)2.744 E(ution)
--.2 E(includes se)117 553.2 Q -.15(ve)-.25 G(ral possible implementations.).15
-E F0 2.5(6.4. Con\214guration)87 577.2 R(in sr)2.5 E(c/daemon.c)-.18 E F1 .4
-(The \214le)127 593.4 R F2(sr)2.9 E(c/daemon.c)-.37 E F1 .4
-(contains a number of routines that are dependent on the local netw)2.9 F(ork-)
--.1 E(ing en)102 605.4 Q 2.5(vironment. The)-.4 F -.15(ve)2.5 G
-(rsion supplied assumes you ha).15 E .3 -.15(ve B)-.2 H(SD style sock).15 E
-(ets.)-.1 E 2.16(In pre)127 621.6 R 2.16
-(vious releases, we recommended that you modify the routine)-.25 F F2
-(maphostname)4.66 E F1 2.16(if you)4.66 F -.1(wa)102 633.6 S 1.919
-(nted to generalize).1 F F0($[)4.418 E F1(...)4.418 E F0($])4.418 E F1 4.418
-(lookups. W)4.418 F 4.418(en)-.8 G 2.418 -.25(ow r)293.906 633.6 T 1.918
-(ecommend that you create a ne).25 F 4.418(wk)-.25 G -.15(ey)463.632 633.6 S
-1.918(ed map).15 F(instead.)102 645.6 Q F0 2.5(7. CHANGES)72 669.6 R
-(IN VERSION 8)2.5 E F1 2.661(The follo)112 685.8 R 2.662
-(wing summarizes changes since the last commonly a)-.25 F -.25(va)-.2 G 2.662
-(ilable v).25 F 2.662(ersion of)-.15 F F0(sendmail)5.162 E F1(\(5.67\):)87
-697.8 Q EP
-%%Page: 51 48
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-51)452.9 60 Q 2.5(7.1. Connection)87 96 R(Caching)2.5 E/F1 10
-/Times-Roman@0 SF .398(Instead of closing SMTP connections immediately)127
-112.2 R 2.897(,t)-.65 G .397(hose connections are cached for possible)339.005
-112.2 R .597(future use.)102 124.2 R .597(The adv)5.597 F .597
-(ent of MX records made this ef)-.15 F(fecti)-.25 E .897 -.15(ve f)-.25 H .598
-(or mailing lists; in addition, substantial).15 F(performance impro)102 136.2 Q
--.15(ve)-.15 G(ments can be e).15 E(xpected for queue processing.)-.15 E F0 2.5
-(7.2. MX)87 160.2 R(Piggybacking)2.5 E F1 1.258(If tw)127 176.4 R 3.757(oh)-.1
-G 1.257(osts with dif)161.075 176.4 R 1.257
-(ferent names in a single message happen to ha)-.25 F 1.557 -.15(ve t)-.2 H
-1.257(he same set of MX).15 F .94(hosts, the)102 188.4 R 3.44(yc)-.15 G .94
-(an be sent in the same transaction.)153.45 188.4 R -1.11(Ve)5.94 G .94
-(rsion 8 notices this and tries to batch the mes-)1.11 F(sages.)102 200.4 Q F0
-2.5(7.3. RFC)87 224.4 R(1123 Compliance)2.5 E F1 3.463(An)127 240.6 S .963
-(umber of changes ha)142.683 240.6 R 1.262 -.15(ve b)-.2 H .962
-(een made to mak).15 F(e)-.1 E/F2 10/Times-Italic@0 SF(sendmail)3.462 E F1 .962
-(\231conditionally compliant\232 \(that is,)3.462 F F2(sendmail)102 252.6 Q F1
-.049(satis\214es all of the \231MUST\232 clauses and most b)2.549 F .05
-(ut not all of the \231SHOULD\232 clauses in RFC)-.2 F(1123\).)102 264.6 Q
-(The major areas of change are \(numbers are RFC 1123 section numbers\):)127
-280.8 Q 15(5.2.7 Response)102 297 R(to RCPT command is f)2.5 E(ast.)-.1 E 15
-(5.2.8 Numeric)102 313.2 R(IP addresses are logged in Recei)2.5 E -.15(ve)-.25
-G(d: lines.).15 E 10(5.2.17 Self)102 329.4 R
-(domain literal is properly handled.)2.5 E 15(5.3.2 Better)102 345.6 R
-(control o)2.5 E -.15(ve)-.15 G 2.5(ri).15 G(ndi)220.02 345.6 Q
-(vidual timeouts.)-.25 E 15(5.3.3 Error)102 361.8 R
-(messages are sent as \231From:<>\232.)2.5 E 15(5.3.3 Error)102 378 R
-(messages are ne)2.5 E -.15(ve)-.25 G 2.5(rs).15 G(ent to \231<>\232.)246.28
-378 Q 15(5.3.3 Route-addrs)102 394.2 R(are pruned.)2.5 E(The areas in which)102
-410.4 Q F2(sendmail)2.5 E F1(is not \231unconditionally compliant\232 are:)2.5
-E(5.2.6)102 426.6 Q F2(Sendmail)139.5 426.6 Q F1(does do header munging.)2.5 E
-(5.2.10)102 442.8 Q F2(Sendmail)139.5 442.8 Q F1(doesn')2.5 E 2.5(ta)-.18 G -.1
-(lwa)215.42 442.8 S(ys use the e).1 E(xact SMTP message te)-.15 E
-(xt as listed in RFC 821.)-.15 E(5.3.1.1)102 459 Q F2(Sendmail)139.5 459 Q F1
-(doesn')2.5 E 2.5(tg)-.18 G
-(uarantee only one connect for each host in queue runs.)215.98 459 Q(5.3.1.1)
-102 475.2 Q F2(Sendmail)139.5 475.2 Q F1(doesn')2.5 E 2.5(ta)-.18 G -.1(lwa)
-215.42 475.2 S(ys pro).1 E(vide adequate concurrenc)-.15 E 2.5(yl)-.15 G
-(imits.)366.54 475.2 Q F0 2.5(7.4. Extended)87 499.2 R(SMTP Support)2.5 E F1
--1.11(Ve)127 515.4 S .155(rsion 8 includes both sending and recei)1.11 F .154
-(ving support for Extended SMTP support as de\214ned)-.25 F(by RFC 1425 \(basi\
-c\) and RFC 1427 \(SIZE\); and limited support for RFC 1426 \(BOD)102 527.4 Q
-(Y\).)-.55 E F0 2.5(7.5. Eight-Bit)87 551.4 R(Clean)2.5 E F1(Pre)127 567.6 Q
-1.104(vious v)-.25 F 1.104(ersions of)-.15 F F0(sendmail)3.604 E F1 1.104
-(used the 0200 bit for quoting.)3.604 F 1.105(This v)6.104 F 1.105(ersion a)
--.15 F -.2(vo)-.2 G 1.105(ids that use.).2 F(Ho)102 579.6 Q(we)-.25 E -.15(ve)
--.25 G .8 -.4(r, f).15 H
-(or compatibility with RFC 822, you can set option `7' to get se).4 E -.15(ve)
--.25 G 2.5(nb).15 G(it stripping.)418.86 579.6 Q(Indi)127 595.8 Q
-(vidual mailers can still produce se)-.25 E -.15(ve)-.25 G 2.5(nb).15 G
-(it out put using the `7' mailer \215ag.)300.77 595.8 Q F0 2.5(7.6. User)87
-619.8 R(Database)2.5 E F1 1.073(The user database is an as-yet e)127 636 R
-1.072(xperimental attempt to pro)-.15 F 1.072(vide uni\214ed lar)-.15 F 1.072
-(ge-site name sup-)-.18 F 2.5(port. W)102 648 R 2.5(ea)-.8 G
-(re installing it at Berk)145.63 648 Q(ele)-.1 E(y; future v)-.15 E
-(ersions may sho)-.15 E 2.5(ws)-.25 G(igni\214cant modi\214cations.)363.57 648
-Q F0 2.5(7.7. Impr)87 672 R -.1(ove)-.18 G 2.5(dB).1 G(IND Support)158.01 672 Q
-F1 .489(The BIND support, particularly for MX records, had a number of anno)127
-688.2 R .49(ying \231features\232 which)-.1 F(ha)102 700.2 Q 1.212 -.15(ve b)
--.2 H .912(een remo).15 F -.15(ve)-.15 G 3.412(di).15 G 3.412(nt)187.116 700.2
-S .912(his release.)198.308 700.2 R .912(In particular)5.912 F 3.412(,t)-.4 G
-.912(hese more tightly bind \(pun intended\) the name)307.916 700.2 R(serv)102
-712.2 Q(er to sendmail, so that the name serv)-.15 E
-(er resolution rules are incorporated directly into)-.15 E F0(sendmail)2.5 E F1
-(.)A EP
-%%Page: 52 49
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 193.36(SMM:08-52 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E 2.5(7.8. K)87 96 R(ey)-.25 E(ed Files)
--.1 E/F1 10/Times-Roman@0 SF .206(Generalized k)127 112.2 R -.15(ey)-.1 G .206
-(ed \214les is an idea tak).15 F .206(en directly from)-.1 F/F2 9/Times-Roman@0
-SF(ID)2.706 E(A)-.36 E F0(sendmail)2.706 E F1 .207(\(albeit with a completely)
-2.706 F(dif)102 124.2 Q(ferent implementation\).)-.25 E(The)5 E 2.5(yc)-.15 G
-(an be useful on lar)239.63 124.2 Q(ge sites.)-.18 E -1.11(Ve)127 140.4 S
-(rsion 8 also understands YP)1.11 E(.)-1.11 E F0 2.5(7.9. Multi-W)87 164.4 R
-(ord Classes)-.75 E F1(Classes can no)127 180.6 Q 2.5(wb)-.25 G 2.5(em)200.35
-180.6 S(ultiple w)215.07 180.6 Q 2.5(ords. F)-.1 F(or e)-.15 E(xample,)-.15 E
-(CShofmann.CS.Berk)142 196.8 Q(ele)-.1 E -.65(y.)-.15 G(EDU).65 E(allo)102 213
-Q 2.664(ws you to match the entire string \231hofmann.CS.Berk)-.25 F(ele)-.1 E
--.65(y.)-.15 G 2.663(EDU\232 using the single construct).65 F(\231$=S\232.)102
-225 Q F0 2.5(7.10. Deferr)87 249 R(ed Macr)-.18 E 2.5(oE)-.18 G(xpansion)189.94
-249 Q F1(The)127 265.2 Q F0($&)2.5 E/F3 10/Times-Italic@0 SF(x)A F1
-(construct has been adopted from)2.5 E F2(ID)2.5 E(A)-.36 E F1(.)A F0 2.5
-(7.11. IDENT)87 289.2 R(Pr)2.5 E(otocol Support)-.18 E F1
-(The IDENT protocol as de\214ned in RFC 1413 is supported.)127 305.4 Q F0 2.5
-(7.12. P)87 329.4 R(arsing Bug Fixes)-.1 E F1 4.03(An)127 345.6 S 1.53
-(umber of small b)143.25 345.6 R 1.53(ugs ha)-.2 F 1.53
-(ving to do with things lik)-.2 F 4.03(eb)-.1 G 1.53
-(ackslash-escaped quotes inside of)364.72 345.6 R(comments ha)102 357.6 Q .3
--.15(ve b)-.2 H(een \214x).15 E(ed.)-.15 E F0 2.5(7.13. Separate)87 381.6 R(En)
-2.5 E -.1(ve)-.4 G(lope/Header Pr).1 E(ocessing)-.18 E F1 .854
-(Since the From: line is passed in separately from the en)127 397.8 R -.15(ve)
--.4 G .854(lope sender).15 F 3.354(,t)-.4 G .854(hese ha)420.978 397.8 R 1.154
--.15(ve b)-.2 H .854(oth been).15 F .427(made visible; the)102 409.8 R F0($g)
-2.927 E F1 .427(macro is set to the en)2.927 F -.15(ve)-.4 G .428
-(lope sender during processing of mailer ar).15 F .428(gument v)-.18 F(ec-)-.15
-E(tors and the header sender during processing of headers.)102 421.8 Q .085
-(It is also possible to specify separate per)127 438 R .085(-mailer en)-.2 F
--.15(ve)-.4 G .084(lope and header processing.).15 F(The)5.084 E F0(S)2.584 E
-F1(ender)A(-)-.2 E -.55(RW)102 450 S .512(Set and).55 F F0(R)3.012 E F1
-(ecipientR)A .512(Wset ar)-.55 F .512
-(guments for mailers can be speci\214ed as)-.18 F F3(en)3.013 E(velope/header)
--.4 E F1 .513(to gi)3.013 F .813 -.15(ve d)-.25 H(if-).15 E(ferent re)102 462 Q
-(writings for en)-.25 E -.15(ve)-.4 G(lope v).15 E(ersus header addresses.)-.15
-E F0 2.5(7.14. Owner)87 486 R(-List Pr)-.37 E(opagates to En)-.18 E -.1(ve)-.4
-G(lope).1 E F1 1.001(When an alias has an associated o)127 502.2 R 1
-(wner\255list name, that alias is used to change the en)-.25 F -.15(ve)-.4 G
-(lope).15 E(sender address.)102 514.2 Q(This will cause do)5 E
-(wnstream errors to be returned to that o)-.25 E(wner)-.25 E(.)-.55 E F0 2.5
-(7.15. Dynamic)87 538.2 R(Header Allocation)2.5 E F1(The \214x)127 554.4 Q
-(ed size limit on header lines has been eliminated.)-.15 E F0 2.5(7.16. New)87
-578.4 R(Command Line Flags)2.5 E F1(The)127 594.6 Q F0<ad42>2.5 E F1
-(\215ag has been added to pass in body type information.)2.5 E(The)127 610.8 Q
-F0<ad70>2.5 E F1(\215ag has been added to pass in protocol information.)2.5 E
-(The)127 627 Q F0<ad58>2.6 E F1 .1(\215ag has been added to allo)2.6 F 2.6(wl)
--.25 G .1(ogging of all protocol in and out of)279.89 627 R F3(sendmail)2.6 E
-F1 .1(for deb)2.6 F(ug-)-.2 E(ging.)102 639 Q F0 2.5(7.17. Enhanced)87 663 R
-(Command Line Flags)2.5 E F1(The)127 679.2 Q F0<ad71>4.007 E F1 1.507(\215ag c\
-an limit limit a queue run to speci\214c recipients, senders, or queue ids usi\
-ng)4.007 F F0(\255qR)102 691.2 Q F3(substring)A F0 2.5<2cad>C(qS)168.41 691.2 Q
-F3(substring)A F0 2.5(,o)C 2.5<72ad>226.76 691.2 S(qI)239.4 691.2 Q F3
-(substring)A F0 -.18(re)2.5 G(specti).18 E -.1(ve)-.1 G(ly).1 E(.)-.7 E EP
-%%Page: 53 50
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-53)452.9 60 Q 2.5(7.18. New)87 96 R(and Old Con\214guration Line T)2.5
-E(ypes)-.74 E/F1 10/Times-Roman@0 SF(The)127 112.2 Q F0(T)2.766 E F1(\(T)2.766
-E .267(rusted users\) con\214guration line has been deleted.)-.35 F .267
-(It will still be accepted b)5.267 F .267(ut will be)-.2 F(ignored.)102 124.2 Q
-(The)127 140.4 Q F0(K)2.5 E F1(line has been added to declare database maps.)
-2.5 E(The)127 156.6 Q F0(V)2.5 E F1
-(line has been added to declare the con\214guration v)2.5 E(ersion le)-.15 E
--.15(ve)-.25 G(l.).15 E(The)127 172.8 Q F0(M)2.797 E F1 .296(line has a \231D=\
-\232 \214eld that lets you change into a temporary directory while that mailer)
-2.797 F(is running.)102 184.8 Q F0 2.5(7.19. New)87 208.8 R(Options)2.5 E F1
-(Se)127 225 Q -.15(ve)-.25 G .9(ral ne).15 F 3.4(wo)-.25 G .9(ptions ha)184.8
-225 R 1.2 -.15(ve b)-.2 H .9(een added, man).15 F 3.4(yt)-.15 G 3.4(os)314.89
-225 S .9(upport ne)327.18 225 R 3.4(wf)-.25 G .9(eatures, others to allo)379.83
-225 R 3.4(wt)-.25 G(uning)481.22 225 Q 1.187(that w)102 237 R 1.187(as pre)-.1
-F 1.187(viously a)-.25 F -.25(va)-.2 G 1.187(ilable only by recompiling.).25 F
-(The)6.186 E 3.686(ya)-.15 G 1.186(re described in detail in Section 5.1.5.)
-345.514 237 R(Brie\215y)102 249 Q(,)-.65 E 31(bI)102 265.2 S
-(nsist on a minimum number of disk blocks.)141.33 265.2 Q 29.33(CS)102 281.4 S
-(et checkpoint interv)143.56 281.4 Q(al.)-.25 E 29.89(ED)102 297.6 S(ef)145.22
-297.6 Q(ault error message.)-.1 E 28.78(GE)102 313.8 S(nable GECOS matching.)
-144.11 313.8 Q 31(hM)102 330 S(aximum hop count.)146.89 330 Q 33.22(jS)102
-346.2 S(end errors in MIME-encapsulated format.)143.56 346.2 Q 32.11(JF)102
-362.4 S(orw)143.41 362.4 Q(ard \214le path.)-.1 E 31(kC)102 378.6 S
-(onnection cache size)144.67 378.6 Q 28.78(KC)102 394.8 S
-(onnection cache lifetime.)144.67 394.8 Q 33.22(lE)102 411 S .333
-(nable Errors-T)144.11 411 R .333(o: header)-.8 F 5.334(.T)-.55 G .334
-(hese headers violate RFC 1123; this option is included to pro-)252.89 411 R
-(vide back compatibility with old v)138 423 Q(ersions of sendmail.)-.15 E 28.78
-(OS)102 439.2 S
-(et incoming SMTP daemon options, such as an alternate SMTP port.)143.56 439.2
-Q 31(pP)102 455.4 S(ri)143.56 455.4 Q -.25(va)-.25 G .3 -.15(cy o).25 H
-(ptions.).15 E 29.33(RD)102 471.6 S(on')145.22 471.6 Q 2.5(tp)-.18 G
-(rune route-addrs.)168.65 471.6 Q 28.78(UU)102 487.8 S(ser database spec.)
-145.22 487.8 Q 28.78(VF)102 504 S(allback \231MX\232 host.)143.41 504 Q 31(7D)
-102 520.2 S 2.5(on)145.22 520.2 S(ot run eight bit clean.)157.72 520.2 Q F0 2.5
-(7.20. Extended)87 544.2 R(Options)2.5 E F1(The)127 560.4 Q F0(r)3.764 E F1
-1.264(\(read timeout\),)3.764 F F0(I)3.764 E F1 1.264(\(use BIND\), and)3.764 F
-F0(T)3.764 E F1 1.264(\(queue timeout\) options ha)3.764 F 1.564 -.15(ve b)-.2
-H 1.264(een e).15 F 1.264(xtended to)-.15 F(pass in more information.)102 572.4
-Q F0 2.5(7.21. New)87 596.4 R(Mailer Flags)2.5 E F1(Se)127 612.6 Q -.15(ve)-.25
-G(ral ne).15 E 2.5(wm)-.25 G(ailer \215ags ha)185.78 612.6 Q .3 -.15(ve b)-.2 H
-(een added.).15 E 31.56(aT)102 628.8 S .636
-(ry to use ESMTP when creating a connection.)143.76 628.8 R .636
-(If this is not set,)5.636 F/F2 10/Times-Italic@0 SF(sendmail)3.136 E F1 .636
-(will still try if)3.136 F .221(the other end hints that it kno)138 640.8 R .22
-(ws about ESMTP in its greeting message; this \215ag says to try)-.25 F -2.15
--.25(ev e)138 652.8 T 2.595(ni).25 G 2.595(fi)161.855 652.8 S 2.595(td)170.56
-652.8 S(oesn')180.935 652.8 Q 2.595(th)-.18 G 2.595(int. If)212.79 652.8 R .095
-(the EHLO \(e)2.595 F .095(xtended hello\) command f)-.15 F(ails,)-.1 E F2
-(sendmail)2.596 E F1 -.1(fa)2.596 G .096(lls back to).1 F(old SMTP)138 664.8 Q
-(.)-1.11 E 31(bE)102 681 S
-(nsure that there is a blank line at the end of all messages.)144.11 681 Q
-31.56(cS)102 697.2 S .68(trip all comments from addresses; this should only be\
- used as a last resort when dealing)143.56 697.2 R(with crank)138 709.2 Q 2.5
-(ym)-.15 G(ailers.)195.62 709.2 Q EP
-%%Page: 54 51
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 193.36(SMM:08-54 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E/F1 10/Times-Roman@0 SF 31(gN)102 96 S
--2.15 -.25(ev e)145.22 96 T 2.64(ru).25 G .14(se the null sender as the en)
-169.67 96 R -.15(ve)-.4 G .141(lope sender).15 F 2.641(,e)-.4 G -.15(ve)341.495
-96 S 2.641(nw).15 G .141(hen running SMTP)365.646 96 R 5.141(.A)-1.11 G .141
-(lthough this)456.349 96 R 1.521(violates RFC 1123, it may be necessary when y\
-ou must deal with some obnoxious old)138 108 R(hosts.)138 120 Q 31(7S)102 136.2
-S(trip all output to 7 bits.)143.56 136.2 Q F0 2.5(7.22. New)87 160.2 R(Pr)2.5
-E(e-De\214ned Macr)-.18 E(os)-.18 E F1(The follo)127 176.4 Q
-(wing macros are pre-de\214ned:)-.25 E 23.5($k The)102 192.6 R
-(UUCP node name, nominally from)2.5 E/F2 10/Times-Italic@0 SF(uname)2.5 E F1
-(\(2\) call.)A 20.72($m The)102 208.8 R(domain part of our full hostname.)2.5 E
-23.5($_ The)102 225 R(RFC 1413-pro)2.5 E(vided sender address.)-.15 E F0 2.5
-(7.23. New)87 249 R(LHS T)2.5 E(ok)-.92 E(en)-.1 E F1 -1.11(Ve)127 265.2 S
-1.375(rsion 8 allo)1.11 F(ws)-.25 E F0($@)3.875 E F1 1.376
-(on the Left Hand Side of an \231R\232 line to match zero tok)3.875 F 3.876
-(ens. This)-.1 F(is)3.876 E(intended to be used to match the null input.)102
-277.2 Q F0 2.5(7.24. Bigger)87 301.2 R(Defaults)2.5 E F1 -1.11(Ve)127 317.4 S
-1.284(rsion 8 allo)1.11 F 1.284(ws up to 100 rulesets instead of 30.)-.25 F
-1.283(It is recommended that rulesets 0\2559 be)6.284 F(reserv)102 329.4 Q
-(ed for)-.15 E F2(sendmail)2.5 E F1 1.1 -.55('s d)D
-(edicated use in future releases.).55 E
-(The total number of MX records that can be used has been raised to 20.)127
-345.6 Q .335(The number of queued messages that can be handled at one time has\
- been raised from 600 to)127 361.8 R(1000.)102 373.8 Q F0 2.5(7.25. Differ)87
-397.8 R(ent Default T)-.18 E(uning P)-.92 E(arameters)-.1 E F1 -1.11(Ve)127 414
-S .8(rsion 8 has changed the def)1.11 F .8
-(ault parameters for tuning queue costs to mak)-.1 F 3.3(et)-.1 G .8
-(he number of)449.08 414 R .712(recipients more important than the size of the\
- message \(for small messages\).)102 426 R .712(This is reasonable if)5.712 F
-(you are connected with reasonably f)102 438 Q(ast links.)-.1 E F0 2.5(7.26. A)
-87 462 R(uto-Quoting in Addr)-.5 E(esses)-.18 E F1(Pre)127 478.2 Q(viously)-.25
-E 2.611(,t)-.65 G .111(he \231Full Name <email address>\232 syntax w)176.771
-478.2 R .111(ould generate incorrect protocol output)-.1 F
-(if \231Full Name\232 had special characters such as dot.)102 490.2 Q(This v)5
-E(ersion puts quotes around such names.)-.15 E F0 2.5(7.27. Symbolic)87 514.2 R
-(Names On Err)2.5 E(or Mailer)-.18 E F1(Se)127 530.4 Q -.15(ve)-.25 G
-(ral names ha).15 E .3 -.15(ve b)-.2 H(een b).15 E
-(uilt in to the $@ portion of the $#error mailer)-.2 E(.)-.55 E F0 2.5
-(7.28. SMTP)87 554.4 R(VRFY Doesn't Expand)2.5 E F1(Pre)127 570.6 Q 1.437
-(vious v)-.25 F 1.437(ersions of)-.15 F F2(sendmail)3.937 E F1 1.438
-(treated VRFY and EXPN the same.)3.937 F 1.438(In this v)6.438 F 1.438
-(ersion, VRFY)-.15 F(doesn')102 582.6 Q 2.5(te)-.18 G(xpand aliases or follo)
-138.05 582.6 Q 2.5(w.)-.25 G(forw)235.84 582.6 Q(ard \214les.)-.1 E .664
-(As an optimization, if you run with your def)127 598.8 R .663(ault deli)-.1 F
--.15(ve)-.25 G .663(ry mode being queue-only).15 F 3.163(,t)-.65 G .663
-(he RCPT)466.387 598.8 R 1.09(command will also not chase aliases and .forw)102
-610.8 R 1.09(ard \214les.)-.1 F 1.09(It will chase them when it processes the)
-6.09 F(queue.)102 622.8 Q F0 2.5(7.29. [IPC])87 646.8 R(Mailers Allo)2.5 E 2.5
-(wM)-.1 G(ultiple Hosts)210.49 646.8 Q F1 .448(When an address resolv)127 663 R
-.448(es to a mailer that has \231[IPC]\232 as its \231P)-.15 F .447
-(ath\232, the $@ part \(host name\))-.15 F .137
-(can be a colon-separated list of hosts instead of a single hostname.)102 675 R
-.138(This asks sendmail to search the)5.138 F .161
-(list for the \214rst entry that is a)102 687 R -.25(va)-.2 G .161(ilable e).25
-F .16(xactly as though it were an MX record.)-.15 F .16(The intent is to route)
-5.16 F .737(internal traf)102 699 R .738(\214c through internal netw)-.25 F
-.738(orks without publishing an MX record to the net.)-.1 F .738(MX e)5.738 F
-(xpan-)-.15 E(sion is still done on the indi)102 711 Q(vidual items.)-.25 E EP
-%%Page: 55 52
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-55)452.9 60 Q 2.5(7.30. Aliases)87 96 R(Extended)2.5 E/F1 10
-/Times-Roman@0 SF 1.457(The implementation has been mer)127 112.2 R 1.457
-(ged with maps.)-.18 F 1.456(Among other things, this supports NIS-)6.457 F
-(based aliases.)102 124.2 Q F0 2.5(7.31. P)87 148.2 R
-(ortability and Security Enhancements)-.2 E F1 2.5(An)127 164.4 S
-(umber of internal changes ha)141.72 164.4 Q .3 -.15(ve b)-.2 H
-(een made to enhance portability).15 E(.)-.65 E(Se)127 180.6 Q -.15(ve)-.25 G
-(ral \214x).15 E(es ha)-.15 E .3 -.15(ve b)-.2 H
-(een made to increase the paranoia f).15 E(actor)-.1 E(.)-.55 E F0 2.5
-(7.32. Miscellaneous)87 204.6 R(Changes)2.5 E/F2 10/Times-Italic@0 SF(Sendmail)
-127 220.8 Q F1(writes a)2.5 E F2(/etc/sendmail.pid)2.5 E F1
-(\214le with the current process id of the SMTP daemon.)2.5 E -1 -.8(Tw o)127
-237 T 1.646(people using the same program in their .forw)4.946 F 1.647
-(ard \214le are considered dif)-.1 F 1.647(ferent so that)-.25 F
-(duplicate elimination doesn')102 249 Q 2.5(td)-.18 G(elete one of them.)225.98
-249 Q(The)127 265.2 Q F2(mailstats)3.181 E F1 .681
-(program prints mailer names and gets the location of the)3.181 F F2
-(sendmail.st)3.18 E F1 .68(\214le from)3.18 F F2(/etc/sendmail.cf)102 277.2 Q
-F1(.)A(Man)127 293.4 Q 2.5(ym)-.15 G(inor b)160.46 293.4 Q(ugs ha)-.2 E .3 -.15
-(ve b)-.2 H(een \214x).15 E
-(ed, such as handling of backslashes inside of quotes.)-.15 E 2.5(Ah)127 309.6
-S(ook \(ruleset 5\) has been added to allo)141.72 309.6 Q 2.5(wr)-.25 G -.25
-(ew)304.21 309.6 S(riting of local addresses after aliasing.).25 E F0 2.5(8. A)
-72 333.6 R(CKNO)-.55 E(WLEDGEMENTS)-.5 E F1(I')112 349.8 Q 2.036 -.15(ve w)-.5
-H(ork).05 E 1.737(ed on)-.1 F F2(sendmail)4.237 E F1 1.737(for man)4.237 F
-4.237(yy)-.15 G 1.737(ears, and man)267.501 349.8 R 4.237(ye)-.15 G(mplo)
-339.762 349.8 Q 1.737(yers ha)-.1 F 2.037 -.15(ve b)-.2 H 1.737
-(een remarkably patient).15 F .404(about letting me w)87 361.8 R .404
-(ork on a lar)-.1 F .404(ge project that w)-.18 F .403(as not part of my of)-.1
-F .403(\214cial job)-.25 F 5.403(.T)-.4 G .403(his includes time on the)407.388
-361.8 R(INGRES Project at Berk)87 373.8 Q(ele)-.1 E 1.3 -.65(y, a)-.15 H 2.5
-(tB).65 G(ritton Lee, and ag)222.75 373.8 Q(ain on the Mammoth Project at Berk)
--.05 E(ele)-.1 E -.65(y.)-.15 G .453(Much of the second w)112 390 R -2.25 -.2
-(av e)-.1 H .453(of impro)3.153 F -.15(ve)-.15 G .453
-(ments should be credited to Bryan Costales of ICSI.).15 F .454(As he)5.454 F
-.781(passed me drafts of his book on)87 402 R F2(sendmail)3.281 E F1 3.281(Iw)
-3.281 G .781(as inspired to start w)274.741 402 R .781(orking on things ag)-.1
-F 3.281(ain. Bryan)-.05 F -.1(wa)3.281 G(s).1 E(also a)87 414 Q -.25(va)-.2 G
-(ilable to bounce ideas of).25 E 2.5(fo)-.25 G(f.)227.38 414 Q(Man)112 430.2 Q
-2.856 -.65(y, m)-.15 H(an).65 E 4.056(yp)-.15 G 1.556(eople contrib)172.212
-430.2 R 1.556(uted chunks of code and ideas to)-.2 F F2(sendmail)4.056 E F1
-6.556(.I)C 4.056(th)418.476 430.2 S 1.557(as pro)430.312 430.2 R -.15(ve)-.15 G
-4.057(nt).15 G 4.057(ob)477.006 430.2 S 4.057(ea)491.063 430.2 S .464
-(group netw)87 442.2 R .464(ork ef)-.1 F 2.964(fort. V)-.25 F .464
-(ersion 8 in particular w)-1.11 F .463(as a group project.)-.1 F .463
-(The follo)5.463 F .463(wing people made notable)-.25 F(contrib)87 454.2 Q
-(utions:)-.2 E -.25(Ke)127 470.4 S(ith Bostic, CSRG, Uni).25 E -.15(ve)-.25 G
-(rsity of California, Berk).15 E(ele)-.1 E(y)-.15 E(Michael J. Corrig)127 482.4
-Q(an, Uni)-.05 E -.15(ve)-.25 G(rsity of California, San Die).15 E(go)-.15 E
-(Bryan Costales, International Computer Science Institute)127 494.4 Q
-(P{r \(Pell\) Emanuelsson)127 506.4 Q(Craig Ev)127 518.4 Q(erhart, T)-.15 E
-(ransarc Corporation)-.35 E -.8(To)127 530.4 S 2.5(mI).8 G -.25(va)150.92 530.4
-S 2.5(rH).25 G(elbekkmo, Norwe)173.16 530.4 Q(gian School of Economics)-.15 E
-(Allan E. Johannesen, WPI)127 542.4 Q -.8(Ta)127 554.4 S
-(kahiro Kanbe, FujiXerox).8 E(Brian Kantor)127 566.4 Q 2.5(,U)-.4 G(ni)191.31
-566.4 Q -.15(ve)-.25 G(rsity of California, San Die).15 E(go)-.15 E
-(Bruce Lilly)127 578.4 Q 2.5(,S)-.65 G(on)182.74 578.4 Q 2.5(yU)-.15 G(.S.)
-207.31 578.4 Q(Nakamura Motonori, K)127 590.4 Q(yoto Uni)-.25 E -.15(ve)-.25 G
-(rsity).15 E(John Gardiner Myers, Carne)127 602.4 Q(gie Mellon Uni)-.15 E -.15
-(ve)-.25 G(rsity).15 E(Neil Rick)127 614.4 Q(ert, Northern Illinois Uni)-.1 E
--.15(ve)-.25 G(rsity).15 E(Eric W)127 626.4 Q(assenaar)-.8 E 2.5(,N)-.4 G
-(ational Institute for Nuclear and High Ener)200.49 626.4 Q(gy Ph)-.18 E
-(ysics, Amsterdam)-.05 E(Christophe W)127 638.4 Q(olfhugel, Herv)-.8 E 2.5(eS)
--.15 G(chauer Consultants \(P)252.7 638.4 Q(aris\))-.15 E 2.687(Ia)87 654.6 S
-.187(pologize for an)97.457 654.6 R .188(yone I ha)-.15 F .488 -.15(ve o)-.2 H
-.188(mitted, misspelled, misattrib).15 F .188(uted, or otherwise missed.)-.2 F
-(Man)5.188 E 2.688(yo)-.15 G .188(ther peo-)467.992 654.6 R(ple ha)87 666.6 Q
-.3 -.15(ve c)-.2 H(ontrib).15 E(uted ideas, comments, and encouragement.)-.2 E
-2.5(Ia)5 G(ppreciate their contrib)338.06 666.6 Q(ution as well.)-.2 E EP
-%%Page: 56 53
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 12/Times-Bold@0 SF 3(APPENDIX A)257.172 98.4 R(COMMAND LINE FLA)224.832
-141.6 Q(GS)-.66 E/F1 10/Times-Roman@0 SF(Ar)97 201 Q
-(guments must be presented with \215ags before addresses.)-.18 E
-(The \215ags are:)5 E<ad62>72 217.2 Q/F2 10/Times-Italic@0 SF(x)A F1
-(Set operation mode to)144 217.2 Q F2(x)2.5 E F1 5(.O)C(peration modes are:)
-253.71 217.2 Q 12.22(mD)184 233.4 S(eli)211.22 233.4 Q -.15(ve)-.25 G 2.5(rm)
-.15 G(ail \(def)243.87 233.4 Q(ault\))-.1 E 16.11(sS)184 245.4 S
-(peak SMTP on input side)209.56 245.4 Q 15(dR)184 257.4 S(un as a daemon)210.67
-257.4 Q 17.22(tR)184 269.4 S(un in test mode)210.67 269.4 Q 15(vJ)184 281.4 S
-(ust v)207.89 281.4 Q(erify addresses, don')-.15 E 2.5(tc)-.18 G
-(ollect or deli)319.48 281.4 Q -.15(ve)-.25 G(r).15 E 17.22(iI)184 293.4 S
-(nitialize the alias database)207.33 293.4 Q 15(pP)184 305.4 S
-(rint the mail queue)209.56 305.4 Q 15.56(zF)184 317.4 S
-(reeze the con\214guration \214le)209.56 317.4 Q<ad42>72 337.8 Q F2(type)A F1
-(Indicate body type.)144 337.8 Q<ad43>72 354 Q F2(\214le)A F1 .947(Use a dif)
-144 354 R .946(ferent con\214guration \214le.)-.25 F F2(Sendmail)5.946 E F1
-.946(runs as the in)3.446 F -.2(vo)-.4 G .946(king user \(rather than root\)).2
-F(when this \215ag is speci\214ed.)144 366 Q<ad64>72 382.2 Q F2(le)A(vel)-.15 E
-F1(Set deb)144 382.2 Q(ugging le)-.2 E -.15(ve)-.25 G(l.).15 E<ad66>72 398.4 Q
-F2(addr)2.5 E F1(The sender')144 398.4 Q 2.5(sm)-.55 G(achine address is)205.1
-398.4 Q F2(addr)2.5 E F1(.)A<ad46>72 414.6 Q F2(name)A F1
-(Sets the full name of this user to)144 414.6 Q F2(name)2.5 E F1(.)A<ad68>72
-430.8 Q F2(cnt)2.5 E F1 .725(Sets the \231hop count\232 to)144 430.8 R F2(cnt)
-3.225 E F1 5.725(.T)C .726
-(his represents the number of times this message has been)269.45 430.8 R .02
-(processed by)144 442.8 R F2(sendmail)2.52 E F1 .02(\(to the e)2.52 F .02
-(xtent that it is supported by the underlying netw)-.15 F(orks\).)-.1 E F2(Cnt)
-5.02 E F1 1.521
-(is incremented during processing, and if it reaches MAXHOP \(currently 30\))
-144 454.8 R F2(sendmail)4.021 E F1(thro)144 466.8 Q(ws a)-.25 E -.1(wa)-.15 G
-2.5(yt).1 G(he message with an error)199.6 466.8 Q(.)-.55 E 58.86(\255n Don')72
-483 R 2.5(td)-.18 G 2.5(oa)174.65 483 S(liasing or forw)186.59 483 Q(arding.)
--.1 E<ad72>72 499.2 Q F2(addr)2.5 E F1(An obsolete form of)144 499.2 Q/F3 10
-/Times-Bold@0 SF<ad66>2.5 E F1(.)A<ad6f>72 515.4 Q F2 1.666(xv)C(alue)-1.666 E
-F1(Set option)144 515.4 Q F2(x)2.5 E F1(to the speci\214ed)2.5 E F2(value)2.5 E
-F1 5(.T)C(hese options are described in Appendix B.)292.6 515.4 Q<ad70>72 531.6
-Q F2(pr)A(otocol)-.45 E F1 .401(Set the sending protocol.)144 531.6 R .401
-(Programs are encouraged to set this.)5.401 F .4(The protocol \214eld can be)
-5.401 F .114(in the form)144 543.6 R F2(pr)2.614 E(otocol)-.45 E F3(:)A F2
-(host)A F1 .114(to set both the sending protocol and sending host.)2.614 F -.15
-(Fo)5.115 G 2.615(re).15 G(xample,)472.06 543.6 Q 2.147(\231\255pUUCP:uunet\
-\232 sets the sending protocol to UUCP and the sending host to uunet.)144 555.6
-R .973(\(Some e)144 567.6 R .974
-(xisting programs use \255oM to set the r and s macros; this is equi)-.15 F
--.25(va)-.25 G .974(lent to using).25 F(\255p.\))144 579.6 Q<ad71>72 595.8 Q F2
-(time)A F1 -.35(Tr)144 595.8 S 3.168(yt).35 G 3.167(op)164.038 595.8 S .667
-(rocess the queued up mail.)177.205 595.8 R .667(If the time is gi)5.667 F -.15
-(ve)-.25 G .667(n, a sendmail will run through the).15 F
-(queue at the speci\214ed interv)144 607.8 Q(al to deli)-.25 E -.15(ve)-.25 G
-2.5(rq).15 G(ueued mail; otherwise, it only runs once.)310.82 607.8 Q<ad71>72
-624 Q F2(Xstring)A F1 .312
-(Run the queue once, limiting the jobs to those matching)144 624 R F2(Xstring)
-2.813 E F1 5.313(.T)C .313(he k)416.325 624 R .613 -.15(ey l)-.1 H(etter).15 E
-F2(X)2.813 E F1 .313(can be)2.813 F F3(I)144 636 Q F1 .671
-(to limit based on queue identi\214er)3.171 F(,)-.4 E F3(R)3.171 E F1 .67
-(to limit based on recipient, or)3.171 F F3(S)3.17 E F1 .67(to limit based on)
-3.17 F(sender)144 648 Q 6.053(.A)-.55 G 1.054
-(particular queued job is accepted if one of the corresponding addresses con-)
-188.876 648 R(tains the indicated)144 660 Q F2(string)2.5 E F1(.)A 61.08
-(\255t Read)72 676.2 R .752(the header for \231T)3.252 F .752
-(o:\232, \231Cc:\232, and \231Bcc:\232 lines, and send to e)-.8 F -.15(ve)-.25
-G .752(ryone listed in those).15 F 2.539(lists. The)144 688.2 R .039
-(\231Bcc:\232 line will be deleted before sending.)2.539 F(An)5.039 E 2.539(ya)
--.15 G .04(ddresses in the ar)385.31 688.2 R .04(gument v)-.18 F(ec-)-.15 E
-(tor will be deleted from the send list.)144 700.2 Q F3 193.36
-(SMM:08-56 Sendmail)72 756 R(Installation and Operation Guide)2.5 E EP
-%%Page: 57 54
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-57)452.9 60 Q/F1 10/Times-Roman@0 SF<ad58>72 96 Q/F2 10/Times-Italic@0
-SF(lo)3.18 E(g\214le)-.1 E F1 .68(Log all traf)144.68 96 R .679
-(\214c in and out of sendmail in the indicated)-.25 F F2(lo)3.179 E(g\214le)-.1
-E F1 .679(for deb)3.179 F .679(ugging mailer prob-)-.2 F 2.5(lems. This)144 108
-R(produces a lot of data v)2.5 E(ery quickly and should be used sparingly)-.15
-E(.)-.65 E 1.118
-(There are a number of options that may be speci\214ed as primiti)97 124.2 R
-1.418 -.15(ve \215)-.25 H 1.118(ags \(pro).15 F 1.118(vided for compatibility)
--.15 F(with)72 136.2 Q F2(delivermail)2.5 E F1 2.5(\). These)B
-(are the e, i, m, and v options.)2.5 E
-(Also, the f option may be speci\214ed as the)5 E F0<ad73>2.5 E F1(\215ag.)2.5
-E EP
-%%Page: 58 55
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 12/Times-Bold@0 SF 3(APPENDIX B)250.002 98.4 R -.12(QU)220.29 141.6 S
-(EUE FILE FORMA).12 E(TS)-1.14 E/F1 10/Times-Roman@0 SF .292
-(This appendix describes the format of the queue \214les.)97 201 R .292
-(These \214les li)5.292 F .592 -.15(ve i)-.25 H 2.792(nt).15 G .291
-(he directory de\214ned by the)395.636 201 R/F2 10/Times-Bold@0 SF(Q)72 213 Q
-F1(option in the)2.5 E/F3 10/Times-Italic@0 SF(sendmail.cf)2.5 E F1
-(\214le, usually)2.5 E F3(/var/spool/mqueue)2.5 E F1(or)2.5 E F3
-(/usr/spool/mqueue)2.5 E F1(.)A .229(All queue \214les ha)97 229.2 R .529 -.15
-(ve t)-.2 H .229(he name).15 F F3(x)2.729 E F2(f)1.666 E F3(AAA99999)A F1
-(where)2.73 E F3(AAA99999)2.73 E F1 .23(is the)2.73 F F3(id)2.73 E F1 .23
-(for this message and the)2.73 F F3(x)2.73 E F1 .23(is a)2.73 F 3.601
-(type. The)72 241.2 R 1.101
-(\214rst letter of the id encodes the hour of the day that the message w)3.601
-F 1.101(as recei)-.1 F -.15(ve)-.25 G 3.601(db).15 G 3.601(yt)451.798 241.2 S
-1.101(he system)463.179 241.2 R .551
-(\(with A being the hour between midnight and 1:00AM\).)72 253.2 R .552
-(All \214les with the same id collecti)5.552 F -.15(ve)-.25 G .552
-(ly de\214ne one).15 F(message.)72 265.2 Q(The types are:)97 281.4 Q 31(dT)72
-297.6 S(he data \214le.)114.11 297.6 Q(The message body \(e)5 E
-(xcluding the header\) is k)-.15 E(ept in this \214le.)-.1 E 33.22(lT)72 313.8
-S .312(he lock \214le.)114.11 313.8 R .312(If this \214le e)5.312 F .311
-(xists, the job is currently being processed, and a queue run will not pro-)
--.15 F .523(cess the \214le.)108 325.8 R -.15(Fo)5.524 G 3.024(rt).15 G .524
-(hat reason, an e)183.274 325.8 R(xtraneous)-.15 E F2(lf)3.024 E F1 .524
-(\214le can cause a job to apparently disappear \(it will)3.024 F .285(not e)
-108 337.8 R -.15(ve)-.25 G 2.785(nt).15 G .284(ime out!\).)147.61 337.8 R
-([Actually)5.284 E 2.784(,t)-.65 G .284
-(his \214le is obsolete on most systems that support the)237.802 337.8 R F2
-(\215ock)2.784 E F1(or)2.784 E F2(lockf)2.784 E F1(system calls.])108 349.8 Q
-31(nT)72 366 S .348(his \214le is created when an id is being created.)114.11
-366 R .348(It is a separate \214le to insure that no mail can e)5.348 F -.15
-(ve)-.25 G(r).15 E .805(be destro)108 378 R .805(yed due to a race condition.)
--.1 F .805(It should e)5.805 F .805(xist for no more than a fe)-.15 F 3.305(wm)
--.25 G .805(illiseconds at an)433.1 378 R(y)-.15 E(gi)108 390 Q -.15(ve)-.25 G
-2.5(nt).15 G 2.5(ime. [This)135.1 390 R(is only used on old v)2.5 E
-(ersions of sendmail; it is not used on ne)-.15 E(wer v)-.25 E(ersions.])-.15 E
-31(qT)72 406.2 S(he queue control \214le.)114.11 406.2 Q
-(This \214le contains the information necessary to process the job)5 E(.)-.4 E
-33.22(tA)72 422.4 S .344(temporary \214le.)118.064 422.4 R .344
-(These are an image of the)5.344 F F2(qf)2.844 E F1 .344
-(\214le when it is being reb)2.844 F 2.845(uilt. It)-.2 F .345
-(should be renamed)2.845 F(to a)108 434.4 Q F2(qf)2.5 E F1(\214le v)2.5 E
-(ery quickly)-.15 E(.)-.65 E 31(xA)72 450.6 S .567(transcript \214le, e)118.287
-450.6 R .567(xisting during the life of a session sho)-.15 F .566(wing e)-.25 F
--.15(ve)-.25 G .566(rything that happens during that).15 F(session.)108 462.6 Q
-(The)97 478.8 Q F2(qf)3.333 E F1 .833
-(\214le is structured as a series of lines each be)3.333 F .834
-(ginning with a code letter)-.15 F 5.834(.T)-.55 G .834(he lines are as fol-)
-427.354 478.8 R(lo)72 490.8 Q(ws:)-.25 E 28.78(DT)72 507 S
-(he name of the data \214le.)114.11 507 Q
-(There may only be one of these lines.)5 E 28.78(HA)72 523.2 S .33
-(header de\214nition.)118.05 523.2 R .33(There may be an)5.33 F 2.829(yn)-.15 G
-.329(umber of these lines.)274.289 523.2 R .329(The order is important: the)
-5.329 F 2.829(yr)-.15 G(epre-)483.46 523.2 Q .046
-(sent the order in the \214nal message.)108 535.2 R .046
-(These use the same syntax as header de\214nitions in the con\214gu-)5.046 F
-(ration \214le.)108 547.2 Q 29.33(CT)72 563.4 S .575(he controlling address.)
-114.11 563.4 R .575(The syntax is \231localuser:aliasname\232.)5.575 F .575
-(Recipient addresses follo)5.575 F .575(wing this)-.25 F 2.814
-(line will be \215agged so that deli)108 575.4 R -.15(ve)-.25 G 2.814
-(ries will be run as the).15 F F3(localuser)5.314 E F1 2.814
-(\(a user name from the)5.314 F .562(/etc/passwd \214le\);)108 587.4 R F3
-(aliasname)3.062 E F1 .561(is the name of the alias that e)3.062 F .561
-(xpanded to this address \(used for print-)-.15 F(ing messages\).)108 599.4 Q
-29.33(RA)72 615.6 S .705(recipient address.)118.425 615.6 R .705
-(This will normally be completely aliased, b)5.705 F .705
-(ut is actually realiased when the)-.2 F(job is processed.)108 627.6 Q
-(There will be one line for each recipient.)5 E 30.44(ST)72 643.8 S
-(he sender address.)114.11 643.8 Q(There may only be one of these lines.)5 E
-29.89(EA)72 660 S 3.742(ne)115.22 660 S 1.242(rror address.)128.402 660 R 1.242
-(If an)6.242 F 3.742(ys)-.15 G 1.241(uch lines e)218.19 660 R 1.241(xist, the)
--.15 F 3.741(yr)-.15 G 1.241(epresent the addresses that should recei)308.124
-660 R 1.541 -.15(ve e)-.25 H(rror).15 E(messages.)108 672 Q 29.89(TT)72 688.2 S
-(he job creation time.)114.11 688.2 Q
-(This is used to compute when to time out the job)5 E(.)-.4 E 30.44(PT)72 704.4
-S .113(he current message priority)114.11 704.4 R 5.113(.T)-.65 G .113
-(his is used to order the queue.)236.662 704.4 R .114(Higher numbers mean lo)
-5.114 F .114(wer priori-)-.25 F 3.677(ties. The)108 716.4 R 1.176
-(priority changes as the message sits in the queue.)3.677 F 1.176
-(The initial priority depends on the)6.176 F F2 193.36(SMM:08-58 Sendmail)72
-756 R(Installation and Operation Guide)2.5 E EP
-%%Page: 59 56
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-59)452.9 60 Q/F1 10/Times-Roman@0 SF
-(message class and the size of the message.)108 96 Q 27.11(MA)72 112.2 S 2.703
-(message. This)117.923 112.2 R .203(line is printed by the)2.703 F/F2 10
-/Times-Italic@0 SF(mailq)2.703 E F1 .204
-(command, and is generally used to store status infor)2.704 F(-)-.2 E 2.5
-(mation. It)108 124.2 R(can contain an)2.5 E 2.5(yt)-.15 G -.15(ex)219.78 124.2
-S(t.).15 E 30.44(FF)72 140.4 S .044
-(lag bits, represented as one letter per \215ag.)113.56 140.4 R .043
-(De\214ned \215ag bits are)5.043 F F0(r)2.543 E F1 .043
-(indicating that this is a response)2.543 F .142(message and)108 152.4 R F0(w)
-2.642 E F1 .142(indicating that a w)2.642 F .143
-(arning message has been sent announcing that the mail has been)-.1 F(delayed.)
-108 164.4 Q 31($A)72 180.6 S .83(macro de\214nition.)118.55 180.6 R .83(The v)
-5.83 F .829(alues of certain macros \(as of this writing, only)-.25 F F0($r)
-3.329 E F1(and)3.329 E F0($s)3.329 E F1 3.329(\)a)C .829(re passed)466.241
-180.6 R(through to the queue run phase.)108 192.6 Q 29.33(BT)72 208.8 S .924
-(he body type.)114.11 208.8 R .925(The remainder of the line is a te)5.924 F
-.925(xt string de\214ning the body type.)-.15 F .925(If this \214eld is)5.925 F
-.009(missing, the body type is assumed to be \231unde\214ned\232 and no specia\
-l processing is attempted.)108 220.8 R(Le)5.008 E -.05(ga)-.15 G(l).05 E -.25
-(va)108 232.8 S(lues are \2317BIT\232 and \2318BITMIME\232.).25 E 4.072
-(As an e)97 249 R 4.072(xample, the follo)-.15 F 4.073
-(wing is a queue \214le sent to \231eric@mammoth.Berk)-.25 F(ele)-.1 E -.65(y.)
--.15 G 4.073(EDU\232 and).65 F(\231bostic@ok)72 263 Q(eef)-.1 E(fe.CS.Berk)-.25
-E(ele)-.1 E -.65(y.)-.15 G(EDU\232).65 E/F3 7/Times-Roman@0 SF(1)219.09 259 Q
-F1(:)222.59 263 Q(P835771)112 279.2 Q(T404261372)112 291.2 Q(DdfAAA13557)112
-303.2 Q(Seric)112 315.2 Q(Eo)112 327.2 Q(wner)-.25 E(-sendmail@v)-.2 E
-(angogh.CS.Berk)-.25 E(ele)-.1 E -.65(y.)-.15 G(EDU).65 E(Ceric:sendmail@v)112
-339.2 Q(angogh.CS.Berk)-.25 E(ele)-.1 E -.65(y.)-.15 G(EDU).65 E
-(Reric@mammoth.Berk)112 351.2 Q(ele)-.1 E -.65(y.)-.15 G(EDU).65 E(Rbostic@ok)
-112 363.2 Q(eef)-.1 E(fe.CS.Berk)-.25 E(ele)-.1 E -.65(y.)-.15 G(EDU).65 E
-(H?P?return-path: <o)112 375.2 Q(wner)-.25 E(-sendmail@v)-.2 E(angogh.CS.Berk)
--.25 E(ele)-.1 E -.65(y.)-.15 G(EDU>).65 E(Hrecei)112 387.2 Q -.15(ve)-.25 G
-(d: by v).15 E(angogh.CS.Berk)-.25 E(ele)-.1 E -.65(y.)-.15 G
-(EDU \(5.108/2.7\) id AAA06703;).65 E(Fri, 17 Jul 92 00:28:55 -0700)132 399.2 Q
-(Hrecei)112 411.2 Q -.15(ve)-.25 G(d: from mail.CS.Berk).15 E(ele)-.1 E -.65
-(y.)-.15 G(EDU by v).65 E(angogh.CS.Berk)-.25 E(ele)-.1 E -.65(y.)-.15 G
-(EDU \(5.108/2.7\)).65 E(id AAA06698; Fri, 17 Jul 92 00:28:54 -0700)132 423.2 Q
-(Hrecei)112 435.2 Q -.15(ve)-.25 G(d: from [128.32.31.21] by mail.CS.Berk).15 E
-(ele)-.1 E -.65(y.)-.15 G(EDU \(5.96/2.5\)).65 E
-(id AA22777; Fri, 17 Jul 92 03:29:14 -0400)132 447.2 Q(Hrecei)112 459.2 Q -.15
-(ve)-.25 G(d: by foo.bar).15 E(.baz.de \(5.57/Ultrix3.0-C\))-.55 E
-(id AA22757; Fri, 17 Jul 92 09:31:25 GMT)132 471.2 Q(H?F?from: eric@foo.bar)112
-483.2 Q(.baz.de \(Eric Allman\))-.55 E(H?x?full-name: Eric Allman)112 495.2 Q
-(Hmessage-id: <9207170931.AA22757@foo.bar)112 507.2 Q(.baz.de>)-.55 E(HT)112
-519.2 Q(o: sendmail@v)-.8 E(angogh.CS.Berk)-.25 E(ele)-.1 E -.65(y.)-.15 G(EDU)
-.65 E(Hsubject: this is an e)112 531.2 Q(xample message)-.15 E 1.083(This sho)
-72 547.4 R 1.084(ws the name of the data \214le, the person who sent the messa\
-ge, the submission time \(in seconds)-.25 F .26
-(since January 1, 1970\), the message priority)72 559.4 R 2.76(,t)-.65 G .259
-(he message class, the recipients, and the headers for the mes-)257.03 559.4 R
-(sage.)72 571.4 Q .32 LW 76 669.2 72 669.2 DL 80 669.2 76 669.2 DL 84 669.2 80
-669.2 DL 88 669.2 84 669.2 DL 92 669.2 88 669.2 DL 96 669.2 92 669.2 DL 100
-669.2 96 669.2 DL 104 669.2 100 669.2 DL 108 669.2 104 669.2 DL 112 669.2 108
-669.2 DL 116 669.2 112 669.2 DL 120 669.2 116 669.2 DL 124 669.2 120 669.2 DL
-128 669.2 124 669.2 DL 132 669.2 128 669.2 DL 136 669.2 132 669.2 DL 140 669.2
-136 669.2 DL 144 669.2 140 669.2 DL 148 669.2 144 669.2 DL 152 669.2 148 669.2
-DL 156 669.2 152 669.2 DL 160 669.2 156 669.2 DL 164 669.2 160 669.2 DL 168
-669.2 164 669.2 DL 172 669.2 168 669.2 DL 176 669.2 172 669.2 DL 180 669.2 176
-669.2 DL 184 669.2 180 669.2 DL 188 669.2 184 669.2 DL 192 669.2 188 669.2 DL
-196 669.2 192 669.2 DL 200 669.2 196 669.2 DL 204 669.2 200 669.2 DL 208 669.2
-204 669.2 DL 212 669.2 208 669.2 DL 216 669.2 212 669.2 DL/F4 5/Times-Roman@0
-SF(1)93.6 679.6 Q/F5 8/Times-Roman@0 SF .719(This e)3.2 J .719
-(xample is contri)-.12 F -.12(ve)-.2 G 2.719(da).12 G .719
-(nd probably inaccurate for your en)186.968 682.8 R 2.719(vironment. Glance)
--.32 F -.12(ove)2.718 G 2.718(ri).12 G 2.718(tt)384.998 682.8 S 2.718(og)
-392.164 682.8 S .718(et an idea; nothing can replace)402.882 682.8 R
-(looking at what your o)72 692.4 Q(wn system generates.)-.2 E EP
-%%Page: 60 57
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 12/Times-Bold@0 SF 3(APPENDIX C)249.672 98.4 R(SUMMAR)198.282 141.6 Q 3(YO)
--.42 G 3(FS)274.182 141.6 S(UPPOR)291.186 141.6 Q 3(TF)-.48 G(ILES)350.37 141.6
-Q/F1 10/Times-Roman@0 SF 1.519(This is a summary of the support \214les that)97
-201 R/F2 10/Times-Italic@0 SF(sendmail)4.019 E F1 1.52(creates or generates.)
-4.019 F(Man)6.52 E 4.02(yo)-.15 G 4.02(ft)444.74 201 S 1.52(hese can be)454.87
-201 R(changed by editing the sendmail.cf \214le; check there to \214nd the act\
-ual pathnames.)72 213 Q(/usr/sbin/sendmail)72 229.2 Q(The binary of)144 241.2 Q
-F2(sendmail)2.5 E F1(.)A(/usr/bin/ne)72 257.4 Q -.1(wa)-.25 G(liases).1 E 3.735
-(Al)144 269.4 S 1.235
-(ink to /usr/sbin/sendmail; causes the alias database to be reb)157.735 269.4 R
-3.734(uilt. Running)-.2 F 1.234(this pro-)3.734 F(gram is completely equi)144
-281.4 Q -.25(va)-.25 G(lent to gi).25 E(ving)-.25 E F2(sendmail)2.5 E F1(the)
-2.5 E/F3 10/Times-Bold@0 SF(\255bi)2.5 E F1(\215ag.)2.5 E 13.38
-(/usr/bin/mailq Prints)72 297.6 R 3.702(al)3.702 G 1.202
-(isting of the mail queue.)181.964 297.6 R 1.203(This program is equi)6.202 F
--.25(va)-.25 G 1.203(lent to using the).25 F F3(\255bp)3.703 E F1 1.203
-(\215ag to)3.703 F F2(sendmail)144 309.6 Q F1(.)A 5.9(/etc/sendmail.cf The)72
-325.8 R(con\214guration \214le, in te)2.5 E(xtual form.)-.15 E 5.9
-(/etc/sendmail.fc The)72 342 R
-(con\214guration \214le represented as a memory image.)2.5 E
-(/usr/lib/sendmail.hf)72 358.2 Q(The SMTP help \214le.)144 370.2 Q 7
-(/etc/sendmail.st A)72 386.4 R(statistics \214le; need not be present.)2.5 E
-.89(/etc/sendmail.pid Created)72 402.6 R .318
-(in daemon mode; it contains the process id of the current SMTP daemon.)2.818 F
-.318(If you)5.318 F .337(use this in scripts; use `)144 414.6 R .337
-(`head \2551')-.74 F 2.838('t)-.74 G 2.838(og)285.78 414.6 S .338
-(et just the \214rst line; later v)298.618 414.6 R .338(ersions of)-.15 F F2
-(sendmail)2.838 E F1(may)2.838 E(add information to subsequent lines.)144 426.6
-Q 25.62(/etc/aliases The)72 442.8 R(te)2.5 E(xtual v)-.15 E
-(ersion of the alias \214le.)-.15 E(/etc/aliases.{pag,dir})72 459 Q
-(The alias \214le in)144 471 Q F2(dbm)2.5 E F1(\(3\) format.)1.666 E(/v)72
-487.2 Q(ar/spool/mqueue)-.25 E
-(The directory in which the mail queue and temporary \214les reside.)144 499.2
-Q(/v)72 515.4 Q(ar/spool/mqueue/qf*)-.25 E
-(Control \(queue\) \214les for messages.)144 527.4 Q(/v)72 543.6 Q
-(ar/spool/mqueue/df*)-.25 E(Data \214les.)144 555.6 Q(/v)72 571.8 Q
-(ar/spool/mqueue/tf*)-.25 E -.7(Te)144 583.8 S(mporary v).7 E
-(ersions of the qf \214les, used during queue \214le reb)-.15 E(uild.)-.2 E(/v)
-72 600 Q(ar/spool/mqueue/xf*)-.25 E 2.5(At)144 612 S
-(ranscript of the current session.)156.5 612 Q F3 193.36(SMM:08-60 Sendmail)72
-756 R(Installation and Operation Guide)2.5 E EP
-%%Page: 2 58
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 198.36(SMM:08-2 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E/F1 12/Times-Roman@0 SF -1.116(TA)
-263.226 98.4 S(BLE OF CONTENTS)1.116 E/F2 10/Times-Roman@0 SF 2.5(1. B)72 124.8
-R(ASIC INST)-.35 E(ALLA)-.93 E 1.18(TION .....................................\
-..........................................................................)
--1.11 F(5)499 124.8 Q 2.5(1.1. Compiling)87 139.2 R .43(Sendmail .............\
-..............................................................................\
-...................)2.5 F(5)499 139.2 Q 2.5(1.1.1. Old)102 153.6 R -.15(ve)2.5
-G(rsions of mak).15 E 2.93(e.)-.1 G 28.5(.....................................\
-.............................................................. 5)220.5 153.6 R
-2.5(1.1.2. Compilation)102 168 R 2.1(\215ags .................................\
-........................................................................)2.5 F
-(5)499 168 Q 2.5(1.1.3. Compilation)102 182.4 R(and installation)2.5 E 28.5(..\
-..............................................................................\
-........ 6)4.6 F 2.5(1.2. Con\214guration)87 196.8 R .99(Files ...............\
-..............................................................................\
-...................)2.5 F(6)499 196.8 Q 2.5(1.3. Details)87 211.2 R
-(of Installation Files)2.5 E 28.5(............................................\
-....................................................... 7)4.89 F 2.5
-(1.3.1. /usr/sbin/sendmail)102 225.6 R 28.5(..................................\
-....................................................................... 7)2.66
-F 2.5(1.3.2. /etc/sendmail.cf)102 240 R 28.5(.................................\
-........................................................................... 8)
-4.9 F 2.5(1.3.3. /usr/ucb/ne)102 254.4 R -.1(wa)-.25 G .53(liases ............\
-..............................................................................\
-.............).1 F(8)499 254.4 Q 2.5(1.3.4. /v)102 268.8 R 1.81(ar/spool/mqueu\
-e ............................................................................\
-............................)-.25 F(8)499 268.8 Q 2.5(1.3.5. /etc/aliases*)102
-283.2 R 28.5(.................................................................\
-................................................. 8)4.62 F 2.5
-(1.3.6. /etc/sendmail.fc)102 297.6 R 28.5(....................................\
-........................................................................ 8)4.9
-F 2.5(1.3.7. /etc/rc)102 312 R 28.5(..........................................\
-..............................................................................\
-.... 9)3.51 F 2.5(1.3.8. /usr/lib/sendmail.hf)102 326.4 R 23.5(...............\
-..............................................................................\
-.......... 10)2.94 F 2.5(1.3.9. /etc/sendmail.st)102 340.8 R 23.5(............\
-..............................................................................\
-................... 10)3.5 F 2.5(1.3.10. /usr/ucb/ne)102 355.2 R -.1(wa)-.25 G
-.53(liases ...................................................................\
-..................................).1 F(11)494 355.2 Q 2.5
-(1.3.11. /usr/ucb/mailq)102 369.6 R 23.5(.....................................\
-........................................................................ 11)
-3.22 F 2.5(2. NORMAL)72 384 R(OPERA)2.5 E 1.56(TIONS .........................\
-..............................................................................\
-......)-1.11 F(11)494 384 Q 2.5(2.1. `)87 398.4 R(`Quick')-.74 E 2.5('C)-.74 G
-(on\214guration Startup)152.45 398.4 Q 23.5(..................................\
-........................................................... 11)2.77 F 2.5
-(2.2. The)87 412.8 R(System Log)2.5 E 23.5(...................................\
-..............................................................................\
-... 11)4.89 F 2.5(2.2.1. F)102 427.2 R 2.26(ormat ............................\
-..............................................................................\
-................)-.15 F(11)494 427.2 Q 2.5(2.2.2. Le)102 441.6 R -.15(ve)-.25 G
-2.24(ls ......................................................................\
-.....................................................).15 F(11)494 441.6 Q 2.5
-(2.3. The)87 456 R(Mail Queue)2.5 E 23.5(.....................................\
-..............................................................................\
-.. 11)2.96 F 2.5(2.3.1. Printing)102 470.4 R(the queue)2.5 E 23.5(............\
-..............................................................................\
-............... 12)2.67 F 2.5(2.3.2. F)102 484.8 R(orcing the queue)-.15 E 23.5
-(.............................................................................\
-............................ 12)3.94 F 2.5(2.4. The)87 499.2 R(Alias Database)
-2.5 E 23.5(...................................................................\
-............................................. 12)2.69 F 2.5(2.4.1. Reb)102
-513.6 R(uilding the alias database)-.2 E 23.5(................................\
-....................................................... 13)4.27 F 2.5
-(2.4.2. Potential)102 528 R .72(problems .....................................\
-...................................................................)2.5 F(13)
-494 528 Q 2.5(2.4.3. List)102 542.4 R -.25(ow)2.5 G 1.81(ners ................\
-..............................................................................\
-.....................).25 F(13)494 542.4 Q 2.5(2.5. User)87 556.8 R
-(Information Database)2.5 E 23.5(.............................................\
-....................................................... 14)2.7 F 2.5(2.6. Per)
-87 571.2 R(-User F)-.2 E(orw)-.15 E(arding \(.forw)-.1 E(ard Files\))-.1 E 23.5
-(.............................................................................\
-...... 14)4.09 F 2.5(2.7. Special)87 585.6 R(Header Lines)2.5 E 23.5(.........\
-..............................................................................\
-...................... 14)2.97 F 2.5(2.7.1. Return-Receipt-T)102 600 R .98(o: \
-..............................................................................\
-.........................)-.8 F(14)494 600 Q 2.5(2.7.2. Errors-T)102 614.4 R
-2.09(o: ......................................................................\
-...............................................)-.8 F(14)494 614.4 Q 2.5
-(2.7.3. Apparently-T)102 628.8 R 2.09(o: .....................................\
-........................................................................)-.8 F
-(15)494 628.8 Q 2.5(2.8. IDENT)87 643.2 R(Protocol Support)2.5 E 23.5(........\
-..............................................................................\
-................. 15)2.95 F 2.5(3. ARGUMENTS)72 657.6 R 23.5(.................\
-..............................................................................\
-................................ 15)3.78 F 2.5(3.1. Queue)87 672 R(Interv)2.5 E
-1.55(al ......................................................................\
-.................................................)-.25 F(15)494 672 Q 2.5
-(3.2. Daemon)87 686.4 R 1.29(Mode ............................................\
-...........................................................................)2.5
-F(15)494 686.4 Q 2.5(3.3. F)87 700.8 R(orcing the Queue)-.15 E 23.5(..........\
-..............................................................................\
-......................... 16)4.22 F 2.5(3.4. Deb)87 715.2 R 1.76(ugging ......\
-..............................................................................\
-.........................................)-.2 F(16)494 715.2 Q EP
-%%Page: 3 59
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-3)457.9 60 Q/F1 10/Times-Roman@0 SF 2.5(3.5. T)87 96 R(rying a Dif)-.35
-E(ferent Con\214guration File)-.25 E 23.5(....................................\
-............................................... 16)4.67 F 2.5(3.6. Changing)87
-110.4 R(the V)2.5 E(alues of Options)-1.11 E 23.5(............................\
-................................................................ 16)3.23 F 2.5
-(3.7. Logging)87 124.8 R -.35(Tr)2.5 G(af).35 E .5(\214c .....................\
-..............................................................................\
-...................)-.25 F(16)494 124.8 Q 2.5(4. TUNING)72 139.2 R 23.5(......\
-..............................................................................\
-..................................................... 17)2.68 F 2.5(4.1. T)87
-153.6 R 1.07(imeouts .........................................................\
-.......................................................................)-.35 F
-(17)494 153.6 Q 2.5(4.1.1. Queue)102 168 R(interv)2.5 E 2.1(al ...............\
-..............................................................................\
-.................)-.25 F(17)494 168 Q 2.5(4.1.2. Read)102 182.4 R 1(timeouts .\
-..............................................................................\
-................................)2.5 F(17)494 182.4 Q 2.5(4.1.3. Message)102
-196.8 R 1.56(timeouts ........................................................\
-.................................................)2.5 F(18)494 196.8 Q 2.5
-(4.2. F)87 211.2 R(orking During Queue Runs)-.15 E 23.5(......................\
-........................................................................... 19)
-4.49 F 2.5(4.3. Queue)87 225.6 R .73(Priorities ..............................\
-..............................................................................\
-.........)2.5 F(19)494 225.6 Q 2.5(4.4. Load)87 240 R .44(Limiting ...........\
-..............................................................................\
-...............................)2.5 F(19)494 240 Q 2.5(4.5. Deli)87 254.4 R
--.15(ve)-.25 G(ry Mode).15 E 23.5(............................................\
-........................................................................... 19)
-3.08 F 2.5(4.6. Log)87 268.8 R(Le)2.5 E -.15(ve)-.25 G 2.52(l.).15 G 23.5(....\
-..............................................................................\
-............................................ 20)153 268.8 R 2.5(4.7. File)87
-283.2 R .72(Modes ............................................................\
-.................................................................)2.5 F(20)494
-283.2 Q 2.5(4.7.1. T)102 297.6 R 2.5(os)-.8 G(uid or not to suid?)146.2 297.6 Q
-23.5(.........................................................................\
-........................ 20)6.52 F 2.5(4.7.2. Should)102 312 R
-(my alias database be writable?)2.5 E 23.5
-(........................................................................ 20)
-5.47 F 2.5(4.8. Connection)87 326.4 R 1.56(Caching ...........................\
-..............................................................................\
-.....)2.5 F(21)494 326.4 Q 2.5(4.9. Name)87 340.8 R(Serv)2.5 E(er Access)-.15 E
-23.5(.........................................................................\
-..................................... 21)2.85 F 2.5(4.10. Mo)87 355.2 R
-(ving the Per)-.15 E(-User F)-.2 E(orw)-.15 E(ard Files)-.1 E 23.5(...........\
-......................................................................... 22)
-3.84 F 2.5(4.11. Free)87 369.6 R 1.85(Space ..................................\
-..............................................................................\
-...........)2.5 F(22)494 369.6 Q 2.5(4.12. Pri)87 384 R -.25(va)-.25 G .3 -.15
-(cy F).25 H 1.93(lags ........................................................\
-...............................................................).15 F(22)494
-384 Q 2.5(4.13. Send)87 398.4 R(to Me T)2.5 E 2.08(oo ........................\
-..............................................................................\
-.............)-.8 F(22)494 398.4 Q 2.5(5. THE)72 412.8 R
-(WHOLE SCOOP ON THE CONFIGURA)2.5 E(TION FILE)-1.11 E 23.5
-(........................................................ 23)4.64 F 2.5
-(5.1. Con\214guration)87 427.2 R(File Lines)2.5 E 23.5(.......................\
-..............................................................................\
-... 23)2.66 F 2.5(5.1.1. R)102 441.6 R(and S \212 re)2.5 E(writing rules)-.25 E
-23.5(.........................................................................\
-................... 23)3.48 F 2.5(5.1.1.1. The)117 456 R(left hand side)2.5 E
-23.5(.........................................................................\
-....................... 23)4.07 F 2.5(5.1.1.2. The)117 470.4 R(right hand side)
-2.5 E 23.5(...................................................................\
-........................... 24)3.51 F 2.5(5.1.1.3. Semantics)117 484.8 R(of re)
-2.5 E(writing rule sets)-.25 E 23.5
-(.......................................................................... 25)
-4.6 F 2.5(5.1.1.4. IPC)117 499.2 R 1(mailers .................................\
-.........................................................................)2.5 F
-(26)494 499.2 Q 2.5(5.1.2. D)102 513.6 R 2.5<8a64>2.5 G(e\214ne macro)156.72
-513.6 Q 23.5(.................................................................\
-....................................... 26)4.35 F 2.5(5.1.3. C)102 528 R
-(and F \212 de\214ne classes)2.5 E 23.5(......................................\
-....................................................... 28)4.62 F 2.5(5.1.4. M)
-102 542.4 R 2.5<8a64>2.5 G(e\214ne mailer)158.39 542.4 Q 23.5(................\
-..............................................................................\
-......... 29)4.62 F 2.5(5.1.5. H)102 556.8 R 2.5<8a64>2.5 G(e\214ne header)
-156.72 556.8 Q 23.5(..........................................................\
-.............................................. 31)2.69 F 2.5(5.1.6. O)102 571.2
-R 2.5<8a73>2.5 G(et option)155.61 571.2 Q 23.5(...............................\
-..............................................................................\
- 31)4.61 F 2.5(5.1.7. P)102 585.6 R 2.5<8a70>2.5 G(recedence de\214nitions)
-155.06 585.6 Q 23.5(..........................................................\
-................................ 35)3.24 F 2.5(5.1.8. V)102 600 R 2.5<8a63>2.5
-G(on\214guration v)156.16 600 Q(ersion le)-.15 E -.15(ve)-.25 G 4.62(l.).15 G
-23.5(.........................................................................\
-........ 36)265.5 600 R 2.5(5.1.9. K)102 614.4 R 2.5<8a6b>2.5 G .3 -.15
-(ey \214)156.62 614.4 T(le declaration).15 E 23.5(............................\
-.................................................................. 36)4.88 F
-2.5(5.2. Building)87 628.8 R 2.5(aC)2.5 G(on\214guration File From Scratch)
-158.12 628.8 Q 23.5
-(......................................................................... 38)
-3.77 F 2.5(5.2.1. What)102 643.2 R(you are trying to do)2.5 E 23.5(...........\
-..............................................................................\
-.... 38)2.96 F 2.5(5.2.2. Philosoph)102 657.6 R 3.54(y.)-.05 G 23.5(..........\
-..............................................................................\
-........................... 39)180.5 657.6 R 2.5(5.2.2.1. Lar)117 672 R
-(ge site, man)-.18 E 2.5(yh)-.15 G(osts \212 minimum information)226.1 672 Q
-23.5(................................................ 39)2.72 F 2.5
-(5.2.2.2. Small)117 686.4 R(site \212 complete information)2.5 E 23.5
-(.................................................................... 40)4.89 F
-2.5(5.2.2.3. Single)117 700.8 R 1.27(host ....................................\
-.......................................................................)2.5 F
-(40)494 700.8 Q 2.5(5.2.2.4. A)117 715.2 R(completely dif)2.5 E
-(ferent philosoph)-.25 E 3.26(y.)-.05 G 23.5
-(..................................................................... 40)295.5
-715.2 R EP
-%%Page: 4 60
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF 198.36(SMM:08-4 Sendmail)72 60 R
-(Installation and Operation Guide)2.5 E/F1 10/Times-Roman@0 SF 2.5(5.2.3. Rele)
-102 96 R -.25(va)-.25 G(nt issues).25 E 23.5(.................................\
-............................................................................ 4\
-0)4.56 F 2.5(5.2.4. Ho)102 110.4 R 2.5(wt)-.25 G 2.5(op)153.97 110.4 S 2.38(ro\
-ceed .........................................................................\
-...................................)166.47 110.4 R(41)494 110.4 Q 2.5(5.2.5. T)
-102 124.8 R(esting the re)-.7 E(writing rules \212 the \255bt \215ag)-.25 E
-23.5(.................................................................... 41)
-2.99 F 2.5(5.2.6. Building)102 139.2 R(mailer descriptions)2.5 E 23.5(........\
-..............................................................................\
-.. 42)4.61 F 2.5(5.3. The)87 153.6 R(User Database)2.5 E 23.5(................\
-..............................................................................\
-.................. 43)4.92 F 2.5(5.3.1. Structure)102 168 R
-(of the user database)2.5 E 23.5(.............................................\
-.......................................... 43)2.7 F 2.5(5.3.2. User)102 182.4 R
-(database semantics)2.5 E 23.5(...............................................\
-................................................ 44)3.25 F 2.5(6. O)72 196.8 R
-(THER CONFIGURA)-.4 E 1.97(TION ..............................................\
-...........................................................)-1.11 F(44)494
-196.8 Q 2.5(6.1. P)87 211.2 R(arameters in src/Mak)-.15 E 1.55(e\214le .......\
-..............................................................................\
-...............)-.1 F(44)494 211.2 Q 2.5(6.2. P)87 225.6 R
-(arameters in src/conf.h)-.15 E 23.5(.........................................\
-............................................................... 45)4.23 F 2.5
-(6.3. Con\214guration)87 240 R(in src/conf.c)2.5 E 23.5(......................\
-..............................................................................\
- 47)3.51 F 2.5(6.3.1. Built-in)102 254.4 R(Header Semantics)2.5 E 23.5(.......\
-..............................................................................\
-...... 47)4.9 F 2.5(6.3.2. Restricting)102 268.8 R(Use of Email)2.5 E 23.5(...\
-..............................................................................\
-............. 48)4.34 F 2.5(6.3.3. Load)102 283.2 R -1.17 -.74(Av e)2.5 H
-(rage Computation).74 E 23.5(.................................................\
-......................................... 49)2.74 F 2.5(6.3.4. Ne)102 297.6 R
-2.5(wD)-.25 G(atabase Map Classes)157.85 297.6 Q 23.5(........................\
-................................................................. 49)4.89 F 2.5
-(6.3.5. Queueing)102 312 R 1.56(Function .....................................\
-..................................................................)2.5 F(49)494
-312 Q 2.5(6.3.6. Refusing)102 326.4 R(Incoming SMTP Connections)2.5 E 23.5
-(....................................................................... 50)
-2.94 F 2.5(6.3.7. Load)102 340.8 R -1.17 -.74(Av e)2.5 H(rage Computation).74 E
-23.5(.........................................................................\
-................. 50)2.74 F 2.5(6.4. Con\214guration)87 355.2 R
-(in src/daemon.c)2.5 E 23.5(..................................................\
-............................................ 50)4.62 F 2.5(7. CHANGES)72 369.6
-R(IN VERSION 8)2.5 E 23.5(....................................................\
-...................................................... 50)4.9 F 2.5
-(7.1. Connection)87 384 R 1.56(Caching .......................................\
-.......................................................................)2.5 F
-(51)494 384 Q 2.5(7.2. MX)87 398.4 R 2.39(Piggybacking .......................\
-..............................................................................\
-............)2.5 F(51)494 398.4 Q 2.5(7.3. RFC)87 412.8 R(1123 Compliance)2.5 E
-23.5(.........................................................................\
-................................. 51)3.77 F 2.5(7.4. Extended)87 427.2 R
-(SMTP Support)2.5 E 23.5(.....................................................\
-.................................................. 51)2.94 F 2.5
-(7.5. Eight-Bit)87 441.6 R .44(Clean .........................................\
-.............................................................................)
-2.5 F(51)494 441.6 Q 2.5(7.6. User)87 456 R .47(Database .....................\
-..............................................................................\
-.....................)2.5 F(51)494 456 Q 2.5(7.7. Impro)87 470.4 R -.15(ve)-.15
-G 2.5(dB).15 G(IND Support)154.75 470.4 Q 23.5(...............................\
-........................................................................ 51)
-3.81 F 2.5(7.8. K)87 484.8 R -.15(ey)-.25 G(ed Files).15 E 23.5(..............\
-..............................................................................\
-................................ 52)3.35 F 2.5(7.9. Multi-W)87 499.2 R
-(ord Classes)-.8 E 23.5(......................................................\
-......................................................... 52)3.47 F 2.5
-(7.10. Deferred)87 513.6 R(Macro Expansion)2.5 E 23.5(........................\
-......................................................................... 52)
-4.65 F 2.5(7.11. IDENT)87 528 R(Protocol Support)2.5 E 23.5(..................\
-..............................................................................\
-..... 52)2.95 F 2.5(7.12. P)87 542.4 R(arsing Bug Fix)-.15 E .46(es ..........\
-..............................................................................\
-........................)-.15 F(52)494 542.4 Q 2.5(7.13. Separate)87 556.8 R
-(En)2.5 E -.15(ve)-.4 G(lope/Header Processing).15 E 23.5(....................\
-............................................................ 52)4.37 F 2.5
-(7.14. Owner)87 571.2 R(-List Propag)-.2 E(ates to En)-.05 E -.15(ve)-.4 G 1.27
-(lope ........................................................................\
-............).15 F(52)494 571.2 Q 2.5(7.15. Dynamic)87 585.6 R
-(Header Allocation)2.5 E 23.5(................................................\
-................................................ 52)3.25 F 2.5(7.16. Ne)87 600
-R 2.5(wC)-.25 G(ommand Line Flags)139.8 600 Q 23.5(...........................\
-....................................................................... 52)3.2
-F 2.5(7.17. Enhanced)87 614.4 R(Command Line Flags)2.5 E 23.5(................\
-......................................................................... 52)
-4.9 F 2.5(7.18. Ne)87 628.8 R 2.5(wa)-.25 G(nd Old Con\214guration Line T)
-137.57 628.8 Q .4(ypes .......................................................\
-.......................)-.8 F(53)494 628.8 Q 2.5(7.19. Ne)87 643.2 R 2.5(wO)
--.25 G .7(ptions .............................................................\
-...........................................................)140.35 643.2 R(53)
-494 643.2 Q 2.5(7.20. Extended)87 657.6 R 1.56(Options .......................\
-..............................................................................\
-...........)2.5 F(53)494 657.6 Q 2.5(7.21. Ne)87 672 R 2.5(wM)-.25 G
-(ailer Flags)142.02 672 Q 23.5(...............................................\
-................................................................. 53)4.04 F 2.5
-(7.22. Ne)87 686.4 R 2.5(wP)-.25 G(re-De\214ned Macros)138.69 686.4 Q 23.5(...\
-..............................................................................\
-................... 54)4.06 F 2.5(7.23. Ne)87 700.8 R 2.5(wL)-.25 G(HS T)139.24
-700.8 Q(ok)-.8 E 1.33(en .....................................................\
-.............................................................)-.1 F(54)494
-700.8 Q 2.5(7.24. Bigger)87 715.2 R(Def)2.5 E(aults ..........................\
-..............................................................................\
-............)-.1 E(54)494 715.2 Q EP
-%%Page: 5 61
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Sendmail Installation and Operation Guide)72 60 Q
-(SMM:08-5)457.9 60 Q/F1 10/Times-Roman@0 SF 2.5(7.25. Dif)87 96 R(ferent Def)
--.25 E(ault T)-.1 E(uning P)-.45 E 1.99(arameters ............................\
-......................................................)-.15 F(54)494 96 Q 2.5
-(7.26. Auto-Quoting)87 110.4 R(in Addresses)2.5 E 23.5(.......................\
-.......................................................................... 54)
-3.51 F 2.5(7.27. Symbolic)87 124.8 R(Names On Error Mailer)2.5 E 23.5(........\
-..............................................................................\
- 54)4.91 F 2.5(7.28. SMTP)87 139.2 R(VRFY Doesn')2.5 E 2.5(tE)-.18 G 1.18(xpan\
-d ............................................................................\
-................)209.88 139.2 R(54)494 139.2 Q 2.5(7.29. [IPC])87 153.6 R
-(Mailers Allo)2.5 E 2.5(wM)-.25 G(ultiple Hosts)205.91 153.6 Q 23.5(..........\
-......................................................................... 54)
-3.75 F 2.5(7.30. Aliases)87 168 R 1.29(Extended ..............................\
-..............................................................................\
-.....)2.5 F(55)494 168 Q 2.5(7.31. Portability)87 182.4 R
-(and Security Enhancements)2.5 E 23.5(........................................\
-....................................... 55)2.68 F 2.5(7.32. Miscellaneous)87
-196.8 R 1.29(Changes .........................................................\
-..............................................)2.5 F(55)494 196.8 Q 2.5(8. A)72
-211.2 R(CKNO)-.4 E .1(WLEDGEMENTS ............................................\
-................................................................)-.35 F(55)494
-211.2 Q(Appendix A.)72 225.6 Q(COMMAND LINE FLA)5 E 1.97(GS ..................\
-.......................................................................)-.4 F
-(56)494 225.6 Q(Appendix B.)72 240 Q -.1(QU)5 G(EUE FILE FORMA).1 E 1.38(TS ..\
-..............................................................................\
-............)-1.11 F(58)494 240 Q(Appendix C.)72 254.4 Q(SUMMAR)5 E 2.5(YO)-.65
-G 2.5(FS)188.85 254.4 S(UPPOR)202.47 254.4 Q 2.5(TF)-.6 G 1.12(ILES ..........\
-....................................................................)248.27
-254.4 R(60)494 254.4 Q EP
-%%Trailer
-end
-%%EOF
diff --git a/usr.sbin/sendmail/doc/usenix/Makefile b/usr.sbin/sendmail/doc/usenix/Makefile
new file mode 100644
index 000000000000..5d3ee41b616a
--- /dev/null
+++ b/usr.sbin/sendmail/doc/usenix/Makefile
@@ -0,0 +1,13 @@
+# @(#)Makefile 8.2 (Berkeley) 2/28/94
+
+SRCS= usenix.me
+MACROS= -me
+CLEANFILES= *.ps
+
+all: usenix.ps
+
+usenix.ps: ${SRCS}
+ rm -f ${.TARGET}
+ ${PIC} ${SRCS} | ${ROFF} > ${.TARGET}
+
+.include <bsd.doc.mk>
diff --git a/usr.sbin/sendmail/doc/usenix/usenix.me b/usr.sbin/sendmail/doc/usenix/usenix.me
index 30da01f3ca4c..0fbb6723c136 100644
--- a/usr.sbin/sendmail/doc/usenix/usenix.me
+++ b/usr.sbin/sendmail/doc/usenix/usenix.me
@@ -1,6 +1,6 @@
.nr si 3n
.he 'Mail Systems and Addressing in 4.2bsd''%'
-.fo 'Version 8.1'USENIX \- Jan 83'Last Mod 6/7/93'
+.fo 'Version 8.2'USENIX \- Jan 83'Last Mod 11/27/93'
.if n .ls 2
.+c
.(l C
@@ -9,7 +9,7 @@ Mail Systems and Addressing
in 4.2bsd
.sz
.sp
-Eric Allman\(dg
+Eric Allman*
.sp 0.5
.i
Britton-Lee, Inc.
@@ -55,7 +55,7 @@ The changes that will be user visible are emphasized.
.)l
.sp 2
.(f
-\(dgA considerable part of this work
+*A considerable part of this work
was done while under the employ
of the INGRES Project
at the University of California at Berkeley.
diff --git a/usr.sbin/sendmail/doc/usenix/usenix.ps b/usr.sbin/sendmail/doc/usenix/usenix.ps
deleted file mode 100644
index 10bd887164d6..000000000000
--- a/usr.sbin/sendmail/doc/usenix/usenix.ps
+++ /dev/null
@@ -1,1004 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: groff version 1.08
-%%DocumentNeededResources: font Times-Roman
-%%+ font Times-Italic
-%%+ font Times-Bold
-%%DocumentSuppliedResources: procset grops 1.08 0
-%%Pages: 9
-%%PageOrder: Ascend
-%%Orientation: Portrait
-%%EndComments
-%%BeginProlog
-%%BeginResource: procset grops 1.08 0
-/setpacking where{
-pop
-currentpacking
-true setpacking
-}if
-/grops 120 dict dup begin
-/SC 32 def
-/A/show load def
-/B{0 SC 3 -1 roll widthshow}bind def
-/C{0 exch ashow}bind def
-/D{0 exch 0 SC 5 2 roll awidthshow}bind def
-/E{0 rmoveto show}bind def
-/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
-/G{0 rmoveto 0 exch ashow}bind def
-/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/I{0 exch rmoveto show}bind def
-/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
-/K{0 exch rmoveto 0 exch ashow}bind def
-/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/M{rmoveto show}bind def
-/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
-/O{rmoveto 0 exch ashow}bind def
-/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/Q{moveto show}bind def
-/R{moveto 0 SC 3 -1 roll widthshow}bind def
-/S{moveto 0 exch ashow}bind def
-/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
-/SF{
-findfont exch
-[exch dup 0 exch 0 exch neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/MF{
-findfont
-[5 2 roll
-0 3 1 roll
-neg 0 0]makefont
-dup setfont
-[exch/setfont cvx]cvx bind def
-}bind def
-/level0 0 def
-/RES 0 def
-/PL 0 def
-/LS 0 def
-/PLG{
-gsave newpath clippath pathbbox grestore
-exch pop add exch pop
-}bind def
-/BP{
-/level0 save def
-1 setlinecap
-1 setlinejoin
-72 RES div dup scale
-LS{
-90 rotate
-}{
-0 PL translate
-}ifelse
-1 -1 scale
-}bind def
-/EP{
-level0 restore
-showpage
-}bind def
-/DA{
-newpath arcn stroke
-}bind def
-/SN{
-transform
-.25 sub exch .25 sub exch
-round .25 add exch round .25 add exch
-itransform
-}bind def
-/DL{
-SN
-moveto
-SN
-lineto stroke
-}bind def
-/DC{
-newpath 0 360 arc closepath
-}bind def
-/TM matrix def
-/DE{
-TM currentmatrix pop
-translate scale newpath 0 0 .5 0 360 arc closepath
-TM setmatrix
-}bind def
-/RC/rcurveto load def
-/RL/rlineto load def
-/ST/stroke load def
-/MT/moveto load def
-/CL/closepath load def
-/FL{
-currentgray exch setgray fill setgray
-}bind def
-/BL/fill load def
-/LW/setlinewidth load def
-/RE{
-findfont
-dup maxlength 1 index/FontName known not{1 add}if dict begin
-{
-1 index/FID ne{def}{pop pop}ifelse
-}forall
-/Encoding exch def
-dup/FontName exch def
-currentdict end definefont pop
-}bind def
-/DEFS 0 def
-/EBEGIN{
-moveto
-DEFS begin
-}bind def
-/EEND/end load def
-/CNT 0 def
-/level1 0 def
-/PBEGIN{
-/level1 save def
-translate
-div 3 1 roll div exch scale
-neg exch neg exch translate
-0 setgray
-0 setlinecap
-1 setlinewidth
-0 setlinejoin
-10 setmiterlimit
-[]0 setdash
-/setstrokeadjust where{
-pop
-false setstrokeadjust
-}if
-/setoverprint where{
-pop
-false setoverprint
-}if
-newpath
-/CNT countdictstack def
-userdict begin
-/showpage{}def
-}bind def
-/PEND{
-clear
-countdictstack CNT sub{end}repeat
-level1 restore
-}bind def
-end def
-/setpacking where{
-pop
-setpacking
-}if
-%%EndResource
-%%IncludeResource: font Times-Roman
-%%IncludeResource: font Times-Italic
-%%IncludeResource: font Times-Bold
-grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 def/PL
-792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron/scaron/zcaron
-/Ydieresis/trademark/quotesingle/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
-/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/space
-/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright/parenleft
-/parenright/asterisk/plus/comma/hyphen/period/slash/zero/one/two/three/four
-/five/six/seven/eight/nine/colon/semicolon/less/equal/greater/question/at/A/B/C
-/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash
-/bracketright/circumflex/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q
-/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase
-/guillemotleft/guillemotright/bullet/florin/fraction/perthousand/dagger
-/daggerdbl/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
-/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
-/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen/brokenbar
-/section/dieresis/copyright/ordfeminine/guilsinglleft/logicalnot/minus
-/registered/macron/degree/plusminus/twosuperior/threesuperior/acute/mu
-/paragraph/periodcentered/cedilla/onesuperior/ordmasculine/guilsinglright
-/onequarter/onehalf/threequarters/questiondown/Agrave/Aacute/Acircumflex/Atilde
-/Adieresis/Aring/AE/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute
-/Icircumflex/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
-/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls
-/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla/egrave/eacute
-/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis/eth/ntilde/ograve
-/oacute/ocircumflex/otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex
-/udieresis/yacute/thorn/ydieresis]def/Times-Bold@0 ENC0/Times-Bold RE
-/Times-Italic@0 ENC0/Times-Italic RE/Times-Roman@0 ENC0/Times-Roman RE
-%%EndProlog
-%%Page: 1 1
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 14/Times-Roman@0 SF(Mail Systems and Addressing)204.196 141 Q(in 4.2bsd)
-262.331 157.8 Q/F1 10/Times-Roman@0 SF(Eric Allman\207)260.92 181.8 Q/F2 10
-/Times-Italic@0 SF(Britton-Lee)254.86 199.8 Q 2.5(,I)-.1 G(nc.)309.2 199.8 Q
-(1919 Addison Str)225.13 211.8 Q(eet, Suite 105.)-.37 E(Berk)232.645 223.8 Q
-(ele)-.1 E 1.1 -.55(y, C)-.3 H(alifornia 94704.).55 E F1(eric@Berk)244.175
-241.8 Q(ele)-.1 E -.65(y.)-.15 G(ARP).65 E(A)-.92 E(ucb)264.6 253.8 Q -.25(va)
--.15 G(x!eric).25 E(ABSTRA)262.085 286.2 Q(CT)-.4 E .966
-(Routing mail through a heterogeneous internet presents man)112 302.4 R 3.466
-(yn)-.15 G 1.466 -.25(ew p)373.438 302.4 T 3.466(roblems. Among).25 F .297
-(the w)112 314.4 R .297(orst of these is that of address mapping.)-.1 F
-(Historically)5.297 E 2.797(,t)-.65 G .298(his has been handled on an)355.03
-314.4 R(ad hoc basis.)112 326.4 Q(Ho)5 E(we)-.25 E -.15(ve)-.25 G .8 -.4(r, t)
-.15 H(his approach has become unmanageable as internets gro).4 E -.65(w.)-.25 G
-.099(Sendmail acts a uni\214ed \231post of)112 342.6 R .098
-(\214ce\232 to which all mail can be submitted.)-.25 F .098(Address inter)5.098
-F(-)-.2 E .754(pretation is controlled by a production system, which can parse\
- both old and ne)112 354.6 R 3.255(wf)-.25 G(or)452.54 354.6 Q(-)-.2 E .242
-(mat addresses.)112 366.6 R .242(The ne)5.242 F 2.742(wf)-.25 G .242
-(ormat is \231domain-based,)216.578 366.6 R 2.742<9a618d>-.7 G -.15(ex)334.326
-366.6 S .241(ible technique that can handle).15 F(man)112 378.6 Q 2.606(yc)-.15
-G .106(ommon situations.)141.116 378.6 R .106
-(Sendmail is not intended to perform user interf)5.106 F .107(ace functions.)
--.1 F .399(Sendmail will replace deli)112 394.8 R -.15(ve)-.25 G .399
-(rmail in the Berk).15 F(ele)-.1 E 2.899(y4)-.15 G .399(.2 distrib)320.504
-394.8 R 2.899(ution. Se)-.2 F -.15(ve)-.25 G .399(ral major hosts).15 F .421
-(are no)112 406.8 R 2.921(wo)-.25 G 2.921(rw)152.022 406.8 S .421
-(ill soon be running sendmail.)165.493 406.8 R .421(This change will af)5.421 F
-.422(fect an)-.25 F 2.922(yu)-.15 G .422(sers that route)407.056 406.8 R 1.5
-(mail through a sendmail g)112 418.8 R(ate)-.05 E -.1(wa)-.25 G 5.3 -.65(y. T)
-.1 H 1.5(he changes that will be user visible are empha-).65 F(sized.)112 430.8
-Q .906(The mail system to appear in 4.2bsd will contain a number of changes.)97
-475.2 R .906(Most of these changes are)5.906 F .469
-(based on the replacement of)72 487.2 R F2(delivermail)2.969 E F1 .469
-(with a ne)2.969 F 2.969(wm)-.25 G .469(odule called)292.871 487.2 R F2 2.97
-(sendmail. Sendmail)2.97 F F1 .47(implements a gen-)2.97 F 1.834
-(eral internetw)72 499.2 R 1.834(ork mail routing f)-.1 F(acility)-.1 E 4.333
-(,f)-.65 G 1.833(eaturing aliasing and forw)239.739 499.2 R 1.833
-(arding, automatic routing to netw)-.1 F(ork)-.1 E -.05(ga)72 511.2 S(te).05 E
--.1(wa)-.25 G .205(ys, and \215e).1 F .205(xible con\214guration.)-.15 F .205
-(Of k)5.205 F .505 -.15(ey i)-.1 H .205
-(nterest to the mail system user will be the changes in the net-).15 F -.1(wo)
-72 523.2 S(rk addressing structure.).1 E .624(In a simple netw)97 539.4 R .624
-(ork, each node has an address, and resources can be identi\214ed with a host-\
-resource)-.1 F .374(pair; in particular)72 551.4 R 2.874(,t)-.4 G .374
-(he mail system can refer to users using a host-username pair)149.932 551.4 R
-5.374(.H)-.55 G .375(ost names and numbers)409.276 551.4 R(ha)72 563.4 Q .3
--.15(ve t)-.2 H 2.5(ob).15 G 2.5(ea)108.31 563.4 S
-(dministered by a central authority)119.69 563.4 Q 2.5(,b)-.65 G
-(ut usernames can be assigned locally to each host.)263.82 563.4 Q .397
-(In an internet, multiple netw)97 579.6 R .396(orks with dif)-.1 F .396
-(ferent characteristics and managements must communicate.)-.25 F .389
-(In particular)72 591.6 R 2.889(,t)-.4 G .389
-(he syntax and semantics of resource identi\214cation change.)129.308 591.6 R
-.39(Certain special cases can be han-)5.389 F 1.033(dled tri)72 603.6 R 1.033
-(vially by)-.25 F F2 1.033(ad hoc)3.533 F F1 1.032(techniques, such as pro)
-3.533 F 1.032(viding netw)-.15 F 1.032
-(ork names that appear local to hosts on other)-.1 F(netw)72 615.6 Q 1.621
-(orks, as with the Ethernet at Xerox P)-.1 F 4.121(ARC. Ho)-.92 F(we)-.25 E
--.15(ve)-.25 G 2.421 -.4(r, t).15 H 1.622(he general case is e).4 F 1.622
-(xtremely comple)-.15 F 4.122(x. F)-.15 F(or)-.15 E -.15(ex)72 627.6 S .29
-(ample, some netw).15 F .29(orks require that the route the message tak)-.1 F
-.29(es be e)-.1 F .29(xplicitly speci\214ed by the sender)-.15 F 2.79(,s)-.4 G
-(im-)490.11 627.6 Q 1.618(plifying the database update problem since only adja\
-cent hosts must be entered into the system tables,)72 639.6 R .573(while other\
-s use logical addressing, where the sender speci\214es the location of the rec\
-ipient b)72 651.6 R .573(ut not ho)-.2 F 3.072(wt)-.25 G(o)499 651.6 Q 1.065
-(get there.)72 663.6 R 1.065(Some netw)6.065 F 1.066(orks use a left-associati)
--.1 F 1.366 -.15(ve s)-.25 H 1.066(yntax and others use a right-associati).15 F
-1.366 -.15(ve s)-.25 H 1.066(yntax, causing).15 F .32 LW 76 673.2 72 673.2 DL
-80 673.2 76 673.2 DL 84 673.2 80 673.2 DL 88 673.2 84 673.2 DL 92 673.2 88
-673.2 DL 96 673.2 92 673.2 DL 100 673.2 96 673.2 DL 104 673.2 100 673.2 DL 108
-673.2 104 673.2 DL 112 673.2 108 673.2 DL 116 673.2 112 673.2 DL 120 673.2 116
-673.2 DL 124 673.2 120 673.2 DL 128 673.2 124 673.2 DL 132 673.2 128 673.2 DL
-136 673.2 132 673.2 DL 140 673.2 136 673.2 DL 144 673.2 140 673.2 DL 148 673.2
-144 673.2 DL 152 673.2 148 673.2 DL 156 673.2 152 673.2 DL 160 673.2 156 673.2
-DL 164 673.2 160 673.2 DL 168 673.2 164 673.2 DL 172 673.2 168 673.2 DL 176
-673.2 172 673.2 DL 180 673.2 176 673.2 DL 184 673.2 180 673.2 DL 188 673.2 184
-673.2 DL 192 673.2 188 673.2 DL 196 673.2 192 673.2 DL 200 673.2 196 673.2 DL
-204 673.2 200 673.2 DL 208 673.2 204 673.2 DL 212 673.2 208 673.2 DL 216 673.2
-212 673.2 DL/F3 8/Times-Roman@0 SF .556(\207A considerable part of this w)93.6
-685.2 R .556(ork w)-.08 F .556(as done while under the emplo)-.08 F 2.557(yo)
--.08 G 2.557(ft)323.107 685.2 S .557(he INGRES Project at the Uni)330.552 685.2
-R -.12(ve)-.2 G .557(rsity of California at).12 F(Berk)72 694.8 Q(ele)-.08 E
--.52(y.)-.12 G/F4 10/Times-Bold@0 SF(Mail Systems and Addr)72 756 Q
-(essing in 4.2bsd)-.18 E(1)499 756 Q EP
-%%Page: 2 2
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Mail Systems and Addr)72 60 Q(essing in 4.2bsd)-.18 E(2)
-499 60 Q/F1 10/Times-Roman@0 SF(ambiguity in mix)72 96 Q(ed addresses.)-.15 E
-.679(Internet standards seek to eliminate these problems.)97 112.2 R(Initially)
-5.678 E 3.178(,t)-.65 G .678(hese proposed e)353.138 112.2 R .678
-(xpanding the address)-.15 F .331
-(pairs to address triples, consisting of {netw)72 124.2 R .331
-(ork, host, username} triples.)-.1 F(Netw)5.332 E .332(ork numbers must be uni)
--.1 F -.15(ve)-.25 G -.2(r-).15 G 1.452
-(sally agreed upon, and hosts can be assigned locally on each netw)72 136.2 R
-3.952(ork. The)-.1 F(user)3.952 E(-le)-.2 E -.15(ve)-.25 G 3.952(lp).15 G 1.452
-(resentation w)440.718 136.2 R(as)-.1 E .249(changed to address domains, compr\
-ised of a local resource identi\214cation and a hierarchical domain speci\214-)
-72 148.2 R 1.54(cation with a common static root.)72 160.2 R 1.539
-(The domain technique separates the issue of ph)6.539 F 1.539(ysical v)-.05 F
-1.539(ersus logical)-.15 F 3.001(addressing. F)72 172.2 R .501(or e)-.15 F .502
-(xample, an address of the form \231eric@a.cc.berk)-.15 F(ele)-.1 E -.65(y.)
--.15 G .502(arpa\232 describes the logical or).65 F -.05(ga)-.18 G(niza-).05 E
-.443(tion of the address space \(user \231eric\232 on host \231a\232 in the Co\
-mputer Center at Berk)72 184.2 R(ele)-.1 E .443(y\) b)-.15 F .443
-(ut not the ph)-.2 F(ysical)-.05 E(netw)72 196.2 Q .934(orks used \(for e)-.1 F
-.934(xample, this could go o)-.15 F -.15(ve)-.15 G 3.434(rd).15 G(if)274.722
-196.2 Q .934(ferent netw)-.25 F .935
-(orks depending on whether \231a\232 were on an)-.1 F
-(ethernet or a store-and-forw)72 208.2 Q(ard netw)-.1 E(ork\).)-.1 E/F2 10
-/Times-Italic@0 SF(Sendmail)97 224.4 Q F1 .493
-(is intended to help bridge the g)2.993 F .493(ap between the totally)-.05 F F2
-.493(ad hoc)2.993 F F1 -.1(wo)2.993 G .493(rld of netw).1 F .493(orks that kno)
--.1 F(w)-.25 E .854(nothing of each other and the clean, tightly-coupled w)72
-236.4 R .854(orld of unique netw)-.1 F .855(ork numbers.)-.1 F .855
-(It can accept old)5.855 F .633(arbitrary address syntax)72 248.4 R .632(es, r\
-esolving ambiguities using heuristics speci\214ed by the system administrator)
--.15 F 3.132(,a)-.4 G(s)500.11 248.4 Q .347(well as domain-based addressing.)72
-260.4 R .347(It helps guide the con)5.347 F -.15(ve)-.4 G .347
-(rsion of message formats between disparate net-).15 F -.1(wo)72 272.4 S 3.395
-(rks. In).1 F(short,)3.395 E F2(sendmail)3.395 E F1 .894
-(is designed to assist a graceful transition to consistent internetw)3.395 F
-.894(ork addressing)-.1 F(schemes.)72 284.4 Q .689
-(Section 1 de\214nes some of the terms frequently left fuzzy when w)97 312.6 R
-.69(orking in mail systems.)-.1 F .69(Section 2)5.69 F .595
-(discusses the design goals for)72 324.6 R F2(sendmail)3.095 E F1 5.595(.I)C
-3.095(ns)243.33 324.6 S .595(ection 3, the ne)255.315 324.6 R 3.095(wa)-.25 G
-.594(ddress formats and basic features of)332.705 324.6 R F2(send-)3.094 E
-(mail)72 336.6 Q F1 .893(are described.)3.393 F .893
-(Section 4 discusses some of the special problems of the UUCP netw)5.893 F
-3.394(ork. The)-.1 F(dif)3.394 E(fer)-.25 E(-)-.2 E(ences between)72 348.6 Q F2
-(sendmail)2.5 E F1(and)2.5 E F2(delivermail)2.5 E F1
-(are presented in section 5.)2.5 E F0(DISCLAIMER:)112 376.8 Q F1 3.333(An)3.333
-G .833(umber of e)199.216 376.8 R .832
-(xamples in this paper use names of actual people and)-.15 F(or)112 388.8 Q
--.05(ga)-.18 G 4.572(nizations. This).05 F 2.072
-(is not intended to imply a commitment or e)4.572 F -.15(ve)-.25 G 4.573(na).15
-G 4.573(ni)409.987 388.8 S(ntellectual)422.34 388.8 Q 1.094
-(agreement on the part of these people or or)112 400.8 R -.05(ga)-.18 G 3.594
-(nizations. In).05 F(particular)3.594 E 3.594(,B)-.4 G 1.094(ell T)408.896
-400.8 R(elephone)-.7 E .656
-(Laboratories \(BTL\), Digital Equipment Corporation \(DEC\), La)112 412.8 R
-.657(wrence Berk)-.15 F(ele)-.1 E 3.157(yL)-.15 G(abo-)446.23 412.8 Q 2.136
-(ratories \(LBL\), Britton-Lee Incorporated \(BLI\), and the Uni)112 424.8 R
--.15(ve)-.25 G 2.136(rsity of California at).15 F(Berk)112 436.8 Q(ele)-.1 E
-3.088(ya)-.15 G .588(re not committed to an)155.378 436.8 R 3.089(yo)-.15 G
-3.089(ft)261.219 436.8 S .589(hese proposals at this time.)270.418 436.8 R .589
-(Much of this paper)5.589 F
-(represents no more than the personal opinions of the author)112 448.8 Q(.)-.55
-E F0 2.5(1. DEFINITIONS)72 477 R F1 .266(There are four basic concepts that mu\
-st be clearly distinguished when dealing with mail systems:)112 493.2 R .514
-(the user \(or the user')87 505.2 R 3.014(sa)-.55 G .515(gent\), the user')
-182.6 505.2 R 3.015(si)-.55 G .515(denti\214cation, the user')253.025 505.2 R
-3.015(sa)-.55 G .515(ddress, and the route.)354.56 505.2 R .515(These are dis-)
-5.515 F(tinguished primarily by their position independence.)87 517.2 Q F0 2.5
-(1.1. User)87 541.2 R(and Identi\214cation)2.5 E F1 .264
-(The user is the being \(a person or program\) that is creating or recei)127
-557.4 R .263(ving a message.)-.25 F(An)5.263 E F2 -.1(age)2.763 G(nt).1 E F1
-.659(is an entity operating on behalf of the user \212 such as a secretary who\
- handles my mail.)102 569.4 R .66(or a pro-)5.66 F(gram that automatically ret\
-urns a message such as \231I am at the UNICOM conference.)102 581.4 Q<9a>-.7 E
-.931(The identi\214cation is the tag that goes along with the particular user)
-127 597.6 R 5.931(.T)-.55 G .931(his tag is completely)418.707 597.6 R .216
-(independent of location.)102 609.6 R -.15(Fo)5.216 G 2.716(re).15 G .216
-(xample, my identi\214cation is the string \231Eric Allman,)225.324 609.6 R
-2.717<9a61>-.7 G .217(nd this identi-)448.006 609.6 R 1.228
-(\214cation does not change whether I am located at U.C. Berk)102 621.6 R(ele)
--.1 E 2.527 -.65(y, a)-.15 H 3.727(tB).65 G 1.227
-(ritton-Lee, or at a scienti\214c)390.502 621.6 R(institute in Austria.)102
-633.6 Q 2.379
-(Since the identi\214cation is frequently ambiguous \(e.g., there are tw)127
-649.8 R 4.879<6f99>-.1 G 2.38(Robert Henry\232s at)426.48 649.8 R(Berk)102
-661.8 Q(ele)-.1 E .316(y\) it is common to add other disambiguating informatio\
-n that is not strictly part of the iden-)-.15 F
-(ti\214cation \(e.g., Robert \231Code Generator\232 Henry v)102 673.8 Q
-(ersus Robert \231System Administrator\232 Henry\).)-.15 E F0 -1(Ve)72 756 S
-(rsion 8.1)1 E(USENIX \255 J)249.805 756 Q(an 83)-.15 E(Last Mod 6/7/93)434.55
-756 Q EP
-%%Page: 3 3
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Mail Systems and Addr)72 60 Q(essing in 4.2bsd)-.18 E(3)
-499 60 Q 2.5(1.2. Addr)87 96 R(ess)-.18 E/F1 10/Times-Roman@0 SF .785
-(The address speci\214es a location.)127 112.2 R .786(As I mo)5.786 F 1.086
--.15(ve a)-.15 H .786(round, my address changes.).15 F -.15(Fo)5.786 G 3.286
-(re).15 G .786(xample, my)455.994 112.2 R 9.712
-(address might change from \231eric@Berk)102 124.2 R(ele)-.1 E -.65(y.)-.15 G
-(ARP).65 E 9.711(A\232 to \231eric@bli.UUCP\232 or \231all-)-.92 F
-(man@IIASA.Austria\232 depending on my current af)102 136.2 Q(\214liation.)-.25
-E(Ho)127 152.4 Q(we)-.25 E -.15(ve)-.25 G 2.819 -.4(r, a).15 H 4.519(na).4 G
-2.019(ddress is independent of the location of an)188.018 152.4 R 2.019
-(yone else.)-.15 F 2.02(That is, my address)7.02 F .385(remains the same to e)
-102 164.4 R -.15(ve)-.25 G .385(ryone who might be sending me mail.).15 F -.15
-(Fo)5.385 G 2.885(re).15 G .385(xample, a person at MIT and a)379.22 164.4 R
-(person at USC could both send to \231eric@Berk)102 176.4 Q(ele)-.1 E -.65(y.)
--.15 G(ARP).65 E(A\232 and ha)-.92 E .3 -.15(ve i)-.2 H 2.5(ta).15 G(rri)388.44
-176.4 Q .3 -.15(ve t)-.25 H 2.5(ot).15 G(he same mailbox.)422.48 176.4 Q .627
-(Ideally a \231white pages\232 service w)127 192.6 R .627(ould be pro)-.1 F
-.627(vided to map user identi\214cations into addresses)-.15 F .444(\(for e)102
-204.6 R .444(xample, see [Solomon81]\).)-.15 F .444
-(Currently this is handled by passing around scraps of paper or by)5.444 F
-(calling people on the telephone to \214nd out their address.)102 216.6 Q F0
-2.5(1.3. Route)87 240.6 R F1 .288(While an address speci\214es)127 256.8 R/F2
-10/Times-Italic@0 SF(wher)2.788 E(e)-.37 E F1 .289
-(to \214nd a mailbox, a route speci\214es)2.789 F F2(how)2.789 E F1 .289
-(to \214nd the mailbox.)2.789 F(Speci\214cally)102 268.8 Q 2.607(,i)-.65 G
-2.607(ts)156.457 268.8 S .106(peci\214es a path from sender to recei)165.734
-268.8 R -.15(ve)-.25 G 3.706 -.55(r. A).15 H 2.606(ss).55 G .106
-(uch, the route is potentially dif)343.364 268.8 R .106(ferent for)-.25 F -2.15
--.25(ev e)102 280.8 T(ry pair of people in the electronic uni).25 E -.15(ve)
--.25 G(rse.).15 E .258(Normally the route is hidden from the user by the softw)
-127 297 R 2.758(are. Ho)-.1 F(we)-.25 E -.15(ve)-.25 G 1.058 -.4(r, s).15 H
-.258(ome netw).4 F .258(orks put the)-.1 F -.2(bu)102 309 S 1.972
-(rden of determining the route onto the sender).2 F 6.971(.A)-.55 G 1.971
-(lthough this simpli\214es the softw)322.544 309 R 1.971(are, it also)-.1 F
-(greatly impairs the usability for most users.)102 321 Q(The UUCP netw)5 E
-(ork is an e)-.1 E(xample of such a netw)-.15 E(ork.)-.1 E F0 2.5(2. DESIGN)72
-345 R(GO)2.5 E(ALS)-.4 E F1(Design goals for)112 363.2 Q F2(sendmail)2.5 E/F3 7
-/Times-Roman@0 SF(1)216.71 359.2 Q F1(include:)222.71 363.2 Q 12.5
-(\(1\) Compatibility)92 379.4 R 1.363(with the e)3.863 F 1.363
-(xisting mail programs, including Bell v)-.15 F 1.363(ersion 6 mail, Bell v)
--.15 F 1.364(ersion 7)-.15 F 3.589(mail, Berk)118.66 391.4 R(ele)-.1 E(y)-.15 E
-F2(Mail)6.089 E F1 3.589
-([Shoens79], BerkNet mail [Schmidt79], and hopefully UUCP mail)6.089 F([No)
-118.66 403.4 Q 2.5(witz78]. ARP)-.25 F(ANET mail [Crock)-.92 E(er82] w)-.1 E
-(as also required.)-.1 E 12.5(\(2\) Reliability)92 419.6 R 4.002(,i)-.65 G
-4.002(nt)169.522 419.6 S 1.502(he sense of guaranteeing that e)181.304 419.6 R
--.15(ve)-.25 G 1.502(ry message is correctly deli).15 F -.15(ve)-.25 G 1.503
-(red or at least).15 F .368
-(brought to the attention of a human for correct disposal; no message should e)
-118.66 431.6 R -.15(ve)-.25 G 2.868(rb).15 G 2.868(ec)452.252 431.6 S
-(ompletely)464 431.6 Q 2.54(lost. This)118.66 443.6 R .04(goal w)2.54 F .041
-(as considered essential because of the emphasis on mail in our en)-.1 F 2.541
-(vironment. It)-.4 F 1.755
-(has turned out to be one of the hardest goals to satisfy)118.66 455.6 R 4.254
-(,e)-.65 G 1.754(specially in the f)363.756 455.6 R 1.754(ace of the man)-.1 F
-(y)-.15 E .977(anomalous message formats produced by v)118.66 467.6 R .977
-(arious ARP)-.25 F .977(ANET sites.)-.92 F -.15(Fo)5.977 G 3.478(re).15 G .978
-(xample, certain sites)420.114 467.6 R .069
-(generate improperly formated addresses, occasionally causing error)118.66
-479.6 R .069(-message loops.)-.2 F .068(Some hosts)5.069 F .766(use blanks in \
-names, causing problems with mail programs that assume that an address is one)
-118.66 491.6 R -.1(wo)118.66 503.6 S 3.924(rd. The).1 F 1.423
-(semantics of some \214elds are interpreted slightly dif)3.923 F 1.423
-(ferently by dif)-.25 F 1.423(ferent sites.)-.25 F(In)6.423 E(summary)118.66
-515.6 Q 3.022(,t)-.65 G .523(he obscure features of the ARP)163.532 515.6 R
-.523(ANET mail protocol really)-.92 F F2(ar)3.023 E(e)-.37 E F1 .523
-(used and are dif)3.023 F(\214cult)-.25 E(to support, b)118.66 527.6 Q
-(ut must be supported.)-.2 E 12.5(\(3\) Existing)92 543.8 R(softw)2.939 E .439
-(are to do actual deli)-.1 F -.15(ve)-.25 G .439(ry should be used whene).15 F
--.15(ve)-.25 G 2.938(rp).15 G 2.938(ossible. This)387.658 543.8 R .438
-(goal deri)2.938 F -.15(ve)-.25 G 2.938(sa).15 G(s)500.11 543.8 Q
-(much from political and practical considerations as technical.)118.66 555.8 Q
-12.5(\(4\) Easy)92 572 R -.15(ex)2.898 G .398(pansion to f).15 F .398
-(airly comple)-.1 F 2.898(xe)-.15 G -.4(nv)261.06 572 S .399
-(ironments, including multiple connections to a single net-).4 F -.1(wo)118.66
-584 S .63(rk type \(such as with multiple UUCP or Ethernets\).).1 F .63
-(This goal requires consideration of the)5.63 F
-(contents of an address as well as its syntax in order to determine which g)
-118.66 596 Q(ate)-.05 E -.1(wa)-.25 G 2.5(yt).1 G 2.5(ou)443.48 596 S(se.)
-455.98 596 Q 12.5(\(5\) Con\214guration)92 612.2 R 1.048
-(information should not be compiled into the code.)3.548 F 3.549(As)6.049 G
-1.049(ingle compiled program)405.802 612.2 R .084
-(should be able to run as is at an)118.66 624.2 R 2.584(ys)-.15 G .083
-(ite \(barring such basic changes as the CPU type or the operat-)256.196 624.2
-R .342(ing system\).)118.66 636.2 R 1.942 -.8(We h)5.342 H -2.25 -.2(av e).8 H
-.343(found this seemingly unimportant goal to be critical in real life.)3.042 F
-(Besides)5.343 E .734(the simple problems that occur when an)118.66 648.2 R
-3.234(yp)-.15 G .734(rogram gets recompiled in a dif)295.568 648.2 R .733
-(ferent en)-.25 F(vironment,)-.4 E(man)118.66 660.2 Q 2.5(ys)-.15 G(ites lik)
-147.12 660.2 Q 2.5(et)-.1 G 2.5<6f99>183.69 660.2 S(\214ddle\232 with an)195.63
-660.2 Q(ything that the)-.15 E 2.5(yw)-.15 G(ill be recompiling an)327.27 660.2
-Q(yw)-.15 E(ay)-.1 E(.)-.65 E .32 LW 76 678.8 72 678.8 DL 80 678.8 76 678.8 DL
-84 678.8 80 678.8 DL 88 678.8 84 678.8 DL 92 678.8 88 678.8 DL 96 678.8 92
-678.8 DL 100 678.8 96 678.8 DL 104 678.8 100 678.8 DL 108 678.8 104 678.8 DL
-112 678.8 108 678.8 DL 116 678.8 112 678.8 DL 120 678.8 116 678.8 DL 124 678.8
-120 678.8 DL 128 678.8 124 678.8 DL 132 678.8 128 678.8 DL 136 678.8 132 678.8
-DL 140 678.8 136 678.8 DL 144 678.8 140 678.8 DL 148 678.8 144 678.8 DL 152
-678.8 148 678.8 DL 156 678.8 152 678.8 DL 160 678.8 156 678.8 DL 164 678.8 160
-678.8 DL 168 678.8 164 678.8 DL 172 678.8 168 678.8 DL 176 678.8 172 678.8 DL
-180 678.8 176 678.8 DL 184 678.8 180 678.8 DL 188 678.8 184 678.8 DL 192 678.8
-188 678.8 DL 196 678.8 192 678.8 DL 200 678.8 196 678.8 DL 204 678.8 200 678.8
-DL 208 678.8 204 678.8 DL 212 678.8 208 678.8 DL 216 678.8 212 678.8 DL/F4 5
-/Times-Roman@0 SF(1)93.6 689.2 Q/F5 8/Times-Roman@0 SF(This section mak)3.2 I
-(es no distinction between)-.08 E/F6 8/Times-Italic@0 SF(delivermail)2 E F5
-(and)2 E F6(sendmail.)2 E F0 -1(Ve)72 756 S(rsion 8.1)1 E(USENIX \255 J)249.805
-756 Q(an 83)-.15 E(Last Mod 6/7/93)434.55 756 Q EP
-%%Page: 4 4
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Mail Systems and Addr)72 60 Q(essing in 4.2bsd)-.18 E(4)
-499 60 Q/F1 10/Times-Roman@0 SF(\(6\))92 96 Q/F2 10/Times-Italic@0 SF(Sendmail)
-118.66 96 Q F1 .184(must be able to let v)2.684 F .184
-(arious groups maintain their o)-.25 F .184(wn mailing lists, and let indi)-.25
-F(viduals)-.25 E(specify their o)118.66 108 Q(wn forw)-.25 E
-(arding, without modifying the system alias \214le.)-.1 E 12.5(\(7\) Each)92
-124.2 R .313(user should be able to specify which mailer to e)2.814 F -.15(xe)
--.15 G .313(cute to process mail being deli).15 F -.15(ve)-.25 G .313(red for)
-.15 F 3.098(him. This)118.66 136.2 R .598(feature allo)3.098 F .598
-(ws users who are using specialized mailers that use a dif)-.25 F .598
-(ferent format to)-.25 F -.2(bu)118.66 148.2 S .25(ild their en).2 F .25
-(vironment without changing the system, and f)-.4 F .25
-(acilitates specialized functions \(such)-.1 F(as returning an \231I am on v)
-118.66 160.2 Q(acation\232 message\).)-.25 E 12.5(\(8\) Netw)92 176.4 R 1.552
-(ork traf)-.1 F 1.552(\214c should be minimized by batching addresses to a sin\
-gle host where possible,)-.25 F(without assistance from the user)118.66 188.4 Q
-(.)-.55 E .375(These goals moti)112 204.6 R -.25(va)-.25 G .375
-(ted the architecture illustrated in \214gure 1.).25 F .374
-(The user interacts with a mail gen-)5.375 F .49(erating and sending program.)
-87 216.6 R .491(When the mail is created, the generator calls)5.49 F F2
-(sendmail)2.991 E F1 2.991(,w)C .491(hich routes the)444.138 216.6 R .841
-(message to the correct mailer\(s\).)87 228.6 R .841
-(Since some of the senders may be netw)5.841 F .84(ork serv)-.1 F .84
-(ers and some of the)-.15 F(mailers may be netw)87 240.6 Q(ork clients,)-.1 E
-F2(sendmail)2.5 E F1(may be used as an internet mail g)2.5 E(ate)-.05 E -.1(wa)
--.25 G -.65(y.).1 G F0 2.5(3. USA)72 264.6 R(GE)-.55 E 2.5(3.1. Addr)87 288.6 R
-(ess F)-.18 E(ormats)-.25 E F1(Ar)127 304.8 Q .886
-(guments may be \215ags or addresses.)-.18 F .886(Flags set v)5.886 F .886
-(arious processing options.)-.25 F -.15(Fo)5.886 G(llo).15 E .886(wing \215ag)
--.25 F(ar)102 316.8 Q .611(guments, address ar)-.18 F .611(guments may be gi)
--.18 F -.15(ve)-.25 G 3.111(n. Addresses).15 F(follo)3.111 E 3.111(wt)-.25 G
-.611(he syntax in RFC822 [Crock)365.558 316.8 R(er82])-.1 E(for ARP)102 328.8 Q
-(ANET address formats.)-.92 E(In brief, the format is:)5 E 12.5(\(1\) An)107
-345 R(ything in parentheses is thro)-.15 E(wn a)-.25 E -.1(wa)-.15 G 2.5(y\().1
-G(as a comment\).)299.65 345 Q 12.5(\(2\) An)107 361.2 R .051
-(ything in angle brack)-.15 F .051(ets \(\231<)-.1 F .051
-(>\232\) is preferred o)1.666 F -.15(ve)-.15 G 2.551(ra).15 G -.15(ny)348.064
-361.2 S .051(thing else.).15 F .051(This rule implements the)5.051 F(ARP)133.66
-373.2 Q(ANET standard that addresses of the form)-.92 E .4 LW 77 408 72 408 DL
-79 408 74 408 DL 84 408 79 408 DL 89 408 84 408 DL 94 408 89 408 DL 99 408 94
-408 DL 104 408 99 408 DL 109 408 104 408 DL 114 408 109 408 DL 119 408 114 408
-DL 124 408 119 408 DL 129 408 124 408 DL 134 408 129 408 DL 139 408 134 408 DL
-144 408 139 408 DL 149 408 144 408 DL 154 408 149 408 DL 159 408 154 408 DL 164
-408 159 408 DL 169 408 164 408 DL 174 408 169 408 DL 179 408 174 408 DL 184 408
-179 408 DL 189 408 184 408 DL 194 408 189 408 DL 199 408 194 408 DL 204 408 199
-408 DL 209 408 204 408 DL 214 408 209 408 DL 219 408 214 408 DL 224 408 219 408
-DL 229 408 224 408 DL 234 408 229 408 DL 239 408 234 408 DL 244 408 239 408 DL
-249 408 244 408 DL 254 408 249 408 DL 259 408 254 408 DL 264 408 259 408 DL 269
-408 264 408 DL 274 408 269 408 DL 279 408 274 408 DL 284 408 279 408 DL 289 408
-284 408 DL 294 408 289 408 DL 299 408 294 408 DL 304 408 299 408 DL 309 408 304
-408 DL 314 408 309 408 DL 319 408 314 408 DL 324 408 319 408 DL 329 408 324 408
-DL 334 408 329 408 DL 339 408 334 408 DL 344 408 339 408 DL 349 408 344 408 DL
-354 408 349 408 DL 359 408 354 408 DL 364 408 359 408 DL 369 408 364 408 DL 374
-408 369 408 DL 379 408 374 408 DL 384 408 379 408 DL 389 408 384 408 DL 394 408
-389 408 DL 399 408 394 408 DL 404 408 399 408 DL 409 408 404 408 DL 414 408 409
-408 DL 419 408 414 408 DL 424 408 419 408 DL 429 408 424 408 DL 434 408 429 408
-DL 439 408 434 408 DL 444 408 439 408 DL 449 408 444 408 DL 454 408 449 408 DL
-459 408 454 408 DL 464 408 459 408 DL 469 408 464 408 DL 474 408 469 408 DL 479
-408 474 408 DL 484 408 479 408 DL 489 408 484 408 DL 494 408 489 408 DL 499 408
-494 408 DL 504 408 499 408 DL(Figure 1 \212 Sendmail System Structure.)208 660
-Q 77 672 72 672 DL 79 672 74 672 DL 84 672 79 672 DL 89 672 84 672 DL 94 672 89
-672 DL 99 672 94 672 DL 104 672 99 672 DL 109 672 104 672 DL 114 672 109 672 DL
-119 672 114 672 DL 124 672 119 672 DL 129 672 124 672 DL 134 672 129 672 DL 139
-672 134 672 DL 144 672 139 672 DL 149 672 144 672 DL 154 672 149 672 DL 159 672
-154 672 DL 164 672 159 672 DL 169 672 164 672 DL 174 672 169 672 DL 179 672 174
-672 DL 184 672 179 672 DL 189 672 184 672 DL 194 672 189 672 DL 199 672 194 672
-DL 204 672 199 672 DL 209 672 204 672 DL 214 672 209 672 DL 219 672 214 672 DL
-224 672 219 672 DL 229 672 224 672 DL 234 672 229 672 DL 239 672 234 672 DL 244
-672 239 672 DL 249 672 244 672 DL 254 672 249 672 DL 259 672 254 672 DL 264 672
-259 672 DL 269 672 264 672 DL 274 672 269 672 DL 279 672 274 672 DL 284 672 279
-672 DL 289 672 284 672 DL 294 672 289 672 DL 299 672 294 672 DL 304 672 299 672
-DL 309 672 304 672 DL 314 672 309 672 DL 319 672 314 672 DL 324 672 319 672 DL
-329 672 324 672 DL 334 672 329 672 DL 339 672 334 672 DL 344 672 339 672 DL 349
-672 344 672 DL 354 672 349 672 DL 359 672 354 672 DL 364 672 359 672 DL 369 672
-364 672 DL 374 672 369 672 DL 379 672 374 672 DL 384 672 379 672 DL 389 672 384
-672 DL 394 672 389 672 DL 399 672 394 672 DL 404 672 399 672 DL 409 672 404 672
-DL 414 672 409 672 DL 419 672 414 672 DL 424 672 419 672 DL 429 672 424 672 DL
-434 672 429 672 DL 439 672 434 672 DL 444 672 439 672 DL 449 672 444 672 DL 454
-672 449 672 DL 459 672 454 672 DL 464 672 459 672 DL 469 672 464 672 DL 474 672
-469 672 DL 479 672 474 672 DL 484 672 479 672 DL 489 672 484 672 DL 494 672 489
-672 DL 499 672 494 672 DL 504 672 499 672 DL F0 -1(Ve)72 756 S(rsion 8.1)1 E
-(USENIX \255 J)249.805 756 Q(an 83)-.15 E(Last Mod 6/7/93)434.55 756 Q EP
-%%Page: 5 5
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Mail Systems and Addr)72 60 Q(essing in 4.2bsd)-.18 E(5)
-499 60 Q/F1 10/Times-Roman@0 SF(user name <machine-address>)173.66 96 Q(will s\
-end to the electronic \231machine-address\232 rather than the human \231user n\
-ame.)133.66 112.2 Q<9a>-.7 E 12.5(\(3\) Double)107 128.4 R 2.246(quotes \()
-4.746 F -2.754 2.5("\) q)2.5 H 2.246
-(uote phrases; backslashes quote characters.)224.188 128.4 R 2.246
-(Backslashes are more)7.246 F(po)133.66 140.4 Q .654(werful in that the)-.25 F
-3.154(yw)-.15 G .655(ill cause otherwise equi)229.196 140.4 R -.25(va)-.25 G
-.655(lent phrases to compare dif).25 F .655(ferently \212 for)-.25 F -.15(ex)
-133.66 152.4 S(ample,).15 E/F2 10/Times-Italic@0 SF(user)3.873 E F1(and)3.873 E
-F2("user")3.872 E F1 1.372(are equi)3.872 F -.25(va)-.25 G 1.372(lent, b).25 F
-(ut)-.2 E F2(\\user)3.872 E F1 1.372(is dif)3.872 F 1.372
-(ferent from either of them.)-.25 F(This)6.372 E(might be used to a)133.66
-164.4 Q -.2(vo)-.2 G(id normal aliasing or duplicate suppression algorithms.).2
-E -.15(Pa)127 180.6 S 1.12(rentheses, angle brack).15 F 1.12
-(ets, and double quotes must be properly balanced and nested.)-.1 F(The)6.12 E
-(re)102 194.6 Q(writing rules control remaining parsing)-.25 E/F3 7
-/Times-Roman@0 SF(2)266.17 190.6 Q F1(.)269.67 194.6 Q .644(Although old style\
- addresses are still accepted in most cases, the preferred address format is)
-127 210.8 R .299(based on ARP)102 222.8 R(ANET)-.92 E .299
-(-style domain-based addresses [Su82a].)-.92 F .299
-(These addresses are based on a hierar)5.299 F(-)-.2 E .13
-(chical, logical decomposition of the address space.)102 234.8 R .13
-(The addresses are hierarchical in a sense similar)5.13 F 1.133(to the U.S. po\
-stal addresses: the messages may \214rst be routed to the correct state, with \
-no initial)102 246.8 R .72
-(consideration of the city or other addressing details.)102 258.8 R .72
-(The addresses are logical in that each step in)5.72 F(the hierarch)102 270.8 Q
-2.5(yc)-.05 G
-(orresponds to a set of \231naming authorities\232 rather than a ph)161.37
-270.8 Q(ysical netw)-.05 E(ork.)-.1 E -.15(Fo)127 287 S 2.5(re).15 G
-(xample, the address:)147.53 287 Q(eric@HostA.BigSite.ARP)142 303.2 Q(A)-.92 E
--.1(wo)102 319.4 S .851
-(uld \214rst look up the domain BigSite in the namespace administrated by ARP)
-.1 F 3.351(A. A)-.92 F .851(query could)3.351 F 1.476
-(then be sent to BigSite for interpretation of HostA.)102 331.4 R(Ev)6.475 E
-1.475(entually the mail w)-.15 F 1.475(ould arri)-.1 F 1.775 -.15(ve a)-.25 H
-3.975(tH).15 G(ostA,)482.61 331.4 Q(which w)102 343.4 Q
-(ould then do \214nal deli)-.1 E -.15(ve)-.25 G(ry to user \231eric.).15 E<9a>
--.7 E F0 2.5(3.2. Mail)87 367.4 R(to Files and Pr)2.5 E(ograms)-.18 E F1 .609
-(Files and programs are le)127 383.6 R .609(gitimate message recipients.)-.15 F
-.609(Files pro)5.609 F .609(vide archi)-.15 F -.25(va)-.25 G 3.109(ls).25 G .61
-(torage of mes-)445.02 383.6 R .124
-(sages, useful for project administration and history)102 395.6 R 5.124(.P)-.65
-G .124(rograms are useful as recipients in a v)318.308 395.6 R .124(ariety of)
--.25 F .69(situations, for e)102 407.6 R .691(xample, to maintain a public rep\
-ository of systems messages \(such as the Berk)-.15 F(ele)-.1 E(y)-.15 E F2
-(msgs)102 419.6 Q F1(program\).)2.5 E(An)127 435.8 Q 3.188(ya)-.15 G .688(ddre\
-ss passing through the initial parsing algorithm as a local address \(i.e, not\
- appear)151.698 435.8 R(-)-.2 E .276(ing to be a v)102 447.8 R .276
-(alid address for another mailer\) is scanned for tw)-.25 F 2.776(os)-.1 G .277
-(pecial cases.)362.128 447.8 R .277(If pre\214x)5.277 F .277(ed by a v)-.15 F
-(erti-)-.15 E .18(cal bar \(\231)102 459.8 R .833<7c9a>.833 G 2.68(\)t)-.833 G
-.179(he rest of the address is processed as a shell command.)156.456 459.8 R
-.179(If the user name be)5.179 F .179(gins with a)-.15 F(slash mark \(\231/)102
-471.8 Q(\232\) the name is used as a \214le name, instead of a login name.).833
-E F0 2.5(3.3. Aliasing,)87 495.8 R -.25(Fo)2.5 G(rwarding, Inclusion).25 E F2
-(Sendmail)127 512 Q F1 1.074(reroutes mail three w)3.574 F 3.574(ays. Aliasing)
--.1 F 1.075(applies system wide.)3.575 F -.15(Fo)6.075 G(rw).15 E 1.075
-(arding allo)-.1 F 1.075(ws each)-.25 F .233
-(user to reroute incoming mail destined for that account.)102 524 R .233
-(Inclusion directs)5.233 F F2(sendmail)2.733 E F1 .233(to read a \214le for)
-2.733 F 2.5(al)102 536 S
-(ist of addresses, and is normally used in conjunction with aliasing.)111.72
-536 Q F0 2.5(3.3.1. Aliasing)102 560 R F1 .065
-(Aliasing maps local addresses to address lists using a system-wide \214le.)142
-576.2 R .065(This \214le is hashed)5.065 F 1.546(to speed access.)117 588.2 R
-1.545(Only addresses that parse as local are allo)6.546 F 1.545
-(wed as aliases; this guarantees a)-.25 F(unique k)117 600.2 Q .3 -.15(ey \()
--.1 H(since there are no nicknames for the local host\).).15 E F0 2.5(3.3.2. F)
-102 624.2 R(orwarding)-.25 E F1 .641
-(After aliasing, if an recipient address speci\214es a local user)142 640.4 R
-F2(sendmail)3.141 E F1 .641(searches for a \231.for)3.141 F(-)-.2 E -.1(wa)117
-652.4 S .413(rd\232 \214le in the recipient').1 F 2.913(sh)-.55 G .413
-(ome directory)235.335 652.4 R 5.413(.I)-.65 G 2.913(fi)302.161 652.4 S 2.913
-(te)311.184 652.4 S .413(xists, the message is)321.167 652.4 R F2(not)2.913 E
-F1 .412(sent to that user)2.913 F 2.912(,b)-.4 G(ut)496.22 652.4 Q .745
-(rather to the list of addresses in that \214le.)117 664.4 R .746
-(Often this list will contain only one address, and the)5.746 F
-(feature will be used for netw)117 676.4 Q(ork mail forw)-.1 E(arding.)-.1 E
-.32 LW 76 686 72 686 DL 80 686 76 686 DL 84 686 80 686 DL 88 686 84 686 DL 92
-686 88 686 DL 96 686 92 686 DL 100 686 96 686 DL 104 686 100 686 DL 108 686 104
-686 DL 112 686 108 686 DL 116 686 112 686 DL 120 686 116 686 DL 124 686 120 686
-DL 128 686 124 686 DL 132 686 128 686 DL 136 686 132 686 DL 140 686 136 686 DL
-144 686 140 686 DL 148 686 144 686 DL 152 686 148 686 DL 156 686 152 686 DL 160
-686 156 686 DL 164 686 160 686 DL 168 686 164 686 DL 172 686 168 686 DL 176 686
-172 686 DL 180 686 176 686 DL 184 686 180 686 DL 188 686 184 686 DL 192 686 188
-686 DL 196 686 192 686 DL 200 686 196 686 DL 204 686 200 686 DL 208 686 204 686
-DL 212 686 208 686 DL 216 686 212 686 DL/F4 5/Times-Roman@0 SF(2)93.6 696.4 Q
-/F5 8/Times-Roman@0 SF(Disclaimer: Some special processing is done after re)3.2
-I(writing local names; see belo)-.2 E -.52(w.)-.2 G F0 -1(Ve)72 756 S
-(rsion 8.1)1 E(USENIX \255 J)249.805 756 Q(an 83)-.15 E(Last Mod 6/7/93)434.55
-756 Q EP
-%%Page: 6 6
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Mail Systems and Addr)72 60 Q(essing in 4.2bsd)-.18 E(6)
-499 60 Q/F1 10/Times-Roman@0 SF -.15(Fo)142 96 S(rw).15 E 1.152
-(arding also permits a user to specify a pri)-.1 F -.25(va)-.25 G 1.151
-(te incoming mailer).25 F 6.151(.F)-.55 G 1.151(or e)437.348 96 R 1.151
-(xample, for)-.15 F(-)-.2 E -.1(wa)117 108 S(rding to:).1 E -2.5 .833("| /)157
-124.2 T(usr/local/ne)-.833 E(wmail myname")-.25 E(will use a dif)117 140.4 Q
-(ferent incoming mailer)-.25 E(.)-.55 E F0 2.5(3.3.3. Inclusion)102 164.4 R F1
-(Inclusion is speci\214ed in RFC 733 [Crock)142 180.6 Q(er77] syntax:)-.1 E
-(:Include: pathname)157 196.8 Q .391
-(An address of this form reads the \214le speci\214ed by)117 213 R/F2 10
-/Times-Italic@0 SF(pathname)2.891 E F1 .391
-(and sends to all users listed in that)2.891 F(\214le.)117 225 Q .645
-(The intent is)142 241.2 R F2(not)3.145 E F1 .644
-(to support direct use of this feature, b)3.145 F .644
-(ut rather to use this as a subset of)-.2 F 2.5(aliasing. F)117 253.2 R(or e)
--.15 E(xample, an alias of the form:)-.15 E
-(project: :include:/usr/project/userlist)157 269.4 Q 1.93(is a method of letti\
-ng a project maintain a mailing list without interaction with the system)117
-285.6 R(administration, e)117 297.6 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(ft)203.54
-297.6 S(he alias \214le is protected.)212.15 297.6 Q 2.025
-(It is not necessary to reb)142 313.8 R 2.025(uild the inde)-.2 F 4.524(xo)-.15
-G 4.524(nt)317.828 313.8 S 2.024(he alias database when a :include: list is)
-330.132 313.8 R(changed.)117 325.8 Q F0 2.5(3.4. Message)87 349.8 R(Collection)
-2.5 E F1 .857(Once all recipient addresses are parsed and v)127 366 R .857
-(eri\214ed, the message is collected.)-.15 F .857(The message)5.857 F .574
-(comes in tw)102 378 R 3.074(op)-.1 G .574
-(arts: a message header and a message body)164.452 378 R 3.074(,s)-.65 G .574
-(eparated by a blank line.)349.734 378 R .573(The body is)5.574 F
-(an uninterpreted sequence of te)102 390 Q(xt lines.)-.15 E
-(The header is formated as a series of lines of the form)127 406.2 Q
-(\214eld-name: \214eld-v)178 422.4 Q(alue)-.25 E(Field-v)102 438.6 Q 1.366
-(alue can be split across lines by starting the follo)-.25 F 1.366
-(wing lines with a space or a tab)-.25 F 6.366(.S)-.4 G(ome)486.78 438.6 Q .211
-(header \214elds ha)102 450.6 R .511 -.15(ve s)-.2 H .211
-(pecial internal meaning, and ha).15 F .511 -.15(ve a)-.2 H .211
-(ppropriate special processing.).15 F .21(Other headers)5.21 F
-(are simply passed through.)102 462.6 Q
-(Some header \214elds may be added automatically)5 E 2.5(,s)-.65 G
-(uch as time stamps.)413.53 462.6 Q F0 2.5(4. THE)72 486.6 R(UUCP PR)2.5 E
-(OBLEM)-.3 E F1 .43(Of particular interest is the UUCP netw)112 502.8 R 2.93
-(ork. The)-.1 F -.15(ex)2.93 G .43(plicit routing used in the UUCP en).15 F
-(vironment)-.4 E .909(causes a number of serious problems.)87 514.8 R .909
-(First, gi)5.909 F .908(ving out an address is impossible without kno)-.25 F
-.908(wing the)-.25 F .453(address of your potential correspondent.)87 526.8 R
-.454(This is typically handled by specifying the address relati)5.453 F .754
--.15(ve t)-.25 H(o).15 E 1.208(some \231well-kno)87 538.8 R 1.208
-(wn\232 host \(e.g., ucb)-.25 F -.25(va)-.15 G 3.708(xo).25 G 3.708(rd)253.47
-538.8 S(ecv)265.508 538.8 Q 3.708(ax\). Second,)-.25 F 1.207(it is often dif)
-3.708 F 1.207(\214cult to compute the set of)-.25 F .157
-(addresses to reply to without some kno)87 550.8 R .157
-(wledge of the topology of the netw)-.25 F 2.657(ork. Although)-.1 F .157
-(it may be easy)2.657 F .352(for a human being to do this under man)87 562.8 R
-2.851(yc)-.15 G .351(ircumstances, a program does not ha)259.713 562.8 R .651
--.15(ve e)-.2 H .351(qually sophisticated).15 F 1.153(heuristics b)87 574.8 R
-1.153(uilt in.)-.2 F 1.154(Third, certain addresses will become painfully and \
-unnecessarily long, as when a)6.153 F .406(message is routed through man)87
-586.8 R 2.906(yh)-.15 G .406(osts in the USENET)225.81 586.8 R 5.406(.A)-.74 G
-.406(nd \214nally)322.804 586.8 R 2.905(,c)-.65 G .405(ertain \231mix)370.465
-586.8 R .405(ed domain\232 addresses)-.15 F
-(are impossible to parse unambiguously \212 e.g.,)87 598.8 Q(decv)127 615 Q
-(ax!ucb)-.25 E -.25(va)-.15 G(x!lbl-h!user@LBL-CSAM).25 E .378(might ha)87
-631.2 R .678 -.15(ve m)-.2 H(an).15 E 2.878(yp)-.15 G .379
-(ossible resolutions, depending on whether the message w)164.574 631.2 R .379
-(as \214rst routed to decv)-.1 F .379(ax or)-.25 F(to LBL-CSAM.)87 643.2 Q 2.32
--.8(To s)112 659.4 T(olv).8 E 3.22(et)-.15 G .72
-(his problem, the UUCP syntax w)152.49 659.4 R .719(ould ha)-.1 F 1.019 -.15
-(ve t)-.2 H 3.219(ob).15 G 3.219(ec)346.956 659.4 S .719
-(hanged to use addresses rather than)359.055 659.4 R 3.718(routes. F)87 671.4 R
-1.218(or e)-.15 F 1.218(xample, the address \231decv)-.15 F(ax!ucb)-.25 E -.25
-(va)-.15 G 1.218(x!eric\232 might be e).25 F 1.218(xpressed as \231eric@ucb)
--.15 F -.25(va)-.15 G(x.UUCP\232).25 E .079(\(with the hop through decv)87
-683.4 R .079(ax implied\).)-.25 F .079(This address w)5.079 F .078
-(ould itself be a domain-based address; for e)-.1 F(xam-)-.15 E
-(ple, an address might be of the form:)87 695.4 Q(mark@d.cbosg.btl.UUCP)127
-711.6 Q F0 -1(Ve)72 756 S(rsion 8.1)1 E(USENIX \255 J)249.805 756 Q(an 83)-.15
-E(Last Mod 6/7/93)434.55 756 Q EP
-%%Page: 7 7
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Mail Systems and Addr)72 60 Q(essing in 4.2bsd)-.18 E(7)
-499 60 Q/F1 10/Times-Roman@0 SF .311(Hosts outside of Bell T)87 96 R .311
-(elephone Laboratories w)-.7 F .311(ould then only need to kno)-.1 F 2.811(wh)
--.25 G .811 -.25(ow t)402.982 96 T 2.811(og).25 G .312(et to a designated)
-433.354 96 R(BTL relay)87 108 Q 2.5(,a)-.65 G(nd the BTL topology w)137.17 108
-Q(ould only be maintained inside Bell.)-.1 E .543(There are three major proble\
-ms associated with turning UUCP addresses into something reason-)112 124.2 R
-.465(able: de\214ning the namespace, creating and propag)87 136.2 R .465
-(ating the necessary softw)-.05 F .466(are, and b)-.1 F .466(uilding and main-)
--.2 F(taining the database.)87 148.2 Q F0 2.5(4.1. De\214ning)87 172.2 R
-(the Namespace)2.5 E F1 1.015(Putting all UUCP hosts into a \215at namespace \
-\(e.g., \231...@host.UUCP\232\) is not practical for a)127 188.4 R .222
-(number of reasons.)102 200.4 R .222(First, with o)5.222 F -.15(ve)-.15 G 2.722
-(r1).15 G .222(600 sites already)253.292 200.4 R 2.722(,a)-.65 G .222
-(nd \(with the increasing a)329.958 200.4 R -.25(va)-.2 G .222
-(ilability of ine).25 F(x-)-.15 E(pensi)102 212.4 Q 1.973 -.15(ve m)-.25 H
-1.673(icrocomputers and autodialers\) se).15 F -.15(ve)-.25 G 1.672
-(ral thousand more coming within a fe).15 F 4.172(wy)-.25 G 1.672(ears, the)
-469.008 212.4 R .078
-(database update problem is simply intractable if the namespace is \215at.)102
-224.4 R .078(Second, there are almost cer)5.078 F(-)-.2 E 2.446
-(tainly name con\215icts today)102 236.4 R 7.446(.T)-.65 G 2.446
-(hird, as the number of sites gro)232.794 236.4 R 4.946(wt)-.25 G 2.446
-(he names become e)386.316 236.4 R -.15(ve)-.25 G 4.946(rl).15 G(ess)491.78
-236.4 Q(mnemonic.)102 248.4 Q .534(It seems ine)127 264.6 R .535
-(vitable that there be some sort of naming authority for the set of top le)-.25
-F -.15(ve)-.25 G 3.035(ln).15 G(ames)483.45 264.6 Q .157
-(in the UUCP domain, as unpleasant a possibility as that may seem.)102 276.6 R
-.157(It will simply not be possible to)5.157 F(ha)102 288.6 Q .536 -.15(ve o)
--.2 H .236(ne host resolving all names.).15 F .236(It may ho)5.236 F(we)-.25 E
--.15(ve)-.25 G 2.736(rb).15 G 2.736(ep)316.144 288.6 S .236
-(ossible to handle this in a f)328.32 288.6 R .237(ashion similar to)-.1 F
-1.582(that of assigning names of ne)102 300.6 R 1.582(wsgroups in USENET)-.25 F
-6.582(.H)-.74 G -.25(ow)334.758 300.6 S -2.15 -.25(ev e).25 H 2.382 -.4(r, i)
-.25 H 4.082(tw).4 G 1.582(ill be essential to encourage)386.582 300.6 R -2.15
--.25(ev e)102 312.6 T .52(ryone to become subdomains of an e).25 F .52
-(xisting domain whene)-.15 F -.15(ve)-.25 G 3.02(rp).15 G .52(ossible \212 e)
-374.85 312.6 R -.15(ve)-.25 G 3.02(nt).15 G .52(hough this will)442.95 312.6 R
-.077(certainly bruise some e)102 324.6 R 2.577(gos. F)-.15 F .077(or e)-.15 F
-.077(xample, if a ne)-.15 F 2.577(wh)-.25 G .076
-(ost named \231blid\232 were to be added to the UUCP)310.843 324.6 R(netw)102
-336.6 Q .65(ork, it w)-.1 F .651(ould probably actually be addressed as \231d.\
-bli.UUCP\232 \(i.e., as host \231d\232 in the pseudo-)-.1 F
-(domain \231bli\232 rather than as host \231blid\232 in the UUCP domain\).)102
-348.6 Q F0 2.5(4.2. Cr)87 372.6 R(eating and Pr)-.18 E(opagating the Softwar)
--.18 E(e)-.18 E F1 .078(The softw)127 388.8 R .078
-(are required to implement a consistent namespace is relati)-.1 F -.15(ve)-.25
-G .077(ly tri).15 F 2.577(vial. T)-.25 F .277 -.1(wo m)-.8 H(odules).1 E
-(are needed, one to handle incoming mail and one to handle outgoing mail.)102
-400.8 Q 1.136(The incoming module must be prepared to handle either old or ne)
-127 417 R 3.636(ws)-.25 G 1.136(tyle addresses.)416.448 417 R(Ne)6.136 E(w-)
--.25 E .025(style addresses can be passed through unchanged.)102 429 R .024
-(Old style addresses must be turned into ne)5.025 F 2.524(ws)-.25 G(tyle)489
-429 Q(addresses where possible.)102 441 Q 2.247
-(The outgoing module is slightly trickier)127 457.2 R 7.247(.I)-.55 G 4.747(tm)
-309.932 457.2 S 2.247(ust do a database lookup on the recipient)325.239 457.2 R
-.823(addresses \(passed on the command line\) to determine what hosts to send \
-the message to.)102 469.2 R .823(If those)5.823 F .023(hosts do not accept ne)
-102 481.2 R .024(w-style addresses, it must transform all addresses in the hea\
-der of the message)-.25 F(into old style using the database lookup.)102 493.2 Q
-1.197(Both of these modules are straightforw)127 509.4 R 1.197(ard e)-.1 F
-1.197(xcept for the issue of modifying the header)-.15 F 6.197(.I)-.55 G(t)
-501.22 509.4 Q .944
-(seems prudent to choose one format for the message headers.)102 521.4 R -.15
-(Fo)5.944 G 3.444(ran).15 G .944(umber of reasons, Berk)391.448 521.4 R(ele)-.1
-E(y)-.15 E .824(has elected to use the ARP)102 533.4 R .824
-(ANET protocols for message formats.)-.92 F(Ho)5.823 E(we)-.25 E -.15(ve)-.25 G
-1.623 -.4(r, t).15 H .823(his protocol is some-).4 F(what dif)102 545.4 Q
-(\214cult to parse.)-.25 E(Propag)127 561.6 Q 1.903(ation is some)-.05 F 1.903
-(what more dif)-.25 F 4.403(\214cult. There)-.25 F 1.903(are a lar)4.403 F
-1.903(ge number of hosts connected to)-.18 F .812(UUCP that will w)102 573.6 R
-.811(ant to run completely standard systems \(for v)-.1 F .811
-(ery good reasons\).)-.15 F .811(The strate)5.811 F .811(gy is)-.15 F
-(not to con)102 585.6 Q -.15(ve)-.4 G(rt the entire netw).15 E
-(ork \212 only enough of it it alle)-.1 E(viate the problem.)-.25 E F0 2.5
-(4.3. Building)87 609.6 R(and Maintaining the Database)2.5 E F1 .127
-(This is by f)127 625.8 R .127(ar the most dif)-.1 F .128(\214cult problem.)
--.25 F 2.628(Ap)5.128 G .128(rototype for this database already e)309.736 625.8
-R .128(xists, b)-.15 F .128(ut it is)-.2 F
-(maintained by hand and does not pretend to be complete.)102 637.8 Q .701(This\
- problem will be reduced considerably if people choose to group their hosts in\
-to subdo-)127 654 R 3.219(mains. This)102 666 R -.1(wo)3.219 G .719
-(uld require a global update only when a ne).1 F 3.22(wt)-.25 G .72(op le)
-356.47 666 R -.15(ve)-.25 G 3.22(ld).15 G .72(omain joined the netw)396.95 666
-R(ork.)-.1 E 2.805(Am)102 678 S .305
-(essage to a host in a subdomain could simply be routed to a kno)119.805 678 R
-.304(wn domain g)-.25 F(ate)-.05 E -.1(wa)-.25 G 2.804(yf).1 G .304(or further)
-465.656 678 R 3.073(processing. F)102 690 R .573(or e)-.15 F .573(xample, the \
-address \231eric@a.bli.UUCP\232 might be routed to the \231bli\232 g)-.15 F
-(ate)-.05 E -.1(wa)-.25 G 3.074(yf).1 G(or)495.67 690 Q(redistrib)102 702 Q
-1.376(ution; ne)-.2 F 3.876(wh)-.25 G 1.375
-(osts could be added within BLI without notifying the rest of the w)187.632 702
-R 3.875(orld. Of)-.1 F(course, other hosts)102 714 Q/F2 10/Times-Italic@0 SF
-(could)2.5 E F1(be noti\214ed as an ef)2.5 E(\214cienc)-.25 E 2.5(ym)-.15 G
-(easure.)321.01 714 Q F0 -1(Ve)72 756 S(rsion 8.1)1 E(USENIX \255 J)249.805 756
-Q(an 83)-.15 E(Last Mod 6/7/93)434.55 756 Q EP
-%%Page: 8 8
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Bold@0 SF(Mail Systems and Addr)72 60 Q(essing in 4.2bsd)-.18 E(8)
-499 60 Q/F1 10/Times-Roman@0 SF .966(There may be more than one domain g)127 96
-R(ate)-.05 E -.1(wa)-.25 G 4.767 -.65(y. A).1 H .967
-(domain such as BTL, for instance, might)4.117 F(ha)102 108 Q .653 -.15(ve a d)
--.2 H .353(ozen g).15 F(ate)-.05 E -.1(wa)-.25 G .353(ys to the outside w).1 F
-.352(orld; a non-BTL site could choose the closest g)-.1 F(ate)-.05 E -.1(wa)
--.25 G 4.152 -.65(y. T).1 H(he).65 E .308(only restriction w)102 120 R .308
-(ould be that all g)-.1 F(ate)-.05 E -.1(wa)-.25 G .308
-(ys maintain a consistent vie).1 F 2.808(wo)-.25 G 2.808(ft)390.998 120 S .308
-(he domain the)399.916 120 R 2.808(yr)-.15 G(epresent.)468.18 120 Q F0 2.5
-(4.4. Logical)87 144 R(Structur)2.5 E(e)-.18 E F1(Logically)127 160.2 Q 3.803
-(,d)-.65 G 1.303(omains are or)175.983 160.2 R -.05(ga)-.18 G 1.303
-(nized into a tree.).05 F 1.303(There need not be a host actually associated)
-6.303 F .462(with each le)102 172.2 R -.15(ve)-.25 G 2.962(li).15 G 2.962(nt)
-168.806 172.2 S .462(he tree \212 for e)179.548 172.2 R .462
-(xample, there will be no host associated with the name \231UUCP)-.15 F -.7
-<2e9a>-1.11 G(Similarly)102 184.2 Q 3.115(,a)-.65 G 3.115(no)148.635 184.2 S
--2.19 -.18(rg a)161.75 184.2 T .614
-(nization might group names together for administrati).18 F .914 -.15(ve r)-.25
-H .614(easons; for e).15 F .614(xample, the)-.15 F(name)102 196.2 Q
-(CAD.research.BigCorp.UUCP)142 212.4 Q(might not actually ha)102 228.6 Q .3
--.15(ve a h)-.2 H(ost representing \231research.).15 E<9a>-.7 E(Ho)127 244.8 Q
-(we)-.25 E -.15(ve)-.25 G 1.531 -.4(r, i).15 H 3.231(tm).4 G .731
-(ay frequently be con)184.902 244.8 R -.15(ve)-.4 G .731(nient to ha).15 F
-1.031 -.15(ve a h)-.2 H .732(ost or hosts that \231represent\232 a domain.).15
-F -.15(Fo)102 256.8 S 3.466(re).15 G .966(xample, if a single host e)123.496
-256.8 R .966(xists that represents Berk)-.15 F(ele)-.1 E 2.266 -.65(y, t)-.15 H
-.966(hen mail from outside Berk).65 F(ele)-.1 E 3.466(yc)-.15 G(an)494.56 256.8
-Q(forw)102 268.8 Q .796
-(ard mail to that host for further resolution without kno)-.1 F .796(wing Berk)
--.25 F(ele)-.1 E(y')-.15 E 3.296(s\()-.55 G .797(rather v)417.066 268.8 R .797
-(olatile\) topol-)-.2 F(ogy)102 280.8 Q 5(.T)-.65 G(his is not unlik)129.96
-280.8 Q 2.5(et)-.1 G(he operation of the telephone netw)198.76 280.8 Q(ork.)-.1
-E .053(This may also be useful inside certain lar)127 297 R .053(ge domains.)
--.18 F -.15(Fo)5.053 G 2.553(re).15 G .053(xample, at Berk)365.352 297 R(ele)
--.1 E 2.553(yi)-.15 G 2.553(tm)450.801 297 S .053(ay be pre-)463.914 297 R .722
-(sumed that most hosts kno)102 309 R 3.222(wa)-.25 G .722
-(bout other hosts inside the Berk)225.64 309 R(ele)-.1 E 3.223(yd)-.15 G 3.223
-(omain. But)380.825 309 R .723(if the)3.223 F 3.223(yp)-.15 G .723(rocess an)
-466.347 309 R .405(address that is unkno)102 321 R .405(wn, the)-.25 F 2.905
-(yc)-.15 G .405(an pass it \231upstairs\232 for further e)229.165 321 R 2.905
-(xamination. Thus)-.15 F .405(as ne)2.905 F 2.905(wh)-.25 G .405(osts are)
-473.325 321 R .488(added only one host \(the domain master\))102 333 R/F2 10
-/Times-Italic@0 SF(must)2.989 E F1 .489
-(be updated immediately; other hosts can be updated)2.989 F(as con)102 345 Q
--.15(ve)-.4 G(nient.).15 E .583(Ideally this name resolution process w)127
-361.2 R .583(ould be performed by a name serv)-.1 F .582
-(er \(e.g., [Su82b]\) to)-.15 F -.2(avo)102 373.2 S .507(id unnecessary cop).2
-F .507(ying of the message.)-.1 F(Ho)5.507 E(we)-.25 E -.15(ve)-.25 G 1.307 -.4
-(r, i).15 H 3.007(nab).4 G .507(atch netw)346.623 373.2 R .508
-(ork such as UUCP this could)-.1 F(result in unnecessary delays.)102 385.2 Q F0
-2.5(5. COMP)72 409.2 R(ARISON WITH DELIVERMAIL)-.74 E F2(Sendmail)112 425.4 Q
-F1(is an outgro)2.5 E(wth of)-.25 E F2(delivermail)2.5 E F1 5(.T)C
-(he primary dif)286.18 425.4 Q(ferences are:)-.25 E 12.5(\(1\) Con\214guration)
-92 441.6 R .573(information is not compiled in.)3.073 F .572
-(This change simpli\214es man)5.572 F 3.072(yo)-.15 G 3.072(ft)433.684 441.6 S
-.572(he problems of)442.866 441.6 R(mo)118.66 453.6 Q(ving to other machines.)
--.15 E(It also allo)5 E(ws easy deb)-.25 E(ugging of ne)-.2 E 2.5(wm)-.25 G
-(ailers.)388.06 453.6 Q 12.5(\(2\) Address)92 469.8 R .491
-(parsing is more \215e)2.991 F 2.991(xible. F)-.15 F .491(or e)-.15 F(xample,)
--.15 E F2(delivermail)2.992 E F1 .492(only supported one g)2.992 F(ate)-.05 E
--.1(wa)-.25 G 2.992(yt).1 G 2.992(oa)481.718 469.8 S -.15(ny)494.15 469.8 S
-(netw)118.66 481.8 Q(ork, whereas)-.1 E F2(sendmail)2.5 E F1(can be sensiti)2.5
-E .3 -.15(ve t)-.25 H 2.5(oh).15 G(ost names and reroute to dif)310.9 481.8 Q
-(ferent g)-.25 E(ate)-.05 E -.1(wa)-.25 G(ys.).1 E 12.5(\(3\) F)92 498 R(orw)
--.15 E 2.878(arding and :include: features eliminate the requirement that the \
-system alias \214le be)-.1 F 1.073(writable by an)118.66 510 R 3.573(yu)-.15 G
-1.073
-(ser \(or that an update program be written, or that the system administration)
-191.439 510 R(mak)118.66 522 Q 2.5(ea)-.1 G(ll changes\).)147.16 522 Q(\(4\))92
-538.2 Q F2(Sendmail)118.66 538.2 Q F1 .443
-(supports message batching across netw)2.944 F .443
-(orks when a message is being sent to multiple)-.1 F(recipients.)118.66 550.2 Q
-12.5(\(5\) A)92 566.4 R 1.945(mail queue is pro)4.445 F 1.946(vided in)-.15 F
-F2(sendmail.)4.446 E F1 1.946(Mail that cannot be deli)6.946 F -.15(ve)-.25 G
-1.946(red immediately b).15 F 1.946(ut can)-.2 F .439(potentially be deli)
-118.66 578.4 R -.15(ve)-.25 G .438
-(red later is stored in this queue for a later retry).15 F 5.438(.T)-.65 G .438
-(he queue also pro)404.088 578.4 R .438(vides a)-.15 F -.2(bu)118.66 590.4 S
--.25(ff).2 G .838(er ag).25 F .839(ainst system crashes; after the message has\
- been collected it may be reliably redeli)-.05 F(v-)-.25 E(ered e)118.66 602.4
-Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(ft)162.13 602.4 S
-(he system crashes during the initial deli)170.74 602.4 Q -.15(ve)-.25 G(ry).15
-E(.)-.65 E(\(6\))92 618.6 Q F2(Sendmail)118.66 618.6 Q F1 1.351(uses the netw)
-3.851 F 1.351(orking support pro)-.1 F 1.351(vided by 4.2BSD to pro)-.15 F 1.35
-(vide a direct interf)-.15 F 1.35(ace net-)-.1 F -.1(wo)118.66 630.6 S .283
-(rks such as the ARP).1 F .284
-(ANET and/or Ethernet using SMTP \(the Simple Mail T)-.92 F .284
-(ransfer Protocol\))-.35 F -.15(ove)118.66 642.6 S 2.5(raT).15 G
-(CP/IP connection.)151.68 642.6 Q F0 -1(Ve)72 756 S(rsion 8.1)1 E
-(USENIX \255 J)249.805 756 Q(an 83)-.15 E(Last Mod 6/7/93)434.55 756 Q EP
-%%Page: 9 9
-%%BeginPageSetup
-BP
-%%EndPageSetup
-/F0 10/Times-Roman@0 SF(REFERENCES)264.105 132 Q([Crock)87 148.2 Q 56.73
-(er77] Crock)-.1 F(er)-.1 E 3.535(,D)-.4 G 3.535(.H)239.965 148.2 S 1.035(., V)
-253.22 148.2 R 1.035(ittal, J. J., Pogran, K. T)-.6 F 1.035
-(., and Henderson, D. A. Jr)-.74 F(.,)-.55 E/F1 10/Times-Italic@0 SF(Stan-)
-3.535 E(dar)195 160.2 Q 2.627(df)-.37 G .127(or the F)218.927 160.2 R .127
-(ormat of ARP)-1.05 F 2.627(AN)-.9 G .128(etwork T)320.112 160.2 R -.2(ex)-.92
-G 2.628(tM).2 G(essa)377.018 160.2 Q -.1(ge)-.1 G(s.).1 E F0 .128
-(RFC 733, NIC 41952.)5.128 F(In [Feinler78].)195 172.2 Q(No)5 E -.15(ve)-.15 G
-(mber 1977.).15 E([Crock)87 188.4 Q 56.73(er82] Crock)-.1 F(er)-.1 E 4.272(,D)
--.4 G 4.272(.H)240.702 188.4 S(.,)254.694 188.4 Q F1(Standar)4.272 E 4.272(df)
--.37 G 1.772(or the F)307.318 188.4 R 1.772(ormat of Arpa Internet T)-1.05 F
--.2(ex)-.92 G 4.271(tM).2 G(essa)471.15 188.4 Q -.1(ge)-.1 G(s.).1 E F0 .025
-(RFC 822.)195 200.4 R(Netw)5.025 E .025(ork Information Center)-.1 F 2.526(,S)
--.4 G .026(RI International, Menlo P)363.506 200.4 R .026(ark, Cali-)-.15 F 2.5
-(fornia. August)195 212.4 R(1982.)2.5 E 60.51([Feinler78] Feinler)87 228.6 R
-2.938(,E)-.4 G .438(., and Postel, J.)234.478 228.6 R(\(eds.\),)5.438 E F1(ARP)
-2.938 E .438(ANET Pr)-.9 F .438(otocol Handbook.)-.45 F F0 .438(NIC 7104,)5.438
-F(Netw)195 240.6 Q 3.011(ork Information Center)-.1 F 5.511(,S)-.4 G 3.012
-(RI International, Menlo P)328.513 240.6 R 3.012(ark, California.)-.15 F(1978.)
-195 252.6 Q([No)87 268.8 Q 59.65(witz78] No)-.25 F .479
-(witz, D. A., and Lesk, M. E.,)-.25 F F1 2.978(AD)2.978 G .478
-(ial-Up Network of UNIX Systems.)344.67 268.8 R F0(Bell)5.478 E 3.528
-(Laboratories. In)195 280.8 R 1.029(UNIX Programmer')3.528 F 3.529(sM)-.55 G
-1.029(anual, Se)363.524 280.8 R -.15(ve)-.25 G 1.029(nth Edition, V).15 F 1.029
-(olume 2.)-1.29 F(August, 1978.)195 292.8 Q 55.5([Schmidt79] Schmidt,)87 309 R
-(E.,)2.631 E F1 .131(An Intr)2.631 F .131(oduction to the Berk)-.45 F(ele)-.1 E
-2.631(yN)-.3 G(etwork.)382.277 309 Q F0(Uni)5.131 E -.15(ve)-.25 G .131
-(rsity of Califor).15 F(-)-.2 E(nia, Berk)195 321 Q(ele)-.1 E 2.5(yC)-.15 G 2.5
-(alifornia. 1979.)257.24 321 R 59.95([Shoens79] Shoens,)87 337.2 R(K.,)3.227 E
-F1 .728(Mail Refer)3.227 F .728(ence Manual.)-.37 F F0(Uni)5.728 E -.15(ve)-.25
-G .728(rsity of California, Berk).15 F(ele)-.1 E 4.528 -.65(y. I)-.15 H(n).65 E
-3.478(UNIX Programmer')195 349.2 R 5.977(sM)-.55 G 3.477(anual, Se)297.495
-349.2 R -.15(ve)-.25 G 3.477(nth Edition, V).15 F 3.477(olume 2C.)-1.29 F
-(December)8.477 E(1979.)195 361.2 Q 52.72([Solomon81] Solomon,)87 377.4 R .251
-(M., Landweber)2.75 F 2.751(,L)-.4 G .251(., and Neuhengen, D.,)308.952 377.4 R
-F1 .251(The Design of the CSNET)2.751 F .397(Name Server)195 389.4 R(.)-1.11 E
-F0 2.896(CS-DN-2. Uni)5.397 F -.15(ve)-.25 G .396(rsity of W).15 F .396
-(isconsin, Madison.)-.4 F .396(October 1981.)5.396 F 73.84([Su82a] Su,)87 405.6
-R(Za)2.844 E .344(w-Sing, and Postel, Jon,)-.15 F F1 .344
-(The Domain Naming Con)2.844 F .344(vention for Internet)-.4 F 2.71
-(User Applications.)195 417.6 R F0 5.21(RFC819. Netw)7.71 F 2.71
-(ork Information Center)-.1 F 5.21(,S)-.4 G 2.71(RI Interna-)457.14 417.6 R
-(tional, Menlo P)195 429.6 Q(ark, California.)-.15 E(August 1982.)5 E 73.28
-([Su82b] Su,)87 445.8 R(Za)4.174 E(w-Sing,)-.15 E F1 4.174(AD)4.174 G(istrib)
-275.702 445.8 Q 1.675(uted System for Internet Name Service)-.2 F(.)-.15 E F0
-(RFC830.)6.675 E(Netw)195 457.8 Q 3.012(ork Information Center)-.1 F 5.512(,S)
--.4 G 3.011(RI International, Menlo P)328.516 457.8 R 3.011(ark, California.)
--.15 F(October 1982.)195 469.8 Q/F2 10/Times-Bold@0 SF(Mail Systems and Addr)72
-756 Q(essing in 4.2bsd)-.18 E(9)499 756 Q EP
-%%Trailer
-end
-%%EOF
diff --git a/usr.sbin/sendmail/mailstats/mailstats.c b/usr.sbin/sendmail/mailstats/mailstats.c
index 648f1c687737..1e11b014cd08 100644
--- a/usr.sbin/sendmail/mailstats/mailstats.c
+++ b/usr.sbin/sendmail/mailstats/mailstats.c
@@ -40,10 +40,9 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)mailstats.c 8.1 (Berkeley) 6/7/93";
+static char sccsid[] = "@(#)mailstats.c 8.3 (Berkeley) 12/27/93";
#endif /* not lint */
-#include <sys/file.h>
#include <sendmail.h>
#include <mailstats.h>
#include <pathnames.h>
@@ -64,6 +63,7 @@ main(argc, argv)
char *cfile;
FILE *cfp;
bool mnames;
+ long frmsgs = 0, frbytes = 0, tomsgs = 0, tobytes = 0;
char mtable[MAXMAILERS][MNAMELEN+1];
char sfilebuf[100];
char buf[MAXLINE];
@@ -196,7 +196,14 @@ main(argc, argv)
if (mnames)
printf(" %s", mtable[i]);
printf("\n");
+ frmsgs += stat.stat_nf[i];
+ frbytes += stat.stat_bf[i];
+ tomsgs += stat.stat_nt[i];
+ tobytes += stat.stat_bt[i];
}
}
+ printf("========================================\n");
+ printf(" T %6ld %10ldK %6ld %10ldK\n",
+ frmsgs, frbytes, tomsgs, tobytes);
exit(EX_OK);
}
diff --git a/usr.sbin/sendmail/makemap/Makefile b/usr.sbin/sendmail/makemap/Makefile
index 1cc9b5970d21..c4ac74eaea4d 100644
--- a/usr.sbin/sendmail/makemap/Makefile
+++ b/usr.sbin/sendmail/makemap/Makefile
@@ -2,7 +2,7 @@
PROG= makemap
MAN8= makemap.8
-CFLAGS+=-I${.CURDIR}/../src -DNEWDB
+CFLAGS+=-I${.CURDIR}/../src -DNDBM -DNEWDB
.include "../../Makefile.inc"
.include <bsd.prog.mk>
diff --git a/usr.sbin/sendmail/makemap/Makefile.dist b/usr.sbin/sendmail/makemap/Makefile.dist
new file mode 100644
index 000000000000..3e7817a2658b
--- /dev/null
+++ b/usr.sbin/sendmail/makemap/Makefile.dist
@@ -0,0 +1,81 @@
+#
+# This Makefile is designed to work on the old "make" program. It does
+# not use the obj subdirectory. It also does not install documentation
+# automatically -- think of it as a quick start for sites that have the
+# 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).
+#
+# @(#)Makefile.dist 8.2 (Berkeley) 11/27/93
+#
+
+# use O=-O (usual) or O=-g (debugging)
+O= -O
+
+# location of sendmail source directory
+SRCDIR= ../src
+
+# define the database mechanisms available for map & alias lookups:
+# -DNDBM -- use new DBM
+# -DNEWDB -- use new Berkeley DB
+# The really old (V7) DBM library is no longer supported.
+#
+DBMDEF= -DNDBM -DNEWDB
+
+# environment definitions (e.g., -D_AIX3)
+ENVDEF=
+
+# see also conf.h for additional compilation flags
+
+# include directories
+INCDIRS=-I${SRCDIR} -I/usr/sww/include/db
+
+# loader options
+LDOPTS=
+
+# library directories
+LIBDIRS=-L/usr/sww/lib
+
+# libraries required on your system
+LIBS= -ldb -ldbm
+
+# location of makemap binary (usually /usr/sbin or /usr/etc)
+BINDIR= ${DESTDIR}/usr/sbin
+
+# additional .o files needed
+OBJADD=
+
+################### end of user configuration flags ######################
+
+CFLAGS= -I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
+
+OBJS= makemap.o ${OBJADD}
+
+LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
+BINOWN= bin
+BINGRP= bin
+BINMODE=555
+
+ALL= makemap makemap.0
+
+all: ${ALL}
+
+makemap: ${BEFORE} ${OBJS}
+ ${CC} -o makemap ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
+
+makemap.0: makemap.8
+ nroff -h -mandoc makemap.8 > makemap.0
+
+install: install-makemap install-docs
+
+install-makemap: makemap
+ install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} makemap ${BINDIR}
+
+# doesn't actually install them -- you may want to install pre-nroff versions
+install-docs: makemap.0
+
+clean:
+ rm -f ${OBJS} makemap makemap.0
+
+# dependencies
+# gross overkill, and yet still not quite enough....
+${OBJS}: ${SRCDIR}/conf.h
diff --git a/usr.sbin/sendmail/makemap/makemap.8 b/usr.sbin/sendmail/makemap/makemap.8
index 70ee4465f3bb..2fd678e7ee0a 100644
--- a/usr.sbin/sendmail/makemap/makemap.8
+++ b/usr.sbin/sendmail/makemap/makemap.8
@@ -29,7 +29,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)makemap.8 8.1 (Berkeley) 6/17/93
+.\" @(#)makemap.8 8.2 (Berkeley) 9/22/93
.\"
.Dd November 16, 1992
.Dt MAKEMAP 8
@@ -99,13 +99,14 @@ in the map.
This must match the \-N flag in the sendmail.cf
``K'' line.
.It Fl f
-Fold all upper case letters in the key
-to lower case;
-this is intended to mesh with the
+Normally all upper case letters in the key
+are folded to lower case.
+This flag disables that behavior.
+This is intended to mesh with the
\-f flag in the
\fBK\fP
line in sendmail.cf.
-The value is not case folded.
+The value is never case folded.
.It Fl o
Append to an old file.
This allows you to augment an existing file.
diff --git a/usr.sbin/sendmail/makemap/makemap.c b/usr.sbin/sendmail/makemap/makemap.c
index 7996c1ac8ab8..f2d4aea9ca90 100644
--- a/usr.sbin/sendmail/makemap/makemap.c
+++ b/usr.sbin/sendmail/makemap/makemap.c
@@ -33,11 +33,12 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)makemap.c 8.1 (Berkeley) 6/7/93";
+static char sccsid[] = "@(#)makemap.c 8.6 (Berkeley) 11/22/93";
#endif /* not lint */
#include <stdio.h>
#include <sysexits.h>
+#include <sys/types.h>
#include <sys/file.h>
#include <ctype.h>
#include <string.h>
@@ -80,11 +81,12 @@ main(argc, argv)
bool notrunc = FALSE;
bool allowreplace = FALSE;
bool verbose = FALSE;
- bool foldcase = FALSE;
+ bool foldcase = TRUE;
int exitstat;
int opt;
char *typename;
char *mapname;
+ char *ext;
int lineno;
int st;
int mode;
@@ -101,6 +103,7 @@ main(argc, argv)
} dbp;
union dbent key, val;
char ibuf[BUFSIZE];
+ char fbuf[MAXNAME];
extern char *optarg;
extern int optind;
@@ -115,7 +118,7 @@ main(argc, argv)
break;
case 'f':
- foldcase = TRUE;
+ foldcase = FALSE;
break;
case 'o':
@@ -144,13 +147,22 @@ main(argc, argv)
{
typename = argv[0];
mapname = argv[1];
+ ext = NULL;
if (strcmp(typename, "dbm") == 0)
+ {
type = T_DBM;
+ }
else if (strcmp(typename, "btree") == 0)
+ {
type = T_BTREE;
+ ext = ".db";
+ }
else if (strcmp(typename, "hash") == 0)
+ {
type = T_HASH;
+ ext = ".db";
+ }
else
type = T_UNKNOWN;
}
@@ -179,6 +191,24 @@ main(argc, argv)
}
/*
+ ** Adjust file names.
+ */
+
+ if (ext != NULL)
+ {
+ int el, fl;
+
+ el = strlen(ext);
+ fl = strlen(mapname);
+ if (fl < el || strcmp(&mapname[fl - el], ext) != 0)
+ {
+ strcpy(fbuf, mapname);
+ strcat(fbuf, ext);
+ mapname = fbuf;
+ }
+ }
+
+ /*
** Create the database.
*/
@@ -232,8 +262,15 @@ main(argc, argv)
*/
p = strchr(ibuf, '\n');
- if (*p != '\0')
+ if (p != NULL)
*p = '\0';
+ else if (!feof(stdin))
+ {
+ fprintf(stderr, "%s: %s: line %d: line too long (%d bytes max)\n",
+ progname, mapname, lineno, sizeof ibuf);
+ continue;
+ }
+
if (ibuf[0] == '\0' || ibuf[0] == '#')
continue;
if (isspace(ibuf[0]))
diff --git a/usr.sbin/sendmail/praliases/Makefile.dist b/usr.sbin/sendmail/praliases/Makefile.dist
new file mode 100644
index 000000000000..a7b07f4c7f80
--- /dev/null
+++ b/usr.sbin/sendmail/praliases/Makefile.dist
@@ -0,0 +1,81 @@
+#
+# This Makefile is designed to work on the old "make" program. It does
+# not use the obj subdirectory. It also does not install documentation
+# automatically -- think of it as a quick start for sites that have the
+# 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).
+#
+# @(#)Makefile.dist 8.1 (Berkeley) 11/27/93
+#
+
+# use O=-O (usual) or O=-g (debugging)
+O= -O
+
+# location of sendmail source directory
+SRCDIR= ../src
+
+# define the database mechanisms available for map & alias lookups:
+# -DNDBM -- use new DBM
+# -DNEWDB -- use new Berkeley DB
+# The really old (V7) DBM library is no longer supported.
+#
+DBMDEF= -DNDBM -DNEWDB
+
+# environment definitions (e.g., -D_AIX3)
+ENVDEF=
+
+# see also conf.h for additional compilation flags
+
+# include directories
+INCDIRS=-I${SRCDIR} -I/usr/sww/include/db
+
+# loader options
+LDOPTS=
+
+# library directories
+LIBDIRS=-L/usr/sww/lib
+
+# libraries required on your system
+LIBS= -ldb -ldbm
+
+# location of praliases binary (usually /usr/sbin or /usr/etc)
+BINDIR= ${DESTDIR}/usr/sbin
+
+# additional .o files needed
+OBJADD=
+
+################### end of user configuration flags ######################
+
+CFLAGS= -I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
+
+OBJS= praliases.o ${OBJADD}
+
+LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
+BINOWN= bin
+BINGRP= bin
+BINMODE=555
+
+ALL= praliases praliases.0
+
+all: ${ALL}
+
+praliases: ${BEFORE} ${OBJS}
+ ${CC} -o praliases ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
+
+praliases.0: praliases.8
+ nroff -h -mandoc praliases.8 > praliases.0
+
+install: install-praliases install-docs
+
+install-praliases: praliases
+ install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} praliases ${BINDIR}
+
+# doesn't actually install them -- you may want to install pre-nroff versions
+install-docs: praliases.0
+
+clean:
+ rm -f ${OBJS} praliases praliases.0
+
+# dependencies
+# gross overkill, and yet still not quite enough....
+${OBJS}: ${SRCDIR}/conf.h
diff --git a/usr.sbin/sendmail/praliases/praliases.c b/usr.sbin/sendmail/praliases/praliases.c
index b637cda551ec..2c22279205eb 100644
--- a/usr.sbin/sendmail/praliases/praliases.c
+++ b/usr.sbin/sendmail/praliases/praliases.c
@@ -39,7 +39,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)praliases.c 8.1 (Berkeley) 6/7/93";
+static char sccsid[] = "@(#)praliases.c 8.3 (Berkeley) 3/6/94";
#endif /* not lint */
#include <ndbm.h>
@@ -85,15 +85,16 @@ main(argc, argv)
if (db = dbopen(buf, O_RDONLY, 0444 , DB_HASH, NULL)) {
if (!argc) {
while(!db->seq(db, &newdbkey, &newdbcontent, R_NEXT))
- printf("%s:%s\n", newdbkey.data,
- newdbcontent.data);
+ printf("%.*s:%.*s\n",
+ newdbkey.size, newdbkey.data,
+ newdbcontent.size, newdbcontent.data);
}
else for (; *argv; ++argv) {
newdbkey.data = *argv;
newdbkey.size = strlen(*argv) + 1;
- if ( !db->get(db, &newdbkey, &newdbcontent, 0) )
- printf("%s:%s\n", newdbkey.data,
- newdbcontent.data);
+ if (!db->get(db, &newdbkey, &newdbcontent, 0))
+ printf("%s:%.*s\n", newdbkey.data,
+ newdbcontent.size, newdbcontent.data);
else
printf("%s: No such key\n",
newdbkey.data);
@@ -107,10 +108,12 @@ main(argc, argv)
exit(EX_OSFILE);
}
if (!argc)
- for (key = dbm_nextkey(dbp);
+ for (key = dbm_firstkey(dbp);
key.dptr != NULL; key = dbm_nextkey(dbp)) {
content = dbm_fetch(dbp, key);
- (void)printf("%s:%s\n", key.dptr, content.dptr);
+ (void)printf("%.*s:%.*s\n",
+ key.dsize, key.dptr,
+ content.dsize, content.dptr);
}
else for (; *argv; ++argv) {
key.dptr = *argv;
@@ -119,7 +122,8 @@ main(argc, argv)
if (!content.dptr)
(void)printf("%s: No such key\n", key.dptr);
else
- (void)printf("%s:%s\n", key.dptr, content.dptr);
+ (void)printf("%s:%.*s\n", key.dptr,
+ content.dsize, content.dptr);
}
#ifdef NEWDB
}
diff --git a/usr.sbin/sendmail/src/Makefile b/usr.sbin/sendmail/src/Makefile
index f49a5b3e03c1..3cdf3ba7d23e 100644
--- a/usr.sbin/sendmail/src/Makefile
+++ b/usr.sbin/sendmail/src/Makefile
@@ -1,4 +1,7 @@
-# @(#)Makefile 8.1 (Berkeley) 6/7/93
+#
+# Makefile for FreeBSD
+#
+# @(#)Makefile.FreeBSD 8.1 (Berkeley) 2/26/94
PROG= sendmail
@@ -12,16 +15,16 @@ PROG= sendmail
# spiral snail, but it will work.
DBMDEF= -DNEWDB
-CFLAGS+=-I${.CURDIR} ${DBMDEF} -DNETISO -DNO_SYSCONF
+CFLAGS+=-I${.CURDIR} ${DBMDEF} -DNETISO -DMIME -DUSEUNAME
SRCS= alias.c arpadate.c clock.c collect.c conf.c convtime.c daemon.c \
deliver.c domain.c envelope.c err.c headers.c macro.c main.c map.c \
mci.c parseaddr.c queue.c readcf.c recipient.c savemail.c srvrsmtp.c \
stab.c stats.c sysexits.c trace.c udb.c usersmtp.c \
util.c version.c
-DPADD= ${LIBDBM} ${LIBCOMPAT} ${LIBUTIL}
-LDADD= ${LIBUTIL}
-MAN1= newaliases.1
+DPADD=
+LDADD= -lutil
+MAN1= mailq.1 newaliases.1
MAN5= aliases.5
MAN8= sendmail.8
LINKS= /usr/sbin/sendmail /usr/bin/newaliases \
@@ -34,7 +37,7 @@ BINMODE=6555
beforeinstall:
# install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
# ${DESTDIR}/etc/sendmail.fc
- install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
+ install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
${DESTDIR}/var/log/sendmail.st
install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/sendmail.hf \
${DESTDIR}/usr/share/misc
diff --git a/usr.sbin/sendmail/src/Makefile.AIX b/usr.sbin/sendmail/src/Makefile.AIX
deleted file mode 100644
index d676e02a5869..000000000000
--- a/usr.sbin/sendmail/src/Makefile.AIX
+++ /dev/null
@@ -1,99 +0,0 @@
-#
-# This Makefile is designed to work on the old "make" program. It does
-# not use the obj subdirectory. It also does not install documentation
-# automatically -- think of it as a quick start for sites that have the
-# 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 Ultrix.
-#
-# @(#)Makefile.dist 6.5 (Berkeley) 2/26/93
-#
-
-# use O=-O (usual) or O=-g (debugging)
-O= -g
-
-# define the database mechanism used for alias lookups:
-# -DNDBM -- use new DBM
-# -DNEWDB -- use new Berkeley DB
-# -DNDBM -DNEWDB -- use both new DBM and new Berkeley DB
-# -DNDBM -DNEWDB -DYPCOMPAT -- use both plus YP compatility
-# The really old (V7) DBM library is no longer supported.
-# If YPCOMPAT is defined and /var/yp/Makefile exists, sendmail will build
-# both the NEWDB and DBM libraries (the DBM just for YP).
-#
-DBMDEF= -DNEWDB
-
-# define the load average calculation on your system: -DLA_TYPE=LA_INT,
-# -DLA_TYPE=LA_FLOAT, -DLA_TYPE=LA_SUBR, or -DLA_TYPE=LA_ZERO
-# leave undefined to use internal guess
-#LADEF= -DLA_TYPE=LA_SUBR
-
-# define UNSETENV if you need to compile in a local version of setenv
-ENVDEF= -D_AIX3
-
-# see also conf.h for additional compilation flags
-
-# include directories
-#INCDIRS=-I/usr/sww/include/db
-
-# library directories
-#LIBDIRS=-L/usr/sww/lib
-
-# libraries required on your system
-LIBS= -ldbm -ldb
-
-# location of sendmail binary (usually /usr/sbin or /usr/lib)
-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
-
-################### end of user configuration flags ######################
-
-CFLAGS= -I. $O ${INCDIRS} ${DBMDEF} ${LADEF} ${ENVDEF}
-
-OBJS= alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
- deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
- map.o mci.o parseaddr.o queue.o readcf.o recipient.o \
- savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
- trace.o udb.o usersmtp.o util.o version.o
-
-LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
-BINOWN= root
-BINGRP= kmem
-BINMODE=6555
-
-sendmail: ${OBJS}
- ${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
-
-aliases.0: aliases.5
- nroff -h -mandoc aliases.5 > aliases.0
-
-newaliases.0: newaliases.1
- nroff -h -mandoc newaliases.1 > newaliases.0
-
-sendmail.0: sendmail.8
- nroff -h -mandoc sendmail.8 > sendmail.0
-
-install: install-sendmail install-docs
-
-install-sendmail: sendmail
- install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
- for i in ${LINKS}; do ; rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
- install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
- ${STDIR}/sendmail.st
- install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
-
-# doesn't actually install them -- you may want to install pre-nroff versions
-install-docs: aliases.0 newaliases.0 sendmail.0
-
-clean:
- rm -f ${OBJS} sendmail aliases.0 newaliases.0 sendmail.0
-
-# dependencies
-# gross overkill, and yet still not quite enough....
-${OBJS}: sendmail.h conf.h
diff --git a/usr.sbin/sendmail/src/Makefile.HPUX b/usr.sbin/sendmail/src/Makefile.HPUX
deleted file mode 100644
index 7394b15bbe8e..000000000000
--- a/usr.sbin/sendmail/src/Makefile.HPUX
+++ /dev/null
@@ -1,107 +0,0 @@
-#
-# This Makefile is designed to work on the old "make" program. It does
-# not use the obj subdirectory. It also does not install documentation
-# automatically -- think of it as a quick start for sites that have the
-# 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 Ultrix.
-#
-# @(#)Makefile.dist 6.5 (Berkeley) 2/26/93
-#
-
-# use O=-O (usual) or O=-g (debugging)
-# +O is OK on 7xx, and 300xx at 9.0
-O= +O1
-
-# define the database mechanism used for alias lookups:
-# -DNDBM -- use new DBM
-# -DNEWDB -- use new Berkeley DB
-# -DNDBM -DNEWDB -- use both new DBM and new Berkeley DB
-# -DNDBM -DNEWDB -DYPCOMPAT -- use both plus YP compatility
-# The really old (V7) DBM library is no longer supported.
-# If YPCOMPAT is defined and /var/yp/Makefile exists, sendmail will build
-# both the NEWDB and DBM libraries (the DBM just for YP).
-#
-DBMDEF= -DNEWDB
-
-# define the load average calculation on your system: -DLA_TYPE=LA_INT,
-# -DLA_TYPE=LA_FLOAT, -DLA_TYPE=LA_SUBR, or -DLA_TYPE=LA_ZERO
-# leave undefined to use internal guess
-#LADEF= -DLA_TYPE=LA_SUBR
-
-# define UNSETENV if you need to compile in a local version of setenv
-#ENVDEF= -DUNSETENV
-
-# see also conf.h for additional compilation flags
-
-# include directories
-INCDIRS=-I/usr/sww/include/db
-
-# library directories
-LIBDIRS=-L/usr/sww/lib
-
-# libraries required on your system
-LIBS= -ldb -ldbm
-
-# location of sendmail binary (usually /usr/sbin or /usr/lib)
-BINDIR= ${DESTDIR}/usr/lib
-
-# 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/lib
-
-# Stirling - watch out for pollution of name space by sys/sysmacros.h
-# - this hits definitions of m_flags in db.h
-# currently only on 300 series.
-# - sys/sysmacros.h is being included by machine/param.h
-# - which is included by sys/param.h
-XCFLAGS=-D_SYS_SYSMACROS_INCLUDED
-
-################### end of user configuration flags ######################
-
-CFLAGS= -I. $O ${INCDIRS} ${DBMDEF} ${LADEF} ${ENVDEF} ${XCFLAGS}
-
-OBJS= alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
- deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
- map.o mci.o parseaddr.o queue.o readcf.o recipient.o \
- savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
- trace.o udb.o usersmtp.o util.o version.o
-
-LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
-BINOWN= root
-BINGRP= kmem
-BINMODE=6555
-
-sendmail: ${OBJS}
- ${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
-
-aliases.0: aliases.5
- nroff -h -mandoc aliases.5 > aliases.0
-
-newaliases.0: newaliases.1
- nroff -h -mandoc newaliases.1 > newaliases.0
-
-sendmail.0: sendmail.8
- nroff -h -mandoc sendmail.8 > sendmail.0
-
-install: install-sendmail install-docs
-
-install-sendmail: sendmail
- install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
- for i in ${LINKS}; do ; rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
- install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
- ${STDIR}/sendmail.st
- install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
-
-# doesn't actually install them -- you may want to install pre-nroff versions
-install-docs: aliases.0 newaliases.0 sendmail.0
-
-clean:
- rm -f ${OBJS} sendmail aliases.0 newaliases.0 sendmail.0
-
-# dependencies
-# gross overkill, and yet still not quite enough....
-${OBJS}: sendmail.h conf.h
diff --git a/usr.sbin/sendmail/src/Makefile.IRIX b/usr.sbin/sendmail/src/Makefile.IRIX
deleted file mode 100644
index 314fd0002a9e..000000000000
--- a/usr.sbin/sendmail/src/Makefile.IRIX
+++ /dev/null
@@ -1,101 +0,0 @@
-#
-# This Makefile is designed to work on the old "make" program. It does
-# not use the obj subdirectory. It also does not install documentation
-# automatically -- think of it as a quick start for sites that have the
-# 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 IRIX
-#
-# @(#)Makefile.dist 8.1 (Berkeley) 6/7/93
-#
-
-# use O=-O (usual) or O=-g (debugging)
-O= -O
-CC=gcc
-
-# define the database mechanisms available for map & alias lookups:
-# -DNDBM -- use new DBM
-# -DNEWDB -- use new Berkeley DB
-# -DNDBM -DNEWDB -DYPCOMPAT -- use both plus YP compatility
-# -DNIS -- include client NIS support
-# The really old (V7) DBM library is no longer supported.
-# If YPCOMPAT is defined and /var/yp/Makefile exists, sendmail will build
-# both the NEWDB and DBM libraries (the DBM just for YP).
-#
-DBMDEF= -DNDBM
-
-# define the load average calculation on your system: -DLA_TYPE=LA_INT,
-# -DLA_TYPE=LA_FLOAT, -DLA_TYPE=LA_SUBR, or -DLA_TYPE=LA_ZERO
-# leave undefined to use internal guess
-#LADEF= -DLA_TYPE=LA_SUBR
-
-# define UNSETENV if you need to compile in a local version of setenv
-#ENVDEF= -DUNSETENV
-ENVDEF= -DIRIX
-
-# see also conf.h for additional compilation flags
-
-# include directories
-INCDIRS=
-
-# library directories
-LIBDIRS=
-
-# libraries required on your system
-LIBS= -lmld
-
-# location of sendmail binary (usually /usr/sbin or /usr/lib)
-BINDIR= ${DESTDIR}/usr/lib
-
-# location of sendmail.st file (usually /var/log or /usr/lib)
-STDIR= ${DESTDIR}/usr/lib
-
-# location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
-HFDIR= ${DESTDIR}/usr/lib
-
-################### end of user configuration flags ######################
-
-CFLAGS= -I. $O ${INCDIRS} ${DBMDEF} ${LADEF} ${ENVDEF}
-
-OBJS= alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
- deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
- map.o mci.o parseaddr.o queue.o readcf.o recipient.o \
- savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
- trace.o udb.o usersmtp.o util.o version.o
-
-LINKS= ${DESTDIR}/usr/bsd/newaliases ${DESTDIR}/usr/bsd/mailq
-BINOWN= root
-BINGRP= sys
-BINMODE=6555
-
-sendmail: ${OBJS}
- ${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
-
-aliases.0: aliases.5
- nroff -h -mandoc aliases.5 > aliases.0
-
-newaliases.0: newaliases.1
- nroff -h -mandoc newaliases.1 > newaliases.0
-
-sendmail.0: sendmail.8
- nroff -h -mandoc sendmail.8 > sendmail.0
-
-install: install-sendmail install-docs
-
-install-sendmail: sendmail
- install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
- for i in ${LINKS}; do ; rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
- install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
- ${STDIR}/sendmail.st
- install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
-
-# doesn't actually install them -- you may want to install pre-nroff versions
-install-docs: aliases.0 newaliases.0 sendmail.0
-
-clean:
- rm -f ${OBJS} sendmail aliases.0 newaliases.0 sendmail.0
-
-# dependencies
-# gross overkill, and yet still not quite enough....
-${OBJS}: sendmail.h conf.h
diff --git a/usr.sbin/sendmail/src/Makefile.OSF1 b/usr.sbin/sendmail/src/Makefile.OSF1
deleted file mode 100644
index dc5a425e75fc..000000000000
--- a/usr.sbin/sendmail/src/Makefile.OSF1
+++ /dev/null
@@ -1,99 +0,0 @@
-#
-# This Makefile is designed to work on the old "make" program. It does
-# not use the obj subdirectory. It also does not install documentation
-# automatically -- think of it as a quick start for sites that have the
-# 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 Ultrix.
-#
-# @(#)Makefile.dist 6.5 (Berkeley) 2/26/93
-#
-
-# use O=-O (usual) or O=-g (debugging)
-O= -O
-
-# define the database mechanism used for alias lookups:
-# -DNDBM -- use new DBM
-# -DNEWDB -- use new Berkeley DB
-# -DNDBM -DNEWDB -- use both new DBM and new Berkeley DB
-# -DNDBM -DNEWDB -DYPCOMPAT -- use both plus YP compatility
-# The really old (V7) DBM library is no longer supported.
-# If YPCOMPAT is defined and /var/yp/Makefile exists, sendmail will build
-# both the NEWDB and DBM libraries (the DBM just for YP).
-#
-DBMDEF= -DNDBM
-
-# define the load average calculation on your system: -DLA_TYPE=LA_INT,
-# -DLA_TYPE=LA_FLOAT, -DLA_TYPE=LA_SUBR, or -DLA_TYPE=LA_ZERO
-# leave undefined to use internal guess
-#LADEF= -DLA_TYPE=LA_SUBR
-
-# define UNSETENV if you need to compile in a local version of setenv
-#ENVDEF= -DUNSETENV
-
-# see also conf.h for additional compilation flags
-
-# include directories
-INCDIRS=-I/usr/sww/include/db
-
-# library directories
-LIBDIRS=-L/usr/sww/lib
-
-# libraries required on your system
-LIBS= -ldbm
-
-# location of sendmail binary (usually /usr/sbin or /usr/lib)
-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
-
-################### end of user configuration flags ######################
-
-CFLAGS= -I. $O ${INCDIRS} ${DBMDEF} ${LADEF} ${ENVDEF}
-
-OBJS= alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
- deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
- map.o mci.o parseaddr.o queue.o readcf.o recipient.o \
- savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
- trace.o udb.o usersmtp.o util.o version.o
-
-LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
-BINOWN= root
-BINGRP= kmem
-BINMODE=6555
-
-sendmail: ${OBJS}
- ${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
-
-aliases.0: aliases.5
- nroff -h -mandoc aliases.5 > aliases.0
-
-newaliases.0: newaliases.1
- nroff -h -mandoc newaliases.1 > newaliases.0
-
-sendmail.0: sendmail.8
- nroff -h -mandoc sendmail.8 > sendmail.0
-
-install: install-sendmail install-docs
-
-install-sendmail: sendmail
- install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
- for i in ${LINKS}; do ; rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
- install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
- ${STDIR}/sendmail.st
- install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
-
-# doesn't actually install them -- you may want to install pre-nroff versions
-install-docs: aliases.0 newaliases.0 sendmail.0
-
-clean:
- rm -f ${OBJS} sendmail aliases.0 newaliases.0 sendmail.0
-
-# dependencies
-# gross overkill, and yet still not quite enough....
-${OBJS}: sendmail.h conf.h
diff --git a/usr.sbin/sendmail/src/Makefile.Solaris b/usr.sbin/sendmail/src/Makefile.Solaris
deleted file mode 100644
index 2e77620206b9..000000000000
--- a/usr.sbin/sendmail/src/Makefile.Solaris
+++ /dev/null
@@ -1,103 +0,0 @@
-#
-# This Makefile is designed to work on the old "make" program. It does
-# not use the obj subdirectory. It also does not install documentation
-# automatically -- think of it as a quick start for sites that have the
-# 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 Ultrix.
-#
-# @(#)Makefile.dist 6.5 (Berkeley) 2/26/93
-#
-
-# use O=-O (usual) or O=-g (debugging)
-O= -O
-
-CC= gcc -V2.3.3
-
-# define the database mechanism used for alias lookups:
-# -DNDBM -- use new DBM
-# -DNEWDB -- use new Berkeley DB
-# -DNDBM -DNEWDB -- use both new DBM and new Berkeley DB
-# -DNDBM -DNEWDB -DYPCOMPAT -- use both plus YP compatility
-# The really old (V7) DBM library is no longer supported.
-# If YPCOMPAT is defined and /var/yp/Makefile exists, sendmail will build
-# both the NEWDB and DBM libraries (the DBM just for YP).
-#
-DBMDEF= -DNDBM
-
-# define the load average calculation on your system: -DLA_TYPE=LA_INT,
-# -DLA_TYPE=LA_FLOAT, -DLA_TYPE=LA_SUBR, or -DLA_TYPE=LA_ZERO
-# leave undefined to use internal guess
-#LADEF= -DLA_TYPE=LA_SUBR
-
-ENVDEF= -D_PATH_SENDMAILCF=\"/etc/mail/sendmail.cf\" \
- -D_PATH_SENDMAILPID=\"/etc/sendmail/sendmail.pid\"
-
-# see also conf.h for additional compilation flags
-
-# include directories
-INCDIRS=-I/usr/sww/include/db
-
-# library directories
-LIBDIRS=-L/usr/sww/lib -L/usr/ucblib
-
-# libraries required on your system
-#LIBS= -lresolv -lsocket -lnsl -lucb -lelf
-LIBS= -lresolv -lsocket -lnsl -lelf
-
-# location of sendmail binary (usually /usr/sbin or /usr/lib)
-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
-
-################### end of user configuration flags ######################
-
-CFLAGS= -I. $O ${INCDIRS} ${DBMDEF} ${LADEF} ${ENVDEF} -DSOLARIS
-
-OBJS= alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
- deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
- map.o mci.o parseaddr.o queue.o readcf.o recipient.o \
- savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
- trace.o udb.o usersmtp.o util.o version.o
-
-LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
-BINOWN= root
-BINGRP= sys
-BINMODE=6555
-INSTALL=/usr/ucb/install
-
-sendmail: ${OBJS}
- ${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
-
-aliases.0: aliases.5
- nroff -h -mandoc aliases.5 > aliases.0
-
-newaliases.0: newaliases.1
- nroff -h -mandoc newaliases.1 > newaliases.0
-
-sendmail.0: sendmail.8
- nroff -h -mandoc sendmail.8 > sendmail.0
-
-install: install-sendmail install-docs
-
-install-sendmail: sendmail
- ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
- for i in ${LINKS}; do ; rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
- ${STDIR}/sendmail.st
- ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
-
-# doesn't actually install them -- you may want to install pre-nroff versions
-install-docs: aliases.0 newaliases.0 sendmail.0
-
-clean:
- rm -f ${OBJS} sendmail aliases.0 newaliases.0 sendmail.0
-
-# dependencies
-# gross overkill, and yet still not quite enough....
-${OBJS}: sendmail.h conf.h
diff --git a/usr.sbin/sendmail/src/Makefile.SunOS b/usr.sbin/sendmail/src/Makefile.SunOS
deleted file mode 100644
index b7be76d9844e..000000000000
--- a/usr.sbin/sendmail/src/Makefile.SunOS
+++ /dev/null
@@ -1,36 +0,0 @@
-# @(#)Makefile 5.22 (Berkeley) 7/26/91
-
-PROG= sendmail
-
-DBMDEF= -DNEWDB -DNDBM -DNIS
-INCLS= -I/usr/local/include -I/usr/sww/include/db
-CFLAGS+=-I${.CURDIR} ${INCLS} ${DBMDEF} ${OPTNS}
-
-SRCS= alias.c arpadate.c clock.c collect.c conf.c convtime.c daemon.c \
- deliver.c domain.c envelope.c err.c headers.c macro.c main.c map.c \
- mci.c parseaddr.c queue.c readcf.c recipient.c savemail.c srvrsmtp.c \
- stab.c stats.c sysexits.c trace.c udb.c usersmtp.c \
- util.c version.c
-DPADD= ${LIBDBM} ${LIBCOMPAT} ${LIBUTIL}
-LDADD= -L/usr/sww/lib -ldb -ldbm -lresolv -Bstatic
-#LDADD= /usr/sww/build/lib/db/libdb.a -ldbm
-#MAN1= newaliases.0
-#MAN5= aliases.0
-#MAN8= sendmail.0
-NOMAN=
-LINKS= ${DESTDIR}/usr/sbin/sendmail ${DESTDIR}/usr/bin/newaliases \
- ${DESTDIR}/usr/sbin/sendmail ${DESTDIR}/usr/bin/mailq
-BINDIR= /usr/sbin
-BINOWN= root
-BINGRP= kmem
-BINMODE=6555
-
-beforeinstall:
- install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
- ${DESTDIR}/etc/sendmail.fc
- install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
- ${DESTDIR}/var/log/sendmail.st
- install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/sendmail.hf \
- ${DESTDIR}/usr/share/misc
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/sendmail/src/Makefile.ULTRIX b/usr.sbin/sendmail/src/Makefile.ULTRIX
deleted file mode 100644
index ccacfe594418..000000000000
--- a/usr.sbin/sendmail/src/Makefile.ULTRIX
+++ /dev/null
@@ -1,34 +0,0 @@
-# @(#)Makefile 5.22 (Berkeley) 7/26/91
-
-PROG= sendmail
-
-CFLAGS+=-I${.CURDIR} -I/usr/local/include -I/usr/sww/include/db -DNEWDB -DNDBM
-
-SRCS= alias.c arpadate.c clock.c collect.c conf.c convtime.c daemon.c \
- deliver.c domain.c envelope.c err.c headers.c macro.c main.c map.c \
- mci.c parseaddr.c queue.c readcf.c recipient.c savemail.c srvrsmtp.c \
- stab.c stats.c sysexits.c trace.c udb.c usersmtp.c \
- util.c version.c unsetenv.c
-DPADD= ${LIBDBM} ${LIBCOMPAT} ${LIBUTIL}
-LDADD= -L/usr/sww/lib -ldb
-#LDADD= /usr/sww/build/lib/db/libdb.a -ldbm
-#MAN1= newaliases.0
-#MAN5= aliases.0
-#MAN8= sendmail.0
-NOMAN=
-LINKS= ${DESTDIR}/usr/sbin/sendmail ${DESTDIR}/usr/bin/newaliases \
- ${DESTDIR}/usr/sbin/sendmail ${DESTDIR}/usr/bin/mailq
-BINDIR= /usr/sbin
-BINOWN= root
-BINGRP= kmem
-BINMODE=6555
-
-beforeinstall:
- install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
- ${DESTDIR}/etc/sendmail.fc
- install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
- ${DESTDIR}/var/log/sendmail.st
- install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/sendmail.hf \
- ${DESTDIR}/usr/share/misc
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/sendmail/src/Makefile.Utah b/usr.sbin/sendmail/src/Makefile.Utah
deleted file mode 100644
index 4ff06ff00b24..000000000000
--- a/usr.sbin/sendmail/src/Makefile.Utah
+++ /dev/null
@@ -1,42 +0,0 @@
-# @(#)Makefile 8.1 (Berkeley) 6/7/93
-
-PROG= sendmail
-
-# define the database format to use for aliases et al. Can be -DNEWDB (for
-# the new BSD database package -- this is preferred) or -DNDBM for the NDBM
-# database package. The old putrescent V7 DBM package is no longer
-# supported.
-# You can define both NEWDB and NDBM during a transition period; old
-# databases are read, but the new format will be used on any rebuilds. On
-# really gnarly systems, you can set this to null; it will crawl like a high
-# spiral snail, but it will work.
-DBMDEF= -DNEWDB -DNDBM -DOLD_NEWDB
-
-CFLAGS+=-I${.CURDIR} ${DBMDEF} -Dsetpgid=setpgrp
-
-SRCS= alias.c arpadate.c clock.c collect.c conf.c convtime.c daemon.c \
- deliver.c domain.c envelope.c err.c headers.c macro.c main.c map.c \
- mci.c parseaddr.c queue.c readcf.c recipient.c savemail.c srvrsmtp.c \
- stab.c stats.c sysexits.c trace.c udb.c usersmtp.c \
- util.c version.c
-DPADD= ${LIBDBM} ${LIBCOMPAT}
-LDADD=
-MAN1= newaliases.0
-MAN5= aliases.0
-MAN8= sendmail.0
-LINKS= ${DESTDIR}/usr/sbin/sendmail ${DESTDIR}/usr/bin/newaliases \
- ${DESTDIR}/usr/sbin/sendmail ${DESTDIR}/usr/bin/mailq
-BINDIR= /usr/sbin
-BINOWN= root
-BINGRP= kmem
-BINMODE=6555
-
-beforeinstall:
-# install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
-# ${DESTDIR}/etc/sendmail.fc
- install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
- ${DESTDIR}/var/log/sendmail.st
- install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/sendmail.hf \
- ${DESTDIR}/usr/share/misc
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/sendmail/src/Makefile.dist b/usr.sbin/sendmail/src/Makefile.dist
index f85dfebdae1a..f8fd7deec4ae 100644
--- a/usr.sbin/sendmail/src/Makefile.dist
+++ b/usr.sbin/sendmail/src/Makefile.dist
@@ -5,9 +5,7 @@
# 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 Ultrix.
-#
-# @(#)Makefile.dist 8.1 (Berkeley) 6/7/93
+# @(#)Makefile.dist 8.11 (Berkeley) 3/5/94
#
# use O=-O (usual) or O=-g (debugging)
@@ -16,27 +14,23 @@ O= -O
# define the database mechanisms available for map & alias lookups:
# -DNDBM -- use new DBM
# -DNEWDB -- use new Berkeley DB
-# -DNDBM -DNEWDB -DYPCOMPAT -- use both plus YP compatility
-# -DNIS -- include client NIS support
+# -DNIS -- include NIS support
# The really old (V7) DBM library is no longer supported.
-# If YPCOMPAT is defined and /var/yp/Makefile exists, sendmail will build
-# both the NEWDB and DBM libraries (the DBM just for YP).
+# See READ_ME for a description of how these flags interact.
#
-DBMDEF= -DNEWDB
-
-# define the load average calculation on your system: -DLA_TYPE=LA_INT,
-# -DLA_TYPE=LA_FLOAT, -DLA_TYPE=LA_SUBR, or -DLA_TYPE=LA_ZERO
-# leave undefined to use internal guess
-#LADEF= -DLA_TYPE=LA_SUBR
+DBMDEF= -DNDBM -DNEWDB
-# define UNSETENV if you need to compile in a local version of setenv
-#ENVDEF= -DUNSETENV
+# environment definitions (e.g., -D_AIX3)
+ENVDEF=
# see also conf.h for additional compilation flags
# include directories
INCDIRS=-I/usr/sww/include/db
+# loader options
+LDOPTS=
+
# library directories
LIBDIRS=-L/usr/sww/lib
@@ -52,47 +46,59 @@ 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=
+
################### end of user configuration flags ######################
-CFLAGS= -I. $O ${INCDIRS} ${DBMDEF} ${LADEF} ${ENVDEF}
+CFLAGS= -I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
OBJS= alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
map.o mci.o parseaddr.o queue.o readcf.o recipient.o \
savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
- trace.o udb.o usersmtp.o util.o version.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
-sendmail: ${OBJS}
- ${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
+ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
+
+all: ${ALL}
+
+sendmail: ${BEFORE} ${OBJS}
+ ${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
aliases.0: aliases.5
nroff -h -mandoc aliases.5 > aliases.0
+mailq.0: mailq.1
+ nroff -h -mandoc mailq.1 > mailq.0
+
newaliases.0: newaliases.1
nroff -h -mandoc newaliases.1 > newaliases.0
sendmail.0: sendmail.8
nroff -h -mandoc sendmail.8 > sendmail.0
+INSTALL=install
+
install: install-sendmail install-docs
install-sendmail: sendmail
- install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
- for i in ${LINKS}; do ; rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
- install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
+ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
+ for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
+ ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
${STDIR}/sendmail.st
- install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
+ ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
# doesn't actually install them -- you may want to install pre-nroff versions
-install-docs: aliases.0 newaliases.0 sendmail.0
+install-docs: aliases.0 mailq.0 newaliases.0 sendmail.0
clean:
- rm -f ${OBJS} sendmail aliases.0 newaliases.0 sendmail.0
+ rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
# dependencies
# gross overkill, and yet still not quite enough....
diff --git a/usr.sbin/sendmail/src/READ_ME b/usr.sbin/sendmail/src/READ_ME
index b1a0f804a62f..50f75fba9913 100644
--- a/usr.sbin/sendmail/src/READ_ME
+++ b/usr.sbin/sendmail/src/READ_ME
@@ -30,7 +30,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# @(#)READ_ME 8.3 (Berkeley) 7/13/93
+# @(#)READ_ME 8.58 (Berkeley) 3/13/94
#
This directory contains the source files for sendmail.
@@ -39,19 +39,137 @@ For detailed instructions, please read the document ../doc/op.me:
eqn ../doc/op.me | pic | ditroff -me
-The Makefile is for the new Berkeley make, available from ftp.uu.net
-in the directory /systems/unix/bsd-sources/usr.bin/make. There is
-also a Makefile.dist which is much less clever, but works on the old
-traditional make. You can use this using:
+The Makefile is for the new (4.4BSD) Berkeley make and uses syntax
+that is not recognized by older makes. It also has assumptions
+about the 4.4 file system layout built in. See below for details
+about other Makefiles.
+
+There is also a Makefile.dist which is much less clever, but works on
+the old traditional make. You can use this using:
make -f Makefile.dist
-There are a couple of other Makefiles for other systems -- these are
-the ones that I use, they have "Berkeley quirks" in them, and I don't
-guarantee that they will work in your environment. To make it worse,
-some are for the new Berkeley make, and some are for the old make.
-I provide them for information only. Still, they may help you get
-started. They have names like "Makefile.HPUX".
+**************************************************
+** Read below for more details of Makefiles. **
+**************************************************
+
+There is also a shell script (makesendmail) that tries to be clever
+about using object subdirectories. It's pretty straightforward, and
+may help if you share a source tree among different architectures.
+
+**************************************************************************
+** IMPORTANT: DO NOT USE OPTIMIZATION (``-O'') IF YOU ARE RUNNING **
+** GCC 2.4.x or 2.5.x. THERE IS A BUG IN THE GCC OPTIMIZER THAT **
+** CAUSES SENDMAIL COMPILES TO FAIL MISERABLY. **
+**************************************************************************
+
+Jim Wilson of Cygnus believes he has found the problem -- it will
+probably be fixed in GCC 2.5.6 -- but until this is verified, be
+very suspicious of gcc -O.
+
+**************************************************************************
+** IMPORTANT: Read the appropriate paragraphs in the section on **
+** ``Operating System and Compile Quirks''. **
+**************************************************************************
+
+
++-----------+
+| MAKEFILES |
++-----------+
+
+The "Makefile"s in these directories are from 4.4 BSD, and hence
+really only work properly if you are on a 4.4 system. In particular,
+they use new syntax that will not be recognized on old make programs,
+and some of them do things like ``.include ../../Makefile.inc'' to
+pick up some system defines. If you are getting sendmail separately,
+these files won't be included in the distribution, as they are
+outside of the sendmail tree.
+
+Instead, you should use one of the other Makefiles, such as
+Makefile.SunOS for a SunOS system, and so forth. These should
+work with the version of make that is appropriate for that
+system.
+
+There are a bunch of other Makefiles for other systems with names
+like Makefile.HPUX for an HP-UX system. They use the version of
+make that is native for that system. These are the Makefiles that
+I use, and they have "Berkeley quirks" in them. I can't guarantee
+that they will work unmodified in your environment. Many of them
+include -I/usr/sww/include/db and -L/usr/sww/lib -- this is Berkeley's
+location (the ``Software Warehouse'') for the new database libraries,
+described below. You don't have to remove these definitions if you
+don't have these directories.
+
+Please look for an appropriate Makefile before you start trying to
+compile with Makefile or Makefile.dist.
+
+If you want to port the new Berkeley make, you can get it from
+ftp.uu.net in the directory /systems/unix/bsd-sources/usr.bin/make.
+Diffs and instructions for building this version of make under
+SunOS 4.1.x are available on ftp.css.itd.umich.edu in
+/pub/systems/sun/Net2-make.sun4.diff.Z. Diffs and instructions
+for building this version of make under IBM AIX 3.2.4 are available
+on ftp.uni-stuttgart.de in /sw/src/patches/bsd-make-rus-patches.
+Paul Southworth <pauls@umich.edu> published a description of porting
+this make in comp.unix.bsd.
+
+The complete text of the Makefile.inc that is in the parent of the
+sendmail directory is:
+
+ # @(#)Makefile.inc 8.1 (Berkeley) 6/6/93
+
+ BINDIR?= /usr/sbin
+
+
++----------------------+
+| DATABASE DEFINITIONS |
++----------------------+
+
+There are several database formats that can be used for the alias files
+and for general maps. When used for alias files they interact in an
+attempt to be back compatible.
+
+The three options are NEWDB (the new Berkeley DB package), NDBM (the
+older DBM implementation -- the very old V7 implementation is no
+longer supported), and NIS (Network Information Services). Used alone
+these just include the support they indicate. [If you are using NEWDB,
+get the latest version from FTP.CS.Berkeley.EDU in /ucb/4bsd. DO NOT
+use the version from the Net2 distribution! However, if you are on
+BSD/386 or 386BSD-based systems, use the one that already exists
+on your system. You may need to define OLD_NEWDB to do this.]
+
+[NOTE WELL: it is CRITICAL that you remove ndbm.o from libdb.a and
+ndbm.h from the appropriate include directories if you want to get
+ndbm support. These files OVERRIDE calls to ndbm routines -- in
+particular, if you leave ndbm.h in, you can find yourself using
+the new db package even if you don't define NEWDB.]
+
+If NEWDB and NDBM are defined (but not NIS), then sendmail will read
+NDBM format alias files, but the next time a newaliases is run the
+format will be converted to NEWDB; that format will be used forever
+more. This is intended as a transition feature. [Note however that
+the NEWDB library also catches and maps NDBM calls; you will have to
+back out this feature to get this to work. See ``Quirks'' section
+below for details.]
+
+If all three are defined, sendmail operates as described above, and also
+looks for the file /var/yp/Makefile. If it exists, newaliases will
+build BOTH the NEWDB and NDBM format alias files. However, it will
+only use the NEWDB file; the NDBM format file is used only by the
+NIS subsystem.
+
+If NDBM and NIS are defined (regardless of the definition of NEWDB
+or the existance of /var/yp/Makefile), sendmail adds the special
+tokens "YP_LAST_MODIFIED" and "YP_MASTER_NAME", both of which are
+required if the NDBM file is to be used as an NIS map.
+
+All of -DNEWDB, -DNDBM, and -DNIS are normally defined in the DBMDEF
+line in the Makefile.
+
+
++---------------+
+| COMPILE FLAGS |
++---------------+
Whereever possible, I try to make sendmail pull in the correct
compilation options needed to compile on various environments based on
@@ -60,60 +178,158 @@ symbols availble, requiring the following compilation flags in the
Makefile:
SOLARIS Define this if you are running Solaris 2.0 or higher.
-__NeXT__ Define this if you are on a NeXT box. (This one may
- be pre-defined for you.)
+SOLARIS_2_3 Define this if you are running Solaris 2.3 or higher.
+SUNOS403 Define this if you are running SunOS 4.0.3.
+NeXT Define this if you are on a NeXT box. (This one may
+ be pre-defined for you.) There are other hacks you
+ have to make -- see below.
_AIX3 Define this if you are IBM AIX 3.x.
+RISCOS Define this if you are running RISC/os from MIPS.
+IRIX Define this if you are running IRIX from SGI.
+_SCO_unix_ Define this if you are on SCO UNIX.
+_SCO_unix_4_2 Define this if you are on SCO Open Server 3.2v4.
If you are a system that sendmail has already been ported to, you
probably won't have to touch these. But if you are porting, you may
-have to tweak the following compilation flags in order to get
-it to compile and link properly:
-
-UNSETENV Define this if your system library does NOT include the
- "unsetenv" subroutine.
-SYSTEM5 Adjust for System V.
-LOCKF Set this if you do not have the flock system call -- it
- will revert to System V file locking. There are some
- semantic gotchas, so flock is preferred. Implied by
- SYSTEM5.
-SYS5TZ Use System V-style time zones. If not set, the TZ
- environment variable is ignored. Implied by SYSTEM5.
+have to tweak the following compilation flags in conf.h in order to
+get it to compile and link properly:
+
+SYSTEM5 Adjust for System V (not necessarily Release 4).
+SYS5SIGNALS Use System V signal semantics -- the signal handler
+ is automatically dropped when the signal is caught.
+ If this is not set, use POSIX/BSD semantics, where the
+ signal handler stays in force until an exec or an
+ explicit delete. Implied by SYSTEM5.
+SYS5SETPGRP Use System V setpgrp() semantics. Implied by SYSTEM5.
+HASFLOCK Set this if you prefer to use the flock(2) system call
+ rather than using fcntl-based locking. Fcntl locking
+ has some semantic gotchas, but many vendor systems
+ also interface it to lockd(8) to do NFS-style locking.
+ For this reason, this should not be set unless you
+ don't have an alternative.
HASUNAME Set if you have the "uname" system call. Implied by
SYSTEM5.
-HASSTATFS Define this if you have the statfs(2) system call. It's
- not a disaster to get this wrong -- but you do lose the
- queue free space code.
-HASUSTAT Define this if you have the ustat(2) system call. It's
- not a disaster to get this wrong -- but you do lose the
- queue free space code.
+HASUNSETENV Define this if your system library has the "unsetenv"
+ subroutine.
HASSETSID Define this if you have the setsid(2) system call. This
is implied if your system appears to be POSIX compliant.
HASINITGROUPS Define this if you have the initgroups(3) routine.
HASSETVBUF Define this if you have the setvbuf(3) library call.
If you don't, setlinebuf will be used instead. This
defaults on if your compiler defines __STDC__.
-HASSETEUID Define this if you have seteuid(2) ***AND*** root can use
- it to change to an arbitrary user. This second condition
- is not satisfied on AIX 3.x. You may find that
- your system has setreuid(2) or setresuid(2), in which
- case you will also have to #define seteuid(uid) to be
- the appropriate call. The important thing is that you
- have a call that will set the effective uid and NOT
- set the real or saved uid. Setting this improves the
- security somewhat, since sendmail doesn't have to read
- .forward and :include: files as root.
+HASSETREUID Define this if you have setreuid(2) ***AND*** root can
+ use setreuid to change to an arbitrary user. This second
+ condition is not satisfied on AIX 3.x. You may find that
+ your system has setresuid(2), (for example, on HP-UX) in
+ which case you will also have to #define setreuid(r, e)
+ to be the appropriate call. Some systems (such as Solaris)
+ have a compatibility routine that doesn't work properly,
+ but may have "saved user ids" properly implemented so you
+ can ``#define setreuid(r, e) seteuid(e)'' and have it work.
+ The important thing is that you have a call that will set
+ the effective uid independently of the real or saved uid
+ and be able to set the effective uid back again when done.
+ There's a test program in ../test/t_setreuid.c that will
+ try things on your system. Setting this improves the
+ security, since sendmail doesn't have to read .forward
+ and :include: files as root. There are certain attacks
+ that may be unpreventable without this call.
+HASLSTAT Define this if you have symbolic links (and thus the
+ lstat(2) system call). This improves security. Unlike
+ most other options, this one is on by default, so you
+ need to #undef it in conf.h if you don't have symbolic
+ links (these days everyone does).
+NEEDGETOPT Define this if you need a reimplementation of getopt(3).
+ On some systems, getopt does very odd things if called
+ to scan the arguments twice. This flag will ask sendmail
+ to compile in a local version of getopt that works
+ properly.
+NEEDSTRTOL Define this if your standard C library does not define
+ strtol(3). This will compile in a local version.
+NEEDVPRINTF Define this if your standard C library does not define
+ vprintf(3). Note that the resulting fake implementation
+ is not very elegant and may not even work on some
+ architectures.
+HASGETUSERSHELL Define this to 1 if you have getusershell(3) in your
+ standard C library. If this is not defined, or is defined
+ to be 0, sendmail will scan the /etc/shells file (no
+ NIS-style support, defaults to /bin/sh and /bin/csh if
+ that file does not exist) to get a list of unrestricted
+ user shells. This is used to determine whether users
+ are allowed to forward their mail to a program or a file.
+GIDSET_T The type of entries in a gidset passed as the second
+ argument to getgroups(2). Historically this has been an
+ int, so this is the default, but some systems (such as
+ IRIX) pass it as a gid_t, which is an unsigned short.
+ This will make a difference, so it is important to get
+ this right! However, it is only an issue if you have
+ group sets.
+SLEEP_T The type returned by the system sleep() function.
+ Defaults to "unsigned int". Don't worry about this
+ if you don't have compilation problems.
+ARBPTR_T The type of an arbitrary pointer -- defaults to "void *".
+ If you are an very old compiler you may need to define
+ this to be "char *".
LA_TYPE The type of load average your kernel supports. These
- can be LA_SUBR (4) if you have the getloadavg(3) routine,
+ can be one of:
+ LA_ZERO (1) -- it always returns the load average as
+ "zero" (and does so on all architectures).
+ LA_SUBR (4) if you have the getloadavg(3) routine,
+ LA_MACH (5) to use MACH-style load averages (calls
+ processor_set_info()),
+ LA_PROCSTR (7) to read /proc/loadavg and interpret it
+ as a string representing a floating-point
+ number (Linux-style),
LA_FLOAT (3) if you read kmem and interpret the value
- as a floating point number, LA_INT (2) to interpret as
- an integer. These last two have several other parameters
- that they try to divine: the name of your kernel, the name
- of the variable in the kernel to examine, the number of
- bits of precision in a fixed point load average, and so
- forth. In desparation, use LA_ZERO -- it always returns
- the load average as "zero" (and does so on all architectures).
- The actual code is in conf.c -- it can be tweaked if you
- are brave.
+ as a floating point number,
+ LA_INT (2) to interpret as a long integer,
+ LA_SHORT (6) to interpret as a short integer.
+ These last three have several other parameters that they
+ try to divine: the name of your kernel, the name of the
+ variable in the kernel to examine, the number of bits of
+ precision in a fixed point load average, and so forth.
+ In desperation, use LA_ZERO. The actual code is in
+ conf.c -- it can be tweaked if you are brave.
+SFS_TYPE Encodes how your kernel can locate the amount of free
+ space on a disk partition. This can be set to SFS_NONE
+ (0) if you have no way of getting this information,
+ SFS_USTAT (1) if you have the ustat(2) system call,
+ SFS_4ARGS (2) if you have a four-argument statfs(2)
+ system call (and the include file is <sys/statfs.h>),
+ and SFS_VFS (3), SFS_MOUNT (4), or SFS_STATFS (5) if
+ you have the two-argument statfs(2) system call, with
+ includes in <sys/vfs.h>, <sys/mount.h>, or <sys/statfs.h>
+ respectively. The default if nothing is defined is
+ SFS_NONE.
+ERRLIST_PREDEFINED
+ If set, assumes that some header file defines sys_errlist.
+ This may be needed if you get type conflicts on this
+ variable -- otherwise don't worry about it.
+WAITUNION The wait(2) routine takes a "union wait" argument instead
+ of an integer argument. This is for compatibility with
+ old versions of BSD.
+SCANF You can set this to extend the F command to accept a
+ scanf string -- this gives you a primitive parser for
+ class definitions -- BUT it can make you vulnerable to
+ core dumps if the target file is poorly formed.
+SYSLOG_BUFSIZE You can define this to be the size of the buffer that
+ syslog accepts. If it is not defined, it assumes a
+ 1024-byte buffer. If the buffer is very small (under
+ 256 bytes) the log message format changes -- each
+ e-mail message will log many more messages, since it
+ will log each piece of information as a separate line
+ in syslog.
+BROKEN_RES_SEARCH
+ On Ultrix (and maybe other systems?) if you use the
+ res_search routine with an unknown host name, it returns
+ -1 but sets h_errno to 0 instead of HOST_NOT_FOUND. If
+ you set this, sendmail considers 0 to be the same as
+ HOST_NOT_FOUND.
+
+
++-----------------------+
+| COMPILE-TIME FEATURES |
++-----------------------+
There are a bunch of features that you can decide to compile in, such
as selecting various database packages and special protocol support.
@@ -122,23 +338,19 @@ Several are assumed based on other compilation flags -- if you want to
flags that add support for special features include:
NDBM Include support for "new" DBM library for aliases and maps.
+ Normally defined in the Makefile.
NEWDB Include support for Berkeley "db" package (hash & btree)
- for aliases and maps.
+ for aliases and maps. Normally defined in the Makefile.
NIS Define this to get NIS (YP) support for aliases and maps.
-YPCOMPAT Define this to force building of DBM versions of alias
- files even if you have NEWDB defined; this will only
- occur on NIS master machines. It is independent of NIS.
+ Normally defined in the Makefile.
USERDB Include support for the User Information Database. Implied
- by NEWDB conf.h.
-IDENTPROTO Define this to get IDENT (RFC 1413) protocol support.
+ by NEWDB in conf.h.
+IDENTPROTO Define this as 1 to get IDENT (RFC 1413) protocol support.
This is assumed unless you are running on Ultrix or
HP-UX, both of which have a problem in the UDP
- implementation.
+ implementation. You can define it to be 0 to explicitly
+ turn off IDENT protocol support.
MIME Include support for MIME-encapsulated error messages.
-FROZENCONFIG Define this to get support for frozen configuration
- files. Frozen configurations make sense if your I/O system
- is fast relative to your processor. At this point this
- is NOT recommended.
LOG Set this to get syslog(3) support. Defined by default
in conf.h. You want this if at all possible.
NETINET Set this to get TCP/IP support. Defined by default
@@ -163,23 +375,432 @@ SETPROCTITLE Try to set the string printed by "ps" to something
informative about what sendmail is doing. Defined by
default in conf.h.
-If you are compiling on SunOS and want to use frozen configuration
-files, you must use -Bstatic -- if you do not, frozen configuration
-files fail in bizarre ways and you will open up several security holes.
-If you are compiling on OSF/1 (DEC Alpha), you must use -lmld.
++---------------------+
+| DNS/RESOLVER ISSUES |
++---------------------+
+
+Many systems have old versions of the resolver library. At a minimum,
+you should be running BIND 4.8.3; older versions may compile, but they
+have known bugs that should give you pause.
+
+Common problems in old versions include "undefined" errors for
+dn_skipname.
+
+Some people have had a problem with BIND 4.9; it uses some routines
+that it expects to be externally defined such as strerror(). It may
+help to link with "-l44bsd" to solve this problem.
+
+!PLEASE! be sure to link with the same version of the resolver as
+the header files you used -- some people have used the 4.9 headers
+and linked with BIND 4.8 or vice versa, and it doesn't work.
+Unfortunately, it doesn't fail in an obvious way -- things just
+subtly don't work.
+
+
++-------------------------------------+
+| OPERATING SYSTEM AND COMPILE QUIRKS |
++-------------------------------------+
+
+GCC 2.5.x problems *** IMPORTANT ***
+ Date: Mon, 29 Nov 93 19:08:44 PST
+ From: wilson@cygnus.com (Jim Wilson)
+ Message-Id: <9311300308.AA04608@cygnus.com>
+ To: kenner@vlsi1.ultra.nyu.edu
+ Subject: [cattelan@thebarn.com: gcc 2.5.4-2.5.5 -O bug]
+ Cc: cattelan@thebarn.com, rms@gnu.ai.mit.edu, sendmail@cs.berkeley.edu
+
+ This fixes a problem that occurs when gcc 2.5.5 is used to compile
+ sendmail 8.6.4 with optimization on a sparc.
+
+ Mon Nov 29 19:00:14 1993 Jim Wilson (wilson@sphagnum.cygnus.com)
+
+ * reload.c (find_reloads_toplev): Replace obsolete reference to
+ BYTE_LOADS_*_EXTEND with LOAD_EXTEND_OP.
+
+ *** clean-ss-931128/reload.c Sun Nov 14 16:20:01 1993
+ --- ss-931128/reload.c Mon Nov 29 18:52:55 1993
+ *************** find_reloads_toplev (x, opnum, type, ind
+ *** 3888,3894 ****
+ force a reload in that case. So we should not do anything here. */
+
+ else if (regno >= FIRST_PSEUDO_REGISTER
+ ! #if defined(BYTE_LOADS_ZERO_EXTEND) || defined(BYTE_LOADS_SIGN_EXTEND)
+ && (GET_MODE_SIZE (GET_MODE (x))
+ <= GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))))
+ #endif
+ --- 3888,3894 ----
+ force a reload in that case. So we should not do anything here. */
+
+ else if (regno >= FIRST_PSEUDO_REGISTER
+ ! #ifdef LOAD_EXTEND_OP
+ && (GET_MODE_SIZE (GET_MODE (x))
+ <= GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))))
+ #endif
+
+
+SunOS 4.x (Solaris 1.x)
+ You may have to use -lresolv on SunOS. However, beware that
+ this links in a new version of gethostbyname that does not
+ understand NIS, so you must have all of your hosts in DNS.
+
+ Some people have reported problems with the SunOS version of
+ -lresolv and/or in.named, and suggest that you get a newer
+ version. The symptoms are delays when you connect to the
+ SMTP server on a SunOS machine or having your domain added to
+ addresses inappropriately. There is a version of BIND
+ version 4.9 on gatekeeper.DEC.COM in pub/BSD/bind/4.9.
+
+ There is substantial disagreement about whether you can make
+ this work with resolv+, which allows you to specify a search-path
+ of services. Some people report that it works fine, others
+ claim it doesn't work at all (including causing sendmail to
+ drop core when it tries to do multiple resolv+ lookups for a
+ single job). I haven't tried resolv+, as we use DNS exclusively.
+
+ Should you want to try resolv+, it is on ftp.uu.net in
+ /networking/ip/dns.
+
+Solaris 2.x (SunOS 5.x)
+ To compile for Solaris, be sure you use -DSOLARIS.
+
+ To the best of my knowledge, Solaris does not have the
+ gethostbyname problem described above. However, it does
+ have another one:
+
+ From a correspondent:
+
+ For solaris 2.2, I have
+
+ hosts: files dns
+
+ in /etc/nsswitch.conf and /etc/hosts has to have the fully
+ qualified host name. I think "files" has to be before "dns"
+ in /etc/nsswitch.conf during bootup.
+
+ From another correspondent:
+
+ When running sendmail under Solaris, the gethostbyname()
+ hack in conf.c which should perform proper canonicalization
+ of host names could fail. Result: the host name is not
+ canonicalized despite the hack, and you'll have to define $j
+ and $m in sendmail.cf somewhere.
+
+ The reason could be that /etc/nsswitch.conf is improperly
+ configured (at least from sendmail's point of view). For
+ example, the line
+
+ hosts: files nisplus dns
+
+ will make gethostbyname() look in /etc/hosts first, then ask
+ nisplus, then dns. However, if /etc/hosts does not contain
+ the full canonicalized hostname, then no amount of
+ gethostbyname()s will work.
+
+ Solution (or rather, a workaround): Ask nisplus first, then
+ dns, then local files:
+
+ hosts: nisplus dns [NOTFOUND=return] files
+
+ The Solaris "syslog" function is apparently limited to something
+ about 90 characters because of a kernel limitation. If you have
+ source code, you can probably up this number. You can get patches
+ that fix this problem: the patch ids are:
+
+ Solaris 2.1 100834
+ Solaris 2.2 100999
+ Solaris 2.3 101318
+
+ Be sure you have the appropriate patch installed or you won't
+ see system logging.
+
+OSF/1
+ If you are compiling on OSF/1 (DEC Alpha), you must use
+ -L/usr/shlib (otherwise it core dumps on startup). You may also
+ need -mld to get the nlist() function, although some versions
+ apparently don't need this.
+
+ Also, the enclosed makefile removed /usr/sbin/smtpd; if you need
+ it, just create the link to the sendmail binary.
+
+IRIX
+ The header files on SGI IRIX are completely prototyped, and as
+ a result you can sometimes get some warning messages during
+ compilation. These can be ignored. There are two errors in
+ deliver only if you are using gcc, both of the form ``warning:
+ passing arg N of `execve' from incompatible pointer type''.
+ Also, if you compile with -DNIS, you will get a complaint
+ about a declaration of struct dom_binding in a prototype
+ when compiling map.c; this is not important because the
+ function being prototyped is not used in that file.
+
+NeXT
+ If you are compiling on NeXT, you will have to create an empty
+ file "unistd.h" and create a file "dirent.h" containing:
+
+ #include <sys/dir.h>
+ #define dirent direct
+
+ (The Makefile.NeXT should try to do both of these for you.)
+
+ Apparently, there is a bug in getservbyname on Nextstep 3.0
+ that causes it to fail under some circumstances with the
+ message "SYSERR: service "smtp" unknown" logged. You should
+ be able to work around this by including the line:
+
+ OOPort=25
+
+ in your .cf file.
+
+ You may have to use -DNeXT.
+
+BSDI (BSD/386) 1.0, NetBSD 0.9, FreeBSD 1.0
+ The "m4" from BSDI won't handle the config files properly.
+ I haven't had a chance to test this myself.
+
+ The M4 shipped in FreeBSD and NetBSD 0.9 don't handle the config
+ files properly. One must use either GNU m4 1.1 or the PD-M4
+ recently posted in comp.os.386bsd.bugs (and maybe others).
+ NetBSD-current includes the PD-M4 (as stated in the NetBSD file
+ CHANGES).
+
+ FreeBSD 1.0 RELEASE has uname(2) now. Use -DUSEUNAME in order to
+ use it (look into Makefile.FreeBSD). NetBSD-current may have
+ it too but it has not been verified.
+
+ You cannot port the latest version of the Berkeley db library
+ and use it with sendmail without recompiling the world. This
+ is because C library routines use the older version which have
+ incompatible header files -- the result is that it can't read
+ other system files, such as /etc/passwd, unless you use the
+ new db format throughout your system. You should normally just
+ use the version of db supplied in your release. You may need
+ to use -DOLD_NEWDB to make this work -- this turns off some
+ new interface calls (for file locking) that are not in older
+ versions of db. You'll get compile errors if you need this
+ flag and don't have it set.
+
+4.3BSD
+ If you are running a "virgin" version of 4.3BSD, you'll have
+ a very old resolver and be missing some header files. The
+ header files are simple -- create empty versions and everything
+ will work fine. For the resolver you should really port a new
+ version (4.8.3 or later) of the resolver; 4.9 is available on
+ gatekeeper.DEC.COM in pub/BSD/bind/4.9. If you are really
+ determined to continue to use your old, buggy version (or as
+ a shortcut to get sendmail working -- I'm sure you have the
+ best intentions to port a modern version of BIND), you can
+ copy ../contrib/oldbind.compat.c into src and add
+ oldbind.compat.o to OBJADD in the Makefile.
+
+A/UX
+ Date: Tue, 12 Oct 1993 18:28:28 -0400 (EDT)
+ From: "Eric C. Hagberg" <hagberg@med.cornell.edu>
+ 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
+ <dlander@afterlife.ncsc.mil>, used procmail instead.
+
+Apollo DomainOS
+ If you are compiling on Apollo, you will have to create an empty
+ file "unistd.h" and create a file "dirent.h" containing:
+
+ #include <sys/dir.h>
+ #define dirent direct
+
+ (The Makefile.DomainOS will attempt to do both of these for you.)
+
+HP-UX 8.00
+ Date: Mon, 24 Jan 1994 13:25:45 +0200
+ From: Kimmo Suominen <Kimmo.Suominen@lut.fi>
+ Subject: 8.6.5 w/ HP-UX 8.00 on s300
+
+ Just compiled and fought with sendmail 8.6.5 on a HP9000/360 (ie. a
+ series 300 machine) running HP-UX 8.00.
+
+ I was getting segmentation fault when delivering to a local user.
+ With debugging I saw it was faulting when doing _free@libc... *sigh*
+ It seems the new implementation of malloc on s300 is buggy as of 8.0,
+ so I tried out the one in -lmalloc (malloc(3X)). With that it seems
+ to work just dandy.
+
+ When linking, you will get the following error:
+
+ ld: multiply defined symbol _freespace in file /usr/lib/libmalloc.a
+
+ but you can just ignore it. You might want to add this info to the
+ README file for the future...
+
+Linux
+ Something broke between versions 0.99.13 and 0.99.14 of Linux:
+ the flock() system call gives errors. If you are running .14,
+ you must not use flock. You can do this with -DHASFLOCK=0.
+
+AIX
+ This version of sendmail does not support MB, MG, and MR resource
+ records, which are supported by AIX sendmail.
+
+RISC/os
+ RISC/os from MIPS is a merged AT&T/Berkeley system. When you
+ compile on that platform you will get duplicate definitions
+ on many files. You can ignore these.
+
+System V Release 4 Based Systems
+ There is a single Makefile that is intended for all SVR4-based
+ systems (called Makefile.SVR4). It defines __svr4__, which is
+ predefined by some compilers. If your compiler already defines
+ this compile variable, you can delete the definition from the
+ Makefile.
+
+ It's been tested on Dell Issue 2.2.
+
+DELL SVR4
+ Date: Mon, 06 Dec 1993 10:42:29 EST
+ From: "Kimmo Suominen" <kim@grendel.lut.fi>
+ Message-ID: <2d0352f9.lento29@lento29.UUCP>
+ To: eric@cs.berkeley.edu
+ Cc: sendmail@cs.berkeley.edu
+ Subject: Notes for DELL SVR4
+
+ Eric,
+
+ Here are some notes for compiling Sendmail 8.6.4 on DELL SVR4. I ran
+ across these things when helping out some people who contacted me by
+ e-mail.
+
+ 1) Use gcc 2.4.5 (or later?). Dell distributes gcc 2.1 with their
+ Issue 2.2 Unix. It is too old, and gives you problems with
+ clock.c, because sigset_t won't get defined in <sys/signal.h>.
+ This is due to a problematic protection rule in there, and is
+ fixed with gcc 2.4.5.
+
+ 2) If you don't use the new Berkeley DB (-DNEWDB), then you need
+ to add "-lc -lucb" to the libraries to link with. This is because
+ the -ldbm distributed by Dell needs the bcopy, bcmp and bzero
+ functions. It is important that you specify both libraries in
+ the given order to be sure you only get the BSTRING functions
+ from the UCB library (and not the signal routines etc.).
+
+ 3) Don't leave out "-lelf" even if compiling with "-lc -lucb".
+ The UCB library also has another copy of the nlist routines,
+ but we do want the ones from "-lelf".
+
+ If anyone needs a compiled gcc 2.4.5 and/or a ported DB library, they
+ can use anonymous ftp to fetch them from lut.fi in the /kim directory.
+ They are copies of what I use on grendel.lut.fi, and offering them
+ does not imply that I would also support them. I have sent the DB
+ port for SVR4 back to Keith Bostic for inclusion in the official
+ distribution, but I haven't heard anything from him as of today.
+
+ - gcc-2.4.5-svr4.tar.gz (gcc 2.4.5 and the corresponding libg++)
+ - db-1.72.tar.gz (with source, objects and a installed copy)
+
+ Cheers
+ + Kim
+ --
+ * Kimmo.Suominen@lut.fi * SysVr4 enthusiast at GRENDEL.LUT.FI *
+ * KIM@FINFILES.BITNET * Postmaster and Hostmaster at LUT.FI *
+ * + 358 200 865 718 * Unix area moderator at NIC.FUNET.FI *
+
+
+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
+ that get installed (that is, use the OLD ndbm.h, not the new
+ ndbm.h). This compatibility module maps ndbm calls into DB
+ calls, and breaks things rather badly.
+
+GNU getopt
+ I'm told that GNU getopt has a problem in that it gets confused
+ by the double call. Use the version in conf.c instead.
+
+BIND 4.9.2 and Ultrix
+ If you are running on Ultrix, be sure you read the conf/Info.Ultrix
+ carefully -- there is information in there that you need to know
+ in order to avoid errors of the form:
+
+ /lib/libc.a(gethostent.o): sethostent: multiply defined
+ /lib/libc.a(gethostent.o): endhostent: multiply defined
+ /lib/libc.a(gethostent.o): gethostbyname: multiply defined
+ /lib/libc.a(gethostent.o): gethostbyaddr: multiply defined
+
+ during the link stage.
+
+
++--------------+
+| MANUAL PAGES |
++--------------+
+
+The manual pages have been written against the -mandoc macros
+instead of the -man macros. The latest version of groff has them
+included. You can also get a copy from FTP.UU.NET in directory
+/systems/unix/bsd-sources/share/tmac.
+
+
++-----------------+
+| DEBUGGING HOOKS |
++-----------------+
+
+As of 8.6.5, sendmail daemons will catch a SIGUSR1 signal and log
+some debugging output (logged at LOG_DEBUG severity). The
+information dumped is:
+
+ * The value of the $j macro.
+ * A warning if $j is not in the set $=w.
+ * A list of the open file descriptors.
+ * The contents of the connection cache.
+ * If ruleset 89 is defined, it is evaluated and the results printed.
+
+This allows you to get information regarding the runtime state of the
+daemon on the fly. This should not be done too frequently, since
+the process of rewriting may lose memory which will not be recovered.
+Also, ruleset 89 may call non-reentrant routines, so there is a small
+non-zero probability that this will cause other problems. It is
+really only for debugging serious problems.
+
+A typical formulation of ruleset 89 would be:
-If you are compiling on NeXT, you will have to create an empty file
-"unistd.h".
+ R$* $@ $>0 some test address
-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 that get
-installed (that is, use the OLD ndbm.h, not the new ndbm.h). This
-compatibility module maps ndbm calls into DB calls, and breaks things
-rather badly.
-You probably want to look over the compilation options in conf.h
-before you compile. These are intended to be per-site information.
++-----------------------------+
+| DESCRIPTION OF SOURCE FILES |
++-----------------------------+
The following list describes the files in this directory:
@@ -240,4 +861,4 @@ version.c The version number and information about this
Eric Allman
-(Version 8.3, last update 7/13/93 12:57:56)
+(Version 8.58, last update 3/13/94 09:38:06)
diff --git a/usr.sbin/sendmail/src/TRACEFLAGS b/usr.sbin/sendmail/src/TRACEFLAGS
index 3fd00b728053..f05c219c8711 100644
--- a/usr.sbin/sendmail/src/TRACEFLAGS
+++ b/usr.sbin/sendmail/src/TRACEFLAGS
@@ -51,9 +51,14 @@
41 queue.c orderq
42 mci.c mci_get
45 envelope.c setsender
+46 envelope.c openxscript
+49 conf.c checkcompat
50 envelope.c dropenvelope
51 queue.c unlockqueue
52 main.c disconnect
53 util.c xfclose
+54 err.c putoutmsg
+55 conf.c lockfile
59 Extended Load Average implementation from Christophe Wolfhugel
60 map.c
+91 mci.c syslogging of MCI cache information
diff --git a/usr.sbin/sendmail/src/alias.c b/usr.sbin/sendmail/src/alias.c
index eb579b22b93d..20a316200cad 100644
--- a/usr.sbin/sendmail/src/alias.c
+++ b/usr.sbin/sendmail/src/alias.c
@@ -33,11 +33,10 @@
*/
# include "sendmail.h"
-# include <signal.h>
# include <pwd.h>
#ifndef lint
-static char sccsid[] = "@(#)alias.c 8.3 (Berkeley) 7/13/93";
+static char sccsid[] = "@(#)alias.c 8.24 (Berkeley) 2/28/94";
#endif /* not lint */
@@ -115,13 +114,15 @@ alias(a, sendq, e)
message("aliased to %s", p);
#ifdef LOG
if (LogLevel > 9)
- syslog(LOG_INFO, "%s: alias %s => %s", e->e_id, a->q_paddr, p);
+ syslog(LOG_INFO, "%s: alias %s => %s",
+ e->e_id == NULL ? "NOQUEUE" : e->e_id,
+ a->q_paddr, p);
#endif
a->q_flags &= ~QSELFREF;
AliasLevel++;
naliases = sendtolist(p, a, sendq, e);
AliasLevel--;
- if (naliases > 0 && !bitset(QSELFREF, a->q_flags))
+ if (!bitset(QSELFREF, a->q_flags))
{
if (tTd(27, 5))
{
@@ -145,7 +146,7 @@ alias(a, sendq, e)
owner = aliaslookup(obuf, e);
if (owner != NULL)
{
- if (strchr(owner, ',') != NULL)
+ if (strpbrk(owner, ",:/|\"") != NULL)
owner = obuf;
a->q_owner = newstr(owner);
}
@@ -280,13 +281,27 @@ setalias(spec)
** 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.
*/
-aliaswait(map, ext)
+bool
+aliaswait(map, ext, isopen)
MAP *map;
char *ext;
+ int isopen;
{
- int atcnt;
+ bool attimeout = FALSE;
time_t mtime;
struct stat stb;
char buf[MAXNAME];
@@ -294,26 +309,41 @@ aliaswait(map, ext)
if (tTd(27, 3))
printf("aliaswait(%s:%s)\n",
map->map_class->map_cname, map->map_file);
+ if (bitset(MF_ALIASWAIT, map->map_mflags))
+ return isopen;
+ map->map_mflags |= MF_ALIASWAIT;
- atcnt = SafeAlias * 2;
- if (atcnt > 0)
+ if (SafeAlias > 0)
{
auto int st;
+ time_t toolong = curtime() + SafeAlias;
+ unsigned int sleeptime = 2;
- while (atcnt-- >= 0 &&
+ while (isopen &&
map->map_class->map_lookup(map, "@", NULL, &st) == NULL)
{
+ if (curtime() > toolong)
+ {
+ /* we timed out */
+ attimeout = TRUE;
+ break;
+ }
+
/*
** Close and re-open the alias database in case
** the one is mv'ed instead of cp'ed in.
*/
if (tTd(27, 2))
- printf("aliaswait: sleeping\n");
+ printf("aliaswait: sleeping for %d seconds\n",
+ sleeptime);
map->map_class->map_close(map);
- sleep(30);
- map->map_class->map_open(map, O_RDONLY);
+ sleep(sleeptime);
+ sleeptime *= 2;
+ if (sleeptime > 60)
+ sleeptime = 60;
+ isopen = map->map_class->map_open(map, O_RDONLY);
}
}
@@ -322,25 +352,30 @@ aliaswait(map, ext)
{
if (tTd(27, 3))
printf("aliaswait: not rebuildable\n");
- return;
+ map->map_mflags &= ~MF_ALIASWAIT;
+ return isopen;
}
if (stat(map->map_file, &stb) < 0)
{
if (tTd(27, 3))
printf("aliaswait: no source file\n");
- return;
+ map->map_mflags &= ~MF_ALIASWAIT;
+ return isopen;
}
mtime = stb.st_mtime;
(void) strcpy(buf, map->map_file);
if (ext != NULL)
(void) strcat(buf, ext);
- if (stat(buf, &stb) < 0 || stb.st_mtime < mtime || atcnt < 0)
+ if (stat(buf, &stb) < 0 || stb.st_mtime < mtime || attimeout)
{
/* database is out of date */
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
{
@@ -352,6 +387,8 @@ aliaswait(map, ext)
message("Warning: alias database %s out of date", buf);
}
}
+ map->map_mflags &= ~MF_ALIASWAIT;
+ return isopen;
}
/*
** REBUILDALIASES -- rebuild the alias database.
@@ -373,31 +410,37 @@ rebuildaliases(map, automatic)
bool automatic;
{
FILE *af;
- void (*oldsigint)();
+ bool nolock = FALSE;
+ sigfunc_t oldsigint;
if (!bitset(MCF_REBUILDABLE, map->map_class->map_cflags))
return;
-#ifdef LOG
- if (LogLevel > 7)
- {
- syslog(LOG_NOTICE, "alias database %s %srebuilt by %s",
- map->map_file, automatic ? "auto" : "", username());
- }
-#endif /* LOG */
-
/* try to lock the source file */
if ((af = fopen(map->map_file, "r+")) == NULL)
{
- if (tTd(27, 1))
- printf("Can't open %s: %s\n",
- map->map_file, errstring(errno));
- errno = 0;
- return;
+ if ((errno != EACCES && errno != EROFS) || automatic ||
+ (af = fopen(map->map_file, "r")) == NULL)
+ {
+ int saveerr = errno;
+
+ if (tTd(27, 1))
+ printf("Can't open %s: %s\n",
+ map->map_file, errstring(saveerr));
+ if (!automatic)
+ message("newaliases: cannot open %s: %s",
+ map->map_file, errstring(saveerr));
+ errno = 0;
+ return;
+ }
+ nolock = TRUE;
+ message("warning: cannot lock %s: %s",
+ map->map_file, errstring(errno));
}
/* see if someone else is rebuilding the alias file */
- if (!lockfile(fileno(af), map->map_file, LOCK_EX|LOCK_NB))
+ if (!nolock &&
+ !lockfile(fileno(af), map->map_file, NULL, LOCK_EX|LOCK_NB))
{
/* yes, they are -- wait until done */
message("Alias file %s is already being rebuilt",
@@ -405,18 +448,26 @@ rebuildaliases(map, automatic)
if (OpMode != MD_INITALIAS)
{
/* wait for other rebuild to complete */
- (void) lockfile(fileno(af), map->map_file,
+ (void) lockfile(fileno(af), map->map_file, NULL,
LOCK_EX);
}
- (void) fclose(af);
+ (void) xfclose(af, "rebuildaliases1", map->map_file);
errno = 0;
return;
}
- oldsigint = signal(SIGINT, SIG_IGN);
+ oldsigint = setsignal(SIGINT, SIG_IGN);
if (map->map_class->map_open(map, O_RDWR))
{
+#ifdef LOG
+ if (LogLevel > 7)
+ {
+ syslog(LOG_NOTICE, "alias database %s %srebuilt by %s",
+ map->map_file, automatic ? "auto" : "",
+ username());
+ }
+#endif /* LOG */
map->map_mflags |= MF_OPEN|MF_WRITABLE;
readaliases(map, af, automatic);
}
@@ -431,14 +482,14 @@ rebuildaliases(map, automatic)
}
/* close the file, thus releasing locks */
- fclose(af);
+ xfclose(af, "rebuildaliases2", map->map_file);
/* add distinguished entries and close the database */
if (bitset(MF_OPEN, map->map_mflags))
map->map_class->map_close(map);
/* restore the old signal */
- (void) signal(SIGINT, oldsigint);
+ (void) setsignal(SIGINT, oldsigint);
}
/*
** READALIASES -- read and process the alias file.
@@ -519,9 +570,9 @@ readaliases(map, af, automatic)
syserr("554 missing colon");
continue;
}
- if (parseaddr(line, &al, 1, ':', NULL, CurEnv) == NULL)
+ if (parseaddr(line, &al, RF_COPYALL, ':', NULL, CurEnv) == NULL)
{
- syserr("554 illegal alias name");
+ syserr("554 %.40s... illegal alias name", line);
continue;
}
@@ -555,7 +606,8 @@ readaliases(map, af, automatic)
p++;
if (*p == '\0')
break;
- if (parseaddr(p, &bl, -1, ',', &delimptr, CurEnv) == NULL)
+ if (parseaddr(p, &bl, RF_COPYNONE, ',',
+ &delimptr, CurEnv) == NULL)
usrerr("553 %s... bad address", p);
p = delimptr;
}
@@ -586,7 +638,8 @@ readaliases(map, af, automatic)
}
if (al.q_mailer != LocalMailer)
{
- syserr("554 cannot alias non-local names");
+ syserr("554 %s... cannot alias non-local names",
+ al.q_paddr);
continue;
}
@@ -653,10 +706,6 @@ forward(user, sendq, e)
{
char *pp;
char *ep;
-#ifdef HASSETEUID
- register ADDRESS *ca;
- uid_t saveduid, uid;
-#endif
if (tTd(27, 1))
printf("forward(%s)\n", user->q_paddr);
@@ -676,14 +725,6 @@ forward(user, sendq, e)
if (ForwardPath == NULL)
ForwardPath = newstr("\201z/.forward");
-#ifdef HASSETEUID
- ca = getctladdr(user);
- if (ca != NULL)
- uid = ca->q_uid;
- else
- uid = DefUid;
-#endif
-
for (pp = ForwardPath; pp != NULL; pp = ep)
{
int err;
@@ -698,33 +739,10 @@ forward(user, sendq, e)
if (tTd(27, 3))
printf("forward: trying %s\n", buf);
- if (tTd(27, 9))
- printf("forward: old uid = %d/%d\n", getuid(), geteuid());
-
-#ifdef HASSETEUID
- saveduid = geteuid();
- if (saveduid == 0 && uid != 0)
- (void) seteuid(uid);
-#endif
-
- if (tTd(27, 9))
- printf("forward: new uid = %d/%d\n", getuid(), geteuid());
-
err = include(buf, TRUE, user, sendq, e);
-
-#ifdef HASSETEUID
- if (saveduid == 0 && uid != 0)
- if (seteuid(saveduid) < 0)
- syserr("seteuid(%d) failure (real=%d, eff=%d)",
- saveduid, getuid(), geteuid());
-#endif
-
- if (tTd(27, 9))
- printf("forward: reset uid = %d/%d\n", getuid(), geteuid());
-
if (err == 0)
break;
- if (transienterror(err))
+ else if (transienterror(err))
{
/* we have to suspend this message */
if (tTd(27, 2))
@@ -732,10 +750,11 @@ forward(user, sendq, e)
#ifdef LOG
if (LogLevel > 2)
syslog(LOG_ERR, "%s: forward %s: transient error: %s",
- e->e_id, buf, errstring(err));
+ e->e_id == NULL ? "NOQUEUE" : e->e_id,
+ buf, errstring(err));
#endif
message("%s: %s: message queued", buf, errstring(err));
- user->q_flags |= QQUEUEUP|QDONTSEND;
+ user->q_flags |= QQUEUEUP;
return;
}
}
diff --git a/usr.sbin/sendmail/src/aliases b/usr.sbin/sendmail/src/aliases
index 9a9508b7254c..7540eeae3f62 100644
--- a/usr.sbin/sendmail/src/aliases
+++ b/usr.sbin/sendmail/src/aliases
@@ -1,5 +1,5 @@
#
-# @(#)aliases 8.1 (Berkeley) 6/9/93
+# @(#)aliases 8.2 (Berkeley) 3/5/94
#
# Aliases in this file will NOT be expanded in the header from
# Mail, but WILL be visible over networks or from /bin/mail.
@@ -34,6 +34,7 @@ decode: root
# OFFICIAL CSRG/BUG ADDRESSES
# Ftp maintainer.
+ftp: ftp-bugs
ftp-bugs: bigbug@cs.berkeley.edu
# Distribution office.
diff --git a/usr.sbin/sendmail/src/aliases.5 b/usr.sbin/sendmail/src/aliases.5
index 39f380516ecd..f40f64de10bc 100644
--- a/usr.sbin/sendmail/src/aliases.5
+++ b/usr.sbin/sendmail/src/aliases.5
@@ -29,9 +29,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)aliases.5 8.1 (Berkeley) 6/16/93
+.\" @(#)aliases.5 8.2 (Berkeley) 12/11/93
.\"
-.Dd June 16, 1993
+.Dd December 11, 1993
.Dt ALIASES 5
.Os BSD 4
.Sh NAME
@@ -94,7 +94,7 @@ change to take effect.
If you have compiled
.Xr sendmail
with DBM support instead of NEWDB,
-you may have encounter problems in
+you may have encountered problems in
.Xr dbm 3
restricting a single alias to about 1000 bytes of information.
You can get longer aliases by ``chaining''; that is, make the last name in
diff --git a/usr.sbin/sendmail/src/cdefs.h b/usr.sbin/sendmail/src/cdefs.h
index a04665e30e49..c104b9e964dd 100644
--- a/usr.sbin/sendmail/src/cdefs.h
+++ b/usr.sbin/sendmail/src/cdefs.h
@@ -2,6 +2,9 @@
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
+ * This code is derived from software contributed to Berkeley by
+ * Berkeley Software Design, Inc.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -30,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)cdefs.h 8.1 (Berkeley) 6/2/93
+ * @(#)cdefs.h 8.7 (Berkeley) 1/21/94
*/
#ifndef _CDEFS_H_
@@ -56,39 +59,64 @@
#define __CONCAT(x,y) x ## y
#define __STRING(x) #x
+#define __const const /* define reserved names to standard */
+#define __signed signed
+#define __volatile volatile
+#if defined(__cplusplus)
+#define __inline inline /* convert to C++ keyword */
+#else
+#ifndef __GNUC__
+#define __inline /* delete GCC keyword */
+#endif /* !__GNUC__ */
+#endif /* !__cplusplus */
+
#else /* !(__STDC__ || __cplusplus) */
#define __P(protos) () /* traditional C preprocessor */
#define __CONCAT(x,y) x/**/y
#define __STRING(x) "x"
-#ifdef __GNUC__
-#define const __const /* GCC: ANSI C with -traditional */
-#define inline __inline
-#define signed __signed
-#define volatile __volatile
-
-#else /* !__GNUC__ */
+#ifndef __GNUC__
+#define __const /* delete pseudo-ANSI C keywords */
+#define __inline
+#define __signed
+#define __volatile
+/*
+ * In non-ANSI C environments, new programs will want ANSI-only C keywords
+ * deleted from the program and old programs will want them left alone.
+ * When using a compiler other than gcc, programs using the ANSI C keywords
+ * const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS.
+ * When using "gcc -traditional", we assume that this is the intent; if
+ * __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone.
+ */
+#ifndef NO_ANSI_KEYWORDS
#define const /* delete ANSI C keywords */
#define inline
#define signed
#define volatile
+#endif
#endif /* !__GNUC__ */
#endif /* !(__STDC__ || __cplusplus) */
/*
- * GCC has extensions for declaring functions as `pure' (always returns
- * the same value given the same inputs, i.e., has no external state and
- * no side effects) and `dead' (nonreturning). These mainly affect
- * optimization and warnings. Unfortunately, GCC complains if these are
- * used under strict ANSI mode (`gcc -ansi -pedantic'), hence we need to
- * define them only if compiling without this.
+ * GCC1 and some versions of GCC2 declare dead (non-returning) and
+ * pure (no side effects) functions using "volatile" and "const";
+ * unfortunately, these then cause warnings under "-ansi -pedantic".
+ * GCC2 uses a new, peculiar __attribute__((attrs)) style. All of
+ * these work for GNU C++ (modulo a slight glitch in the C++ grammar
+ * in the distribution version of 2.5.5).
*/
+#if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 5
+#define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-#define __dead __volatile
-#define __pure __const
-#else
-#define __dead
-#define __pure
+#define __dead __volatile
+#define __pure __const
+#endif
+#endif
+
+/* Delete pseudo-keywords wherever they are not available or needed. */
+#ifndef __dead
+#define __dead
+#define __pure
#endif
#endif /* !_CDEFS_H_ */
diff --git a/usr.sbin/sendmail/src/clock.c b/usr.sbin/sendmail/src/clock.c
index 96675c096a72..45ef1c2782c6 100644
--- a/usr.sbin/sendmail/src/clock.c
+++ b/usr.sbin/sendmail/src/clock.c
@@ -33,11 +33,10 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)clock.c 8.2 (Berkeley) 7/13/93";
+static char sccsid[] = "@(#)clock.c 8.8 (Berkeley) 1/12/94";
#endif /* not lint */
# include "sendmail.h"
-# include <signal.h>
# ifndef sigmask
# define sigmask(s) (1 << ((s) - 1))
@@ -61,7 +60,7 @@ static char sccsid[] = "@(#)clock.c 8.2 (Berkeley) 7/13/93";
** none.
*/
-static void tick();
+static void tick __P((int));
EVENT *
setevent(intvl, func, arg)
@@ -79,6 +78,7 @@ setevent(intvl, func, arg)
return (NULL);
}
+ (void) setsignal(SIGALRM, SIG_IGN);
(void) time(&now);
/* search event queue for correct position */
@@ -101,7 +101,7 @@ setevent(intvl, func, arg)
printf("setevent: intvl=%ld, for=%ld, func=%x, arg=%d, ev=%x\n",
intvl, now + intvl, func, arg, ev);
- tick();
+ tick(0);
return (ev);
}
/*
@@ -128,7 +128,7 @@ clrevent(ev)
return;
/* find the parent event */
- (void) signal(SIGALRM, SIG_IGN);
+ (void) setsignal(SIGALRM, SIG_IGN);
for (evp = &EventQueue; *evp != NULL; evp = &(*evp)->ev_link)
{
if (*evp == ev)
@@ -143,7 +143,7 @@ clrevent(ev)
}
/* restore clocks and pick up anything spare */
- tick();
+ tick(0);
}
/*
** TICK -- take a clock tick
@@ -151,7 +151,7 @@ clrevent(ev)
** Called by the alarm clock. This routine runs events as needed.
**
** Parameters:
-** none.
+** One that is ignored; for compatibility with signal handlers.
**
** Returns:
** none.
@@ -161,16 +161,18 @@ clrevent(ev)
*/
static void
-tick()
+tick(arg)
+ int arg;
{
register time_t now;
register EVENT *ev;
int mypid = getpid();
+ int olderrno = errno;
#ifdef SIG_UNBLOCK
sigset_t ss;
#endif
- (void) signal(SIGALRM, SIG_IGN);
+ (void) setsignal(SIGALRM, SIG_IGN);
(void) alarm(0);
now = curtime();
@@ -192,19 +194,6 @@ tick()
ev->ev_func, ev->ev_arg, ev->ev_pid);
/* we must be careful in here because ev_func may not return */
- (void) signal(SIGALRM, tick);
-#ifdef SIG_UNBLOCK
- /* unblock SIGALRM signal */
- sigemptyset(&ss);
- sigaddset(&ss, SIGALRM);
- sigprocmask(SIG_UNBLOCK, &ss, NULL);
-#else
-#ifdef SIGVTALRM
- /* reset 4.2bsd signal mask to allow future alarms */
- (void) sigsetmask(sigblock(0) & ~sigmask(SIGALRM));
-#endif /* SIGVTALRM */
-#endif /* SIG_UNBLOCK */
-
f = ev->ev_func;
arg = ev->ev_arg;
pid = ev->ev_pid;
@@ -218,13 +207,31 @@ tick()
else
(void) alarm(3);
}
+
+ /* restore signals so that we can take ticks while in ev_func */
+ (void) setsignal(SIGALRM, tick);
+#ifdef SIG_UNBLOCK
+ /* unblock SIGALRM signal */
+ sigemptyset(&ss);
+ sigaddset(&ss, SIGALRM);
+ sigprocmask(SIG_UNBLOCK, &ss, NULL);
+#else
+#ifdef SIGVTALRM
+ /* reset 4.2bsd signal mask to allow future alarms */
+ (void) sigsetmask(sigblock(0) & ~sigmask(SIGALRM));
+#endif /* SIGVTALRM */
+#endif /* SIG_UNBLOCK */
+
+ /* call ev_func */
+ errno = olderrno;
(*f)(arg);
(void) alarm(0);
now = curtime();
}
- (void) signal(SIGALRM, tick);
+ (void) setsignal(SIGALRM, tick);
if (EventQueue != NULL)
(void) alarm((unsigned) (EventQueue->ev_time - now));
+ errno = olderrno;
}
/*
** SLEEP -- a version of sleep that works with this stuff
@@ -244,13 +251,16 @@ tick()
*/
static bool SleepDone;
+static int endsleep();
-unsigned int
+#ifndef SLEEP_T
+# define SLEEP_T unsigned int
+#endif
+
+SLEEP_T
sleep(intvl)
unsigned int intvl;
{
- static int endsleep();
-
if (intvl == 0)
return;
SleepDone = FALSE;
diff --git a/usr.sbin/sendmail/src/collect.c b/usr.sbin/sendmail/src/collect.c
index 4398b8572147..b434d4900eb8 100644
--- a/usr.sbin/sendmail/src/collect.c
+++ b/usr.sbin/sendmail/src/collect.c
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)collect.c 8.1 (Berkeley) 6/7/93";
+static char sccsid[] = "@(#)collect.c 8.9 (Berkeley) 1/31/94";
#endif /* not lint */
# include <errno.h>
@@ -72,6 +72,7 @@ collect(smtpmode, requeueflag, e)
bool ignrdot = smtpmode ? FALSE : IgnrDot;
char buf[MAXLINE], buf2[MAXLINE];
register char *workbuf, *freebuf;
+ bool inputerr = FALSE;
extern char *hvalue();
extern bool isheader(), flusheol();
@@ -79,7 +80,8 @@ collect(smtpmode, requeueflag, e)
** Create the temp file name and create the file.
*/
- e->e_df = newstr(queuename(e, 'd'));
+ e->e_df = queuename(e, 'd');
+ e->e_df = newstr(e->e_df);
if ((tf = dfopen(e->e_df, O_WRONLY|O_CREAT, FileMode)) == NULL)
{
syserr("Cannot create %s", e->e_df);
@@ -158,7 +160,10 @@ collect(smtpmode, requeueflag, e)
if (sfgets(freebuf, MAXLINE, InChannel,
TimeOuts.to_datablock,
"message header read") == NULL)
- goto readerr;
+ {
+ freebuf[0] = '\0';
+ break;
+ }
/* is this a continuation line? */
if (*freebuf != ' ' && *freebuf != '\t')
@@ -244,7 +249,7 @@ collect(smtpmode, requeueflag, e)
** Collect the body of the message.
*/
- do
+ for (;;)
{
register char *bp = buf;
@@ -255,7 +260,8 @@ collect(smtpmode, requeueflag, e)
break;
/* check for transparent dot */
- if (OpMode == MD_SMTP && bp[0] == '.' && bp[1] == '.')
+ if ((OpMode == MD_SMTP || OpMode == MD_DAEMON) &&
+ bp[0] == '.' && bp[1] == '.')
bp++;
/*
@@ -268,39 +274,64 @@ collect(smtpmode, requeueflag, e)
fputs("\n", tf);
if (ferror(tf))
tferror(tf, e);
- } while (sfgets(buf, MAXLINE, InChannel, TimeOuts.to_datablock,
- "message body read") != NULL);
+ if (sfgets(buf, MAXLINE, InChannel, TimeOuts.to_datablock,
+ "message body read") == NULL)
+ goto readerr;
+ }
+ if (feof(InChannel) || ferror(InChannel))
+ {
readerr:
+ if (tTd(30, 1))
+ printf("collect: read error\n");
+ inputerr = TRUE;
+ }
+
if (fflush(tf) != 0)
tferror(tf, e);
- (void) fsync(fileno(tf));
- (void) fclose(tf);
+ if (fsync(fileno(tf)) < 0 || fclose(tf) < 0)
+ {
+ syserr("cannot sync message data to disk (%s)", e->e_df);
+ finis();
+ }
/* An EOF when running SMTP is an error */
- if ((feof(InChannel) || ferror(InChannel)) && OpMode == MD_SMTP)
+ if (inputerr && (OpMode == MD_SMTP || OpMode == MD_DAEMON))
{
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: unexpected close on connection from %s, sender=%s: %m\n",
- host, e->e_from.q_paddr);
+ "collect: %s on connection from %s, sender=%s: %m\n",
+ problem, 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);
+ if (feof(InChannel))
+ usrerr("451 collect: %s on connection from %s, from=%s",
+ problem, host, e->e_from.q_paddr);
+ else
+ 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;
e->e_flags &= ~EF_FATALERRS;
+ e->e_flags |= EF_CLRQUEUE;
/* and don't try to deliver the partial message either */
+ if (InChild)
+ ExitStat = EX_QUIT;
finis();
}
@@ -311,6 +342,10 @@ readerr:
eatheader(e, !requeueflag);
+ /* collect statistics */
+ if (OpMode != MD_VERIFY)
+ markstats(e, (ADDRESS *) NULL);
+
/*
** Add an Apparently-To: line if we have no recipient lines.
*/
diff --git a/usr.sbin/sendmail/src/conf.c b/usr.sbin/sendmail/src/conf.c
index f87534803fd2..1a9646365b88 100644
--- a/usr.sbin/sendmail/src/conf.c
+++ b/usr.sbin/sendmail/src/conf.c
@@ -33,15 +33,15 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)conf.c 8.3 (Berkeley) 7/13/93";
+static char sccsid[] = "@(#)conf.c 8.82 (Berkeley) 3/6/94";
#endif /* not lint */
+# include "sendmail.h"
+# include "pathnames.h"
# include <sys/ioctl.h>
# include <sys/param.h>
-# include <signal.h>
+# include <netdb.h>
# include <pwd.h>
-# include "sendmail.h"
-# include "pathnames.h"
/*
** CONF.C -- Sendmail Configuration Tables.
@@ -87,7 +87,7 @@ struct hdrinfo HdrInfo[] =
"from", H_FROM,
"reply-to", H_FROM,
"full-name", H_ACHECK,
- "return-receipt-to", H_FROM /* |H_RECEIPTTO */,
+ "return-receipt-to", H_FROM|H_RECEIPTTO,
"errors-to", H_FROM|H_ERRORSTO,
/* destination fields */
@@ -128,8 +128,6 @@ struct hdrinfo HdrInfo[] =
** Location of system files/databases/etc.
*/
-char *ConfFile = _PATH_SENDMAILCF; /* runtime configuration */
-char *FreezeFile = _PATH_SENDMAILFC; /* frozen version of above */
char *PidFile = _PATH_SENDMAILPID; /* stores daemon proc id */
@@ -146,7 +144,8 @@ struct prival PrivacyValues[] =
"needvrfyhelo", PRIV_NEEDVRFYHELO,
"noexpn", PRIV_NOEXPN,
"novrfy", PRIV_NOVRFY,
- "restrictmailq", PRIV_RESTRMAILQ,
+ "restrictmailq", PRIV_RESTRICTMAILQ,
+ "restrictqrun", PRIV_RESTRICTQRUN,
"authwarnings", PRIV_AUTHWARNINGS,
"goaway", PRIV_GOAWAY,
NULL, 0,
@@ -159,6 +158,25 @@ struct prival PrivacyValues[] =
*/
int DtableSize = 50; /* max open files; reset in 4.2bsd */
+
+
+/*
+** Following should be config parameters (and probably will be in
+** future releases). In the meantime, setting these is considered
+** unsupported, and is intentionally undocumented.
+*/
+
+#ifdef BROKENSMTPPEERS
+bool BrokenSmtpPeers = TRUE; /* set if you have broken SMTP peers */
+#else
+bool BrokenSmtpPeers = FALSE; /* set if you have broken SMTP peers */
+#endif
+#ifdef NOLOOPBACKCHECK
+bool CheckLoopBack = FALSE; /* set to check HELO loopback */
+#else
+bool CheckLoopBack = TRUE; /* set to check HELO loopback */
+#endif
+
/*
** SETDEFAULTS -- set default values
**
@@ -491,7 +509,12 @@ checkcompat(to, e)
# ifdef lint
if (to == NULL)
to++;
-# endif lint
+# endif /* lint */
+
+ if (tTd(49, 1))
+ printf("checkcompat(to=%s, from=%s)\n",
+ to->q_paddr, e->e_from.q_paddr);
+
# ifdef EXAMPLE_CODE
/* this code is intended as an example only */
register STAB *s;
@@ -508,6 +531,29 @@ checkcompat(to, e)
return (EX_OK);
}
/*
+** SETSIGNAL -- set a signal handler
+**
+** This is essentially old BSD "signal(3)".
+*/
+
+sigfunc_t
+setsignal(sig, handler)
+ int sig;
+ sigfunc_t handler;
+{
+#if defined(SYS5SIGNALS) || defined(BSD4_3) || defined(_AUX_SOURCE)
+ return signal(sig, handler);
+#else
+ struct sigaction n, o;
+
+ bzero(&n, sizeof n);
+ n.sa_handler = handler;
+ if (sigaction(sig, &n, &o) < 0)
+ return SIG_ERR;
+ return o.sa_handler;
+#endif
+}
+ /*
** HOLDSIGS -- arrange to hold all signals
**
** Parameters:
@@ -542,6 +588,25 @@ rlsesigs()
{
}
/*
+** INIT_MD -- do machine dependent initializations
+**
+** Systems that have global modes that should be set should do
+** them here rather than in main.
+*/
+
+#ifdef _AUX_SOURCE
+# include <compat.h>
+#endif
+
+init_md(argc, argv)
+ int argc;
+ char **argv;
+{
+#ifdef _AUX_SOURCE
+ setcompat(getcompat() | COMPAT_BSDPROT);
+#endif
+}
+ /*
** GETLA -- get the current load average
**
** This code stolen from la.c.
@@ -558,71 +623,37 @@ rlsesigs()
/* try to guess what style of load average we have */
#define LA_ZERO 1 /* always return load average as zero */
-#define LA_INT 2 /* read kmem for avenrun; interpret as int */
+#define LA_INT 2 /* read kmem for avenrun; interpret as long */
#define LA_FLOAT 3 /* read kmem for avenrun; interpret as float */
#define LA_SUBR 4 /* call getloadavg */
+#define LA_MACH 5 /* MACH load averages (as on NeXT boxes) */
+#define LA_SHORT 6 /* read kmem for avenrun; interpret as short */
+#define LA_PROCSTR 7 /* read string ("1.17") from /proc/loadavg */
+/* do guesses based on general OS type */
#ifndef LA_TYPE
-# if defined(sun) && !defined(BSD)
-# define LA_TYPE LA_INT
-# endif
-# if defined(mips) || defined(__alpha)
- /* Ultrix or OSF/1 or RISC/os */
-# define LA_TYPE LA_INT
-# define LA_AVENRUN "avenrun"
-# endif
-# if defined(__hpux)
-# define LA_TYPE LA_FLOAT
-# define LA_AVENRUN "avenrun"
-# endif
-# if defined(__NeXT__)
-# define LA_TYPE LA_ZERO
-# endif
-
-/* now do the guesses based on general OS type */
-# ifndef LA_TYPE
-# if defined(SYSTEM5)
-# define LA_TYPE LA_INT
-# define LA_AVENRUN "avenrun"
-# else
-# if defined(BSD)
-# define LA_TYPE LA_SUBR
-# else
-# define LA_TYPE LA_ZERO
-# endif
-# endif
-# endif
+# define LA_TYPE LA_ZERO
#endif
-#if (LA_TYPE == LA_INT) || (LA_TYPE == LA_FLOAT)
+#if (LA_TYPE == LA_INT) || (LA_TYPE == LA_FLOAT) || (LA_TYPE == LA_SHORT)
#include <nlist.h>
#ifndef LA_AVENRUN
-#define LA_AVENRUN "_avenrun"
+# ifdef SYSTEM5
+# define LA_AVENRUN "avenrun"
+# else
+# define LA_AVENRUN "_avenrun"
+# endif
#endif
/* _PATH_UNIX should be defined in <paths.h> */
#ifndef _PATH_UNIX
-# if defined(__hpux)
-# define _PATH_UNIX "/hp-ux"
-# endif
-# if defined(mips) && !defined(ultrix)
- /* powerful RISC/os */
-# define _PATH_UNIX "/unix"
-# endif
-# if defined(Solaris2)
- /* Solaris 2 */
-# define _PATH_UNIX "/kernel/unix"
-# endif
-# if defined(SYSTEM5)
-# ifndef _PATH_UNIX
-# define _PATH_UNIX "/unix"
-# endif
-# endif
-# ifndef _PATH_UNIX
-# define _PATH_UNIX "/vmunix"
-# endif
+# if defined(SYSTEM5)
+# define _PATH_UNIX "/unix"
+# else
+# define _PATH_UNIX "/vmunix"
+# endif
#endif
struct nlist Nl[] =
@@ -641,12 +672,12 @@ struct nlist Nl[] =
# define FSHIFT 10
# endif
-# if (LA_TYPE == LA_INT)
+# if (LA_TYPE == LA_INT) || (LA_TYPE == LA_SHORT)
# define FSHIFT 8
# endif
#endif
-#if (LA_TYPE == LA_INT) && !defined(FSCALE)
+#if ((LA_TYPE == LA_INT) || (LA_TYPE == LA_SHORT)) && !defined(FSCALE)
# define FSCALE (1 << FSHIFT)
#endif
@@ -656,7 +687,11 @@ getla()
#if LA_TYPE == LA_INT
long avenrun[3];
#else
+# if LA_TYPE == LA_SHORT
+ short avenrun[3];
+# else
double avenrun[3];
+# endif
#endif
extern off_t lseek();
extern int errno;
@@ -697,7 +732,7 @@ getla()
printf("getla: lseek or read: %s\n", errstring(errno));
return (-1);
}
-#if LA_TYPE == LA_INT
+#if (LA_TYPE == LA_INT) || (LA_TYPE == LA_SHORT)
if (tTd(3, 5))
{
printf("getla: avenrun = %d", avenrun[0]);
@@ -725,6 +760,22 @@ getla()
#else
#if LA_TYPE == LA_SUBR
+#ifdef DGUX
+
+#include <sys/dg_sys_info.h>
+
+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];
@@ -740,6 +791,88 @@ getla()
return ((int) (avenrun[0] + 0.5));
}
+#endif /* DGUX */
+#else
+#if LA_TYPE == LA_MACH
+
+/*
+** This has been tested on NEXTSTEP release 2.1/3.X.
+*/
+
+#if defined(NX_CURRENT_COMPILER_RELEASE) && NX_CURRENT_COMPILER_RELEASE > NX_COMPILER_RELEASE_3_0
+# include <mach/mach.h>
+#else
+# include <mach.h>
+#endif
+
+getla()
+{
+ processor_set_t default_set;
+ kern_return_t error;
+ unsigned int info_count;
+ struct processor_set_basic_info info;
+ host_t host;
+
+ error = processor_set_default(host_self(), &default_set);
+ if (error != KERN_SUCCESS)
+ return -1;
+ info_count = PROCESSOR_SET_BASIC_INFO_COUNT;
+ if (processor_set_info(default_set, PROCESSOR_SET_BASIC_INFO,
+ &host, (processor_set_info_t)&info,
+ &info_count) != KERN_SUCCESS)
+ {
+ return -1;
+ }
+ return (int) (info.load_average + (LOAD_SCALE / 2)) / LOAD_SCALE;
+}
+
+
+#else
+#if LA_TYPE == LA_PROCSTR
+
+/*
+** Read /proc/loadavg for the load average. This is assumed to be
+** in a format like "0.15 0.12 0.06".
+**
+** Initially intended for Linux. This has been in the kernel
+** since at least 0.99.15.
+*/
+
+# ifndef _PATH_LOADAVG
+# define _PATH_LOADAVG "/proc/loadavg"
+# endif
+
+int
+getla()
+{
+ double avenrun;
+ register int result;
+ FILE *fp;
+
+ fp = fopen(_PATH_LOADAVG, "r");
+ if (fp == NULL)
+ {
+ if (tTd(3, 1))
+ printf("getla: fopen(%s): %s\n",
+ _PATH_LOADAVG, errstring(errno));
+ return -1;
+ }
+ result = fscanf(fp, "%lf", &avenrun);
+ fclose(fp);
+ if (result != 1)
+ {
+ if (tTd(3, 1))
+ printf("getla: fscanf() = %d: %s\n",
+ result, errstring(errno));
+ return -1;
+ }
+
+ if (tTd(3, 1))
+ printf("getla(): %.2f\n", avenrun);
+
+ return ((int) (avenrun + 0.5));
+}
+
#else
getla()
@@ -751,6 +884,55 @@ getla()
#endif
#endif
+#endif
+#endif
+
+
+/*
+ * Copyright 1989 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. M.I.T. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors: Many and varied...
+ */
+
+/* Non Apollo stuff removed by Don Lewis 11/15/93 */
+#ifndef lint
+static char rcsid[] = "@(#)$Id: conf.c,v 1.5.2.1 1994/04/18 03:53:45 rgrimes Exp $";
+#endif /* !lint */
+
+#ifdef apollo
+# undef volatile
+# include <apollo/base.h>
+
+/* ARGSUSED */
+int getloadavg( call_data )
+ caddr_t call_data; /* pointer to (double) return value */
+{
+ double *avenrun = (double *) call_data;
+ int i;
+ status_$t st;
+ long loadav[3];
+ proc1_$get_loadav(loadav, &st);
+ *avenrun = loadav[0] / (double) (1 << 16);
+ return(0);
+}
+# endif /* apollo */
/*
** SHOULDQUEUE -- should this message be queued or sent?
**
@@ -822,12 +1004,19 @@ refuseconnections()
*/
#ifdef SETPROCTITLE
+# ifdef HASSETPROCTITLE
+ *** ERROR *** Cannot have both SETPROCTITLE and HASSETPROCTITLE defined
+# endif
# ifdef __hpux
# include <sys/pstat.h>
# endif
# ifdef BSD4_4
# include <machine/vmparam.h>
# include <sys/exec.h>
+# ifdef __bsdi__
+# undef PS_STRINGS /* BSDI 1.0 doesn't do PS_STRINGS as we expect */
+# define PROCTITLEPAD '\0'
+# endif
# ifdef PS_STRINGS
# define SETPROC_STATIC static
# endif
@@ -837,6 +1026,12 @@ refuseconnections()
# endif
#endif
+#ifndef PROCTITLEPAD
+# define PROCTITLEPAD ' '
+#endif
+
+#ifndef HASSETPROCTITLE
+
/*VARARGS1*/
#ifdef __STDC__
setproctitle(char *fmt, ...)
@@ -886,11 +1081,13 @@ setproctitle(fmt, va_alist)
(void) strcpy(Argv[0], buf);
p = &Argv[0][i];
while (p < LastArgv)
- *p++ = ' ';
+ *p++ = PROCTITLEPAD;
# endif
# endif
# endif /* SETPROCTITLE */
}
+
+#endif
/*
** REAPCHILD -- pick up the body of my child, lest it become a zombie
**
@@ -904,12 +1101,11 @@ setproctitle(fmt, va_alist)
** Picks up extant zombies.
*/
-# include <sys/wait.h>
-
void
reapchild()
{
-# if defined(WIFEXITED) && !defined(__NeXT__)
+ int olderrno = errno;
+# ifdef HASWAITPID
auto int status;
int count;
int pid;
@@ -937,9 +1133,10 @@ reapchild()
continue;
# endif /* WNOHANG */
# endif
-# ifdef SYSTEM5
- (void) signal(SIGCHLD, reapchild);
+# ifdef SYS5SIGNALS
+ (void) setsignal(SIGCHLD, reapchild);
# endif
+ errno = olderrno;
}
/*
** UNSETENV -- remove a variable from the environment
@@ -960,7 +1157,7 @@ reapchild()
** Modifies environ.
*/
-#ifdef UNSETENV
+#ifndef HASUNSETENV
void
unsetenv(name)
@@ -981,7 +1178,7 @@ unsetenv(name)
*pp = pp[1];
}
-#endif /* UNSETENV */
+#endif
/*
** GETDTABLESIZE -- return number of file descriptors
**
@@ -1011,11 +1208,11 @@ getdtsize()
return rl.rlim_cur;
#endif
-# if defined(_SC_OPEN_MAX) && !defined(NO_SYSCONF)
- return sysconf(_SC_OPEN_MAX);
-# else
-# ifdef HASGETDTABLESIZE
+# ifdef HASGETDTABLESIZE
return getdtablesize();
+# else
+# ifdef _SC_OPEN_MAX
+ return sysconf(_SC_OPEN_MAX);
# else
return NOFILE;
# endif
@@ -1090,12 +1287,6 @@ uname(name)
*/
#ifndef HASINITGROUPS
-# if !defined(SYSTEM5) || defined(__hpux)
-# define HASINITGROUPS
-# endif
-#endif
-
-#ifndef HASINITGROUPS
initgroups(name, basegid)
char *name;
@@ -1114,61 +1305,317 @@ initgroups(name, basegid)
pid_t
setsid __P ((void))
{
-# ifdef SYSTEM5
+#ifdef TIOCNOTTY
+ int fd;
+
+ fd = open("/dev/tty", 2);
+ if (fd >= 0)
+ {
+ (void) ioctl(fd, (int) TIOCNOTTY, (char *) 0);
+ (void) close(fd);
+ }
+#endif /* TIOCNOTTY */
+# ifdef SYS5SETPGRP
return setpgrp();
# else
- return 0;
+ return setpgid(0, getpid());
# endif
}
#endif
/*
-** ENOUGHSPACE -- check to see if there is enough free space on the queue fs
+** DGUX_INET_ADDR -- inet_addr for DG/UX
**
-** Only implemented if you have statfs.
+** 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
+*/
+
+#ifdef NEEDGETOPT
+
+/*
+ * Copyright (c) 1985 Regents of the University of California.
+ * All rights reserved. The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
+
+/*
+** this version hacked to add `atend' flag to allow state machine
+** to reset if invoked by the program to scan args for a 2nd time
+*/
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)getopt.c 4.3 (Berkeley) 3/9/86";
+#endif /* LIBC_SCCS and not lint */
+
+#include <stdio.h>
+
+/*
+ * get option letter from argument vector
+ */
+#ifdef _CONVEX_SOURCE
+extern int optind, opterr;
+#else
+int opterr = 1; /* if error message should be printed */
+int optind = 1; /* index into parent argv vector */
+#endif
+int optopt; /* character checked for validity */
+char *optarg; /* argument associated with option */
+
+#define BADCH (int)'?'
+#define EMSG ""
+#define tell(s) if (opterr) {fputs(*nargv,stderr);fputs(s,stderr); \
+ fputc(optopt,stderr);fputc('\n',stderr);return(BADCH);}
+
+getopt(nargc,nargv,ostr)
+ int nargc;
+ char *const *nargv;
+ const char *ostr;
+{
+ static char *place = EMSG; /* option letter processing */
+ static char atend = 0;
+ register char *oli; /* option letter list index */
+
+ if (atend) {
+ atend = 0;
+ place = EMSG;
+ }
+ if(!*place) { /* update scanning pointer */
+ if (optind >= nargc || *(place = nargv[optind]) != '-' || !*++place) {
+ atend++;
+ return(EOF);
+ }
+ if (*place == '-') { /* found "--" */
+ ++optind;
+ atend++;
+ return(EOF);
+ }
+ } /* option letter okay? */
+ if ((optopt = (int)*place++) == (int)':' || !(oli = strchr(ostr,optopt))) {
+ if (!*place) ++optind;
+ tell(": illegal option -- ");
+ }
+ if (*++oli != ':') { /* don't need argument */
+ optarg = NULL;
+ if (!*place) ++optind;
+ }
+ else { /* need an argument */
+ if (*place) optarg = place; /* no white space */
+ else if (nargc <= ++optind) { /* no arg */
+ place = EMSG;
+ tell(": option requires an argument -- ");
+ }
+ else optarg = nargv[optind]; /* white space */
+ place = EMSG;
+ ++optind;
+ }
+ return(optopt); /* dump back option letter */
+}
+
+#endif
+ /*
+** VFPRINTF, VSPRINTF -- for old 4.3 BSD systems missing a real version
+*/
+
+#ifdef NEEDVPRINTF
+
+#define MAXARG 16
+
+vfprintf(fp, fmt, ap)
+ FILE * fp;
+ char * fmt;
+ char ** ap;
+{
+ char * bp[MAXARG];
+ int i = 0;
+
+ while (*ap && i < MAXARG)
+ bp[i++] = *ap++;
+ fprintf(fp, fmt, bp[0], bp[1], bp[2], bp[3],
+ bp[4], bp[5], bp[6], bp[7],
+ bp[8], bp[9], bp[10], bp[11],
+ bp[12], bp[13], bp[14], bp[15]);
+}
+
+vsprintf(s, fmt, ap)
+ char * s;
+ char * fmt;
+ char ** ap;
+{
+ char * bp[MAXARG];
+ int i = 0;
+
+ while (*ap && i < MAXARG)
+ bp[i++] = *ap++;
+ sprintf(s, fmt, bp[0], bp[1], bp[2], bp[3],
+ bp[4], bp[5], bp[6], bp[7],
+ bp[8], bp[9], bp[10], bp[11],
+ bp[12], bp[13], bp[14], bp[15]);
+}
+
+#endif
+ /*
+** USERSHELLOK -- tell if a user's shell is ok for unrestricted use
**
** Parameters:
-** msize -- the size to check against. If zero, we don't yet
-** know how big the message will be, so just check for
-** a "reasonable" amount.
+** shell -- the user's shell from /etc/passwd
**
** Returns:
-** TRUE if there is enough space.
-** FALSE otherwise.
+** TRUE -- if it is ok to use this for unrestricted access.
+** FALSE -- if the shell is restricted.
*/
-#ifndef HASSTATFS
-# if defined(BSD4_4) || defined(__osf__)
-# define HASSTATFS
+#if !HASGETUSERSHELL
+
+# ifndef _PATH_SHELLS
+# define _PATH_SHELLS "/etc/shells"
# endif
+
+char *DefaultUserShells[] =
+{
+ "/bin/sh",
+ "/usr/bin/sh",
+ "/bin/csh",
+ "/usr/bin/csh",
+#ifdef __hpux
+ "/bin/rsh",
+ "/bin/ksh",
+ "/bin/rksh",
+ "/bin/pam",
+ "/usr/bin/keysh",
+ "/bin/posix/sh",
#endif
+ NULL
+};
-#ifdef HASSTATFS
-# undef HASUSTAT
#endif
-#if defined(HASUSTAT)
-# include <ustat.h>
+#define WILDCARD_SHELL "/SENDMAIL/ANY/SHELL/"
+
+bool
+usershellok(shell)
+ char *shell;
+{
+#if HASGETUSERSHELL
+ register char *p;
+ extern char *getusershell();
+
+ setusershell();
+ while ((p = getusershell()) != NULL)
+ if (strcmp(p, shell) == 0 || strcmp(p, WILDCARD_SHELL) == 0)
+ break;
+ endusershell();
+ return p != NULL;
+#else
+ register FILE *shellf;
+ char buf[MAXLINE];
+
+ shellf = fopen(_PATH_SHELLS, "r");
+ if (shellf == NULL)
+ {
+ /* no /etc/shells; see if it is one of the std shells */
+ char **d;
+
+ for (d = DefaultUserShells; *d != NULL; d++)
+ {
+ if (strcmp(shell, *d) == 0)
+ return TRUE;
+ }
+ return FALSE;
+ }
+
+ while (fgets(buf, sizeof buf, shellf) != NULL)
+ {
+ register char *p, *q;
+
+ p = buf;
+ while (*p != '\0' && *p != '#' && *p != '/')
+ p++;
+ if (*p == '#' || *p == '\0')
+ continue;
+ q = p;
+ while (*p != '\0' && *p != '#' && !isspace(*p))
+ p++;
+ *p = '\0';
+ if (strcmp(shell, q) == 0 || strcmp(WILDCARD_SHELL, q) == 0)
+ {
+ fclose(shellf);
+ return TRUE;
+ }
+ }
+ fclose(shellf);
+ return FALSE;
#endif
+}
+ /*
+** FREESPACE -- see how much free space is on the queue filesystem
+**
+** Only implemented if you have statfs.
+**
+** Parameters:
+** dir -- the directory in question.
+** bsize -- a variable into which the filesystem
+** block size is stored.
+**
+** Returns:
+** The number of bytes free on the queue filesystem.
+** -1 if the statfs call fails.
+**
+** Side effects:
+** Puts the filesystem block size into bsize.
+*/
-#ifdef HASSTATFS
-# if defined(sgi) || defined(apollo)
-# include <sys/statfs.h>
-# else
-# if (defined(sun) && !defined(BSD)) || defined(__hpux)
-# include <sys/vfs.h>
-# else
-# include <sys/mount.h>
-# endif
-# endif
+/* statfs types */
+#define SFS_NONE 0 /* no statfs implementation */
+#define SFS_USTAT 1 /* use ustat */
+#define SFS_4ARGS 2 /* use four-argument statfs call */
+#define SFS_VFS 3 /* use <sys/vfs.h> implementation */
+#define SFS_MOUNT 4 /* use <sys/mount.h> implementation */
+#define SFS_STATFS 5 /* use <sys/statfs.h> implementation */
+
+#ifndef SFS_TYPE
+# define SFS_TYPE SFS_NONE
#endif
-bool
-enoughspace(msize)
- long msize;
+#if SFS_TYPE == SFS_USTAT
+# include <ustat.h>
+#endif
+#if SFS_TYPE == SFS_4ARGS || SFS_TYPE == SFS_STATFS
+# include <sys/statfs.h>
+#endif
+#if SFS_TYPE == SFS_VFS
+# include <sys/vfs.h>
+#endif
+#if SFS_TYPE == SFS_MOUNT
+# include <sys/mount.h>
+#endif
+
+long
+freespace(dir, bsize)
+ char *dir;
+ long *bsize;
{
-#if defined(HASSTATFS) || defined(HASUSTAT)
-# if defined(HASUSTAT)
+#if SFS_TYPE != SFS_NONE
+# if SFS_TYPE == SFS_USTAT
struct ustat fs;
struct stat statbuf;
# define FSBLOCKSIZE DEV_BSIZE
@@ -1181,46 +1628,81 @@ enoughspace(msize)
# else
struct statfs fs;
# define FSBLOCKSIZE fs.f_bsize
+# if defined(_SCO_unix_) || defined(IRIX) || defined(apollo)
+# define f_bavail f_bfree
+# endif
# endif
# endif
extern int errno;
- if (MinBlocksFree <= 0 && msize <= 0)
- {
- if (tTd(4, 80))
- printf("enoughspace: no threshold\n");
- return TRUE;
- }
-
-# if defined(HASUSTAT)
- if (stat(QueueDir, &statbuf) == 0 && ustat(statbuf.st_dev, &fs) == 0)
+# if SFS_TYPE == SFS_USTAT
+ if (stat(dir, &statbuf) == 0 && ustat(statbuf.st_dev, &fs) == 0)
# else
-# if defined(sgi) || defined(apollo)
- if (statfs(QueueDir, &fs, sizeof fs, 0) == 0)
+# if SFS_TYPE == SFS_4ARGS
+ if (statfs(dir, &fs, sizeof fs, 0) == 0)
# else
# if defined(ultrix)
- if (statfs(QueueDir, &fs) > 0)
+ if (statfs(dir, &fs) > 0)
# else
- if (statfs(QueueDir, &fs) == 0)
+ if (statfs(dir, &fs) == 0)
# endif
# endif
# endif
{
+ if (bsize != NULL)
+ *bsize = FSBLOCKSIZE;
+ return (fs.f_bavail);
+ }
+#endif
+ return (-1);
+}
+ /*
+** ENOUGHSPACE -- check to see if there is enough free space on the queue fs
+**
+** Only implemented if you have statfs.
+**
+** Parameters:
+** msize -- the size to check against. If zero, we don't yet
+** know how big the message will be, so just check for
+** a "reasonable" amount.
+**
+** Returns:
+** TRUE if there is enough space.
+** FALSE otherwise.
+*/
+
+bool
+enoughspace(msize)
+ long msize;
+{
+ long bfree, bsize;
+
+ if (MinBlocksFree <= 0 && msize <= 0)
+ {
+ if (tTd(4, 80))
+ printf("enoughspace: no threshold\n");
+ return TRUE;
+ }
+
+ if ((bfree = freespace(QueueDir, &bsize)) >= 0)
+ {
if (tTd(4, 80))
printf("enoughspace: bavail=%ld, need=%ld\n",
- fs.f_bavail, msize);
+ bfree, msize);
/* convert msize to block count */
- msize = msize / FSBLOCKSIZE + 1;
+ msize = msize / bsize + 1;
if (MinBlocksFree >= 0)
msize += MinBlocksFree;
- if (fs.f_bavail < msize)
+ if (bfree < msize)
{
#ifdef LOG
if (LogLevel > 0)
- syslog(LOG_ALERT, "%s: low on space (have %ld, need %ld)",
- QueueDir, fs.f_bavail, msize);
+ syslog(LOG_ALERT,
+ "%s: low on space (have %ld, %s needs %ld in %s)",
+ CurEnv->e_id, bfree,
+ CurHostName, msize, QueueDir);
#endif
return FALSE;
}
@@ -1228,7 +1710,6 @@ enoughspace(msize)
else if (tTd(4, 80))
printf("enoughspace failure: min=%ld, need=%ld: %s\n",
MinBlocksFree, msize, errstring(errno));
-#endif
return TRUE;
}
/*
@@ -1322,7 +1803,10 @@ transienterror(err)
#ifdef EADDRNOTAVAIL
case EADDRNOTAVAIL: /* Can't assign requested address */
#endif
-#ifdef ENOSR
+#ifdef ETXTBSY
+ case ETXTBSY: /* (Apollo) file locked */
+#endif
+#if defined(ENOSR) && (!defined(ENOBUFS) || (ENOBUFS != ENOSR))
case ENOSR: /* Out of streams resources */
#endif
return TRUE;
@@ -1332,11 +1816,12 @@ transienterror(err)
return FALSE;
}
/*
-** LOCKFILE -- lock a file using flock or (shudder) lockf
+** LOCKFILE -- lock a file using flock or (shudder) fcntl locking
**
** Parameters:
** fd -- the file descriptor of the file.
** filename -- the file name (for error messages).
+** ext -- the filename extension.
** type -- type of the lock. Bits can be:
** LOCK_EX -- exclusive lock.
** LOCK_NB -- non-blocking.
@@ -1347,15 +1832,20 @@ transienterror(err)
*/
bool
-lockfile(fd, filename, type)
+lockfile(fd, filename, ext, type)
int fd;
char *filename;
+ char *ext;
int type;
{
-# ifdef LOCKF
+# if !HASFLOCK
int action;
struct flock lfd;
+ if (ext == NULL)
+ ext = "";
+
+ bzero(&lfd, sizeof lfd);
if (bitset(LOCK_UN, type))
lfd.l_type = F_UNLCK;
else if (bitset(LOCK_EX, type))
@@ -1368,19 +1858,492 @@ lockfile(fd, filename, type)
else
action = F_SETLKW;
- lfd.l_whence = lfd.l_start = lfd.l_len = 0;
+ if (tTd(55, 60))
+ printf("lockfile(%s%s, action=%d, type=%d): ",
+ filename, ext, action, lfd.l_type);
if (fcntl(fd, action, &lfd) >= 0)
+ {
+ if (tTd(55, 60))
+ printf("SUCCESS\n");
return TRUE;
+ }
+
+ if (tTd(55, 60))
+ printf("(%s) ", errstring(errno));
+
+ /*
+ ** On SunOS, if you are testing using -oQ/tmp/mqueue or
+ ** -oA/tmp/aliases or anything like that, and /tmp is mounted
+ ** as type "tmp" (that is, served from swap space), the
+ ** previous fcntl will fail with "Invalid argument" errors.
+ ** Since this is fairly common during testing, we will assume
+ ** that this indicates that the lock is successfully grabbed.
+ */
+
+ if (errno == EINVAL)
+ {
+ if (tTd(55, 60))
+ printf("SUCCESS\n");
+ return TRUE;
+ }
if (!bitset(LOCK_NB, type) || (errno != EACCES && errno != EAGAIN))
- syserr("cannot lockf(%s, %o)", filename, type);
+ {
+ int omode = -1;
+# ifdef F_GETFL
+ int oerrno = errno;
+
+ (void) fcntl(fd, F_GETFL, &omode);
+ errno = oerrno;
+# endif
+ syserr("cannot lockf(%s%s, fd=%d, type=%o, omode=%o, euid=%d)",
+ filename, ext, fd, type, omode, geteuid());
+ }
# else
+ if (ext == NULL)
+ ext = "";
+
+ if (tTd(55, 60))
+ printf("lockfile(%s%s, type=%o): ", filename, ext, type);
+
if (flock(fd, type) >= 0)
+ {
+ if (tTd(55, 60))
+ printf("SUCCESS\n");
return TRUE;
+ }
+
+ if (tTd(55, 60))
+ printf("(%s) ", errstring(errno));
if (!bitset(LOCK_NB, type) || errno != EWOULDBLOCK)
- syserr("cannot flock(%s, %o)", filename, type);
+ {
+ int omode = -1;
+# ifdef F_GETFL
+ int oerrno = errno;
+
+ (void) fcntl(fd, F_GETFL, &omode);
+ errno = oerrno;
+# endif
+ syserr("cannot flock(%s%s, fd=%d, type=%o, omode=%o, euid=%d)",
+ filename, ext, fd, type, omode, geteuid());
+ }
# endif
+ if (tTd(55, 60))
+ printf("FAIL\n");
+ return FALSE;
+}
+ /*
+** CHOWNSAFE -- tell if chown is "safe" (executable only by root)
+**
+** Parameters:
+** fd -- the file descriptor to check.
+**
+** Returns:
+** TRUE -- if only root can chown the file to an arbitrary
+** user.
+** FALSE -- if an arbitrary user can give away a file.
+*/
+
+#if defined(__FreeBSD__) && defined(_POSIX_CHOWN_RESTRICTED)
+# undef _POSIX_CHOWN_RESTRICTED
+# define _POSIX_CHOWN_RESTRICTED 1
+#endif
+
+bool
+chownsafe(fd)
+ int fd;
+{
+#ifdef __hpux
+ char *s;
+ int tfd;
+ uid_t o_uid, o_euid;
+ gid_t o_gid, o_egid;
+ bool rval;
+ struct stat stbuf;
+
+ o_uid = getuid();
+ o_euid = geteuid();
+ o_gid = getgid();
+ o_egid = getegid();
+ fstat(fd, &stbuf);
+ setresuid(stbuf.st_uid, stbuf.st_uid, -1);
+ setresgid(stbuf.st_gid, stbuf.st_gid, -1);
+ s = tmpnam(NULL);
+ tfd = open(s, O_RDONLY|O_CREAT, 0600);
+ rval = fchown(tfd, DefUid, DefGid) != 0;
+ close(tfd);
+ unlink(s);
+ setreuid(o_uid, o_euid);
+ setresgid(o_gid, o_egid, -1);
+ return rval;
+#else
+# ifdef _POSIX_CHOWN_RESTRICTED
+# if _POSIX_CHOWN_RESTRICTED == -1
+ return FALSE;
+# else
+ return TRUE;
+# endif
+# else
+# ifdef _PC_CHOWN_RESTRICTED
+ return fpathconf(fd, _PC_CHOWN_RESTRICTED) > 0;
+# else
+# ifdef BSD
+ return TRUE;
+# else
+ return FALSE;
+# endif
+# endif
+# endif
+#endif
+}
+ /*
+** GETCFNAME -- return the name of the .cf file.
+**
+** Some systems (e.g., NeXT) determine this dynamically.
+*/
+
+char *
+getcfname()
+{
+ if (ConfFile != NULL)
+ return ConfFile;
+#ifdef NETINFO
+ {
+ extern char *ni_propval();
+ char *cflocation;
+
+ cflocation = ni_propval("/locations/sendmail", "sendmail.cf");
+ if (cflocation != NULL)
+ return cflocation;
+ }
+#endif
+ 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.
+**
+** Side Effects:
+** It is reasonable to set mode flags here to tweak
+** processing in other parts of the code if necessary.
+** For example, if you are a vendor that uses $%y to
+** indicate YP lookups, you could enable that here.
+*/
+
+bool
+setvendor(vendor)
+ char *vendor;
+{
+ if (strcasecmp(vendor, "Berkeley") == 0)
+ return TRUE;
+
+ /* add vendor extensions here */
+
return FALSE;
}
+ /*
+** STRTOL -- convert string to long integer
+**
+** For systems that don't have it in the C library.
+**
+** This is taken verbatim from the 4.4-Lite C library.
+*/
+
+#ifdef NEEDSTRTOL
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)strtol.c 8.1 (Berkeley) 6/4/93";
+#endif /* LIBC_SCCS and not lint */
+
+#include <limits.h>
+
+/*
+ * Convert a string to a long integer.
+ *
+ * Ignores `locale' stuff. Assumes that the upper and lower case
+ * alphabets and digits are each contiguous.
+ */
+
+long
+strtol(nptr, endptr, base)
+ const char *nptr;
+ char **endptr;
+ register int base;
+{
+ register const char *s = nptr;
+ register unsigned long acc;
+ register int c;
+ register unsigned long cutoff;
+ register int neg = 0, any, cutlim;
+
+ /*
+ * Skip white space and pick up leading +/- sign if any.
+ * If base is 0, allow 0x for hex and 0 for octal, else
+ * assume decimal; if base is already 16, allow 0x.
+ */
+ do {
+ c = *s++;
+ } while (isspace(c));
+ if (c == '-') {
+ neg = 1;
+ c = *s++;
+ } else if (c == '+')
+ c = *s++;
+ if ((base == 0 || base == 16) &&
+ c == '0' && (*s == 'x' || *s == 'X')) {
+ c = s[1];
+ s += 2;
+ base = 16;
+ }
+ if (base == 0)
+ base = c == '0' ? 8 : 10;
+
+ /*
+ * Compute the cutoff value between legal numbers and illegal
+ * numbers. That is the largest legal value, divided by the
+ * base. An input number that is greater than this value, if
+ * followed by a legal input character, is too big. One that
+ * is equal to this value may be valid or not; the limit
+ * between valid and invalid numbers is then based on the last
+ * digit. For instance, if the range for longs is
+ * [-2147483648..2147483647] and the input base is 10,
+ * cutoff will be set to 214748364 and cutlim to either
+ * 7 (neg==0) or 8 (neg==1), meaning that if we have accumulated
+ * a value > 214748364, or equal but the next digit is > 7 (or 8),
+ * the number is too big, and we will return a range error.
+ *
+ * Set any if any `digits' consumed; make it negative to indicate
+ * overflow.
+ */
+ cutoff = neg ? -(unsigned long)LONG_MIN : LONG_MAX;
+ cutlim = cutoff % (unsigned long)base;
+ cutoff /= (unsigned long)base;
+ for (acc = 0, any = 0;; c = *s++) {
+ if (isdigit(c))
+ c -= '0';
+ else if (isalpha(c))
+ c -= isupper(c) ? 'A' - 10 : 'a' - 10;
+ else
+ break;
+ if (c >= base)
+ break;
+ if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim)
+ any = -1;
+ else {
+ any = 1;
+ acc *= base;
+ acc += c;
+ }
+ }
+ if (any < 0) {
+ acc = neg ? LONG_MIN : LONG_MAX;
+ errno = ERANGE;
+ } else if (neg)
+ acc = -acc;
+ if (endptr != 0)
+ *endptr = (char *)(any ? s - 1 : nptr);
+ return (acc);
+}
+
+#endif
+ /*
+** SOLARIS_GETHOSTBY{NAME,ADDR} -- compatibility routines for gethostbyXXX
+**
+** Solaris versions prior through 2.3 don't properly deliver a
+** canonical h_name field. This tries to work around it.
+*/
+
+#ifdef SOLARIS
+
+struct hostent *
+solaris_gethostbyname(name)
+ const char *name;
+{
+# ifdef SOLARIS_2_3
+ static struct hostent hp;
+ static char buf[1000];
+ extern struct hostent *_switch_gethostbyname_r();
+
+ return _switch_gethostbyname_r(name, &hp, buf, sizeof(buf), &h_errno);
+# else
+ extern struct hostent *__switch_gethostbyname();
+
+ return __switch_gethostbyname(name);
+# endif
+}
+
+struct hostent *
+solaris_gethostbyaddr(addr, len, type)
+ const char *addr;
+ int len;
+ int type;
+{
+# ifdef SOLARIS_2_3
+ static struct hostent hp;
+ static char buf[1000];
+ extern struct hostent *_switch_gethostbyaddr_r();
+
+ return _switch_gethostbyaddr_r(addr, len, type, &hp, buf, sizeof(buf), &h_errno);
+# else
+ extern struct hostent *__switch_gethostbyaddr();
+
+ return __switch_gethostbyaddr(addr, len, type);
+# endif
+}
+
+#endif
+ /*
+** NI_PROPVAL -- netinfo property value lookup routine
+**
+** Parameters:
+** directory -- the Netinfo directory name.
+** propname -- the Netinfo property name.
+**
+** Returns:
+** NULL -- if:
+** 1. the directory is not found
+** 2. the property name is not found
+** 3. the property contains multiple values
+** 4. some error occured
+** else -- the location of the config file.
+**
+** Notes:
+** Caller should free the return value of ni_proval
+*/
+
+#ifdef NETINFO
+
+# include <netinfo/ni.h>
+
+# define LOCAL_NETINFO_DOMAIN "."
+# define PARENT_NETINFO_DOMAIN ".."
+# define MAX_NI_LEVELS 256
+
+char *
+ni_propval(directory, propname)
+ char *directory;
+ char *propname;
+{
+ char *propval = NULL;
+ int i;
+ void *ni = NULL;
+ void *lastni = NULL;
+ ni_status nis;
+ ni_id nid;
+ ni_namelist ninl;
+
+ /*
+ ** If the passed directory and property name are found
+ ** in one of netinfo domains we need to search (starting
+ ** from the local domain moving all the way back to the
+ ** root domain) set propval to the property's value
+ ** and return it.
+ */
+
+ for (i = 0; i < MAX_NI_LEVELS; ++i)
+ {
+ if (i == 0)
+ {
+ nis = ni_open(NULL, LOCAL_NETINFO_DOMAIN, &ni);
+ }
+ else
+ {
+ if (lastni != NULL)
+ ni_free(lastni);
+ lastni = ni;
+ nis = ni_open(lastni, PARENT_NETINFO_DOMAIN, &ni);
+ }
+
+ /*
+ ** Don't bother if we didn't get a handle on a
+ ** proper domain. This is not necessarily an error.
+ ** We would get a positive ni_status if, for instance
+ ** we never found the directory or property and tried
+ ** to open the parent of the root domain!
+ */
+
+ if (nis != 0)
+ break;
+
+ /*
+ ** Find the path to the server information.
+ */
+
+ if (ni_pathsearch(ni, &nid, directory) != 0)
+ continue;
+
+ /*
+ ** Find "host" information.
+ */
+
+ if (ni_lookupprop(ni, &nid, propname, &ninl) != 0)
+ continue;
+
+ /*
+ ** If there's only one name in
+ ** the list, assume we've got
+ ** what we want.
+ */
+
+ if (ninl.ni_namelist_len == 1)
+ {
+ propval = ni_name_dup(ninl.ni_namelist_val[0]);
+ break;
+ }
+ }
+
+ /*
+ ** Clean up.
+ */
+
+ if (ni != NULL)
+ ni_free(ni);
+ if (lastni != NULL && ni != lastni)
+ ni_free(lastni);
+
+ return propval;
+}
+
+#endif /* NETINFO */
+ /*
+** HARD_SYSLOG -- call syslog repeatedly until it works
+**
+** Needed on HP-UX, which apparently doesn't guarantee that
+** syslog succeeds during interrupt handlers.
+*/
+
+#ifdef __hpux
+
+# define MAXSYSLOGTRIES 100
+# undef syslog
+
+# ifdef __STDC__
+hard_syslog(int pri, char *msg, ...)
+# else
+hard_syslog(pri, msg, va_alist)
+ int pri;
+ char *msg;
+ va_dcl
+# endif
+{
+ int i;
+ char buf[SYSLOG_BUFSIZE * 2];
+ VA_LOCAL_DECL;
+
+ VA_START(msg);
+ vsprintf(buf, msg, ap);
+ VA_END;
+
+ for (i = MAXSYSLOGTRIES; --i >= 0 && syslog(pri, "%s", buf) < 0; )
+ continue;
+}
+
+#endif
diff --git a/usr.sbin/sendmail/src/conf.h b/usr.sbin/sendmail/src/conf.h
index e3ea48719830..8341de5cb2de 100644
--- a/usr.sbin/sendmail/src/conf.h
+++ b/usr.sbin/sendmail/src/conf.h
@@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)conf.h 8.3 (Berkeley) 7/13/93
+ * @(#)conf.h 8.96 (Berkeley) 3/11/94
*/
/*
@@ -39,13 +39,17 @@
*/
# include <sys/param.h>
+# include <sys/types.h>
# include <sys/stat.h>
+# include <sys/file.h>
+# include <sys/wait.h>
# include <fcntl.h>
+# include <signal.h>
-/*
+/**********************************************************************
** Table sizes, etc....
** There shouldn't be much need to change these....
-*/
+**********************************************************************/
# define MAXLINE 2048 /* max line length */
# define MAXNAME 256 /* max length of a name */
@@ -59,146 +63,846 @@
# define MAXKEY 128 /* maximum size of a database key */
# define MEMCHUNKSIZE 1024 /* chunk size for memory allocation */
# define MAXUSERENVIRON 100 /* max envars saved, must be >= 3 */
-# define MAXIPADDR 16 /* max # of IP addrs for this host */
# define MAXALIASDB 12 /* max # of alias databases */
-# define PSBUFSIZE (MAXLINE + MAXATOM) /* size of prescan buffer */
# ifndef QUEUESIZE
# define QUEUESIZE 1000 /* max # of jobs per queue run */
# endif
-/*
+/**********************************************************************
** Compilation options.
**
** #define these if they are available; comment them out otherwise.
-*/
+**********************************************************************/
# define LOG 1 /* enable logging */
# define UGLYUUCP 1 /* output ugly UUCP From lines */
+# define NETUNIX 1 /* include unix domain support */
# define NETINET 1 /* include internet support */
# define SETPROCTITLE 1 /* munge argv to display current status */
-# define NAMED_BIND 1 /* use Berkeley Internet Domain Server */
# define MATCHGECOS 1 /* match user names from gecos field */
# define XDEBUG 1 /* enable extended debugging */
-
# ifdef NEWDB
# define USERDB 1 /* look in user database (requires NEWDB) */
# endif
+/**********************************************************************
+** 0/1 Compilation options.
+** #define these to 1 if they are available;
+** #define them to 0 otherwise.
+**********************************************************************/
+
+# ifndef NAMED_BIND
+# define NAMED_BIND 1 /* use Berkeley Internet Domain Server */
+# endif
+
/*
-** Operating system configuration.
+** Most systems have symbolic links today, so default them on. You
+** can turn them off by #undef'ing this below.
+*/
+
+# define HASLSTAT 1 /* has lstat(2) call */
+
+/*
+** General "standard C" defines.
**
-** Unless you are porting to a new OS, you shouldn't have to
-** change these.
+** These may be undone later, to cope with systems that claim to
+** be Standard C but aren't. Gcc is the biggest offender -- it
+** doesn't realize that the library is part of the language.
+**
+** Life would be much easier if we could get rid of this sort
+** of bozo problems.
*/
-/* general "standard C" defines */
#ifdef __STDC__
-# define HASSETVBUF 1 /* yes, we have setvbuf in libc */
+# define HASSETVBUF 1 /* we have setvbuf(3) in libc */
#endif
-/* general POSIX defines */
-#ifdef _POSIX_VERSION
-# define HASSETSID 1 /* has setsid(2) call */
-#endif
+/**********************************************************************
+** Operating system configuration.
+**
+** Unless you are porting to a new OS, you shouldn't have to
+** change these.
+**********************************************************************/
/*
** Per-Operating System defines
*/
-/* HP-UX -- tested for 8.07 */
+
+/*
+** HP-UX -- tested for 8.07, 9.00, and 9.01.
+*/
+
# ifdef __hpux
+/* avoid m_flags conflict between db.h & sys/sysmacros.h on HP 300 */
+# undef m_flags
# define SYSTEM5 1 /* include all the System V defines */
-# define UNSETENV 1 /* need unsetenv(3) support */
-# define HASSETEUID 1 /* we have seteuid call */
-# define seteuid(uid) setresuid(-1, uid, -1)
-# ifndef __STDC__
-# define HASSETVBUF 1 /* we have setvbuf in libc (but not __STDC__) */
+# define HASINITGROUPS 1 /* has initgroups(3) call */
+# define HASSETREUID 1 /* has setreuid(2) call */
+# define setreuid(r, e) setresuid(r, e, -1)
+# define LA_TYPE LA_FLOAT
+# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
+# define GIDSET_T gid_t
+# define _PATH_UNIX "/hp-ux"
+# ifndef _PATH_SENDMAILCF
+# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
+# endif
+# ifndef IDENTPROTO
+# define IDENTPROTO 0 /* TCP/IP implementation is broken */
+# endif
+# ifndef HASGETUSERSHELL
+# define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */
+# endif
+# define syslog hard_syslog
+# ifdef __STDC__
+extern int syslog(int, char *, ...);
# endif
# endif
-/* IBM AIX 3.x -- actually tested for 3.2.3 */
+
+/*
+** IBM AIX 3.x -- actually tested for 3.2.3
+*/
+
# ifdef _AIX3
-# define LOCKF 1 /* use System V lockf instead of flock */
+# define HASINITGROUPS 1 /* has initgroups(3) call */
+# define HASUNAME 1 /* use System V uname(2) system call */
+# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
# define FORK fork /* no vfork primitive available */
-# define UNSETENV 1 /* need unsetenv(3) support */
-# define SYS5TZ 1 /* use System V style timezones */
+# undef SETPROCTITLE /* setproctitle confuses AIX */
+# define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */
# endif
-/* Silicon Graphics IRIX */
+
+/*
+** Silicon Graphics IRIX
+**
+** Compiles on 4.0.1.
+*/
+
# ifdef IRIX
+# include <sys/sysmacros.h>
+# define HASSETREUID 1 /* has setreuid(2) call */
+# define HASINITGROUPS 1 /* has initgroups(3) call */
+# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
# define FORK fork /* no vfork primitive available */
-# define UNSETENV 1 /* need unsetenv(3) support */
-# define setpgrp BSDsetpgrp
+# define WAITUNION 1 /* use "union wait" as wait argument type */
+# define setpgid BSDsetpgrp
+# define GIDSET_T gid_t
+# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
# endif
-/* various systems from Sun Microsystems */
+
+/*
+** SunOS and Solaris
+**
+** Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
+** Solaris 2.2 (a.k.a. SunOS 5.2).
+*/
+
#if defined(sun) && !defined(BSD)
-# define UNSETENV 1 /* need unsetenv(3) support */
+# define HASINITGROUPS 1 /* has initgroups(3) call */
+# define HASUNAME 1 /* use System V uname(2) system call */
+# define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */
+# define LA_TYPE LA_INT
+
+# ifdef SOLARIS_2_3
+# define SOLARIS
+# endif
# ifdef SOLARIS
- /* Solaris 2.x */
-# define LOCKF 1 /* use System V lockf instead of flock */
-# define HASUSTAT 1 /* has the ustat(2) syscall */
-# define bcopy(s, d, l) (memmove((d), (s), (l)))
-# define bzero(d, l) (memset((d), '\0', (l)))
-# define bcmp(s, d, l) (memcmp((s), (d), (l)))
+ /* Solaris 2.x (a.k.a. SunOS 5.x) */
+# ifndef __svr4__
+# define __svr4__ /* use all System V Releae 4 defines below */
+# endif
# include <sys/time.h>
+# define gethostbyname solaris_gethostbyname /* get working version */
+# define gethostbyaddr solaris_gethostbyaddr /* get working version */
+# define GIDSET_T gid_t
+# ifndef _PATH_UNIX
+# define _PATH_UNIX "/kernel/unix"
+# endif
+# ifndef _PATH_SENDMAILCF
+# define _PATH_SENDMAILCF "/etc/mail/sendmail.cf"
+# endif
+# ifndef _PATH_SENDMAILPID
+# define _PATH_SENDMAILPID "/etc/mail/sendmail.pid"
+# endif
+# ifndef SYSLOG_BUFSIZE
+# define SYSLOG_BUFSIZE 1024 /* allow full size syslog buffer */
+# endif
# else
- /* SunOS 4.1.x */
-# define HASSTATFS 1 /* has the statfs(2) syscall */
-# define HASSETEUID 1 /* we have seteuid call */
+ /* SunOS 4.0.3 or 4.1.x */
+# define HASSETREUID 1 /* has setreuid(2) call */
+# ifndef HASFLOCK
+# define HASFLOCK 1 /* has flock(2) call */
+# endif
+# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
# include <vfork.h>
+# ifdef SUNOS403
+ /* special tweaking for SunOS 4.0.3 */
+# include <malloc.h>
+# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
+# define WAITUNION 1 /* use "union wait" as wait argument type */
+# undef WIFEXITED
+# undef WEXITSTATUS
+# undef HASUNAME
+# define setpgid setpgrp
+typedef int pid_t;
+extern char *getenv();
+
+# endif
+# endif
+#endif
+
+/*
+** DG/UX
+**
+** Tested on 5.4.2
+*/
+
+#ifdef DGUX
+# define SYSTEM5 1
+# define LA_TYPE LA_SUBR
+# 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 HASGETUSERSHELL 0 /* does not have getusershell(3) */
+# ifndef IDENTPROTO
+# define IDENTPROTO 0 /* TCP/IP implementation is broken */
# endif
+# undef SETPROCTITLE
+# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
+
+/* these include files must be included early on DG/UX */
+# include <netinet/in.h>
+# include <arpa/inet.h>
+
+# define inet_addr dgux_inet_addr
+extern long dgux_inet_addr();
#endif
-/* Digital Ultrix 4.2A or 4.3 */
+
+/*
+** Digital Ultrix 4.2A or 4.3
+**
+** Apparently, fcntl locking is broken on 4.2A, in that locks are
+** not dropped when the process exits. This causes major problems,
+** so flock is the only alternative.
+*/
+
#ifdef ultrix
-# define HASSTATFS 1 /* has the statfs(2) syscall */
-# define HASSETEUID 1 /* we have seteuid call */
+# define HASSETREUID 1 /* has setreuid(2) call */
+# define HASUNSETENV 1 /* has unsetenv(3) call */
+# define HASINITGROUPS 1 /* has initgroups(3) call */
+# define HASUNAME 1 /* use System V uname(2) system call */
+# ifndef HASFLOCK
+# define HASFLOCK 1 /* has flock(2) call */
+# endif
+# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
+# define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */
+# ifdef vax
+# define LA_TYPE LA_FLOAT
+# else
+# define LA_TYPE LA_INT
+# define LA_AVENRUN "avenrun"
+# endif
+# define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
+# ifndef IDENTPROTO
+# define IDENTPROTO 0 /* TCP/IP implementation is broken */
+# endif
#endif
-/* OSF/1 (tested on Alpha) */
+
+/*
+** OSF/1 (tested on Alpha)
+*/
+
#ifdef __osf__
-# define HASSETEUID 1 /* we have seteuid call */
-# define seteuid(uid) setreuid(-1, uid)
+# define HASUNSETENV 1 /* has unsetenv(3) call */
+# define HASSETREUID 1 /* has setreuid(2) call */
+# define HASINITGROUPS 1 /* has initgroups(3) call */
+# ifndef HASFLOCK
+# define HASFLOCK 1 /* has flock(2) call */
+# endif
+# define LA_TYPE LA_INT
+# define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
+# ifndef _PATH_SENDMAILPID
+# define _PATH_SENDMAILPID "/var/run/sendmail.pid"
+# endif
#endif
-/* NeXTstep */
-#ifdef __NeXT__
+
+/*
+** NeXTstep
+*/
+
+#ifdef NeXT
+# define HASINITGROUPS 1 /* has initgroups(3) call */
+# ifndef HASFLOCK
+# define HASFLOCK 1 /* has flock(2) call */
+# endif
+# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
+# define WAITUNION 1 /* use "union wait" as wait argument type */
# define sleep sleepX
-# define UNSETENV 1 /* need unsetenv(3) support */
+# define setpgid setpgrp
+# ifndef LA_TYPE
+# define LA_TYPE LA_MACH
+# endif
+# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
+# ifndef _POSIX_SOURCE
+typedef int pid_t;
+# undef WEXITSTATUS
+# undef WIFEXITED
+# endif
+# ifndef _PATH_SENDMAILCF
+# define _PATH_SENDMAILCF "/etc/sendmail/sendmail.cf"
+# endif
+# ifndef _PATH_SENDMAILPID
+# define _PATH_SENDMAILPID "/etc/sendmail/sendmail.pid"
+# endif
#endif
-/* various flavors of BSD */
-#ifdef BSD
-# define HASGETDTABLESIZE 1 /* we have getdtablesize(2) call */
+
+/*
+** 4.4 BSD
+**
+** See also BSD defines.
+*/
+
+#ifdef BSD4_4
+# define HASUNSETENV 1 /* has unsetenv(3) call */
+# include <sys/cdefs.h>
+# define ERRLIST_PREDEFINED /* don't declare sys_errlist */
+# ifndef LA_TYPE
+# define LA_TYPE LA_SUBR
+# endif
+# define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
#endif
-#if defined(NetBSD)
-#define NO_SYSCONF
+
+/*
+** BSD/386 (all versions)
+** From Tony Sanders, BSDI
+*/
+
+#ifdef __bsdi__
+# define HASUNSETENV 1 /* has the unsetenv(3) call */
+# define HASSETSID 1 /* has the setsid(2) POSIX syscall */
+# define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
+# if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
+# define HASSETPROCTITLE 1 /* setproctitle is in libc */
+# else
+# define SETPROCTITLE 1
+# endif
+# include <sys/cdefs.h>
+# define ERRLIST_PREDEFINED /* don't declare sys_errlist */
+# ifndef LA_TYPE
+# define LA_TYPE LA_SUBR
+# endif
#endif
-/* 4.4BSD */
-#ifdef BSD4_4
+
+
+/*
+** 386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions)
+**
+** 4.3BSD clone, closer to 4.4BSD
+**
+** See also BSD defines.
+*/
+
+#if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
+# define HASUNSETENV 1 /* has unsetenv(3) call */
+# define HASSETSID 1 /* has the setsid(2) POSIX syscall */
# include <sys/cdefs.h>
-# define HASSETEUID 1 /* we have seteuid(2) call */
+# define ERRLIST_PREDEFINED /* don't declare sys_errlist */
+# ifndef LA_TYPE
+# define LA_TYPE LA_SUBR
+# endif
+# define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
#endif
+
/*
-** End of Per-Operating System defines
+** Mach386
+**
+** For mt Xinu's Mach386 system.
*/
+#if defined(MACH) && defined(i386)
+# define MACH386 1
+# define HASUNSETENV 1 /* has unsetenv(3) call */
+# define HASINITGROUPS 1 /* has initgroups(3) call */
+# ifndef HASFLOCK
+# define HASFLOCK 1 /* has flock(2) call */
+# endif
+# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
+# define NEEDSTRTOL 1 /* need the strtol() function */
+# define setpgid setpgrp
+# ifndef LA_TYPE
+# define LA_TYPE LA_FLOAT
+# endif
+# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
+# undef HASSETVBUF /* don't actually have setvbuf(3) */
+# undef WEXITSTATUS
+# undef WIFEXITED
+# ifndef _PATH_SENDMAILCF
+# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
+# endif
+# ifndef _PATH_SENDMAILPID
+# define _PATH_SENDMAILPID "/etc/sendmail.pid"
+# endif
+#endif
+
+
+/*
+** 4.3 BSD -- this is for very old systems
+**
+** Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
+**
+** You'll also have to install a new resolver library.
+** I don't guarantee that support for this environment is complete.
+*/
+
+#if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
+# define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */
+# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
+# define ARBPTR_T char *
+# define setpgid setpgrp
+# ifndef LA_TYPE
+# define LA_TYPE LA_FLOAT
+# endif
+# ifndef _PATH_SENDMAILCF
+# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
+# endif
+# ifndef IDENTPROTO
+# define IDENTPROTO 0 /* TCP/IP implementation is broken */
+# endif
+# undef WEXITSTATUS
+# undef WIFEXITED
+typedef short pid_t;
+extern int errno;
+#endif
+
+
+/*
+** SCO Unix
+**
+** This includes two parts -- the first is for SCO Open Server 3.2v4
+** (contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
+** The second is, I believe, for an older version.
+*/
+
+#ifdef _SCO_unix_4_2
+# define _SCO_unix_
+# define HASSETREUID 1 /* has setreuid(2) call */
+# define _PATH_UNIX "/unix"
+# ifndef _PATH_SENDMAILCF
+# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
+# endif
+# ifndef _PATH_SENDMAILPID
+# define _PATH_SENDMAILPID "/etc/sendmail.pid"
+# endif
+#endif
+
+#ifdef _SCO_unix_
+# define SYSTEM5 1 /* include all the System V defines */
+# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
+# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
+# define FORK fork
+# define MAXPATHLEN PATHSIZE
+# define LA_TYPE LA_SHORT
+# define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */
+# undef NETUNIX /* no unix domain socket support */
+#endif
+
+
+/*
+** ConvexOS 11.0 and later
+**
+** "Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
+** works on 9.1 as well.
+*/
+
+#ifdef _CONVEX_SOURCE
+# define BSD 1 /* include all the BSD defines */
+# define HASUNAME 1 /* use System V uname(2) system call */
+# define HASSETSID 1 /* has POSIX setsid(2) call */
+# define NEEDGETOPT 1 /* need replacement for getopt(3) */
+# define LA_TYPE LA_FLOAT
+# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
+# ifndef _PATH_SENDMAILCF
+# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
+# endif
+# ifndef S_IREAD
+# define S_IREAD _S_IREAD
+# define S_IWRITE _S_IWRITE
+# define S_IEXEC _S_IEXEC
+# define S_IFMT _S_IFMT
+# define S_IFCHR _S_IFCHR
+# define S_IFBLK _S_IFBLK
+# endif
+# ifndef IDENTPROTO
+# define IDENTPROTO 0 /* TCP/IP implementation is broken */
+# endif
+#endif
+
+
+/*
+** RISC/os 4.52
+**
+** Gives a ton of warning messages, but otherwise compiles.
+*/
+
+#ifdef RISCOS
+
+# define HASUNSETENV 1 /* has unsetenv(3) call */
+# ifndef HASFLOCK
+# define HASFLOCK 1 /* has flock(2) call */
+# endif
+# define WAITUNION 1 /* use "union wait" as wait argument type */
+# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
+# define LA_TYPE LA_INT
+# define LA_AVENRUN "avenrun"
+# define _PATH_UNIX "/unix"
+# undef WIFEXITED
+
+# define setpgid setpgrp
+
+extern int errno;
+typedef int pid_t;
+#define SIGFUNC_DEFINED
+typedef int (*sigfunc_t)();
+extern char *getenv();
+extern void *malloc();
+
+#endif
+
+
+/*
+** Linux 0.99pl10 and above...
+**
+** Thanks to, in reverse order of contact:
+**
+** John Kennedy <warlock@csuchico.edu>
+** Florian La Roche <rzsfl@rz.uni-sb.de>
+** Karl London <karl@borg.demon.co.uk>
+**
+** Last compiled against: [03/02/94 @ 05:34 PM (Wednesday)]
+** sendmail 8.6.6.b9 named 4.9.2-931205-p1 db-1.73
+** gcc 2.5.8 libc.so.4.5.19
+** slackware 1.1.2 linux 0.99.15
+*/
+
+#ifdef __linux__
+# define BSD 1 /* include BSD defines */
+# define NEEDGETOPT 1 /* need a replacement for getopt(3) */
+# define HASUNAME 1 /* use System V uname(2) system call */
+# define HASUNSETENV 1 /* has unsetenv(3) call */
+# define ERRLIST_PREDEFINED /* don't declare sys_errlist */
+# define GIDSET_T gid_t /* from <linux/types.h> */
+# ifndef LA_TYPE
+# define LA_TYPE LA_PROCSTR
+# endif
+# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() impl */
+# include <sys/sysmacros.h>
+# undef atol /* wounded in <stdlib.h> */
+#endif
+
+
+/*
+** DELL SVR4 Issue 2.2, and others
+** From Kimmo Suominen <kim@grendel.lut.fi>
+**
+** It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
+** defined, and the definitions conflict.
+**
+** Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
+** trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
+** (SVR4.0/386 version 3.0).
+*/
+
+#ifdef DELL_SVR4
+ /* no changes necessary */
+ /* see general __svr4__ defines below */
+#endif
+
+
+/*
+** Apple A/UX 3.0
+*/
+
+#ifdef _AUX_SOURCE
+# include <sys/sysmacros.h>
+# define BSD /* has BSD routines */
+# define HASUNAME 1 /* use System V uname(2) system call */
+# define HASSETVBUF 1 /* we have setvbuf(3) in libc */
+# define SIGFUNC_DEFINED /* sigfunc_t already defined */
+# ifndef IDENTPROTO
+# define IDENTPROTO 0 /* TCP/IP implementation is broken */
+# endif
+# define FORK fork
+# ifndef _PATH_SENDMAILCF
+# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
+# endif
+# ifndef LA_TYPE
+# define LA_TYPE LA_ZERO
+# endif
+# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
+# undef WIFEXITED
+# undef WEXITSTATUS
+#endif
+
+
+/*
+** Encore UMAX V
+**
+** Not extensively tested.
+*/
+
+#ifdef UMAXV
+# include <limits.h>
+# define HASUNAME 1 /* use System V uname(2) system call */
+# define HASSETVBUF 1 /* we have setvbuf(3) in libc */
+# define HASINITGROUPS 1 /* has initgroups(3) call */
+# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
+# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
+# define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */
+# define FORK fork /* no vfork(2) primitive available */
+# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
+# define MAXPATHLEN PATH_MAX
+extern struct passwd *getpwent(), *getpwnam(), *getpwuid();
+extern struct group *getgrent(), *getgrnam(), *getgrgid();
+# undef WIFEXITED
+# undef WEXITSTATUS
+#endif
+
+
+/*
+** Stardent Titan 3000 running TitanOS 4.2.
+**
+** Must be compiled in "cc -43" mode.
+**
+** From Kate Hedstrom <kate@ahab.rutgers.edu>.
+**
+** Note the tweaking below after the BSD defines are set.
+*/
+
+#ifdef titan
+# define setpgid setpgrp
+typedef int pid_t;
+# undef WIFEXITED
+# undef WEXITSTATUS
+#endif
+
+
+/*
+** Sequent DYNIX 3.2.0
+**
+** From Jim Davis <jdavis@cs.arizona.edu>.
+*/
+
+#ifdef sequent
+
+# define BSD 1
+# define HASUNSETENV 1
+# define BSD4_3 1 /* to get signal() in conf.c */
+# define WAITUNION 1
+# define LA_TYPE LA_FLOAT
+# ifdef _POSIX_VERSION
+# undef _POSIX_VERSION /* set in <unistd.h> */
+# endif
+# undef HASSETVBUF /* don't actually have setvbuf(3) */
+# define setpgid setpgrp
+
+/* Have to redefine WIFEXITED to take an int, to work with waitfor() */
+# undef WIFEXITED
+# define WIFEXITED(s) (((union wait*)&(s))->w_stopval != WSTOPPED && \
+ ((union wait*)&(s))->w_termsig == 0)
+# define WEXITSTATUS(s) (((union wait*)&(s))->w_retcode)
+typedef int pid_t;
+# define isgraph(c) (isprint(c) && (c != ' '))
+
+# ifndef IDENTPROTO
+# define IDENTPROTO 0 /* TCP/IP implementation is broken */
+# endif
+
+# ifndef _PATH_UNIX
+# define _PATH_UNIX "/dynix"
+# endif
+# ifndef _PATH_SENDMAILCF
+# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
+# endif
+
+#endif
+
+
+/*
+** Sequent DYNIX/ptx v2.0 (and higher)
+**
+** For DYNIX/ptx v1.x, undefine HASSETREUID.
+**
+** From Tim Wright <timw@sequent.com>.
+*/
+
+#ifdef _SEQUENT_
+# define SYSTEM5 1 /* include all the System V defines */
+# define HASSETSID 1 /* has POSIX setsid(2) call */
+# define HASINITGROUPS 1 /* has initgroups(3) call */
+# define HASSETREUID 1 /* has setreuid(2) call */
+# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
+# define GIDSET_T gid_t
+# define LA_TYPE LA_INT
+# define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */
+# undef SETPROCTITLE
+# ifndef IDENTPROTO
+# define IDENTPROTO 0 /* TCP/IP implementation is broken */
+# endif
+# ifndef _PATH_SENDMAILCF
+# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
+# endif
+# ifndef _PATH_SENDMAILPID
+# define _PATH_SENDMAILPID "/etc/sendmail.pid"
+# endif
+#endif
+
+
+/*
+** Cray Unicos
+**
+** Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
+*/
+
+#ifdef UNICOS
+# define SYSTEM5 1 /* include all the System V defines */
+# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
+# define MAXPATHLEN PATHSIZE
+# define LA_TYPE LA_ZERO
+# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
+#endif
+
+
+/*
+** Apollo DomainOS
+**
+** From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
+**
+** 15 Jan 1994
+**
+*/
+
+#ifdef apollo
+# define HASSETREUID 1 /* has setreuid(2) call */
+# define HASINITGROUPS 1 /* has initgroups(2) call */
+# undef SETPROCTITLE
+# define LA_TYPE LA_SUBR /* use getloadavg.c */
+# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
+# ifndef _PATH_SENDMAILCF
+# define _PATH_SENDMAILCF "/usr/lib/sendmail.cf"
+# endif
+# ifndef _PATH_SENDMAILPID
+# define _PATH_SENDMAILPID "/etc/sendmail.pid"
+# endif
+# undef S_IFSOCK /* S_IFSOCK and S_IFIFO are the same */
+# undef S_IFIFO
+# define S_IFIFO 0010000
+# ifndef IDENTPROTO
+# define IDENTPROTO 0 /* TCP/IP implementation is broken */
+# endif
+#endif
+
+
+
+
+/**********************************************************************
+** End of Per-Operating System defines
+**********************************************************************/
+
+/**********************************************************************
+** More general defines
+**********************************************************************/
+
+/* general BSD defines */
+#ifdef BSD
+# define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */
+# define HASSETREUID 1 /* has setreuid(2) call */
+# define HASINITGROUPS 1 /* has initgroups(2) call */
+# ifndef HASFLOCK
+# define HASFLOCK 1 /* has flock(2) call */
+# endif
+#endif
+
+/* general System V Release 4 defines */
+#ifdef __svr4__
+# define SYSTEM5 1
+# define HASSETREUID 1 /* has seteuid(2) call & working saved uids */
+# ifndef HASGETUSERSHELL
+# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
+# endif
+# define setreuid(r, e) seteuid(e)
+
+# ifndef _PATH_UNIX
+# define _PATH_UNIX "/unix"
+# endif
+# ifndef _PATH_SENDMAILCF
+# define _PATH_SENDMAILCF "/usr/ucblib/sendmail.cf"
+# endif
+# ifndef _PATH_SENDMAILPID
+# define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid"
+# endif
+# ifndef SYSLOG_BUFSIZE
+# define SYSLOG_BUFSIZE 128
+# endif
+#endif
+
/* general System V defines */
-# ifdef SYSTEM5
-# define LOCKF 1 /* use System V lockf instead of flock */
-# define SYS5TZ 1 /* use System V style timezones */
-# define HASUNAME 1 /* use System V uname system call */
-# define NEEDGETDTABLESIZE 1 /* needs a replacement getdtablesize */
+#ifdef SYSTEM5
+# include <sys/sysmacros.h>
+# define HASUNAME 1 /* use System V uname(2) system call */
+# define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */
+# define HASSETVBUF 1 /* we have setvbuf(3) in libc */
+# ifndef LA_TYPE
+# define LA_TYPE LA_INT /* assume integer load average */
# endif
+# ifndef SFS_TYPE
+# define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */
+# endif
+# define bcopy(s, d, l) (memmove((d), (s), (l)))
+# define bzero(d, l) (memset((d), '\0', (l)))
+# define bcmp(s, d, l) (memcmp((s), (d), (l)))
+#endif
+
+/* general POSIX defines */
+#ifdef _POSIX_VERSION
+# define HASSETSID 1 /* has Posix setsid(2) call */
+# define HASWAITPID 1 /* has Posix waitpid(2) call */
+#endif
+
+/*
+** If no type for argument two of getgroups call is defined, assume
+** it's an integer -- unfortunately, there seem to be several choices
+** here.
+*/
+
+#ifndef GIDSET_T
+# define GIDSET_T int
+#endif
+
+/*
+** Tweaking for systems that (for example) claim to be BSD but
+** don't have all the standard BSD routines (boo hiss).
+*/
+
+#ifdef titan
+# undef HASINITGROUPS /* doesn't have initgroups(3) call */
+#endif
+
/*
** Due to a "feature" in some operating systems such as Ultrix 4.3 and
@@ -207,22 +911,35 @@
** are closed. Some firewalls return this error if you try to connect
** to the IDENT port (113), so you can't receive email from these hosts
** on these systems. The firewall really should use a more specific
-** message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.
+** message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB. If
+** not explicitly set to zero above, default it on.
*/
-#if !defined(ultrix) && !defined(__hpux)
+#ifndef IDENTPROTO
# define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */
#endif
-/*
+#ifndef HASGETUSERSHELL
+# define HASGETUSERSHELL 1 /* libc has getusershell(3) call */
+#endif
+
+#ifndef HASFLOCK
+# define HASFLOCK 0 /* assume no flock(2) support */
+#endif
+
+
+/**********************************************************************
** Remaining definitions should never have to be changed. They are
** primarily to provide back compatibility for older systems -- for
** example, it includes some POSIX compatibility definitions
-*/
+**********************************************************************/
/* System 5 compatibility */
#ifndef S_ISREG
-#define S_ISREG(foo) ((foo & S_IFREG) == S_IFREG)
+# define S_ISREG(foo) ((foo & S_IFMT) == S_IFREG)
+#endif
+#if !defined(S_ISLNK) && defined(S_IFLNK)
+# define S_ISLNK(foo) ((foo & S_IFMT) == S_IFLNK)
#endif
#ifndef S_IWGRP
#define S_IWGRP 020
@@ -240,6 +957,28 @@
# 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
+** error codes, but where the system doesn't provide something
+** reasonable. They are printed in errstring.
+*/
+
+#ifndef E_PSEUDOBASE
+# define E_PSEUDOBASE 256
+#endif
+
+#define EOPENTIMEOUT (E_PSEUDOBASE + 0) /* timeout on open */
+#define E_DNSBASE (E_PSEUDOBASE + 20) /* base for DNS h_errno */
+
+/* type of arbitrary pointer */
+#ifndef ARBPTR_T
+# define ARBPTR_T void *
+#endif
+
#ifndef __P
# include "cdefs.h"
#endif
@@ -290,8 +1029,8 @@ struct utsname
};
#endif /* HASUNAME */
-#ifndef MAXHOSTNAMELEN
-#define MAXHOSTNAMELEN 256
+#if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_)
+# define MAXHOSTNAMELEN 256
#endif
#if !defined(SIGCHLD) && defined(SIGCLD)
@@ -310,16 +1049,31 @@ struct utsname
#define STDERR_FILENO 2
#endif
-#ifdef LOCKF
-#define LOCK_SH 0x01 /* shared lock */
-#define LOCK_EX 0x02 /* exclusive lock */
-#define LOCK_NB 0x04 /* non-blocking lock */
-#define LOCK_UN 0x08 /* unlock */
+#ifndef LOCK_SH
+# define LOCK_SH 0x01 /* shared lock */
+# define LOCK_EX 0x02 /* exclusive lock */
+# define LOCK_NB 0x04 /* non-blocking lock */
+# define LOCK_UN 0x08 /* unlock */
+#endif
+
+#ifndef SIG_ERR
+# define SIG_ERR ((void (*)()) -1)
+#endif
-#else
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(st) (((st) >> 8) & 0377)
+#endif
+#ifndef WIFEXITED
+# define WIFEXITED(st) (((st) & 0377) == 0)
+#endif
-# include <sys/file.h>
+#ifndef SIGFUNC_DEFINED
+typedef void (*sigfunc_t) __P((int));
+#endif
+/* size of syslog buffer */
+#ifndef SYSLOG_BUFSIZE
+# define SYSLOG_BUFSIZE 1024
#endif
/*
@@ -329,10 +1083,29 @@ struct utsname
*/
#ifndef TOBUFSIZE
-# define TOBUFSIZE (1024 - 256)
+# if (SYSLOG_BUFSIZE) > 512
+# define TOBUFSIZE (SYSLOG_BUFSIZE - 256)
+# else
+# define TOBUFSIZE 256
+# endif
#endif
+/*
+** Size of prescan buffer.
+** Despite comments in the _sendmail_ book, this probably should
+** not be changed; there are some hard-to-define dependencies.
+*/
+
+# define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */
/* fork routine -- set above using #ifdef _osname_ or in Makefile */
# ifndef FORK
# define FORK vfork /* function to call to fork mailer */
# endif
+
+/*
+** If we are going to link scanf anyway, use it in readcf
+*/
+
+#if !defined(HASUNAME) && !defined(SCANF)
+# define SCANF 1
+#endif
diff --git a/usr.sbin/sendmail/src/daemon.c b/usr.sbin/sendmail/src/daemon.c
index cfbfec6b18e9..f7876825161a 100644
--- a/usr.sbin/sendmail/src/daemon.c
+++ b/usr.sbin/sendmail/src/daemon.c
@@ -33,24 +33,22 @@
*/
#include <errno.h>
-#include <signal.h>
#include "sendmail.h"
#ifndef lint
#ifdef DAEMON
-static char sccsid[] = "@(#)daemon.c 8.2 (Berkeley) 7/13/93 (with daemon mode)";
+static char sccsid[] = "@(#)daemon.c 8.39 (Berkeley) 3/13/94 (with daemon mode)";
#else
-static char sccsid[] = "@(#)daemon.c 8.2 (Berkeley) 7/13/93 (without daemon mode)";
+static char sccsid[] = "@(#)daemon.c 8.39 (Berkeley) 3/13/94 (without daemon mode)";
#endif
#endif /* not lint */
#ifdef DAEMON
# include <netdb.h>
-# include <sys/wait.h>
-# include <sys/time.h>
+# include <arpa/inet.h>
-#ifdef NAMED_BIND
+#if NAMED_BIND
# include <arpa/nameser.h>
# include <resolv.h>
#endif
@@ -105,14 +103,16 @@ static char sccsid[] = "@(#)daemon.c 8.2 (Berkeley) 7/13/93 (without daemon mode
int DaemonSocket = -1; /* fd describing socket */
SOCKADDR DaemonAddr; /* socket for incoming */
int ListenQueueSize = 10; /* size of listen queue */
+int TcpRcvBufferSize = 0; /* size of TCP receive buffer */
+int TcpSndBufferSize = 0; /* size of TCP send buffer */
getrequests()
{
int t;
- register struct servent *sp;
int on = 1;
bool refusingconnections = TRUE;
FILE *pidf;
+ int socksize;
extern void reapchild();
/*
@@ -125,17 +125,16 @@ getrequests()
DaemonAddr.sin.sin_addr.s_addr = INADDR_ANY;
if (DaemonAddr.sin.sin_port == 0)
{
+ register struct servent *sp;
+
sp = getservbyname("smtp", "tcp");
if (sp == NULL)
{
syserr("554 service \"smtp\" unknown");
- goto severe;
+ DaemonAddr.sin.sin_port = htons(25);
}
-#ifdef _SCO_unix_
- DaemonAddr.sin.sin_port = htons(sp->s_port);
-#else
- DaemonAddr.sin.sin_port = sp->s_port;
-#endif
+ else
+ DaemonAddr.sin.sin_port = sp->s_port;
}
/*
@@ -166,39 +165,57 @@ getrequests()
(void) setsockopt(DaemonSocket, SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof on);
(void) setsockopt(DaemonSocket, SOL_SOCKET, SO_KEEPALIVE, (char *)&on, sizeof on);
+#ifdef SO_RCVBUF
+ if (TcpRcvBufferSize > 0)
+ {
+ if (setsockopt(DaemonSocket, SOL_SOCKET, SO_RCVBUF,
+ (char *) &TcpRcvBufferSize,
+ sizeof(TcpRcvBufferSize)) < 0)
+ syserr("getrequests: setsockopt(SO_RCVBUF)");
+ }
+#endif
+
switch (DaemonAddr.sa.sa_family)
{
# ifdef NETINET
case AF_INET:
- t = sizeof DaemonAddr.sin;
+ socksize = sizeof DaemonAddr.sin;
break;
# endif
# ifdef NETISO
case AF_ISO:
- t = sizeof DaemonAddr.siso;
+ socksize = sizeof DaemonAddr.siso;
break;
# endif
default:
- t = sizeof DaemonAddr;
+ socksize = sizeof DaemonAddr;
break;
}
- if (bind(DaemonSocket, &DaemonAddr.sa, t) < 0)
+ if (bind(DaemonSocket, &DaemonAddr.sa, socksize) < 0)
{
syserr("getrequests: cannot bind");
(void) close(DaemonSocket);
goto severe;
}
- (void) signal(SIGCHLD, reapchild);
+ (void) setsignal(SIGCHLD, reapchild);
/* write the pid to the log file for posterity */
pidf = fopen(PidFile, "w");
if (pidf != NULL)
{
+ extern char *CommandLineArgs;
+
+ /* write the process id on line 1 */
fprintf(pidf, "%d\n", getpid());
+
+ /* line 2 contains all command line flags */
+ fprintf(pidf, "%s\n", CommandLineArgs);
+
+ /* flush and close */
fclose(pidf);
}
@@ -245,7 +262,7 @@ getrequests()
do
{
errno = 0;
- lotherend = sizeof RealHostAddr;
+ lotherend = socksize;
t = accept(DaemonSocket,
(struct sockaddr *)&RealHostAddr, &lotherend);
} while (t < 0 && errno == EINTR);
@@ -274,6 +291,7 @@ getrequests()
if (pid == 0)
{
+ char *p;
extern char *hostnamebyanyaddr();
/*
@@ -282,14 +300,19 @@ getrequests()
** Verify calling user id if possible here.
*/
- (void) signal(SIGCHLD, SIG_DFL);
- OpMode = MD_SMTP;
+ (void) setsignal(SIGCHLD, SIG_DFL);
+ DisConnected = FALSE;
+
+ setproctitle("startup with %s",
+ anynet_ntoa(&RealHostAddr));
/* determine host name */
- RealHostName = newstr(hostnamebyanyaddr(&RealHostAddr));
+ p = hostnamebyanyaddr(&RealHostAddr);
+ RealHostName = newstr(p);
+ setproctitle("startup with %s", p);
#ifdef LOG
- if (LogLevel > 10)
+ if (LogLevel > 11)
{
/* log connection information */
syslog(LOG_INFO, "connect from %s (%s)",
@@ -298,8 +321,13 @@ getrequests()
#endif
(void) close(DaemonSocket);
- InChannel = fdopen(t, "r");
- OutChannel = fdopen(dup(t), "w");
+ if ((InChannel = fdopen(t, "r")) == NULL ||
+ (t = dup(t)) < 0 ||
+ (OutChannel = fdopen(t, "w")) == NULL)
+ {
+ syserr("cannot open SMTP server channel, fd=%d", t);
+ exit(0);
+ }
/* should we check for illegal connection here? XXX */
#ifdef XLA
@@ -434,7 +462,7 @@ setdaemonoptions(p)
#ifdef NETINET
case AF_INET:
if (isascii(*v) && isdigit(*v))
- DaemonAddr.sin.sin_port = atoi(v);
+ DaemonAddr.sin.sin_port = htons(atoi(v));
else
{
register struct servent *sp;
@@ -443,13 +471,7 @@ setdaemonoptions(p)
if (sp == NULL)
syserr("554 service \"%s\" unknown", v);
else
- {
-#ifdef _SCO_unix_
- DaemonAddr.sin.sin_port = htons(sp->s_port);
-#else
DaemonAddr.sin.sin_port = sp->s_port;
-#endif
- }
}
break;
#endif
@@ -458,7 +480,7 @@ setdaemonoptions(p)
case AF_ISO:
/* assume two byte transport selector */
if (isascii(*v) && isdigit(*v))
- port = atoi(v);
+ port = htons(atoi(v));
else
{
register struct servent *sp;
@@ -483,6 +505,14 @@ setdaemonoptions(p)
case 'L': /* listen queue size */
ListenQueueSize = atoi(v);
break;
+
+ case 'S': /* send buffer size */
+ TcpSndBufferSize = atoi(v);
+ break;
+
+ case 'R': /* receive buffer size */
+ TcpRcvBufferSize = atoi(v);
+ break;
}
}
}
@@ -519,7 +549,7 @@ makeconnection(host, port, mci, usesecureport)
SOCKADDR addr;
int sav_errno;
int addrlen;
-#ifdef NAMED_BIND
+#if NAMED_BIND
extern int h_errno;
#endif
@@ -528,11 +558,12 @@ makeconnection(host, port, mci, usesecureport)
** Accept "[a.b.c.d]" syntax for host name.
*/
-#ifdef NAMED_BIND
+#if NAMED_BIND
h_errno = 0;
#endif
errno = 0;
bzero(&CurHostAddr, sizeof CurHostAddr);
+ SmtpPhase = mci->mci_phase = "initial connection";
CurHostName = host;
if (host[0] == '[')
@@ -550,6 +581,12 @@ makeconnection(host, port, mci, usesecureport)
{
/* try it as a host name (avoid MX lookup) */
hp = gethostbyname(&host[1]);
+ if (hp == NULL && p[-1] == '.')
+ {
+ p[-1] = '\0';
+ hp = gethostbyname(&host[1]);
+ p[-1] = '.';
+ }
*p = ']';
goto gothostent;
}
@@ -567,11 +604,19 @@ makeconnection(host, port, mci, usesecureport)
}
else
{
+ register char *p = &host[strlen(host) - 1];
+
hp = gethostbyname(host);
+ if (hp == NULL && *p == '.')
+ {
+ *p = '\0';
+ hp = gethostbyname(host);
+ *p = '.';
+ }
gothostent:
if (hp == NULL)
{
-#ifdef NAMED_BIND
+#if NAMED_BIND
if (errno == ETIMEDOUT || h_errno == TRY_AGAIN)
return (EX_TEMPFAIL);
@@ -588,7 +633,7 @@ gothostent:
case AF_INET:
bcopy(hp->h_addr,
&addr.sin.sin_addr,
- hp->h_length);
+ sizeof addr.sin.sin_addr);
break;
#endif
@@ -614,13 +659,10 @@ gothostent:
if (sp == NULL)
{
syserr("554 makeconnection: service \"smtp\" unknown");
- return (EX_OSERR);
+ port = htons(25);
}
-#ifdef _SCO_unix_
- port = htons(sp->s_port);
-#else
- port = sp->s_port;
-#endif
+ else
+ port = sp->s_port;
}
switch (addr.sa.sa_family)
@@ -681,6 +723,16 @@ gothostent:
goto failure;
}
+#ifdef SO_SNDBUF
+ if (TcpSndBufferSize > 0)
+ {
+ if (setsockopt(s, SOL_SOCKET, SO_SNDBUF,
+ (char *) &TcpSndBufferSize,
+ sizeof(TcpSndBufferSize)) < 0)
+ syserr("makeconnection: setsockopt(SO_SNDBUF)");
+ }
+#endif
+
if (tTd(16, 1))
printf("makeconnection: fd=%d\n", s);
@@ -711,7 +763,7 @@ gothostent:
case AF_INET:
bcopy(hp->h_addr_list[i++],
&addr.sin.sin_addr,
- hp->h_length);
+ sizeof addr.sin.sin_addr);
break;
#endif
@@ -739,8 +791,13 @@ gothostent:
}
/* connection ok, put it into canonical form */
- mci->mci_out = fdopen(s, "w");
- mci->mci_in = fdopen(dup(s), "r");
+ if ((mci->mci_out = fdopen(s, "w")) == NULL ||
+ (s = dup(s)) < 0 ||
+ (mci->mci_in = fdopen(s, "r")) == NULL)
+ {
+ syserr("cannot open SMTP client channel, fd=%d", s);
+ return EX_TEMPFAIL;
+ }
return (EX_OK);
}
@@ -755,11 +812,9 @@ gothostent:
** A list of aliases for this host.
**
** Side Effects:
-** Sets the MyIpAddrs buffer to a list of my IP addresses.
+** Adds numeric codes to $=w.
*/
-struct in_addr MyIpAddrs[MAXIPADDR + 1];
-
char **
myhostname(hostbuf, size)
char hostbuf[];
@@ -782,13 +837,14 @@ myhostname(hostbuf, size)
{
register int i;
- for (i = 0; i < MAXIPADDR; i++)
+ for (i = 0; hp->h_addr_list[i] != NULL; i++)
{
- if (hp->h_addr_list[i] == NULL)
- break;
- MyIpAddrs[i].s_addr = *(u_long *) hp->h_addr_list[i];
+ char ipbuf[100];
+
+ sprintf(ipbuf, "[%s]",
+ inet_ntoa(*((struct in_addr *) hp->h_addr_list[i])));
+ setclass('w', ipbuf);
}
- MyIpAddrs[i].s_addr = 0;
}
return (hp->h_aliases);
@@ -806,12 +862,9 @@ myhostname(hostbuf, size)
**
** Returns:
** The user@host information associated with this descriptor.
-**
-** Side Effects:
-** Sets RealHostName to the name of the host at the other end.
*/
-#ifdef IDENTPROTO
+#if IDENTPROTO
static jmp_buf CtxAuthTimeout;
@@ -830,7 +883,7 @@ getauthinfo(fd)
SOCKADDR fa;
int falen;
register char *p;
-#ifdef IDENTPROTO
+#if IDENTPROTO
SOCKADDR la;
int lalen;
register struct servent *sp;
@@ -843,19 +896,19 @@ getauthinfo(fd)
extern char RealUserName[]; /* main.c */
falen = sizeof fa;
- if (getpeername(fd, &fa.sa, &falen) < 0 || falen <= 0)
+ if (getpeername(fd, &fa.sa, &falen) < 0 || falen <= 0 ||
+ fa.sa.sa_family == 0)
{
- RealHostName = "localhost";
(void) sprintf(hbuf, "%s@localhost", RealUserName);
if (tTd(9, 1))
printf("getauthinfo: %s\n", hbuf);
return hbuf;
}
- RealHostName = newstr(hostnamebyanyaddr(&fa));
- RealHostAddr = fa;
+#if IDENTPROTO
+ if (TimeOuts.to_ident == 0)
+ goto noident;
-#ifdef IDENTPROTO
lalen = sizeof la;
if (fa.sa.sa_family != AF_INET ||
getsockname(fd, &la.sa, &lalen) < 0 || lalen <= 0 ||
@@ -870,18 +923,12 @@ getauthinfo(fd)
ntohs(fa.sin.sin_port), ntohs(la.sin.sin_port));
/* create local address */
- bzero(&la, sizeof la);
+ la.sin.sin_port = 0;
/* create foreign address */
sp = getservbyname("auth", "tcp");
if (sp != NULL)
- {
-#ifdef _SCO_unix_
- fa.sin.sin_port = htons(sp->s_port);
-#else
fa.sin.sin_port = sp->s_port;
-#endif
- }
else
fa.sin.sin_port = htons(113);
@@ -894,21 +941,19 @@ getauthinfo(fd)
}
/* put a timeout around the whole thing */
- ev = setevent((time_t) 30, authtimeout, 0);
+ ev = setevent(TimeOuts.to_ident, authtimeout, 0);
- /* connect to foreign IDENT server */
+ /* connect to foreign IDENT server using same address as SMTP socket */
s = socket(AF_INET, SOCK_STREAM, 0);
if (s < 0)
{
clrevent(ev);
goto noident;
}
- if (connect(s, &fa.sa, sizeof fa.sin) < 0)
+ if (bind(s, &la.sa, sizeof la.sin) < 0 ||
+ connect(s, &fa.sa, sizeof fa.sin) < 0)
{
-closeident:
- (void) close(s);
- clrevent(ev);
- goto noident;
+ goto closeident;
}
if (tTd(9, 10))
@@ -967,16 +1012,27 @@ closeident:
continue;
/* p now points to the authenticated name */
- (void) sprintf(hbuf, "%s@%s", p, RealHostName);
+ (void) sprintf(hbuf, "%s@%s",
+ p, RealHostName == NULL ? "localhost" : RealHostName);
goto finish;
+closeident:
+ (void) close(s);
+ clrevent(ev);
+
#endif /* IDENTPROTO */
noident:
+ if (RealHostName == NULL)
+ {
+ if (tTd(9, 1))
+ printf("getauthinfo: NULL\n");
+ return NULL;
+ }
(void) strcpy(hbuf, RealHostName);
finish:
- if (RealHostName[0] != '[')
+ if (RealHostName != NULL && RealHostName[0] != '[')
{
p = &hbuf[strlen(hbuf)];
(void) sprintf(p, " [%s]", anynet_ntoa(&RealHostAddr));
@@ -1020,7 +1076,9 @@ host_map_lookup(map, name, av, statp)
register STAB *s;
char hbuf[MAXNAME];
extern struct hostent *gethostbyaddr();
+#if NAMED_BIND
extern int h_errno;
+#endif
/*
** See if we have already looked up this name. If so, just
@@ -1034,8 +1092,16 @@ host_map_lookup(map, name, av, statp)
printf("host_map_lookup(%s) => CACHE %s\n",
name, s->s_namecanon.nc_cname);
errno = s->s_namecanon.nc_errno;
+#if NAMED_BIND
h_errno = s->s_namecanon.nc_herrno;
+#endif
*statp = s->s_namecanon.nc_stat;
+ if (CurEnv->e_message == NULL && *statp == EX_TEMPFAIL)
+ {
+ sprintf(hbuf, "%s: Name server timeout",
+ shortenstring(name, 33));
+ CurEnv->e_message = newstr(hbuf);
+ }
return s->s_namecanon.nc_cname;
}
@@ -1054,7 +1120,7 @@ host_map_lookup(map, name, av, statp)
printf("host_map_lookup(%s) => ", name);
s->s_namecanon.nc_flags |= NCF_VALID; /* will be soon */
(void) strcpy(hbuf, name);
- if (getcanonname(hbuf, sizeof hbuf - 1))
+ if (getcanonname(hbuf, sizeof hbuf - 1, TRUE))
{
if (tTd(9, 1))
printf("%s\n", hbuf);
@@ -1066,20 +1132,21 @@ host_map_lookup(map, name, av, statp)
{
register struct hostent *hp;
- if (tTd(9, 1))
- printf("FAIL (%d)\n", h_errno);
s->s_namecanon.nc_errno = errno;
+#if NAMED_BIND
s->s_namecanon.nc_herrno = h_errno;
+ if (tTd(9, 1))
+ printf("FAIL (%d)\n", h_errno);
switch (h_errno)
{
case TRY_AGAIN:
if (UseNameServer)
{
- char *msg = "Recipient domain nameserver timed out";
-
- message(msg);
+ sprintf(hbuf, "%s: Name server timeout",
+ shortenstring(name, 33));
+ message("%s", hbuf);
if (CurEnv->e_message == NULL)
- CurEnv->e_message = newstr(msg);
+ CurEnv->e_message = newstr(hbuf);
}
*statp = EX_TEMPFAIL;
break;
@@ -1096,6 +1163,11 @@ host_map_lookup(map, name, av, statp)
*statp = EX_UNAVAILABLE;
break;
}
+#else
+ if (tTd(9, 1))
+ printf("FAIL\n");
+ *statp = EX_NOHOST;
+#endif
s->s_namecanon.nc_stat = *statp;
if (*statp != EX_TEMPFAIL || UseNameServer)
return NULL;
@@ -1123,19 +1195,12 @@ host_map_lookup(map, name, av, statp)
*cp = '\0';
in_addr = inet_addr(&name[1]);
- /* check to see if this is one of our addresses */
- for (i = 0; MyIpAddrs[i].s_addr != 0; i++)
- {
- if (MyIpAddrs[i].s_addr == in_addr)
- {
- return map_rewrite(map, MyHostName, strlen(MyHostName), av);
- }
- }
-
/* nope -- ask the name server */
hp = gethostbyaddr((char *)&in_addr, sizeof(struct in_addr), AF_INET);
s->s_namecanon.nc_errno = errno;
+#if NAMED_BIND
s->s_namecanon.nc_herrno = h_errno;
+#endif
s->s_namecanon.nc_flags |= NCF_VALID; /* will be soon */
if (hp == NULL)
{
@@ -1166,7 +1231,7 @@ anynet_ntoa(sap)
register char *bp;
register char *ap;
int l;
- static char buf[80];
+ static char buf[100];
/* check for null/zero family */
if (sap == NULL)
@@ -1174,15 +1239,29 @@ anynet_ntoa(sap)
if (sap->sa.sa_family == 0)
return "0";
-#ifdef NETINET
- if (sap->sa.sa_family == AF_INET)
+ switch (sap->sa.sa_family)
{
- extern char *inet_ntoa();
+#ifdef MAYBENEXTRELEASE /*** UNTESTED *** UNTESTED *** UNTESTED ***/
+#ifdef NETUNIX
+ case AF_UNIX:
+ if (sap->sunix.sun_path[0] != '\0')
+ sprintf(buf, "[UNIX: %.64s]", sap->sunix.sun_path);
+ else
+ sprintf(buf, "[UNIX: localhost]");
+ return buf;
+#endif
+#endif
+#ifdef NETINET
+ case AF_INET:
return inet_ntoa(((struct sockaddr_in *) sap)->sin_addr);
- }
#endif
+ default:
+ /* this case is only to ensure syntactic correctness */
+ break;
+ }
+
/* unknown family -- just dump bytes */
(void) sprintf(buf, "Family %d: ", sap->sa.sa_family);
bp = &buf[strlen(buf)];
@@ -1213,10 +1292,9 @@ hostnamebyanyaddr(sap)
register SOCKADDR *sap;
{
register struct hostent *hp;
-
-#ifdef NAMED_BIND
int saveretry;
+#if NAMED_BIND
/* shorten name server timeout to avoid higher level timeouts */
saveretry = _res.retry;
_res.retry = 3;
@@ -1240,6 +1318,12 @@ hostnamebyanyaddr(sap)
break;
#endif
+#ifdef MAYBENEXTRELEASE /*** UNTESTED *** UNTESTED *** UNTESTED ***/
+ case AF_UNIX:
+ hp = NULL;
+ break;
+#endif
+
default:
hp = gethostbyaddr(sap->sa.sa_data,
sizeof sap->sa.sa_data,
@@ -1247,7 +1331,7 @@ hostnamebyanyaddr(sap)
break;
}
-#ifdef NAMED_BIND
+#if NAMED_BIND
_res.retry = saveretry;
#endif /* NAMED_BIND */
diff --git a/usr.sbin/sendmail/src/deliver.c b/usr.sbin/sendmail/src/deliver.c
index ef9fd82330c8..692dffe932a7 100644
--- a/usr.sbin/sendmail/src/deliver.c
+++ b/usr.sbin/sendmail/src/deliver.c
@@ -33,20 +33,21 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)deliver.c 8.3 (Berkeley) 7/13/93";
+static char sccsid[] = "@(#)deliver.c 8.78 (Berkeley) 3/11/94";
#endif /* not lint */
#include "sendmail.h"
-#include <signal.h>
#include <netdb.h>
#include <errno.h>
-#ifdef NAMED_BIND
+#if NAMED_BIND
#include <arpa/nameser.h>
#include <resolv.h>
extern int h_errno;
#endif
+extern char SmtpError[];
+
/*
** SENDALL -- actually send all the messages.
**
@@ -76,14 +77,22 @@ sendall(e, mode)
ENVELOPE *splitenv = NULL;
bool announcequeueup;
- if (bitset(EF_FATALERRS, e->e_flags))
+ /*
+ ** If we have had global, fatal errors, don't bother sending
+ ** the message at all if we are in SMTP mode. Local errors
+ ** (e.g., a single address failing) will still cause the other
+ ** addresses to be sent.
+ */
+
+ if (bitset(EF_FATALERRS, e->e_flags) &&
+ (OpMode == MD_SMTP || OpMode == MD_DAEMON))
{
- /* this will get a return message -- so don't send it */
e->e_flags |= EF_CLRQUEUE;
return;
}
/* determine actual delivery mode */
+ CurrentLA = getla();
if (mode == SM_DEFAULT)
{
mode = e->e_sendmode;
@@ -97,7 +106,8 @@ sendall(e, mode)
if (tTd(13, 1))
{
- printf("\nSENDALL: mode %c, e_from ", mode);
+ printf("\n===== SENDALL: mode %c, id %s, e_from ",
+ mode, e->e_id);
printaddr(&e->e_from, FALSE);
printf("sendqueue:\n");
printaddr(e->e_sendqueue, TRUE);
@@ -114,8 +124,10 @@ sendall(e, mode)
if (e->e_hopcount > MaxHopCount)
{
errno = 0;
- syserr("554 too many hops %d (%d max): from %s, to %s",
+ e->e_flags |= EF_FATALERRS|EF_PM_NOTIFY|EF_CLRQUEUE;
+ syserr("554 too many hops %d (%d max): from %s via %s, to %s",
e->e_hopcount, MaxHopCount, e->e_from.q_paddr,
+ RealHostName == NULL ? "localhost" : RealHostName,
e->e_sendqueue->q_paddr);
return;
}
@@ -129,7 +141,8 @@ sendall(e, mode)
** is instantiated in the queue as a recipient.
*/
- if (!MeToo && !bitset(QQUEUEUP, e->e_from.q_flags))
+ if (!bitset(EF_METOO, e->e_flags) &&
+ !bitset(QQUEUEUP, e->e_from.q_flags))
{
if (tTd(13, 5))
{
@@ -229,7 +242,6 @@ sendall(e, mode)
ee->e_from.q_flags |= QDONTSEND;
ee->e_dfp = NULL;
ee->e_xfp = NULL;
- ee->e_lockfp = NULL;
ee->e_df = NULL;
ee->e_errormode = EM_MAIL;
ee->e_sibling = splitenv;
@@ -237,28 +249,32 @@ sendall(e, mode)
for (q = e->e_sendqueue; q != NULL; q = q->q_next)
if (q->q_owner == owner)
+ {
q->q_flags |= QDONTSEND;
+ q->q_flags &= ~QQUEUEUP;
+ }
for (q = ee->e_sendqueue; q != NULL; q = q->q_next)
if (q->q_owner != owner)
+ {
q->q_flags |= QDONTSEND;
+ q->q_flags &= ~QQUEUEUP;
+ }
if (e->e_df != NULL && mode != SM_VERIFY)
{
ee->e_dfp = NULL;
- ee->e_df = newstr(queuename(ee, 'd'));
+ ee->e_df = queuename(ee, 'd');
+ ee->e_df = newstr(ee->e_df);
if (link(e->e_df, ee->e_df) < 0)
{
syserr("sendall: link(%s, %s)",
e->e_df, ee->e_df);
}
}
-
- if (mode != SM_VERIFY)
- openxscript(ee);
#ifdef LOG
if (LogLevel > 4)
- syslog(LOG_INFO, "%s: clone %s",
- ee->e_id, e->e_id);
+ syslog(LOG_INFO, "%s: clone %s, owner=%s",
+ ee->e_id, e->e_id, owner);
#endif
}
}
@@ -298,15 +314,15 @@ sendall(e, mode)
for (ee = splitenv; ee != NULL; ee = ee->e_sibling)
{
CurEnv = ee;
+ if (mode != SM_VERIFY)
+ openxscript(ee);
sendenvelope(ee, mode);
+ dropenvelope(ee);
}
CurEnv = e;
}
sendenvelope(e, mode);
-
- for (; splitenv != NULL; splitenv = splitenv->e_sibling)
- dropenvelope(splitenv);
}
sendenvelope(e, mode)
@@ -316,9 +332,22 @@ sendenvelope(e, mode)
bool oldverbose;
int pid;
register ADDRESS *q;
-#ifdef LOCKF
- struct flock lfd;
-#endif
+ char *qf;
+ char *id;
+
+ /*
+ ** If we have had global, fatal errors, don't bother sending
+ ** the message at all if we are in SMTP mode. Local errors
+ ** (e.g., a single address failing) will still cause the other
+ ** addresses to be sent.
+ */
+
+ if (bitset(EF_FATALERRS, e->e_flags) &&
+ (OpMode == MD_SMTP || OpMode == MD_DAEMON))
+ {
+ e->e_flags |= EF_CLRQUEUE;
+ return;
+ }
oldverbose = Verbose;
switch (mode)
@@ -336,20 +365,27 @@ sendenvelope(e, mode)
if (e->e_xfp != NULL)
(void) fflush(e->e_xfp);
-# ifdef LOCKF
+# if !HASFLOCK
/*
- ** Since lockf has the interesting semantic that the
- ** lock is lost when we fork, we have to risk losing
- ** the lock here by closing before the fork, and then
- ** trying to get it back in the child.
+ ** Since fcntl locking has the interesting semantic that
+ ** the lock is owned by a process, not by an open file
+ ** descriptor, we have to flush this to the queue, and
+ ** then restart from scratch in the child.
*/
- if (e->e_lockfp != NULL)
- {
- (void) xfclose(e->e_lockfp, "sendenvelope", "lockfp");
- e->e_lockfp = NULL;
- }
-# endif /* LOCKF */
+ /* save id for future use */
+ id = e->e_id;
+
+ /* now drop the envelope in the parent */
+ e->e_flags |= EF_INQUEUE|EF_KEEPQUEUE;
+ dropenvelope(e);
+
+ /* and reacquire in the child */
+ (void) dowork(id, TRUE, FALSE, e);
+
+ return;
+
+# else /* HASFLOCK */
pid = fork();
if (pid < 0)
@@ -359,60 +395,37 @@ sendenvelope(e, mode)
else if (pid > 0)
{
/* be sure we leave the temp files to our child */
- e->e_id = e->e_df = NULL;
-# ifndef LOCKF
+ /* can't call unlockqueue to avoid unlink of xfp */
if (e->e_lockfp != NULL)
- {
(void) xfclose(e->e_lockfp, "sendenvelope", "lockfp");
- e->e_lockfp = NULL;
- }
-# endif
+ e->e_lockfp = NULL;
/* close any random open files in the envelope */
+ closexscript(e);
if (e->e_dfp != NULL)
- {
- (void) xfclose(e->e_dfp, "sendenvelope", "dfp");
- e->e_dfp = NULL;
- }
- if (e->e_xfp != NULL)
- {
- (void) xfclose(e->e_xfp, "sendenvelope", "xfp");
- e->e_xfp = NULL;
- }
+ (void) xfclose(e->e_dfp, "sendenvelope", e->e_df);
+ e->e_dfp = NULL;
+ e->e_id = e->e_df = NULL;
+
+ /* catch intermediate zombie */
+ (void) waitfor(pid);
return;
}
/* double fork to avoid zombies */
- if (fork() > 0)
+ pid = fork();
+ if (pid > 0)
exit(EX_OK);
/* be sure we are immune from the terminal */
- disconnect(FALSE, e);
-
-# ifdef LOCKF
- /*
- ** Now try to get our lock back.
- */
+ disconnect(1, e);
- lfd.l_type = F_WRLCK;
- lfd.l_whence = lfd.l_start = lfd.l_len = 0;
- e->e_lockfp = fopen(queuename(e, 'q'), "r+");
- if (e->e_lockfp == NULL ||
- fcntl(fileno(e->e_lockfp), F_SETLK, &lfd) < 0)
+ /* prevent parent from waiting if there was an error */
+ if (pid < 0)
{
- /* oops.... lost it */
- if (tTd(13, 1))
- printf("sendenvelope: %s lost lock: lockfp=%x, %s\n",
- e->e_id, e->e_lockfp, errstring(errno));
-
-# ifdef LOG
- if (LogLevel > 29)
- syslog(LOG_NOTICE, "%s: lost lock: %m",
- e->e_id);
-# endif /* LOG */
- exit(EX_OK);
+ e->e_flags |= EF_INQUEUE|EF_KEEPQUEUE;
+ finis();
}
-# endif /* LOCKF */
/*
** Close any cached connections.
@@ -426,25 +439,44 @@ sendenvelope(e, mode)
mci_flush(FALSE, NULL);
+# endif /* HASFLOCK */
+
break;
}
/*
** Run through the list and send everything.
+ **
+ ** Set EF_GLOBALERRS so that error messages during delivery
+ ** result in returned mail.
*/
e->e_nsent = 0;
+ e->e_flags |= EF_GLOBALERRS;
+
+ /* now run through the queue */
for (q = e->e_sendqueue; q != NULL; q = q->q_next)
{
+#ifdef XDEBUG
+ char wbuf[MAXNAME + 20];
+
+ (void) sprintf(wbuf, "sendall(%s)", q->q_paddr);
+ checkfd012(wbuf);
+#endif
if (mode == SM_VERIFY)
{
e->e_to = q->q_paddr;
if (!bitset(QDONTSEND|QBADADDR, q->q_flags))
{
- message("deliverable: mailer %s, host %s, user %s",
- q->q_mailer->m_name,
- q->q_host,
- q->q_user);
+ if (q->q_host != NULL && q->q_host[0] != '\0')
+ message("deliverable: mailer %s, host %s, user %s",
+ q->q_mailer->m_name,
+ q->q_host,
+ q->q_user);
+ else
+ message("deliverable: mailer %s, user %s",
+ q->q_mailer->m_name,
+ q->q_user);
}
}
else if (!bitset(QDONTSEND|QBADADDR, q->q_flags))
@@ -465,37 +497,9 @@ sendenvelope(e, mode)
}
Verbose = oldverbose;
- /*
- ** Now run through and check for errors.
- */
-
- if (mode == SM_VERIFY)
- {
- return;
- }
-
- for (q = e->e_sendqueue; q != NULL; q = q->q_next)
- {
- if (tTd(13, 3))
- {
- printf("Checking ");
- printaddr(q, FALSE);
- }
-
- /* only send errors if the message failed */
- if (!bitset(QBADADDR, q->q_flags) ||
- bitset(QDONTSEND, q->q_flags))
- continue;
-
- if (tTd(13, 3))
- printf("FATAL ERRORS\n");
-
- e->e_flags |= EF_FATALERRS;
-
- if (q->q_owner == NULL && strcmp(e->e_from.q_paddr, "<>") != 0)
- (void) sendtolist(e->e_from.q_paddr, NULL,
- &e->e_errorqueue, e);
- }
+#ifdef XDEBUG
+ checkfd012("end of sendenvelope");
+#endif
if (mode == SM_FORK)
finis();
@@ -611,15 +615,15 @@ deliver(e, firstto)
char buf[MAXNAME];
char rpathbuf[MAXNAME]; /* translated return path */
extern int checkcompat();
- extern FILE *fdopen();
errno = 0;
if (bitset(QDONTSEND|QBADADDR|QQUEUEUP, to->q_flags))
return (0);
-#ifdef NAMED_BIND
+#if NAMED_BIND
/* unless interactive, try twice, over a minute */
- if (OpMode == MD_DAEMON || OpMode == MD_SMTP) {
+ if (OpMode == MD_DAEMON || OpMode == MD_SMTP)
+ {
_res.retrans = 30;
_res.retry = 2;
}
@@ -629,10 +633,13 @@ deliver(e, firstto)
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",
- m->m_mno, host, to->q_user);
+ printf("\n--deliver, id=%s, mailer=%s, host=`%s', first user=`%s'\n",
+ e->e_id, m->m_name, host, to->q_user);
+ if (tTd(10, 100))
+ printopenfds(FALSE);
/*
** If this mailer is expensive, and if we don't want to make
@@ -644,19 +651,18 @@ deliver(e, firstto)
** This should be on a per-mailer basis.
*/
- if (NoConnect && !bitset(EF_QUEUERUN, e->e_flags) &&
- bitnset(M_EXPENSIVE, m->m_flags) && !Verbose)
+ if (NoConnect && bitnset(M_EXPENSIVE, m->m_flags) && !Verbose)
{
for (; to != NULL; to = to->q_next)
{
if (bitset(QDONTSEND|QBADADDR|QQUEUEUP, to->q_flags) ||
to->q_mailer != m)
continue;
- to->q_flags |= QQUEUEUP|QDONTSEND;
+ to->q_flags |= QQUEUEUP;
e->e_to = to->q_paddr;
message("queued");
if (LogLevel > 8)
- logdelivery(m, NULL, "queued", e);
+ logdelivery(m, NULL, "queued", NULL, e);
}
e->e_to = NULL;
return (0);
@@ -740,7 +746,7 @@ deliver(e, firstto)
*pvp = NULL;
# else /* SMTP */
/* oops! we don't implement SMTP */
- syserr("554 SMTP style mailer");
+ syserr("554 SMTP style mailer not implemented");
return (EX_SOFTWARE);
# endif /* SMTP */
}
@@ -779,7 +785,9 @@ deliver(e, firstto)
}
/* compute effective uid/gid when sending */
- if (to->q_mailer == ProgMailer)
+ /* XXX perhaps this should be to->q_mailer != LocalMailer ?? */
+ /* XXX perhaps it should be a mailer flag? */
+ if (to->q_mailer == ProgMailer || to->q_mailer == FileMailer)
ctladdr = getctladdr(to);
user = to->q_user;
@@ -800,14 +808,14 @@ deliver(e, firstto)
{
NoReturn = TRUE;
usrerr("552 Message is too large; %ld bytes max", m->m_maxsize);
- giveresponse(EX_UNAVAILABLE, m, NULL, e);
+ giveresponse(EX_UNAVAILABLE, m, NULL, ctladdr, e);
continue;
}
rcode = checkcompat(to, e);
if (rcode != EX_OK)
{
markfailure(e, to, rcode);
- giveresponse(rcode, m, NULL, e);
+ giveresponse(rcode, m, NULL, ctladdr, e);
continue;
}
@@ -851,8 +859,8 @@ deliver(e, firstto)
if (m == FileMailer)
{
- rcode = mailfile(user, getctladdr(to), e);
- giveresponse(rcode, m, NULL, e);
+ rcode = mailfile(user, ctladdr, e);
+ giveresponse(rcode, m, NULL, ctladdr, e);
if (rcode == EX_OK)
to->q_flags |= QSENT;
continue;
@@ -871,7 +879,10 @@ deliver(e, firstto)
(void) strcat(tobuf, ",");
(void) strcat(tobuf, to->q_paddr);
define('u', user, e); /* to user */
- define('z', to->q_home, e); /* user's home */
+ p = to->q_home;
+ if (p == NULL && ctladdr != NULL)
+ p = ctladdr->q_home;
+ define('z', p, e); /* user's home */
/*
** Expand out this user into argument list.
@@ -920,9 +931,12 @@ deliver(e, firstto)
** If we are running SMTP, we just need to clean up.
*/
- if (ctladdr == NULL && m != ProgMailer)
+ /*XXX this seems a bit wierd */
+ if (ctladdr == NULL && m != ProgMailer &&
+ bitset(QGOODUID, e->e_from.q_flags))
ctladdr = &e->e_from;
-#ifdef NAMED_BIND
+
+#if NAMED_BIND
if (ConfigLevel < 2)
_res.options &= ~(RES_DEFNAMES | RES_DNSRCH); /* XXX */
#endif
@@ -946,6 +960,18 @@ deliver(e, firstto)
*/
curhost = NULL;
+ SmtpPhase = NULL;
+ mci = NULL;
+
+#ifdef XDEBUG
+ {
+ char wbuf[MAXLINE];
+
+ /* make absolutely certain 0, 1, and 2 are in use */
+ sprintf(wbuf, "%s... openmailer(%s)", e->e_to, m->m_name);
+ checkfd012(wbuf);
+ }
+#endif
/* check for Local Person Communication -- not for mortals!!! */
if (strcmp(m->m_mailer, "[LPC]") == 0)
@@ -964,12 +990,19 @@ deliver(e, firstto)
register int i;
register u_short port;
+ if (pv[0] == NULL || pv[1] == NULL || pv[1][0] == '\0')
+ {
+ syserr("null host name for %s mailer", m->m_mailer);
+ rcode = EX_CONFIG;
+ goto give_up;
+ }
+
CurHostName = pv[1];
curhost = hostsignature(m, pv[1], e);
if (curhost == NULL || curhost[0] == '\0')
{
- syserr("null signature");
+ syserr("null host signature for %s", pv[1]);
rcode = EX_OSERR;
goto give_up;
}
@@ -977,7 +1010,7 @@ deliver(e, firstto)
if (!clever)
{
syserr("554 non-clever IPC");
- rcode = EX_OSERR;
+ rcode = EX_CONFIG;
goto give_up;
}
if (pv[2] != NULL)
@@ -985,18 +1018,21 @@ deliver(e, firstto)
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)];
+ if (p == curhost)
+ {
+ syserr("deliver: null host name in signature");
+ curhost++;
+ continue;
+ }
strncpy(hostbuf, curhost, p - curhost);
hostbuf[p - curhost] = '\0';
if (*p != '\0')
@@ -1011,7 +1047,7 @@ tryhost:
if (tTd(11, 1))
{
printf("openmailer: ");
- mci_dump(mci);
+ mci_dump(mci, FALSE);
}
CurHostName = mci->mci_host;
break;
@@ -1028,7 +1064,7 @@ tryhost:
bitnset(M_SECURE_PORT, m->m_flags));
mci->mci_exitstat = i;
mci->mci_errno = errno;
-#ifdef NAMED_BIND
+#if NAMED_BIND
mci->mci_herrno = h_errno;
#endif
if (i == EX_OK)
@@ -1044,28 +1080,28 @@ tryhost:
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");
- return NULL;
+ rcode = EX_UNAVAILABLE;
+ goto give_up;
#endif /* DAEMON */
}
else
{
-#ifdef XDEBUG
- char wbuf[MAXLINE];
-
- /* make absolutely certain 0, 1, and 2 are in use */
- sprintf(wbuf, "%s... openmailer(%s)", e->e_to, m->m_name);
- checkfd012(wbuf);
-#endif
-
if (TrafficLogFile != NULL)
{
char **av;
@@ -1112,7 +1148,7 @@ tryhost:
(void) fflush(e->e_xfp); /* for debugging */
(void) fflush(stdout);
# ifdef SIGCHLD
- (void) signal(SIGCHLD, SIG_DFL);
+ (void) setsignal(SIGCHLD, SIG_DFL);
# endif /* SIGCHLD */
DOFORK(FORK);
/* pid is set by DOFORK */
@@ -1143,13 +1179,32 @@ tryhost:
extern int DtableSize;
/* child -- set up input & exec mailer */
- /* make diagnostic output be standard output */
- (void) signal(SIGINT, SIG_IGN);
- (void) signal(SIGHUP, SIG_IGN);
- (void) signal(SIGTERM, SIG_DFL);
+ (void) setsignal(SIGINT, SIG_IGN);
+ (void) setsignal(SIGHUP, SIG_IGN);
+ (void) setsignal(SIGTERM, SIG_DFL);
- /* close any other cached connections */
- mci_flush(FALSE, mci);
+ /* reset user and group */
+ if (!bitnset(M_RESTR, m->m_flags))
+ {
+ if (ctladdr == NULL || ctladdr->q_uid == 0)
+ {
+ (void) initgroups(DefUser, DefGid);
+ (void) setgid(DefGid);
+ (void) setuid(DefUid);
+ }
+ else
+ {
+ (void) initgroups(ctladdr->q_ruser?
+ ctladdr->q_ruser: ctladdr->q_user,
+ ctladdr->q_gid);
+ (void) setgid(ctladdr->q_gid);
+ (void) setuid(ctladdr->q_uid);
+ }
+ }
+
+ if (tTd(11, 2))
+ printf("openmailer: running as r/euid=%d/%d\n",
+ getuid(), geteuid());
/* move into some "safe" directory */
if (m->m_execdir != NULL)
@@ -1185,7 +1240,8 @@ tryhost:
}
(void) close(rpvect[1]);
}
- else if (OpMode == MD_SMTP || HoldErrs)
+ else if (OpMode == MD_SMTP || OpMode == MD_DAEMON ||
+ HoldErrs || DisConnected)
{
/* put mailer output in transcript */
if (dup2(fileno(e->e_xfp), STDOUT_FILENO) < 0)
@@ -1212,38 +1268,30 @@ tryhost:
_exit(EX_OSERR);
}
(void) close(mpvect[0]);
- if (!bitnset(M_RESTR, m->m_flags))
- {
- if (ctladdr == NULL || ctladdr->q_uid == 0)
- {
- (void) setgid(DefGid);
- (void) initgroups(DefUser, DefGid);
- (void) setuid(DefUid);
- }
- else
- {
- (void) setgid(ctladdr->q_gid);
- (void) initgroups(ctladdr->q_ruser?
- ctladdr->q_ruser: ctladdr->q_user,
- ctladdr->q_gid);
- (void) setuid(ctladdr->q_uid);
- }
- }
/* arrange for all the files to be closed */
for (i = 3; i < DtableSize; i++)
{
register int j;
+
if ((j = fcntl(i, F_GETFD, 0)) != -1)
- (void)fcntl(i, F_SETFD, j|1);
+ (void) fcntl(i, F_SETFD, j | 1);
}
- /* set up the mailer environment */
+ /*
+ ** Set up the mailer environment
+ ** TZ is timezone information.
+ ** SYSTYPE is Apollo software sys type (required).
+ ** ISP is Apollo hardware system type (required).
+ */
+
i = 0;
env[i++] = "AGENT=sendmail";
for (ep = environ; *ep != NULL; ep++)
{
- if (strncmp(*ep, "TZ=", 3) == 0)
+ if (strncmp(*ep, "TZ=", 3) == 0 ||
+ strncmp(*ep, "ISP=", 4) == 0 ||
+ strncmp(*ep, "SYSTYPE=", 8) == 0)
env[i++] = *ep;
}
env[i++] = NULL;
@@ -1268,10 +1316,33 @@ tryhost:
mci->mci_pid = pid;
(void) close(mpvect[0]);
mci->mci_out = fdopen(mpvect[1], "w");
+ if (mci->mci_out == NULL)
+ {
+ syserr("deliver: cannot create mailer output channel, fd=%d",
+ mpvect[1]);
+ (void) close(mpvect[1]);
+ if (clever)
+ {
+ (void) close(rpvect[0]);
+ (void) close(rpvect[1]);
+ }
+ rcode = EX_OSERR;
+ goto give_up;
+ }
if (clever)
{
(void) close(rpvect[1]);
mci->mci_in = fdopen(rpvect[0], "r");
+ if (mci->mci_in == NULL)
+ {
+ syserr("deliver: cannot create mailer input channel, fd=%d",
+ mpvect[1]);
+ (void) close(rpvect[0]);
+ fclose(mci->mci_out);
+ mci->mci_out = NULL;
+ rcode = EX_OSERR;
+ goto give_up;
+ }
}
else
{
@@ -1291,7 +1362,7 @@ tryhost:
if (tTd(11, 1))
{
printf("openmailer: ");
- mci_dump(mci);
+ mci_dump(mci, FALSE);
}
if (mci->mci_state != MCIS_OPEN)
@@ -1299,7 +1370,7 @@ tryhost:
/* couldn't open the mailer */
rcode = mci->mci_exitstat;
errno = mci->mci_errno;
-#ifdef NAMED_BIND
+#if NAMED_BIND
h_errno = mci->mci_herrno;
#endif
if (rcode == EX_OK)
@@ -1309,7 +1380,7 @@ tryhost:
rcode, mci->mci_state, firstsig);
rcode = EX_SOFTWARE;
}
- else if (rcode == EX_TEMPFAIL && *curhost != '\0')
+ else if (rcode == EX_TEMPFAIL && curhost != NULL && *curhost != '\0')
{
/* try next MX site */
goto tryhost;
@@ -1321,10 +1392,10 @@ tryhost:
** Format and send message.
*/
- putfromline(mci->mci_out, m, e);
- (*e->e_puthdr)(mci->mci_out, m, e);
- putline("\n", mci->mci_out, m);
- (*e->e_putbody)(mci->mci_out, m, e, NULL);
+ putfromline(mci, e);
+ (*e->e_puthdr)(mci, e);
+ putline("\n", mci);
+ (*e->e_putbody)(mci, e, NULL);
/* get the exit status */
rcode = endmailer(mci, e, pv);
@@ -1350,13 +1421,14 @@ tryhost:
if ((i = smtprcpt(to, m, mci, e)) != EX_OK)
{
markfailure(e, to, i);
- giveresponse(i, m, mci, e);
+ giveresponse(i, m, mci, ctladdr, e);
}
else
{
*t++ = ',';
for (p = to->q_paddr; *p; *t++ = *p++)
continue;
+ *t = '\0';
}
}
@@ -1378,7 +1450,7 @@ tryhost:
if (!bitset(MCIF_CACHED, mci->mci_flags))
smtpquit(m, mci, e);
}
- if (rcode != EX_OK && *curhost != '\0')
+ if (rcode != EX_OK && curhost != NULL && *curhost != '\0')
{
/* try next MX site */
goto tryhost;
@@ -1391,13 +1463,14 @@ tryhost:
goto give_up;
}
#endif /* SMTP */
-#ifdef NAMED_BIND
+#if NAMED_BIND
if (ConfigLevel < 2)
_res.options |= RES_DEFNAMES | RES_DNSRCH; /* XXX */
#endif
/* arrange a return receipt if requested */
- if (e->e_receiptto != NULL && bitnset(M_LOCALMAILER, m->m_flags))
+ 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,7 +1485,7 @@ tryhost:
give_up:
if (tobuf[0] != '\0')
- giveresponse(rcode, m, mci, e);
+ giveresponse(rcode, m, mci, ctladdr, e);
for (to = tochain; to != NULL; to = to->q_tchain)
{
if (rcode != EX_OK)
@@ -1421,6 +1494,12 @@ tryhost:
{
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);
+ }
}
}
@@ -1428,6 +1507,18 @@ tryhost:
** Restore state and return.
*/
+#ifdef XDEBUG
+ {
+ char wbuf[MAXLINE];
+
+ /* make absolutely certain 0, 1, and 2 are in use */
+ sprintf(wbuf, "%s... end of deliver(%s)",
+ e->e_to == NULL ? "NO-TO-LIST" : e->e_to,
+ m->m_name);
+ checkfd012(wbuf);
+ }
+#endif
+
errno = 0;
define('g', (char *) NULL, e);
return (rcode);
@@ -1456,12 +1547,21 @@ markfailure(e, q, rcode)
{
char buf[MAXLINE];
- if (rcode == EX_OK)
- return;
- else if (rcode == EX_TEMPFAIL)
+ switch (rcode)
+ {
+ case EX_OK:
+ break;
+
+ case EX_TEMPFAIL:
+ case EX_IOERR:
+ case EX_OSERR:
q->q_flags |= QQUEUEUP;
- else if (rcode != EX_IOERR && rcode != EX_OSERR)
+ break;
+
+ default:
q->q_flags |= QBADADDR;
+ break;
+ }
}
/*
** ENDMAILER -- Wait for mailer to terminate.
@@ -1493,9 +1593,9 @@ endmailer(mci, e, pv)
/* close any connections */
if (mci->mci_in != NULL)
- (void) xfclose(mci->mci_in, pv[0], "mci_in");
+ (void) xfclose(mci->mci_in, mci->mci_mailer->m_name, "mci_in");
if (mci->mci_out != NULL)
- (void) xfclose(mci->mci_out, pv[0], "mci_out");
+ (void) xfclose(mci->mci_out, mci->mci_mailer->m_name, "mci_out");
mci->mci_in = mci->mci_out = NULL;
mci->mci_state = MCIS_CLOSED;
@@ -1511,29 +1611,29 @@ endmailer(mci, e, pv)
return (EX_SOFTWARE);
}
- /* see if it died a horrid death */
- if ((st & 0377) != 0)
+ if (WIFEXITED(st))
{
- syserr("mailer %s died with signal %o", pv[0], st);
+ /* normal death -- return status */
+ return (WEXITSTATUS(st));
+ }
- /* log the arguments */
- if (e->e_xfp != NULL)
- {
- register char **av;
+ /* it died a horrid death */
+ syserr("451 mailer %s died with signal %o",
+ mci->mci_mailer->m_name, st);
- fprintf(e->e_xfp, "Arguments:");
- for (av = pv; *av != NULL; av++)
- fprintf(e->e_xfp, " %s", *av);
- fprintf(e->e_xfp, "\n");
- }
+ /* log the arguments */
+ if (pv != NULL && e->e_xfp != NULL)
+ {
+ register char **av;
- ExitStat = EX_TEMPFAIL;
- return (EX_TEMPFAIL);
+ fprintf(e->e_xfp, "Arguments:");
+ for (av = pv; *av != NULL; av++)
+ fprintf(e->e_xfp, " %s", *av);
+ fprintf(e->e_xfp, "\n");
}
- /* normal death -- return status */
- st = (st >> 8) & 0377;
- return (st);
+ ExitStat = EX_TEMPFAIL;
+ return (EX_TEMPFAIL);
}
/*
** GIVERESPONSE -- Interpret an error response from a mailer
@@ -1545,6 +1645,8 @@ endmailer(mci, e, pv)
** m -- the mailer info for this mailer.
** mci -- the mailer connection info -- can be NULL if the
** response is given before the connection is made.
+** ctladdr -- the controlling address for the recipient
+** address(es).
** e -- the current envelope.
**
** Returns:
@@ -1555,10 +1657,11 @@ endmailer(mci, e, pv)
** ExitStat may be set.
*/
-giveresponse(stat, m, mci, e)
+giveresponse(stat, m, mci, ctladdr, e)
int stat;
register MAILER *m;
register MCI *mci;
+ ADDRESS *ctladdr;
ENVELOPE *e;
{
register const char *statmsg;
@@ -1590,9 +1693,9 @@ giveresponse(stat, m, mci, e)
else if (stat == EX_TEMPFAIL)
{
(void) strcpy(buf, SysExMsg[i] + 1);
-#ifdef NAMED_BIND
+#if NAMED_BIND
if (h_errno == TRY_AGAIN)
- statmsg = errstring(h_errno+MAX_ERRNO);
+ statmsg = errstring(h_errno+E_DNSBASE);
else
#endif
{
@@ -1601,8 +1704,6 @@ giveresponse(stat, m, mci, e)
else
{
#ifdef SMTP
- extern char SmtpError[];
-
statmsg = SmtpError;
#else /* SMTP */
statmsg = NULL;
@@ -1616,10 +1717,10 @@ giveresponse(stat, m, mci, e)
}
statmsg = buf;
}
-#ifdef NAMED_BIND
+#if NAMED_BIND
else if (stat == EX_NOHOST && h_errno != 0)
{
- statmsg = errstring(h_errno + MAX_ERRNO);
+ statmsg = errstring(h_errno + E_DNSBASE);
(void) sprintf(buf, "%s (%s)", SysExMsg[i], statmsg);
statmsg = buf;
}
@@ -1639,7 +1740,13 @@ giveresponse(stat, m, mci, e)
*/
if (stat == EX_OK || stat == EX_TEMPFAIL)
- message(&statmsg[4], errstring(errno));
+ {
+ extern char MsgBuf[];
+
+ message("%s", &statmsg[4]);
+ if (stat == EX_TEMPFAIL && e->e_xfp != NULL)
+ fprintf(e->e_xfp, "%s\n", &MsgBuf[4]);
+ }
else
{
Errors++;
@@ -1654,29 +1761,38 @@ giveresponse(stat, m, mci, e)
*/
if (LogLevel > ((stat == EX_TEMPFAIL) ? 8 : (stat == EX_OK) ? 7 : 6))
- logdelivery(m, mci, &statmsg[4], e);
+ logdelivery(m, mci, &statmsg[4], ctladdr, e);
+
+ if (tTd(11, 2))
+ printf("giveresponse: stat=%d, e->e_message=%s\n",
+ stat, e->e_message);
if (stat != EX_TEMPFAIL)
setstat(stat);
- if (stat != EX_OK)
+ if (stat != EX_OK && (stat != EX_TEMPFAIL || e->e_message == NULL))
{
if (e->e_message != NULL)
free(e->e_message);
e->e_message = newstr(&statmsg[4]);
}
errno = 0;
-#ifdef NAMED_BIND
+#if NAMED_BIND
h_errno = 0;
#endif
}
/*
** LOGDELIVERY -- log the delivery in the system log
**
+** Care is taken to avoid logging lines that are too long, because
+** some versions of syslog have an unfortunate proclivity for core
+** dumping. This is a hack, to be sure, that is at best empirical.
+**
** Parameters:
** m -- the mailer info. Can be NULL for initial queue.
** mci -- the mailer connection info -- can be NULL if the
** log is occuring when no connection is active.
** stat -- the message to print for the status.
+** ctladdr -- the controlling address for the to list.
** e -- the current envelope.
**
** Returns:
@@ -1686,21 +1802,42 @@ giveresponse(stat, m, mci, e)
** none
*/
-logdelivery(m, mci, stat, e)
+logdelivery(m, mci, stat, ctladdr, e)
MAILER *m;
register MCI *mci;
char *stat;
+ ADDRESS *ctladdr;
register ENVELOPE *e;
{
# ifdef LOG
+ register char *bp;
+ register char *p;
+ int l;
char buf[512];
- (void) sprintf(buf, "delay=%s", pintvl(curtime() - e->e_ctime, TRUE));
+# if (SYSLOG_BUFSIZE) >= 256
+ bp = buf;
+ if (ctladdr != NULL)
+ {
+ strcpy(bp, ", ctladdr=");
+ strcat(bp, shortenstring(ctladdr->q_paddr, 83));
+ bp += strlen(bp);
+ if (bitset(QGOODUID, ctladdr->q_flags))
+ {
+ (void) sprintf(bp, " (%d/%d)",
+ ctladdr->q_uid, ctladdr->q_gid);
+ bp += strlen(bp);
+ }
+ }
+
+ (void) sprintf(bp, ", delay=%s", pintvl(curtime() - e->e_ctime, TRUE));
+ bp += strlen(bp);
if (m != NULL)
{
- (void) strcat(buf, ", mailer=");
- (void) strcat(buf, m->m_name);
+ (void) strcpy(bp, ", mailer=");
+ (void) strcat(bp, m->m_name);
+ bp += strlen(bp);
}
if (mci != NULL && mci->mci_host != NULL)
@@ -1709,13 +1846,13 @@ logdelivery(m, mci, stat, e)
extern SOCKADDR CurHostAddr;
# endif
- (void) strcat(buf, ", relay=");
- (void) strcat(buf, mci->mci_host);
+ (void) strcpy(bp, ", relay=");
+ (void) strcat(bp, mci->mci_host);
# ifdef DAEMON
- (void) strcat(buf, " (");
- (void) strcat(buf, anynet_ntoa(&CurHostAddr));
- (void) strcat(buf, ")");
+ (void) strcat(bp, " [");
+ (void) strcat(bp, anynet_ntoa(&CurHostAddr));
+ (void) strcat(bp, "]");
# endif
}
else
@@ -1724,13 +1861,118 @@ logdelivery(m, mci, stat, e)
if (p != NULL && p[0] != '\0')
{
- (void) strcat(buf, ", relay=");
- (void) strcat(buf, p);
+ (void) strcpy(bp, ", relay=");
+ (void) strcat(bp, p);
}
}
+ bp += strlen(bp);
+
+#define STATLEN (((SYSLOG_BUFSIZE) - 100) / 4)
+#if (STATLEN) < 63
+# undef STATLEN
+# define STATLEN 63
+#endif
+#if (STATLEN) > 203
+# undef STATLEN
+# define STATLEN 203
+#endif
+
+ if ((bp - buf) > (sizeof buf - ((STATLEN) + 20)))
+ {
+ /* desperation move -- truncate data */
+ bp = buf + sizeof buf - ((STATLEN) + 17);
+ strcpy(bp, "...");
+ bp += 3;
+ }
+
+ (void) strcpy(bp, ", stat=");
+ bp += strlen(bp);
+
+ (void) strcpy(bp, shortenstring(stat, (STATLEN)));
- syslog(LOG_INFO, "%s: to=%s, %s, stat=%s",
- e->e_id, e->e_to, buf, stat);
+ l = SYSLOG_BUFSIZE - 100 - strlen(buf);
+ p = e->e_to;
+ while (strlen(p) >= l)
+ {
+ register char *q = strchr(p + l, ',');
+
+ if (q == NULL)
+ break;
+ syslog(LOG_INFO, "%s: to=%.*s [more]%s",
+ e->e_id, ++q - p, p, buf);
+ p = q;
+ }
+ syslog(LOG_INFO, "%s: to=%s%s", e->e_id, p, buf);
+
+# else /* we have a very short log buffer size */
+
+ l = SYSLOG_BUFSIZE - 85;
+ p = e->e_to;
+ while (strlen(p) >= l)
+ {
+ register char *q = strchr(p + l, ',');
+
+ if (q == NULL)
+ break;
+ syslog(LOG_INFO, "%s: to=%.*s [more]",
+ e->e_id, ++q - p, p);
+ p = q;
+ }
+ syslog(LOG_INFO, "%s: to=%s", e->e_id, p);
+
+ if (ctladdr != NULL)
+ {
+ bp = buf;
+ strcpy(buf, "ctladdr=");
+ bp += strlen(buf);
+ strcpy(bp, shortenstring(ctladdr->q_paddr, 83));
+ bp += strlen(buf);
+ if (bitset(QGOODUID, ctladdr->q_flags))
+ {
+ (void) sprintf(bp, " (%d/%d)",
+ ctladdr->q_uid, ctladdr->q_gid);
+ bp += strlen(bp);
+ }
+ syslog(LOG_INFO, "%s: %s", e->e_id, buf);
+ }
+ bp = buf;
+ sprintf(bp, "delay=%s", pintvl(curtime() - e->e_ctime, TRUE));
+ bp += strlen(bp);
+
+ if (m != NULL)
+ {
+ sprintf(bp, ", mailer=%s", m->m_name);
+ bp += strlen(bp);
+ }
+ syslog(LOG_INFO, "%s: %s", e->e_id, buf);
+
+ buf[0] = '\0';
+ if (mci != NULL && mci->mci_host != NULL)
+ {
+# ifdef DAEMON
+ extern SOCKADDR CurHostAddr;
+# endif
+
+ sprintf(buf, "relay=%s", mci->mci_host);
+
+# ifdef DAEMON
+ (void) strcat(buf, " [");
+ (void) strcat(buf, anynet_ntoa(&CurHostAddr));
+ (void) strcat(buf, "]");
+# endif
+ }
+ else
+ {
+ char *p = macvalue('h', e);
+
+ if (p != NULL && p[0] != '\0')
+ sprintf(buf, "relay=%s", p);
+ }
+ if (buf[0] != '\0')
+ syslog(LOG_INFO, "%s: %s", e->e_id, buf);
+
+ syslog(LOG_INFO, "%s: stat=%s", e->e_id, shortenstring(stat, 63));
+# endif /* short log buffer */
# endif /* LOG */
}
/*
@@ -1744,8 +1986,8 @@ logdelivery(m, mci, stat, e)
** this kind of antique garbage????
**
** Parameters:
-** fp -- the file to output to.
-** m -- the mailer describing this entry.
+** mci -- the connection information.
+** e -- the envelope.
**
** Returns:
** none
@@ -1754,19 +1996,18 @@ logdelivery(m, mci, stat, e)
** outputs some text to fp.
*/
-putfromline(fp, m, e)
- register FILE *fp;
- register MAILER *m;
+putfromline(mci, e)
+ register MCI *mci;
ENVELOPE *e;
{
char *template = "\201l\n";
char buf[MAXLINE];
- if (bitnset(M_NHDR, m->m_flags))
+ if (bitnset(M_NHDR, mci->mci_mailer->m_flags))
return;
# ifdef UGLYUUCP
- if (bitnset(M_UGLYUUCP, m->m_flags))
+ if (bitnset(M_UGLYUUCP, mci->mci_mailer->m_flags))
{
char *bang;
char xbuf[MAXLINE];
@@ -1774,7 +2015,10 @@ putfromline(fp, m, e)
expand("\201g", buf, &buf[sizeof buf - 1], e);
bang = strchr(buf, '!');
if (bang == NULL)
- syserr("554 No ! in UUCP! (%s)", buf);
+ {
+ errno = 0;
+ syserr("554 No ! in UUCP From address! (%s given)", buf);
+ }
else
{
*bang++ = '\0';
@@ -1784,14 +2028,13 @@ putfromline(fp, m, e)
}
# endif /* UGLYUUCP */
expand(template, buf, &buf[sizeof buf - 1], e);
- putline(buf, fp, m);
+ putline(buf, mci);
}
/*
** PUTBODY -- put the body of a message.
**
** Parameters:
-** fp -- file to output onto.
-** m -- a mailer descriptor to control output format.
+** mci -- the connection information.
** e -- the envelope to put out.
** separator -- if non-NULL, a message separator that must
** not be permitted in the resulting message.
@@ -1803,9 +2046,8 @@ putfromline(fp, m, e)
** The message is written onto fp.
*/
-putbody(fp, m, e, separator)
- FILE *fp;
- MAILER *m;
+putbody(mci, e, separator)
+ register MCI *mci;
register ENVELOPE *e;
char *separator;
{
@@ -1822,43 +2064,45 @@ putbody(fp, m, e, separator)
e->e_dfp = fopen(e->e_df, "r");
if (e->e_dfp == NULL)
syserr("putbody: Cannot open %s for %s from %s",
- e->e_df, e->e_to, e->e_from);
+ e->e_df, e->e_to, e->e_from.q_paddr);
}
else
- putline("<<< No Message Collected >>>", fp, m);
+ putline("<<< No Message Collected >>>", mci);
}
if (e->e_dfp != NULL)
{
rewind(e->e_dfp);
- while (!ferror(fp) && fgets(buf, sizeof buf, e->e_dfp) != NULL)
+ while (!ferror(mci->mci_out) && fgets(buf, sizeof buf, e->e_dfp) != NULL)
{
- if (buf[0] == 'F' && bitnset(M_ESCFROM, m->m_flags) &&
+ if (buf[0] == 'F' &&
+ bitnset(M_ESCFROM, mci->mci_mailer->m_flags) &&
strncmp(buf, "From ", 5) == 0)
- (void) putc('>', fp);
+ (void) putc('>', mci->mci_out);
if (buf[0] == '-' && buf[1] == '-' && separator != NULL)
{
/* possible separator */
int sl = strlen(separator);
if (strncmp(&buf[2], separator, sl) == 0)
- (void) putc(' ', fp);
+ (void) putc(' ', mci->mci_out);
}
- putline(buf, fp, m);
+ putline(buf, mci);
}
if (ferror(e->e_dfp))
{
- syserr("putbody: read error");
+ syserr("putbody: %s: read error", e->e_df);
ExitStat = EX_IOERR;
}
}
/* some mailers want extra blank line at end of message */
- if (bitnset(M_BLANKEND, m->m_flags) && buf[0] != '\0' && buf[0] != '\n')
- putline("", fp, m);
+ if (bitnset(M_BLANKEND, mci->mci_mailer->m_flags) &&
+ buf[0] != '\0' && buf[0] != '\n')
+ putline("", mci);
- (void) fflush(fp);
- if (ferror(fp) && errno != EPIPE)
+ (void) fflush(mci->mci_out);
+ if (ferror(mci->mci_out) && errno != EPIPE)
{
syserr("putbody: write error");
ExitStat = EX_IOERR;
@@ -1923,10 +2167,11 @@ mailfile(filename, ctladdr, e)
{
/* child -- actually write to file */
struct stat stb;
+ MCI mcibuf;
- (void) signal(SIGINT, SIG_DFL);
- (void) signal(SIGHUP, SIG_DFL);
- (void) signal(SIGTERM, SIG_DFL);
+ (void) setsignal(SIGINT, SIG_DFL);
+ (void) setsignal(SIGHUP, SIG_DFL);
+ (void) setsignal(SIGTERM, SIG_DFL);
(void) umask(OldUmask);
if (stat(filename, &stb) < 0)
@@ -1939,9 +2184,7 @@ mailfile(filename, ctladdr, e)
if (bitset(0111, stb.st_mode))
exit(EX_CANTCREAT);
- if (ctladdr == NULL)
- ctladdr = &e->e_from;
- else
+ if (ctladdr != NULL)
{
/* ignore setuid and setgid bits */
mode &= ~(S_ISGID|S_ISUID);
@@ -1954,20 +2197,18 @@ mailfile(filename, ctladdr, e)
if (e->e_dfp == NULL)
{
syserr("mailfile: Cannot open %s for %s from %s",
- e->e_df, e->e_to, e->e_from);
+ e->e_df, e->e_to, e->e_from.q_paddr);
}
}
if (!bitset(S_ISGID, mode) || setgid(stb.st_gid) < 0)
{
- if (ctladdr->q_uid == 0)
+ if (ctladdr == NULL || ctladdr->q_uid == 0)
{
- (void) setgid(DefGid);
(void) initgroups(DefUser, DefGid);
}
else
{
- (void) setgid(ctladdr->q_gid);
(void) initgroups(ctladdr->q_ruser ?
ctladdr->q_ruser : ctladdr->q_user,
ctladdr->q_gid);
@@ -1975,7 +2216,7 @@ mailfile(filename, ctladdr, e)
}
if (!bitset(S_ISUID, mode) || setuid(stb.st_uid) < 0)
{
- if (ctladdr->q_uid == 0)
+ if (ctladdr == NULL || ctladdr->q_uid == 0)
(void) setuid(DefUid);
else
(void) setuid(ctladdr->q_uid);
@@ -1985,18 +2226,24 @@ mailfile(filename, ctladdr, e)
f = dfopen(filename, O_WRONLY|O_CREAT|O_APPEND, FileMode);
if (f == NULL)
{
- message("554 cannot open");
+ message("554 cannot open: %s", errstring(errno));
exit(EX_CANTCREAT);
}
- putfromline(f, FileMailer, e);
- (*e->e_puthdr)(f, FileMailer, e);
- putline("\n", f, FileMailer);
- (*e->e_putbody)(f, FileMailer, e, NULL);
- putline("\n", f, FileMailer);
+ bzero(&mcibuf, sizeof mcibuf);
+ mcibuf.mci_mailer = FileMailer;
+ mcibuf.mci_out = f;
+ if (bitnset(M_7BITS, FileMailer->m_flags))
+ mcibuf.mci_flags |= MCIF_7BIT;
+
+ putfromline(&mcibuf, e);
+ (*e->e_puthdr)(&mcibuf, e);
+ putline("\n", &mcibuf);
+ (*e->e_putbody)(&mcibuf, e, NULL);
+ putline("\n", &mcibuf);
if (ferror(f))
{
- message("451 I/O error");
+ message("451 I/O error: %s", errstring(errno));
setstat(EX_IOERR);
}
(void) xfclose(f, "mailfile", filename);
@@ -2013,10 +2260,13 @@ mailfile(filename, ctladdr, e)
int st;
st = waitfor(pid);
- if ((st & 0377) != 0)
- return (EX_UNAVAILABLE);
+ if (WIFEXITED(st))
+ return (WEXITSTATUS(st));
else
- return ((st >> 8) & 0377);
+ {
+ syserr("child died on signal %d", st);
+ return (EX_UNAVAILABLE);
+ }
/*NOTREACHED*/
}
}
@@ -2049,7 +2299,7 @@ hostsignature(m, host, e)
register STAB *s;
int i;
int len;
-#ifdef NAMED_BIND
+#if NAMED_BIND
int nmx;
auto int rcode;
char *hp;
@@ -2070,13 +2320,6 @@ hostsignature(m, host, e)
}
/*
- ** If it is a numeric address, just return it.
- */
-
- if (host[0] == '[')
- return host;
-
- /*
** Look it up in the symbol table.
*/
@@ -2088,7 +2331,7 @@ hostsignature(m, host, e)
** Not already there -- create a signature.
*/
-#ifdef NAMED_BIND
+#if NAMED_BIND
if (ConfigLevel < 2)
{
oldoptions = _res.options;
@@ -2106,13 +2349,12 @@ hostsignature(m, host, e)
if (nmx <= 0)
{
register MCI *mci;
- extern int errno;
/* update the connection info for this host */
mci = mci_get(hp, m);
mci->mci_exitstat = rcode;
mci->mci_errno = errno;
-#ifdef NAMED_BIND
+#if NAMED_BIND
mci->mci_herrno = h_errno;
#endif
diff --git a/usr.sbin/sendmail/src/domain.c b/usr.sbin/sendmail/src/domain.c
index fe977d29ed6a..48109fef9770 100644
--- a/usr.sbin/sendmail/src/domain.c
+++ b/usr.sbin/sendmail/src/domain.c
@@ -35,14 +35,14 @@
#include "sendmail.h"
#ifndef lint
-#ifdef NAMED_BIND
-static char sccsid[] = "@(#)domain.c 8.1 (Berkeley) 6/7/93 (with name server)";
+#if NAMED_BIND
+static char sccsid[] = "@(#)domain.c 8.19 (Berkeley) 3/11/94 (with name server)";
#else
-static char sccsid[] = "@(#)domain.c 8.1 (Berkeley) 6/7/93 (without name server)";
+static char sccsid[] = "@(#)domain.c 8.19 (Berkeley) 3/11/94 (without name server)";
#endif
#endif /* not lint */
-#ifdef NAMED_BIND
+#if NAMED_BIND
#include <errno.h>
#include <arpa/nameser.h>
@@ -65,6 +65,14 @@ static char MXHostBuf[MAXMXHOSTS*PACKETSZ];
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif
+#ifndef NO_DATA
+# define NO_DATA NO_ADDRESS
+#endif
+
+#ifndef HEADERSZ
+# define HEADERSZ sizeof(HEADER)
+#endif
+
/* don't use sizeof because sizeof(long) is different on 64-bit machines */
#define SHORTSIZE 2 /* size of a short (really, must be 2) */
#define LONGSIZE 4 /* size of a long (really, must be 4) */
@@ -96,18 +104,24 @@ getmxrr(host, mxhosts, droplocalhost, rcode)
{
extern int h_errno;
register u_char *eom, *cp;
- register int i, j, n, nmx;
+ register int i, j, n;
+ int nmx = 0;
register char *bp;
HEADER *hp;
querybuf answer;
int ancount, qdcount, buflen;
- bool seenlocal;
+ bool seenlocal = FALSE;
u_short pref, localpref, type;
char *fallbackMX = FallBackMX;
static bool firsttime = TRUE;
STAB *st;
+ bool trycanon = FALSE;
u_short prefer[MAXMXHOSTS];
int weight[MAXMXHOSTS];
+ extern bool getcanonname();
+
+ if (tTd(8, 2))
+ printf("getmxrr(%s, droplocalhost=%d)\n", host, droplocalhost);
if (fallbackMX != NULL)
{
@@ -127,6 +141,10 @@ getmxrr(host, mxhosts, droplocalhost, rcode)
firsttime = FALSE;
}
+ /* efficiency hack -- numeric or non-MX lookups */
+ if (host[0] == '[')
+ goto punt;
+
errno = 0;
n = res_search(host, C_IN, T_MX, (char *)&answer, sizeof(answer));
if (n < 0)
@@ -137,13 +155,26 @@ getmxrr(host, mxhosts, droplocalhost, rcode)
switch (h_errno)
{
case NO_DATA:
+ trycanon = TRUE;
+ /* fall through */
+
case NO_RECOVERY:
/* no MX data on this host */
goto punt;
case HOST_NOT_FOUND:
+#ifdef BROKEN_RES_SEARCH
+ /* Ultrix resolver returns failure w/ h_errno=0 */
+ case 0:
+#endif
/* the host just doesn't exist */
*rcode = EX_NOHOST;
+
+ if (!UseNameServer)
+ {
+ /* might exist in /etc/hosts */
+ goto punt;
+ }
break;
case TRY_AGAIN:
@@ -154,6 +185,12 @@ getmxrr(host, mxhosts, droplocalhost, rcode)
/* it might come up later; better queue it up */
*rcode = EX_TEMPFAIL;
break;
+
+ default:
+ syserr("getmxrr: res_search (%s) failed with impossible h_errno (%d)\n",
+ host, h_errno);
+ *rcode = EX_OSERR;
+ break;
}
/* irreconcilable differences */
@@ -162,13 +199,11 @@ getmxrr(host, mxhosts, droplocalhost, rcode)
/* find first satisfactory answer */
hp = (HEADER *)&answer;
- cp = (u_char *)&answer + sizeof(HEADER);
+ cp = (u_char *)&answer + HEADERSZ;
eom = (u_char *)&answer + n;
for (qdcount = ntohs(hp->qdcount); qdcount--; cp += n + QFIXEDSZ)
if ((n = dn_skipname(cp, eom)) < 0)
goto punt;
- nmx = 0;
- seenlocal = FALSE;
buflen = sizeof(MXHostBuf) - 1;
bp = MXHostBuf;
ancount = ntohs(hp->ancount);
@@ -198,6 +233,9 @@ getmxrr(host, mxhosts, droplocalhost, rcode)
(st = stab(bp, ST_CLASS, ST_FIND)) != NULL &&
bitnset('w', st->s_class))
{
+ if (tTd(8, 3))
+ printf("found localhost (%s) in MX list, pref=%d\n",
+ bp, pref);
if (!seenlocal || pref < localpref)
localpref = pref;
seenlocal = TRUE;
@@ -216,63 +254,95 @@ getmxrr(host, mxhosts, droplocalhost, rcode)
*bp++ = '\0';
buflen -= n + 1;
}
- if (nmx == 0)
+
+ /* sort the records */
+ for (i = 0; i < nmx; i++)
{
-punt:
- mxhosts[0] = strcpy(MXHostBuf, host);
- bp = &MXHostBuf[strlen(MXHostBuf)];
- if (bp[-1] != '.')
+ for (j = i + 1; j < nmx; j++)
{
- *bp++ = '.';
- *bp = '\0';
+ if (prefer[i] > prefer[j] ||
+ (prefer[i] == prefer[j] && weight[i] > weight[j]))
+ {
+ register int temp;
+ register char *temp1;
+
+ temp = prefer[i];
+ prefer[i] = prefer[j];
+ prefer[j] = temp;
+ temp1 = mxhosts[i];
+ mxhosts[i] = mxhosts[j];
+ mxhosts[j] = temp1;
+ temp = weight[i];
+ weight[i] = weight[j];
+ weight[j] = temp;
+ }
+ }
+ if (seenlocal && prefer[i] >= localpref)
+ {
+ /* truncate higher preference part of list */
+ nmx = i;
}
- nmx = 1;
}
- else
+
+ if (nmx == 0)
{
- /* sort the records */
- for (i = 0; i < nmx; i++)
+punt:
+ if (seenlocal &&
+ (!TryNullMXList || gethostbyname(host) == NULL))
+ {
+ /*
+ ** If we have deleted all MX entries, this is
+ ** an error -- we should NEVER send to a host that
+ ** has an MX, and this should have been caught
+ ** earlier in the config file.
+ **
+ ** Some sites prefer to go ahead and try the
+ ** A record anyway; that case is handled by
+ ** setting TryNullMXList. I believe this is a
+ ** bad idea, but it's up to you....
+ */
+
+ *rcode = EX_CONFIG;
+ syserr("MX list for %s points back to %s",
+ host, MyHostName);
+ return -1;
+ }
+ strcpy(MXHostBuf, host);
+ mxhosts[0] = MXHostBuf;
+ if (host[0] == '[')
{
- for (j = i + 1; j < nmx; j++)
+ register char *p;
+
+ /* this may be an MX suppression-style address */
+ p = strchr(MXHostBuf, ']');
+ if (p != NULL)
{
- if (prefer[i] > prefer[j] ||
- (prefer[i] == prefer[j] && weight[i] > weight[j]))
+ *p = '\0';
+ if (inet_addr(&MXHostBuf[1]) != -1)
+ *p = ']';
+ else
{
- register int temp;
- register char *temp1;
-
- temp = prefer[i];
- prefer[i] = prefer[j];
- prefer[j] = temp;
- temp1 = mxhosts[i];
- mxhosts[i] = mxhosts[j];
- mxhosts[j] = temp1;
- temp = weight[i];
- weight[i] = weight[j];
- weight[j] = temp;
+ trycanon = TRUE;
+ mxhosts[0]++;
}
}
- if (seenlocal && prefer[i] >= localpref)
+ }
+ if (trycanon &&
+ getcanonname(mxhosts[0], sizeof MXHostBuf - 2, FALSE))
+ {
+ bp = &MXHostBuf[strlen(MXHostBuf)];
+ if (bp[-1] != '.')
{
- /*
- * truncate higher pref part of list; if we're
- * the best choice left, we should have realized
- * awhile ago that this was a local delivery.
- */
- if (i == 0)
- {
- *rcode = EX_CONFIG;
- return (-1);
- }
- nmx = i;
- break;
+ *bp++ = '.';
+ *bp = '\0';
}
}
+ nmx = 1;
}
/* if we have a default lowest preference, include that */
- if (FallBackMX != NULL && !seenlocal)
- mxhosts[nmx++] = FallBackMX;
+ if (fallbackMX != NULL && !seenlocal)
+ mxhosts[nmx++] = fallbackMX;
return (nmx);
}
@@ -317,7 +387,7 @@ mxrand(host)
if (isascii(c) && isupper(c))
c = tolower(c);
- hfunc = ((hfunc << 1) + c) % 2003;
+ hfunc = ((hfunc << 1) ^ c) % 2003;
}
hfunc &= 0xff;
@@ -348,6 +418,7 @@ mxrand(host)
** host -- a buffer containing the name of the host.
** This is a value-result parameter.
** hbsize -- the size of the host buffer.
+** trymx -- if set, try MX records as well as A and CNAME.
**
** Returns:
** TRUE -- if the host matched.
@@ -355,9 +426,10 @@ mxrand(host)
*/
bool
-getcanonname(host, hbsize)
+getcanonname(host, hbsize, trymx)
char *host;
int hbsize;
+ bool trymx;
{
extern int h_errno;
register u_char *eom, *ap;
@@ -375,8 +447,10 @@ getcanonname(host, hbsize)
bool gotmx;
int qtype;
int loopcnt;
+ char *xp;
char nbuf[MAX(PACKETSZ, MAXDNAME*2+2)];
char *searchlist[MAXDNSRCH+2];
+ extern char *gethostalias();
if (tTd(8, 2))
printf("getcanonname(%s)\n", host);
@@ -400,6 +474,20 @@ cnameloop:
if (*cp == '.')
n++;
+ if (n == 0 && (xp = gethostalias(host)) != NULL)
+ {
+ if (loopcnt++ > MAXCNAMEDEPTH)
+ {
+ syserr("loop in ${HOSTALIASES} file");
+ }
+ else
+ {
+ strncpy(host, xp, hbsize);
+ host[hbsize - 1] = '\0';
+ goto cnameloop;
+ }
+ }
+
dp = searchlist;
if (n > 0)
*dp++ = "";
@@ -412,6 +500,10 @@ cnameloop:
{
*dp++ = _res.defdname;
}
+ else if (*cp == '.')
+ {
+ *cp = '\0';
+ }
*dp = NULL;
/*
@@ -452,7 +544,7 @@ cnameloop:
qtype = T_A;
continue;
}
- else if (qtype == T_A && !gotmx)
+ else if (qtype == T_A && !gotmx && trymx)
{
qtype = T_MX;
continue;
@@ -480,7 +572,7 @@ cnameloop:
*/
hp = (HEADER *) &answer;
- ap = (u_char *) &answer + sizeof(HEADER);
+ ap = (u_char *) &answer + HEADERSZ;
eom = (u_char *) &answer + ret;
/* skip question part of response -- we know what we asked */
@@ -513,7 +605,7 @@ cnameloop:
if (**dp != '\0')
{
/* got a match -- save that info */
- if (mxmatch == NULL)
+ if (trymx && mxmatch == NULL)
mxmatch = *dp;
continue;
}
@@ -531,9 +623,19 @@ cnameloop:
case T_CNAME:
if (loopcnt++ > MAXCNAMEDEPTH)
{
- syserr("DNS failure: CNAME loop for %s",
+ /*XXX should notify postmaster XXX*/
+ message("DNS failure: CNAME loop for %s",
host);
- continue;
+ if (CurEnv->e_message == NULL)
+ {
+ char ebuf[MAXLINE];
+
+ sprintf(ebuf, "Deferred: DNS failure: CNAME loop for %s",
+ host);
+ CurEnv->e_message = newstr(ebuf);
+ }
+ h_errno = NO_RECOVERY;
+ return FALSE;
}
/* value points at name */
@@ -571,7 +673,7 @@ cnameloop:
if (qtype == T_ANY)
qtype = T_A;
- else if (qtype == T_A && !gotmx)
+ else if (qtype == T_A && !gotmx && trymx)
qtype = T_MX;
else
{
@@ -593,14 +695,63 @@ cnameloop:
return TRUE;
}
+
+char *
+gethostalias(host)
+ char *host;
+{
+ char *fname;
+ FILE *fp;
+ register char *p;
+ char buf[MAXLINE];
+ static char hbuf[MAXDNAME];
+
+ fname = getenv("HOSTALIASES");
+ if (fname == NULL || (fp = fopen(fname, "r")) == NULL)
+ return NULL;
+ while (fgets(buf, sizeof buf, fp) != NULL)
+ {
+ for (p = buf; p != '\0' && !(isascii(*p) && isspace(*p)); p++)
+ continue;
+ if (*p == 0)
+ {
+ /* syntax error */
+ continue;
+ }
+ *p++ = '\0';
+ if (strcasecmp(buf, host) == 0)
+ break;
+ }
+
+ if (feof(fp))
+ {
+ /* no match */
+ fclose(fp);
+ return NULL;
+ }
+
+ /* got a match; extract the equivalent name */
+ while (*p != '\0' && isascii(*p) && isspace(*p))
+ p++;
+ host = p;
+ while (*p != '\0' && !(isascii(*p) && isspace(*p)))
+ p++;
+ *p = '\0';
+ strncpy(hbuf, host, sizeof hbuf - 1);
+ hbuf[sizeof hbuf - 1] = '\0';
+ return hbuf;
+}
+
+
#else /* not NAMED_BIND */
#include <netdb.h>
bool
-getcanonname(host, hbsize)
+getcanonname(host, hbsize, trymx)
char *host;
int hbsize;
+ bool trymx;
{
struct hostent *hp;
diff --git a/usr.sbin/sendmail/src/envelope.c b/usr.sbin/sendmail/src/envelope.c
index 6818d8a59de4..14656f0d7ee1 100644
--- a/usr.sbin/sendmail/src/envelope.c
+++ b/usr.sbin/sendmail/src/envelope.c
@@ -33,11 +33,10 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)envelope.c 8.3 (Berkeley) 7/13/93";
+static char sccsid[] = "@(#)envelope.c 8.33 (Berkeley) 2/10/94";
#endif /* not lint */
#include "sendmail.h"
-#include <sys/time.h>
#include <pwd.h>
/*
@@ -101,6 +100,7 @@ dropenvelope(e)
register ENVELOPE *e;
{
bool queueit = FALSE;
+ bool saveit = bitset(EF_FATALERRS, e->e_flags);
register ADDRESS *q;
char *id = e->e_id;
char buf[MAXLINE];
@@ -109,7 +109,7 @@ dropenvelope(e)
{
printf("dropenvelope %x: id=", e);
xputs(e->e_id);
- printf(", flags=%o\n", e->e_flags);
+ printf(", flags=0x%x\n", e->e_flags);
if (tTd(50, 10))
{
printf("sendq=");
@@ -122,10 +122,13 @@ dropenvelope(e)
return;
#ifdef LOG
+ if (LogLevel > 4 && bitset(EF_LOGSENDER, e->e_flags))
+ logsender(e, NULL);
if (LogLevel > 84)
- syslog(LOG_DEBUG, "dropenvelope, id=%s, flags=%o, pid=%d",
+ syslog(LOG_DEBUG, "dropenvelope, id=%s, flags=0x%x, pid=%d",
id, e->e_flags, getpid());
#endif /* LOG */
+ e->e_flags &= ~EF_LOGSENDER;
/* post statistics */
poststats(StatFile);
@@ -134,10 +137,19 @@ dropenvelope(e)
** Extract state information from dregs of send list.
*/
+ e->e_flags &= ~EF_QUEUERUN;
for (q = e->e_sendqueue; q != NULL; q = q->q_next)
{
if (bitset(QQUEUEUP, q->q_flags))
queueit = TRUE;
+ if (!bitset(QDONTSEND, q->q_flags) &&
+ bitset(QBADADDR, q->q_flags))
+ {
+ if (q->q_owner == NULL &&
+ strcmp(e->e_from.q_paddr, "<>") != 0)
+ (void) sendtolist(e->e_from.q_paddr, NULL,
+ &e->e_errorqueue, e);
+ }
}
/*
@@ -148,16 +160,14 @@ dropenvelope(e)
/* nothing to do */ ;
else if (curtime() > e->e_ctime + TimeOuts.to_q_return)
{
- if (!bitset(EF_TIMEOUT, e->e_flags))
- {
- (void) sprintf(buf, "Cannot send message for %s",
- pintvl(TimeOuts.to_q_return, FALSE));
- if (e->e_message != NULL)
- free(e->e_message);
- e->e_message = newstr(buf);
- message(buf);
- }
- e->e_flags |= EF_TIMEOUT|EF_CLRQUEUE;
+ (void) sprintf(buf, "Cannot send message for %s",
+ pintvl(TimeOuts.to_q_return, FALSE));
+ if (e->e_message != NULL)
+ free(e->e_message);
+ e->e_message = newstr(buf);
+ message(buf);
+ e->e_flags |= EF_CLRQUEUE;
+ saveit = TRUE;
fprintf(e->e_xfp, "Message could not be delivered for %s\n",
pintvl(TimeOuts.to_q_return, FALSE));
fprintf(e->e_xfp, "Message will be deleted from queue\n");
@@ -181,7 +191,8 @@ dropenvelope(e)
free(e->e_message);
e->e_message = newstr(buf);
message(buf);
- e->e_flags |= EF_WARNING|EF_TIMEOUT;
+ e->e_flags |= EF_WARNING;
+ saveit = TRUE;
}
fprintf(e->e_xfp,
"Warning: message still undelivered after %s\n",
@@ -203,35 +214,53 @@ dropenvelope(e)
{
auto ADDRESS *rlist = NULL;
- (void) sendtolist(e->e_receiptto, (ADDRESS *) NULL, &rlist, e);
+ (void) sendtolist(e->e_receiptto, NULLADDR, &rlist, e);
(void) returntosender("Return receipt", rlist, FALSE, e);
+ e->e_flags &= ~EF_SENDRECEIPT;
}
/*
** Arrange to send error messages if there are fatal errors.
*/
- if (bitset(EF_FATALERRS|EF_TIMEOUT, e->e_flags) &&
- e->e_errormode != EM_QUIET)
+ if (saveit && e->e_errormode != EM_QUIET)
savemail(e);
/*
+ ** Arrange to send warning messages to postmaster as requested.
+ */
+
+ if (bitset(EF_PM_NOTIFY, e->e_flags) && PostMasterCopy != NULL &&
+ !bitset(EF_RESPONSE, e->e_flags) && e->e_class >= 0)
+ {
+ auto ADDRESS *rlist = NULL;
+
+ (void) sendtolist(PostMasterCopy, NULLADDR, &rlist, e);
+ (void) returntosender(e->e_message, rlist, FALSE, e);
+ }
+
+ /*
** Instantiate or deinstantiate the queue.
*/
if ((!queueit && !bitset(EF_KEEPQUEUE, e->e_flags)) ||
bitset(EF_CLRQUEUE, e->e_flags))
{
- if (tTd(50, 2))
- printf("Dropping envelope\n");
+ if (tTd(50, 1))
+ printf("\n===== Dropping [dq]f%s =====\n\n", e->e_id);
if (e->e_df != NULL)
xunlink(e->e_df);
xunlink(queuename(e, 'q'));
+
+#ifdef LOG
+ if (LogLevel > 10)
+ syslog(LOG_INFO, "%s: done", id);
+#endif
}
else if (queueit || !bitset(EF_INQUEUE, e->e_flags))
{
#ifdef QUEUE
- queueup(e, FALSE, FALSE);
+ queueup(e, bitset(EF_KEEPQUEUE, e->e_flags), FALSE);
#else /* QUEUE */
syserr("554 dropenvelope: queueup");
#endif /* QUEUE */
@@ -246,11 +275,6 @@ dropenvelope(e)
(void) xfclose(e->e_dfp, "dropenvelope", e->e_df);
e->e_dfp = NULL;
e->e_id = e->e_df = NULL;
-
-#ifdef LOG
- if (LogLevel > 74)
- syslog(LOG_INFO, "%s: done", id);
-#endif /* LOG */
}
/*
** CLEARENVELOPE -- clear an envelope without unlocking
@@ -326,8 +350,8 @@ void
initsys(e)
register ENVELOPE *e;
{
- static char cbuf[5]; /* holds hop count */
- static char pbuf[10]; /* holds pid */
+ char cbuf[5]; /* holds hop count */
+ char pbuf[10]; /* holds pid */
#ifdef TTYNAME
static char ybuf[60]; /* holds tty id */
register char *p;
@@ -351,7 +375,7 @@ initsys(e)
** tucked away in the transcript).
*/
- if (OpMode == MD_DAEMON && !bitset(EF_QUEUERUN, e->e_flags) &&
+ if (OpMode == MD_DAEMON && bitset(EF_QUEUERUN, e->e_flags) &&
e->e_xfp != NULL)
OutChannel = e->e_xfp;
@@ -361,11 +385,11 @@ initsys(e)
/* process id */
(void) sprintf(pbuf, "%d", getpid());
- define('p', pbuf, e);
+ define('p', newstr(pbuf), e);
/* hop count */
(void) sprintf(cbuf, "%d", e->e_hopcount);
- define('c', cbuf, e);
+ define('c', newstr(cbuf), e);
/* time as integer, unix time, arpa time */
settime(e);
@@ -404,8 +428,8 @@ settime(e)
{
register char *p;
auto time_t now;
- static char tbuf[20]; /* holds "current" time */
- static char dbuf[30]; /* holds ctime(tbuf) */
+ char tbuf[20]; /* holds "current" time */
+ char dbuf[30]; /* holds ctime(tbuf) */
register struct tm *tm;
extern char *arpadate();
extern struct tm *gmtime();
@@ -414,13 +438,14 @@ settime(e)
tm = gmtime(&now);
(void) sprintf(tbuf, "%04d%02d%02d%02d%02d", tm->tm_year + 1900,
tm->tm_mon+1, tm->tm_mday, tm->tm_hour, tm->tm_min);
- define('t', tbuf, e);
+ define('t', newstr(tbuf), e);
(void) strcpy(dbuf, ctime(&now));
p = strchr(dbuf, '\n');
if (p != NULL)
*p = '\0';
- define('d', dbuf, e);
- p = newstr(arpadate(dbuf));
+ define('d', newstr(dbuf), e);
+ p = arpadate(dbuf);
+ p = newstr(p);
if (macvalue('a', e) == NULL)
define('a', p, e);
define('b', p, e);
@@ -464,6 +489,15 @@ openxscript(e)
syserr("!Can't open /dev/null");
}
e->e_xfp = fdopen(fd, "w");
+ if (e->e_xfp == NULL)
+ {
+ syserr("!Can't create transcript stream %s", p);
+ }
+ if (tTd(46, 9))
+ {
+ printf("openxscript(%s):\n ", p);
+ dumpfd(fileno(e->e_xfp), TRUE, FALSE);
+ }
}
/*
** CLOSEXSCRIPT -- close the transcript file.
@@ -535,7 +569,8 @@ setsender(from, e, delimptr, internal)
char *realname = NULL;
register struct passwd *pw;
char delimchar;
- char buf[MAXNAME];
+ char *bp;
+ char buf[MAXNAME + 2];
char pvpbuf[PSBUFSIZE];
extern struct passwd *getpwnam();
extern char *FullName;
@@ -548,7 +583,8 @@ setsender(from, e, delimptr, internal)
** Username can return errno != 0 on non-errors.
*/
- if (bitset(EF_QUEUERUN, e->e_flags) || OpMode == MD_SMTP)
+ if (bitset(EF_QUEUERUN, e->e_flags) || OpMode == MD_SMTP ||
+ OpMode == MD_ARPAFTP || OpMode == MD_DAEMON)
realname = from;
if (realname == NULL || realname[0] == '\0')
realname = username();
@@ -557,8 +593,14 @@ setsender(from, e, delimptr, internal)
SuprErrs = TRUE;
delimchar = internal ? '\0' : ' ';
+ e->e_from.q_flags = QBADADDR;
if (from == NULL ||
- parseaddr(from, &e->e_from, 1, delimchar, delimptr, e) == NULL)
+ parseaddr(from, &e->e_from, RF_COPYALL|RF_SENDERADDR,
+ delimchar, delimptr, e) == NULL ||
+ bitset(QBADADDR, e->e_from.q_flags) ||
+ e->e_from.q_mailer == ProgMailer ||
+ e->e_from.q_mailer == FileMailer ||
+ e->e_from.q_mailer == InclMailer)
{
/* log garbage addresses for traceback */
# ifdef LOG
@@ -577,17 +619,31 @@ setsender(from, e, delimptr, internal)
p = ebuf;
}
syslog(LOG_NOTICE,
- "from=%s unparseable, received from %s",
- from, p);
+ "setsender: %s: invalid or unparseable, received from %s",
+ shortenstring(from, 83), p);
}
# endif /* LOG */
if (from != NULL)
+ {
+ if (!bitset(QBADADDR, e->e_from.q_flags))
+ {
+ /* it was a bogus mailer in the from addr */
+ usrerr("553 Invalid sender address");
+ }
SuprErrs = TRUE;
+ }
if (from == realname ||
- parseaddr(from = newstr(realname), &e->e_from, 1, ' ', NULL, e) == NULL)
+ parseaddr(from = newstr(realname), &e->e_from,
+ RF_COPYALL|RF_SENDERADDR, ' ', NULL, e) == NULL)
{
+ char nbuf[100];
+
SuprErrs = TRUE;
- if (parseaddr("postmaster", &e->e_from, 1, ' ', NULL, e) == NULL)
+ expand("\201n", nbuf, &nbuf[sizeof nbuf], e);
+ if (parseaddr(from = newstr(nbuf), &e->e_from,
+ RF_COPYALL, ' ', NULL, e) == NULL &&
+ parseaddr(from = "postmaster", &e->e_from,
+ RF_COPYALL, ' ', NULL, e) == NULL)
syserr("553 setsender: can't even parse postmaster!");
}
}
@@ -618,7 +674,7 @@ setsender(from, e, delimptr, internal)
FullName = NULL;
# ifdef USERDB
- p = udbsender(from);
+ p = udbsender(e->e_from.q_user);
if (p != NULL)
{
@@ -626,7 +682,7 @@ setsender(from, e, delimptr, internal)
** We have an alternate address for the sender
*/
- pvp = prescan(p, '\0', pvpbuf, NULL);
+ pvp = prescan(p, '\0', pvpbuf, sizeof pvpbuf, NULL);
}
# endif /* USERDB */
}
@@ -637,14 +693,17 @@ setsender(from, e, delimptr, internal)
** Process passwd file entry.
*/
-
/* extract home directory */
- e->e_from.q_home = newstr(pw->pw_dir);
+ if (strcmp(pw->pw_dir, "/") == 0)
+ e->e_from.q_home = newstr("");
+ else
+ e->e_from.q_home = newstr(pw->pw_dir);
define('z', e->e_from.q_home, e);
/* extract user and group id */
e->e_from.q_uid = pw->pw_uid;
e->e_from.q_gid = pw->pw_gid;
+ e->e_from.q_flags |= QGOODUID;
/* extract full name from passwd file */
if (FullName == NULL && pw->pw_gecos != NULL &&
@@ -659,12 +718,18 @@ setsender(from, e, delimptr, internal)
if (FullName != NULL && !internal)
define('x', FullName, e);
}
- else if (!internal)
+ else if (!internal && OpMode != MD_DAEMON)
{
if (e->e_from.q_home == NULL)
+ {
e->e_from.q_home = getenv("HOME");
+ if (e->e_from.q_home != NULL &&
+ strcmp(e->e_from.q_home, "/") == 0)
+ e->e_from.q_home++;
+ }
e->e_from.q_uid = RealUid;
e->e_from.q_gid = RealGid;
+ e->e_from.q_flags |= QGOODUID;
}
/*
@@ -673,7 +738,7 @@ setsender(from, e, delimptr, internal)
*/
if (pvp == NULL)
- pvp = prescan(from, '\0', pvpbuf, NULL);
+ pvp = prescan(from, delimchar, pvpbuf, sizeof pvpbuf, NULL);
if (pvp == NULL)
{
/* don't need to give error -- prescan did that already */
@@ -683,15 +748,22 @@ setsender(from, e, delimptr, internal)
# endif
finis();
}
- (void) rewrite(pvp, 3, e);
- (void) rewrite(pvp, 1, e);
- (void) rewrite(pvp, 4, e);
- cataddr(pvp, NULL, buf, sizeof buf, '\0');
- e->e_sender = newstr(buf);
+ (void) rewrite(pvp, 3, 0, e);
+ (void) rewrite(pvp, 1, 0, e);
+ (void) rewrite(pvp, 4, 0, e);
+ bp = buf + 1;
+ cataddr(pvp, NULL, bp, sizeof buf - 2, '\0');
+ if (*bp == '@')
+ {
+ /* heuristic: route-addr: add angle brackets */
+ strcat(bp, ">");
+ *--bp = '<';
+ }
+ e->e_sender = newstr(bp);
define('f', e->e_sender, e);
/* save the domain spec if this mailer wants it */
- if (!internal && e->e_from.q_mailer != NULL &&
+ if (e->e_from.q_mailer != NULL &&
bitnset(M_CANONICAL, e->e_from.q_mailer->m_flags))
{
extern char **copyplist();
diff --git a/usr.sbin/sendmail/src/err.c b/usr.sbin/sendmail/src/err.c
index 9ee17becf456..fee36c4b42af 100644
--- a/usr.sbin/sendmail/src/err.c
+++ b/usr.sbin/sendmail/src/err.c
@@ -33,12 +33,13 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)err.c 8.2 (Berkeley) 7/11/93";
+static char sccsid[] = "@(#)err.c 8.26 (Berkeley) 3/11/94";
#endif /* not lint */
# include "sendmail.h"
# include <errno.h>
# include <netdb.h>
+# include <pwd.h>
/*
** SYSERR -- Print error message.
@@ -64,13 +65,13 @@ static char sccsid[] = "@(#)err.c 8.2 (Berkeley) 7/11/93";
** sets ExitStat.
*/
-# ifdef lint
-int sys_nerr;
-char *sys_errlist[];
-# endif lint
char MsgBuf[BUFSIZ*2]; /* text of most recent message */
-static void fmtmsg();
+static void fmtmsg();
+
+#if NAMED_BIND && !defined(NO_DATA)
+# define NO_DATA NO_ADDRESS
+#endif
void
/*VARARGS1*/
@@ -85,6 +86,11 @@ syserr(fmt, va_alist)
register char *p;
int olderrno = errno;
bool panic;
+#ifdef LOG
+ char *uname;
+ struct passwd *pw;
+ char ubuf[80];
+#endif
VA_LOCAL_DECL
panic = *fmt == '!';
@@ -108,14 +114,30 @@ syserr(fmt, va_alist)
ExitStat = EX_SOFTWARE;
else
ExitStat = EX_OSERR;
+ if (tTd(54, 1))
+ printf("syserr: ExitStat = %d\n", ExitStat);
}
# ifdef LOG
+ pw = getpwuid(getuid());
+ if (pw != NULL)
+ uname = pw->pw_name;
+ else
+ {
+ uname = ubuf;
+ sprintf(ubuf, "UID%d", getuid());
+ }
+
if (LogLevel > 0)
- syslog(panic ? LOG_ALERT : LOG_CRIT, "%s: SYSERR: %s",
+ syslog(panic ? LOG_ALERT : LOG_CRIT, "%s: SYSERR(%s): %s",
CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id,
- &MsgBuf[4]);
+ uname, &MsgBuf[4]);
# endif /* LOG */
+ if (olderrno == EMFILE)
+ {
+ printopenfds(TRUE);
+ mci_dump_all(TRUE);
+ }
if (panic)
{
#ifdef XLA
@@ -154,8 +176,6 @@ usrerr(fmt, va_alist)
#endif
{
VA_LOCAL_DECL
- extern char SuprErrs;
- extern int errno;
if (SuprErrs)
return;
@@ -265,29 +285,45 @@ putoutmsg(msg, holdmsg)
char *msg;
bool holdmsg;
{
+ /* display for debugging */
+ if (tTd(54, 8))
+ printf("--- %s%s\n", msg, holdmsg ? " (held)" : "");
+
/* output to transcript if serious */
- if (CurEnv->e_xfp != NULL && (msg[0] == '4' || msg[0] == '5'))
+ if (CurEnv->e_xfp != NULL && strchr("456", msg[0]) != NULL)
fprintf(CurEnv->e_xfp, "%s\n", msg);
/* output to channel if appropriate */
if (holdmsg || (!Verbose && msg[0] == '0'))
return;
+ /* map warnings to something SMTP can handle */
+ if (msg[0] == '6')
+ msg[0] = '5';
+
(void) fflush(stdout);
- if (OpMode == MD_SMTP)
+
+ /* if DisConnected, OutChannel now points to the transcript */
+ if (!DisConnected &&
+ (OpMode == MD_SMTP || OpMode == MD_DAEMON || OpMode == MD_ARPAFTP))
fprintf(OutChannel, "%s\r\n", msg);
else
fprintf(OutChannel, "%s\n", &msg[4]);
if (TrafficLogFile != NULL)
fprintf(TrafficLogFile, "%05d >>> %s\n", getpid(),
- OpMode == MD_SMTP ? msg : &msg[4]);
+ (OpMode == MD_SMTP || OpMode == MD_DAEMON) ? msg : &msg[4]);
if (msg[3] == ' ')
(void) fflush(OutChannel);
- if (!ferror(OutChannel))
+ if (!ferror(OutChannel) || DisConnected)
return;
- /* error on output -- if reporting lost channel, just ignore it */
- if (feof(InChannel) || ferror(InChannel))
+ /*
+ ** Error on output -- if reporting lost channel, just ignore it.
+ ** Also, ignore errors from QUIT response (221 message) -- some
+ ** rude servers don't read result.
+ */
+
+ if (feof(InChannel) || ferror(InChannel) || strncmp(msg, "221", 3) == 0)
return;
/* can't call syserr, 'cause we are using MsgBuf */
@@ -295,9 +331,10 @@ putoutmsg(msg, holdmsg)
#ifdef LOG
if (LogLevel > 0)
syslog(LOG_CRIT,
- "%s: SYSERR: putoutmsg (%s): error on output channel sending \"%s\"",
+ "%s: SYSERR: putoutmsg (%s): error on output channel sending \"%s\": %m",
CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id,
- CurHostName, msg);
+ CurHostName == NULL ? "NO-HOST" : CurHostName,
+ msg);
#endif
}
/*
@@ -316,13 +353,23 @@ putoutmsg(msg, holdmsg)
puterrmsg(msg)
char *msg;
{
+ char msgcode = msg[0];
+
/* output the message as usual */
putoutmsg(msg, HoldErrs);
/* signal the error */
Errors++;
- if (msg[0] == '5')
+ if (msgcode == '6')
+ {
+ /* notify the postmaster */
+ CurEnv->e_flags |= EF_PM_NOTIFY;
+ }
+ else if (msgcode == '5' && bitset(EF_GLOBALERRS, CurEnv->e_flags))
+ {
+ /* mark long-term fatal errors */
CurEnv->e_flags |= EF_FATALERRS;
+ }
}
/*
** FMTMSG -- format a message into buffer.
@@ -377,7 +424,7 @@ fmtmsg(eb, to, num, eno, fmt, ap)
/* output the "to" person */
if (to != NULL && to[0] != '\0')
{
- (void) sprintf(eb, "%s... ", to);
+ (void) sprintf(eb, "%s... ", shortenstring(to, 203));
while (*eb != '\0')
*eb++ &= 0177;
}
@@ -396,46 +443,53 @@ fmtmsg(eb, to, num, eno, fmt, ap)
eb += strlen(eb);
}
- if (CurEnv->e_message == NULL && strchr("45", num[0]) != NULL)
+ if (num[0] == '5' || (CurEnv->e_message == NULL && num[0] == '4'))
+ {
+ if (CurEnv->e_message != NULL)
+ free(CurEnv->e_message);
CurEnv->e_message = newstr(meb);
+ }
}
/*
** ERRSTRING -- return string description of error code
**
** Parameters:
-** errno -- the error number to translate
+** errnum -- the error number to translate
**
** Returns:
-** A string description of errno.
+** A string description of errnum.
**
** Side Effects:
** none.
*/
const char *
-errstring(errno)
- int errno;
+errstring(errnum)
+ int errnum;
{
- extern const char *const sys_errlist[];
- extern int sys_nerr;
+ char *dnsmsg;
static char buf[MAXLINE];
+# ifndef ERRLIST_PREDEFINED
+ extern char *sys_errlist[];
+ extern int sys_nerr;
+# endif
# ifdef SMTP
extern char *SmtpPhase;
# endif /* SMTP */
-# ifdef DAEMON
-# ifdef ETIMEDOUT
/*
** Handle special network error codes.
**
** These are 4.2/4.3bsd specific; they should be in daemon.c.
*/
- switch (errno)
+ dnsmsg = NULL;
+ switch (errnum)
{
+# if defined(DAEMON) && defined(ETIMEDOUT)
case ETIMEDOUT:
case ECONNRESET:
- (void) strcpy(buf, sys_errlist[errno]);
+ (void) strcpy(buf, sys_errlist[errnum]);
if (SmtpPhase != NULL)
{
(void) strcat(buf, " during ");
@@ -459,27 +513,49 @@ errstring(errno)
break;
(void) sprintf(buf, "Connection refused by %s", CurHostName);
return (buf);
+# endif
-# ifdef NAMED_BIND
- case HOST_NOT_FOUND + MAX_ERRNO:
- return ("Name server: host not found");
+ case EOPENTIMEOUT:
+ return "Timeout on file open";
- case TRY_AGAIN + MAX_ERRNO:
- return ("Name server: host name lookup failure");
+# if NAMED_BIND
+ case HOST_NOT_FOUND + E_DNSBASE:
+ dnsmsg = "host not found";
+ break;
- case NO_RECOVERY + MAX_ERRNO:
- return ("Name server: non-recoverable error");
+ case TRY_AGAIN + E_DNSBASE:
+ dnsmsg = "host name lookup failure";
+ break;
- case NO_DATA + MAX_ERRNO:
- return ("Name server: no data known for name");
+ case NO_RECOVERY + E_DNSBASE:
+ dnsmsg = "non-recoverable error";
+ break;
+
+ case NO_DATA + E_DNSBASE:
+ dnsmsg = "no data known";
+ break;
# endif
+
+ case EPERM:
+ /* SunOS gives "Not owner" -- this is the POSIX message */
+ return "Operation not permitted";
+ }
+
+ if (dnsmsg != NULL)
+ {
+ (void) strcpy(buf, "Name server: ");
+ if (CurHostName != NULL)
+ {
+ (void) strcat(buf, CurHostName);
+ (void) strcat(buf, ": ");
+ }
+ (void) strcat(buf, dnsmsg);
+ return buf;
}
-# endif
-# endif
- if (errno > 0 && errno < sys_nerr)
- return (sys_errlist[errno]);
+ if (errnum > 0 && errnum < sys_nerr)
+ return (sys_errlist[errnum]);
- (void) sprintf(buf, "Error %d", errno);
+ (void) sprintf(buf, "Error %d", errnum);
return (buf);
}
diff --git a/usr.sbin/sendmail/src/headers.c b/usr.sbin/sendmail/src/headers.c
index 6679b50347d5..0d80b884b10f 100644
--- a/usr.sbin/sendmail/src/headers.c
+++ b/usr.sbin/sendmail/src/headers.c
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)headers.c 8.2 (Berkeley) 7/11/93";
+static char sccsid[] = "@(#)headers.c 8.30 (Berkeley) 2/25/94";
#endif /* not lint */
# include <errno.h>
@@ -70,6 +70,7 @@ chompheader(line, def, e)
struct hdrinfo *hi;
bool cond = FALSE;
BITMAP mopts;
+ char buf[MAXNAME];
if (tTd(31, 6))
printf("chompheader: %s\n", line);
@@ -96,16 +97,18 @@ chompheader(line, def, e)
/* find canonical name */
fname = p;
- p = strchr(p, ':');
- if (p == NULL)
+ while (isascii(*p) && isgraph(*p) && *p != ':')
+ p++;
+ fvalue = p;
+ while (isascii(*p) && isspace(*p))
+ p++;
+ if (*p++ != ':' || fname == fvalue)
{
syserr("553 header syntax error, line \"%s\"", line);
return (0);
}
- fvalue = &p[1];
- while (isascii(*--p) && isspace(*p))
- continue;
- *++p = '\0';
+ *fvalue = '\0';
+ fvalue = p;
/* strip field value on front */
if (*fvalue == ' ')
@@ -118,6 +121,14 @@ chompheader(line, def, e)
break;
}
+ if (tTd(31, 9))
+ {
+ if (hi->hi_field == NULL)
+ printf("no header match\n");
+ else
+ printf("header match, hi_flags=%o\n", hi->hi_flags);
+ }
+
/* see if this is a resent message */
if (!def && bitset(H_RESENT, hi->hi_flags))
e->e_flags |= EF_RESENT;
@@ -126,7 +137,12 @@ chompheader(line, def, e)
if (bitset(H_EOH, hi->hi_flags))
return (hi->hi_flags);
- /* drop explicit From: if same as what we would generate -- for MH */
+ /*
+ ** Drop explicit From: if same as what we would generate.
+ ** This is to make MH (which doesn't always give a full name)
+ ** insert the full name information in all circumstances.
+ */
+
p = "resent-from";
if (!bitset(EF_RESENT, e->e_flags))
p += 7;
@@ -141,6 +157,46 @@ chompheader(line, def, e)
(strcmp(fvalue, e->e_from.q_paddr) == 0 ||
strcmp(fvalue, e->e_from.q_user) == 0))
return (hi->hi_flags);
+#ifdef MAYBENEXTRELEASE /* XXX UNTESTED XXX UNTESTED XXX UNTESTED XXX */
+#ifdef USERDB
+ else
+ {
+ auto ADDRESS a;
+ char *fancy;
+ bool oldSuprErrs = SuprErrs;
+ extern char *crackaddr();
+ extern char *udbsender();
+
+ /*
+ ** Try doing USERDB rewriting even on fully commented
+ ** names; this saves the "comment" information (such
+ ** as full name) and rewrites the electronic part.
+ **
+ ** XXX This code doesn't belong here -- parsing should
+ ** XXX not be done during collect() phase because
+ ** XXX error messages can confuse the SMTP phase.
+ ** XXX Setting SuprErrs is a crude hack around this
+ ** XXX problem.
+ */
+
+ if (OpMode == MD_SMTP || OpMode == MD_ARPAFTP)
+ SuprErrs = TRUE;
+ fancy = crackaddr(fvalue);
+ if (parseaddr(fvalue, &a, RF_COPYNONE, '\0', NULL, e) != NULL &&
+ a.q_mailer == LocalMailer &&
+ (p = udbsender(a.q_user)) != NULL)
+ {
+ char *oldg = macvalue('g', e);
+
+ define('g', p, e);
+ expand(fancy, buf, &buf[sizeof buf], e);
+ define('g', oldg, e);
+ fvalue = buf;
+ }
+ SuprErrs = oldSuprErrs;
+ }
+#endif
+#endif
}
/* delete default value for this header */
@@ -155,7 +211,7 @@ chompheader(line, def, e)
/* create a new node */
h = (HDR *) xalloc(sizeof *h);
h->h_field = newstr(fname);
- h->h_value = NULL;
+ h->h_value = newstr(fvalue);
h->h_link = NULL;
bcopy((char *) mopts, (char *) h->h_mflags, sizeof mopts);
*hp = h;
@@ -164,9 +220,6 @@ chompheader(line, def, e)
h->h_flags |= H_DEFAULT;
if (cond)
h->h_flags |= H_CHECK;
- if (h->h_value != NULL)
- free((char *) h->h_value);
- h->h_value = newstr(fvalue);
/* hack to see if this is a new format message */
if (!def && bitset(H_RCPT|H_FROM, h->h_flags) &&
@@ -323,14 +376,30 @@ eatheader(e, full)
define('f', e->e_sender, e);
define('g', e->e_sender, e);
+ if (e->e_origrcpt != NULL && *e->e_origrcpt != '\0')
+ define('u', e->e_origrcpt, e);
+ else
+ define('u', NULL, e);
+
+ /* full name of from person */
+ p = hvalue("full-name", e);
+ if (p != NULL)
+ define('x', p, e);
if (tTd(32, 1))
printf("----- collected header -----\n");
msgid = "<none>";
for (h = e->e_header; h != NULL; h = h->h_link)
{
+ if (h->h_value == NULL)
+ {
+ if (tTd(32, 1))
+ printf("%s: <NULL>\n", h->h_field);
+ continue;
+ }
+
/* do early binding */
- if (bitset(H_DEFAULT, h->h_flags) && h->h_value != NULL)
+ if (bitset(H_DEFAULT, h->h_flags))
{
expand(h->h_value, buf, &buf[sizeof buf], e);
if (buf[0] != '\0')
@@ -341,7 +410,11 @@ eatheader(e, full)
}
if (tTd(32, 1))
- printf("%s: %s\n", h->h_field, h->h_value);
+ {
+ printf("%s: ", h->h_field);
+ xputs(h->h_value);
+ printf("\n");
+ }
/* count the number of times it has been processed */
if (bitset(H_TRACE, h->h_flags))
@@ -352,13 +425,18 @@ eatheader(e, full)
!bitset(H_DEFAULT, h->h_flags) &&
(!bitset(EF_RESENT, e->e_flags) || bitset(H_RESENT, h->h_flags)))
{
- (void) sendtolist(h->h_value, (ADDRESS *) NULL,
+ int saveflags = e->e_flags;
+
+ (void) sendtolist(h->h_value, NULLADDR,
&e->e_sendqueue, e);
+
+ /* delete fatal errors generated by this address */
+ if (!GrabTo && !bitset(EF_FATALERRS, saveflags))
+ e->e_flags &= ~EF_FATALERRS;
}
/* save the message-id for logging */
- if (full && h->h_value != NULL &&
- strcasecmp(h->h_field, "message-id") == 0)
+ if (full && strcasecmp(h->h_field, "message-id") == 0)
{
msgid = h->h_value;
while (isascii(*msgid) && isspace(*msgid))
@@ -371,7 +449,7 @@ eatheader(e, full)
/* see if this is an errors-to header */
if (UseErrorsTo && bitset(H_ERRORSTO, h->h_flags))
- (void) sendtolist(h->h_value, (ADDRESS *) NULL,
+ (void) sendtolist(h->h_value, NULLADDR,
&e->e_errorqueue, e);
}
if (tTd(32, 1))
@@ -394,11 +472,6 @@ eatheader(e, full)
- e->e_class * WkClassFact
+ e->e_nrcpts * WkRecipFact;
- /* full name of from person */
- p = hvalue("full-name", e);
- if (p != NULL)
- define('x', p, e);
-
/* date message originated */
p = hvalue("posted-date", e);
if (p == NULL)
@@ -407,53 +480,130 @@ eatheader(e, full)
define('a', p, e);
/*
+ ** From person in antiquated ARPANET mode
+ ** required by UK Grey Book e-mail gateways (sigh)
+ */
+
+ if (OpMode == MD_ARPAFTP)
+ {
+ register struct hdrinfo *hi;
+
+ for (hi = HdrInfo; hi->hi_field != NULL; hi++)
+ {
+ if (bitset(H_FROM, hi->hi_flags) &&
+ (!bitset(H_RESENT, hi->hi_flags) ||
+ bitset(EF_RESENT, e->e_flags)) &&
+ (p = hvalue(hi->hi_field, e)) != NULL)
+ break;
+ }
+ if (hi->hi_field != NULL)
+ {
+ if (tTd(32, 2))
+ printf("eatheader: setsender(*%s == %s)\n",
+ hi->hi_field, p);
+ setsender(p, e, NULL, TRUE);
+ }
+ }
+
+ /*
** Log collection information.
*/
# ifdef LOG
if (full && LogLevel > 4)
+ logsender(e, msgid);
+# endif /* LOG */
+ e->e_flags &= ~EF_LOGSENDER;
+}
+ /*
+** LOGSENDER -- log sender information
+**
+** Parameters:
+** e -- the envelope to log
+** msgid -- the message id
+**
+** Returns:
+** none
+*/
+
+logsender(e, msgid)
+ register ENVELOPE *e;
+ char *msgid;
+{
+ char *name;
+ register char *sbp;
+ register char *p;
+ char hbuf[MAXNAME];
+ char sbuf[MAXLINE];
+
+ if (bitset(EF_RESPONSE, e->e_flags))
+ name = "[RESPONSE]";
+ else if ((name = macvalue('_', e)) != NULL)
+ ;
+ else if (RealHostName == NULL)
+ name = "localhost";
+ else if (RealHostName[0] == '[')
+ name = RealHostName;
+ else
{
- char *name;
- register char *sbp;
- char hbuf[MAXNAME];
- char sbuf[MAXLINE];
-
- if (bitset(EF_RESPONSE, e->e_flags))
- name = "[RESPONSE]";
- else if ((name = macvalue('_', e)) != NULL)
- ;
- else if (RealHostName[0] == '[')
- name = RealHostName;
- else
+ name = hbuf;
+ (void) sprintf(hbuf, "%.80s", RealHostName);
+ if (RealHostAddr.sa.sa_family != 0)
{
- name = hbuf;
- (void) sprintf(hbuf, "%.80s", RealHostName);
- if (RealHostAddr.sa.sa_family != 0)
- {
- p = &hbuf[strlen(hbuf)];
- (void) sprintf(p, " (%s)",
- anynet_ntoa(&RealHostAddr));
- }
+ p = &hbuf[strlen(hbuf)];
+ (void) sprintf(p, " (%s)",
+ anynet_ntoa(&RealHostAddr));
}
+ }
- /* some versions of syslog only take 5 printf args */
- sbp = sbuf;
- sprintf(sbp, "from=%.200s, size=%ld, class=%d, pri=%ld, nrcpts=%d, msgid=%.100s",
- e->e_from.q_paddr, e->e_msgsize, e->e_class,
- e->e_msgpriority, e->e_nrcpts, msgid);
+ /* some versions of syslog only take 5 printf args */
+# if (SYSLOG_BUFSIZE) >= 256
+ sbp = sbuf;
+ sprintf(sbp, "from=%.200s, size=%ld, class=%d, pri=%ld, nrcpts=%d",
+ e->e_from.q_paddr, e->e_msgsize, e->e_class,
+ e->e_msgpriority, e->e_nrcpts);
+ sbp += strlen(sbp);
+ if (msgid != NULL)
+ {
+ sprintf(sbp, ", msgid=%.100s", msgid);
sbp += strlen(sbp);
- if (e->e_bodytype != NULL)
- {
- (void) sprintf(sbp, ", bodytype=%.20s", e->e_bodytype);
- sbp += strlen(sbp);
- }
- p = macvalue('r', e);
- if (p != NULL)
- (void) sprintf(sbp, ", proto=%.20s", p);
- syslog(LOG_INFO, "%s: %s, relay=%s",
- e->e_id, sbuf, name);
}
-# endif /* LOG */
+ if (e->e_bodytype != NULL)
+ {
+ (void) sprintf(sbp, ", bodytype=%.20s", e->e_bodytype);
+ sbp += strlen(sbp);
+ }
+ p = macvalue('r', e);
+ if (p != NULL)
+ (void) sprintf(sbp, ", proto=%.20s", p);
+ syslog(LOG_INFO, "%s: %s, relay=%s",
+ e->e_id, sbuf, name);
+
+# else /* short syslog buffer */
+
+ syslog(LOG_INFO, "%s: from=%s",
+ e->e_id, shortenstring(e->e_from.q_paddr, 83));
+ syslog(LOG_INFO, "%s: size=%ld, class=%ld, pri=%ld, nrcpts=%d",
+ e->e_id, e->e_msgsize, e->e_class,
+ e->e_msgpriority, e->e_nrcpts);
+ if (msgid != NULL)
+ syslog(LOG_INFO, "%s: msgid=%s", e->e_id, msgid);
+ sbp = sbuf;
+ sprintf(sbp, "%s:", e->e_id);
+ sbp += strlen(sbp);
+ if (e->e_bodytype != NULL)
+ {
+ sprintf(sbp, " bodytype=%s,", e->e_bodytype);
+ sbp += strlen(sbp);
+ }
+ p = macvalue('r', e);
+ if (p != NULL)
+ {
+ sprintf(sbp, " proto=%s,", p);
+ sbp += strlen(sbp);
+ }
+ syslog(LOG_INFO, "%s relay=%s", sbuf, name);
+# endif
}
/*
** PRIENCODE -- encode external priority names into internal values.
@@ -525,6 +675,7 @@ crackaddr(addr)
bool skipping;
bool putgmac = FALSE;
bool quoteit = FALSE;
+ bool gotangle = FALSE;
register char *bp;
char *buflim;
static char buf[MAXNAME];
@@ -579,7 +730,7 @@ crackaddr(addr)
}
/* check for quoted strings */
- if (c == '"')
+ if (c == '"' && cmtlev <= 0)
{
qmode = !qmode;
if (copylev > 0 && !skipping)
@@ -623,13 +774,12 @@ crackaddr(addr)
else if (c == ')')
{
/* syntax error: unmatched ) */
- if (!skipping)
+ if (copylev > 0 && !skipping)
bp--;
}
-
/* check for characters that may have to be quoted */
- if (strchr(".'@,;:\\()", c) != NULL)
+ if (strchr(".'@,;:\\()[]", c) != NULL)
{
/*
** If these occur as the phrase part of a <>
@@ -647,10 +797,15 @@ crackaddr(addr)
{
register char *q;
+ /* assume first of two angles is bogus */
+ if (gotangle)
+ quoteit = TRUE;
+ gotangle = TRUE;
+
/* oops -- have to change our mind */
- anglelev++;
+ anglelev = 1;
if (!skipping)
- realanglelev++;
+ realanglelev = 1;
bp = buf;
if (quoteit)
@@ -675,7 +830,10 @@ crackaddr(addr)
}
if (quoteit)
{
- *bp++ = '"';
+ if (bp == &buf[1])
+ bp--;
+ else
+ *bp++ = '"';
while ((c = *p++) != '<')
{
if (bp < buflim)
@@ -704,6 +862,7 @@ crackaddr(addr)
/* syntax error: unmatched > */
if (copylev > 0)
bp--;
+ quoteit = TRUE;
continue;
}
if (copylev++ <= 0)
@@ -739,8 +898,7 @@ crackaddr(addr)
** PUTHEADER -- put the header part of a message from the in-core copy
**
** Parameters:
-** fp -- file to put it on.
-** m -- mailer to use.
+** mci -- the connection information.
** e -- envelope to use.
**
** Returns:
@@ -757,9 +915,8 @@ crackaddr(addr)
# define MAX(a,b) (((a)>(b))?(a):(b))
#endif
-putheader(fp, m, e)
- register FILE *fp;
- register MAILER *m;
+putheader(mci, e)
+ register MCI *mci;
register ENVELOPE *e;
{
char buf[MAX(MAXLINE,BUFSIZ)];
@@ -767,7 +924,8 @@ putheader(fp, m, e)
char obuf[MAXLINE];
if (tTd(34, 1))
- printf("--- putheader, mailer = %s ---\n", m->m_name);
+ printf("--- putheader, mailer = %s ---\n",
+ mci->mci_mailer->m_name);
for (h = e->e_header; h != NULL; h = h->h_link)
{
@@ -781,7 +939,7 @@ putheader(fp, m, e)
}
if (bitset(H_CHECK|H_ACHECK, h->h_flags) &&
- !bitintersect(h->h_mflags, m->m_flags))
+ !bitintersect(h->h_mflags, mci->mci_mailer->m_flags))
{
if (tTd(34, 11))
printf(" (skipped)\n");
@@ -795,19 +953,24 @@ putheader(fp, m, e)
printf(" (skipped (resent))\n");
continue;
}
- if (tTd(34, 11))
- printf("\n");
+ /* macro expand value if generated internally */
p = h->h_value;
if (bitset(H_DEFAULT, h->h_flags))
{
- /* macro expand value if generated internally */
expand(p, buf, &buf[sizeof buf], e);
p = buf;
if (p == NULL || *p == '\0')
+ {
+ if (tTd(34, 11))
+ printf(" (skipped -- null value)\n");
continue;
+ }
}
+ if (tTd(34, 11))
+ printf("\n");
+
if (bitset(H_FROM|H_RCPT, h->h_flags))
{
/* address field */
@@ -815,7 +978,7 @@ putheader(fp, m, e)
if (bitset(H_FROM, h->h_flags))
oldstyle = FALSE;
- commaize(h, p, fp, oldstyle, m, e);
+ commaize(h, p, oldstyle, mci, e);
}
else
{
@@ -828,12 +991,12 @@ putheader(fp, m, e)
*nlp = '\0';
(void) strcat(obuf, p);
*nlp = '\n';
- putline(obuf, fp, m);
+ putline(obuf, mci);
p = ++nlp;
obuf[0] = '\0';
}
(void) strcat(obuf, p);
- putline(obuf, fp, m);
+ putline(obuf, mci);
}
}
}
@@ -843,10 +1006,8 @@ putheader(fp, m, e)
** Parameters:
** h -- the header field to output.
** p -- the value to put in it.
-** fp -- file to put it to.
** oldstyle -- TRUE if this is an old style header.
-** m -- a pointer to the mailer descriptor. If NULL,
-** don't transform the name at all.
+** mci -- the connection information.
** e -- the envelope containing the message.
**
** Returns:
@@ -856,16 +1017,17 @@ putheader(fp, m, e)
** outputs "p" to file "fp".
*/
-commaize(h, p, fp, oldstyle, m, e)
+void
+commaize(h, p, oldstyle, mci, e)
register HDR *h;
register char *p;
- FILE *fp;
bool oldstyle;
- register MAILER *m;
+ register MCI *mci;
register ENVELOPE *e;
{
register char *obp;
int opos;
+ int omax;
bool firstone = TRUE;
char obuf[MAXLINE + 3];
@@ -881,6 +1043,9 @@ commaize(h, p, fp, oldstyle, m, e)
(void) sprintf(obp, "%s: ", h->h_field);
opos = strlen(h->h_field) + 2;
obp += opos;
+ omax = mci->mci_mailer->m_linelimit - 2;
+ if (omax < 0 || omax > 78)
+ omax = 78;
/*
** Run through the list of values.
@@ -911,7 +1076,8 @@ commaize(h, p, fp, oldstyle, m, e)
auto char *oldp;
char pvpbuf[PSBUFSIZE];
- (void) prescan(p, oldstyle ? ' ' : ',', pvpbuf, &oldp);
+ (void) prescan(p, oldstyle ? ' ' : ',', pvpbuf,
+ sizeof pvpbuf, &oldp);
p = oldp;
/* look to see if we have an at sign */
@@ -943,7 +1109,7 @@ commaize(h, p, fp, oldstyle, m, e)
if (bitset(H_FROM, h->h_flags))
flags |= RF_SENDERADDR;
stat = EX_OK;
- name = remotename(name, m, flags, &stat, e);
+ name = remotename(name, mci->mci_mailer, flags, &stat, e);
if (*name == '\0')
{
*p = savechar;
@@ -954,19 +1120,19 @@ commaize(h, p, fp, oldstyle, m, e)
opos += strlen(name);
if (!firstone)
opos += 2;
- if (opos > 78 && !firstone)
+ if (opos > omax && !firstone)
{
(void) strcpy(obp, ",\n");
- putline(obuf, fp, m);
+ putline(obuf, mci);
obp = obuf;
- (void) sprintf(obp, " ");
+ (void) strcpy(obp, " ");
opos = strlen(obp);
obp += opos;
opos += strlen(name);
}
else if (!firstone)
{
- (void) sprintf(obp, ", ");
+ (void) strcpy(obp, ", ");
obp += 2;
}
@@ -976,7 +1142,7 @@ commaize(h, p, fp, oldstyle, m, e)
*p = savechar;
}
(void) strcpy(obp, "\n");
- putline(obuf, fp, m);
+ putline(obuf, mci);
}
/*
** COPYHEADER -- copy header list
diff --git a/usr.sbin/sendmail/src/macro.c b/usr.sbin/sendmail/src/macro.c
index 877251debbb2..8a8a90b4f0f9 100644
--- a/usr.sbin/sendmail/src/macro.c
+++ b/usr.sbin/sendmail/src/macro.c
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)macro.c 8.1 (Berkeley) 6/7/93";
+static char sccsid[] = "@(#)macro.c 8.3 (Berkeley) 2/7/94";
#endif /* not lint */
# include "sendmail.h"
@@ -83,7 +83,7 @@ expand(s, buf, buflim, e)
s = "";
for (xp = xbuf; *s != '\0'; s++)
{
- char c;
+ int c;
/*
** Check for non-ordinary (special?) character.
@@ -115,8 +115,14 @@ expand(s, buf, buflim, e)
continue;
case MACROEXPAND: /* macro interpolation */
- c = *++s;
- q = macvalue(c & 0177, e);
+ c = *++s & 0177;
+ if (c != '\0')
+ q = macvalue(c, e);
+ else
+ {
+ s--;
+ q = NULL;
+ }
if (q == NULL)
continue;
break;
@@ -230,7 +236,7 @@ expand(s, buf, buflim, e)
void
define(n, v, e)
- char n;
+ int n;
char *v;
register ENVELOPE *e;
{
@@ -257,7 +263,7 @@ define(n, v, e)
char *
macvalue(n, e)
- char n;
+ int n;
register ENVELOPE *e;
{
n &= 0177;
diff --git a/usr.sbin/sendmail/src/mailq.1 b/usr.sbin/sendmail/src/mailq.1
new file mode 100644
index 000000000000..f7b9da43ed0f
--- /dev/null
+++ b/usr.sbin/sendmail/src/mailq.1
@@ -0,0 +1,88 @@
+.\" Copyright (c) 1985, 1990, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)mailq.1 8.4 (Berkeley) 2/22/94
+.\"
+.Dd February 22, 1994
+.Dt MAILQ 1
+.Os BSD 4
+.Sh NAME
+.Nm mailq
+.Nd print the mail queue
+.Sh SYNOPSIS
+.Nm mailq
+.Op Fl v
+.Sh DESCRIPTION
+.Nm Mailq
+prints a summary of the mail messages queued for future delivery.
+.Pp
+The first line printed for each message
+shows the internal identifier used on this host
+for the message,
+the size of the message in bytes,
+the date and time the message was accepted into the queue,
+and the envelope sender of the message.
+The second line shows the error message that caused this message
+to be retained in the queue;
+it will not be present if the message is being processed
+for the first time.
+The following lines show message recipients,
+one per line.
+.Pp
+.Nm Mailq
+is identical to
+.Dq Li "sendmail -bp" .
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl v
+Print verbose information.
+This adds the priority of the message and
+a single character indicator (``+'' or blank)
+indicating whether a warning message has been sent
+on the first line of the message.
+Additionally, extra lines may be intermixed with the recipients
+indicating the ``controlling user'' information;
+this shows who will own any programs that are executed
+on behalf of this message
+and the name of the alias this command expanded from, if any.
+.El
+.Pp
+The
+.Nm mailq
+utility exits 0 on success, and >0 if an error occurs.
+.Sh SEE ALSO
+.Xr sendmail 8
+.Sh HISTORY
+The
+.Nm mailq
+command appeared in
+.Bx 4.0 .
diff --git a/usr.sbin/sendmail/src/main.c b/usr.sbin/sendmail/src/main.c
index f4191ba61bff..cdd97c34a9a1 100644
--- a/usr.sbin/sendmail/src/main.c
+++ b/usr.sbin/sendmail/src/main.c
@@ -39,15 +39,13 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 7/13/93";
+static char sccsid[] = "@(#)main.c 8.52 (Berkeley) 3/11/94";
#endif /* not lint */
#define _DEFINE
#include "sendmail.h"
-#include <signal.h>
-#include <sgtty.h>
-#ifdef NAMED_BIND
+#if NAMED_BIND
#include <arpa/nameser.h>
#include <resolv.h>
#endif
@@ -55,7 +53,7 @@ static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 7/13/93";
# ifdef lint
char edata, end;
-# endif lint
+# endif /* lint */
/*
** SENDMAIL -- Post mail to a set of destinations.
@@ -96,15 +94,15 @@ ENVELOPE BlankEnvelope; /* a "blank" envelope */
ENVELOPE MainEnvelope; /* the envelope around the basic letter */
ADDRESS NullAddress = /* a null address */
{ "", "", NULL, "" };
-char *UserEnviron[MAXUSERENVIRON + 1];
+char *UserEnviron[MAXUSERENVIRON + 2];
/* 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.
** This allows "ps" listings to give more useful information.
-** These must be kept out of BSS for frozen configuration files
-** to work.
*/
# ifdef SETPROCTITLE
@@ -120,7 +118,7 @@ ERROR %%%% Cannot have daemon mode without SMTP %%%% ERROR
#endif /* SMTP */
#endif /* DAEMON */
-#define MAXCONFIGLEVEL 4 /* highest config version level known */
+#define MAXCONFIGLEVEL 5 /* highest config version level known */
main(argc, argv, envp)
int argc;
@@ -128,7 +126,6 @@ main(argc, argv, envp)
char **envp;
{
register char *p;
- register char *q;
char **av;
extern int finis();
extern char Version[];
@@ -137,10 +134,10 @@ main(argc, argv, envp)
STAB *st;
register int i;
int j;
- bool readconfig = TRUE;
bool queuemode = FALSE; /* process queue requests */
- bool nothaw;
bool safecf = TRUE;
+ bool warn_C_flag = FALSE;
+ char warn_f_flag = '\0';
static bool reenter = FALSE;
char *argv0 = argv[0];
struct passwd *pw;
@@ -154,8 +151,10 @@ main(argc, argv, envp)
extern char **myhostname();
extern char *arpadate();
extern char *getauthinfo();
+ extern char *getcfname();
extern char *optarg;
extern char **environ;
+ extern void dumpstate();
/*
** Check to see if we reentered.
@@ -170,9 +169,12 @@ main(argc, argv, envp)
}
reenter = TRUE;
-#ifndef SYS5TZ
- /* enforce use of kernel-supplied time zone information */
- unsetenv("TZ");
+ /* do machine-dependent initializations */
+ init_md(argc, argv);
+
+ /* arrange to dump state on signal */
+#ifdef SIGUSR1
+ setsignal(SIGUSR1, dumpstate);
#endif
/* in 4.4BSD, the table can be huge; impose a reasonable limit */
@@ -186,13 +188,14 @@ main(argc, argv, envp)
*/
i = open("/dev/null", O_RDWR);
- if (fstat(STDIN_FILENO, &stb) < 0)
+ if (fstat(STDIN_FILENO, &stb) < 0 && errno != EOPNOTSUPP)
(void) dup2(i, STDIN_FILENO);
- if (fstat(STDOUT_FILENO, &stb) < 0)
+ if (fstat(STDOUT_FILENO, &stb) < 0 && errno != EOPNOTSUPP)
(void) dup2(i, STDOUT_FILENO);
- if (fstat(STDERR_FILENO, &stb) < 0)
+ if (fstat(STDERR_FILENO, &stb) < 0 && errno != EOPNOTSUPP)
(void) dup2(i, STDERR_FILENO);
- (void) close(i);
+ if (i != STDIN_FILENO && i != STDOUT_FILENO && i != STDERR_FILENO)
+ (void) close(i);
i = DtableSize;
while (--i > 0)
@@ -232,42 +235,43 @@ main(argc, argv, envp)
else
(void) sprintf(RealUserName, "Unknown UID %d", RealUid);
- /* our real uid will have to be root -- we will trash this later */
- setuid((uid_t) 0);
+ /* save command line arguments */
+ i = 0;
+ for (av = argv; *av != NULL; )
+ i += strlen(*av++) + 1;
+ CommandLineArgs = xalloc(i);
+ p = CommandLineArgs;
+ for (av = argv; *av != NULL; )
+ {
+ if (av != argv)
+ *p++ = ' ';
+ strcpy(p, *av++);
+ p += strlen(p);
+ }
/* Handle any non-getoptable constructions. */
obsolete(argv);
/*
** Do a quick prescan of the argument list.
- ** We do this to find out if we can potentially thaw the
- ** configuration file. If not, we do the thaw now so that
- ** the argument processing applies to this run rather than
- ** to the run that froze the configuration.
*/
- nothaw = FALSE;
+
#if defined(__osf__) || defined(_AIX3)
-#define OPTIONS "B:b:C:cd:e:F:f:h:Iimno:p:q:r:sTtvX:x"
-#else
-#define OPTIONS "B:b:C:cd:e:F:f:h:Iimno:p:q:r:sTtvX:"
+# define OPTIONS "B:b:C:cd:e:F:f:h:Iimno:p:q:r:sTtvX:x"
+#endif
+#if defined(ultrix)
+# define OPTIONS "B:b:C:cd:e:F:f:h:IiM:mno:p:q:r:sTtvX:"
+#endif
+#if defined(NeXT)
+# define OPTIONS "B:b:C:cd:e:F:f:h:IimnOo:p:q:r:sTtvX:"
+#endif
+#ifndef OPTIONS
+# define OPTIONS "B:b:C:cd:e:F:f:h:Iimno:p:q:r:sTtvX:"
#endif
while ((j = getopt(argc, argv, OPTIONS)) != EOF)
{
switch (j)
{
- case 'b':
- if (optarg[0] == 'z' && optarg[1] == '\0')
- nothaw = TRUE;
- break;
-
- case 'C':
- ConfFile = optarg;
- (void) setgid(RealGid);
- (void) setuid(RealUid);
- safecf = FALSE;
- nothaw = TRUE;
- break;
-
case 'd':
tTsetup(tTdvect, sizeof tTdvect, "0-99.1");
tTflag(optarg);
@@ -280,14 +284,6 @@ main(argc, argv, envp)
InChannel = stdin;
OutChannel = stdout;
-# ifdef FROZENCONFIG
- if (!nothaw)
- readconfig = !thaw(FreezeFile, argv0);
-# else
- readconfig = TRUE;
-# endif
-
-# ifdef SETPROCTITLE
/*
** Move the environment so setproctitle can use the space at
** the top of memory.
@@ -302,6 +298,7 @@ main(argc, argv, envp)
UserEnviron[j] = NULL;
environ = UserEnviron;
+# ifdef SETPROCTITLE
/*
** Save start and extent of argv for setproctitle.
*/
@@ -313,17 +310,17 @@ main(argc, argv, envp)
LastArgv = argv[argc - 1] + strlen(argv[argc - 1]);
# endif /* SETPROCTITLE */
- if (signal(SIGINT, SIG_IGN) != SIG_IGN)
- (void) signal(SIGINT, intsig);
- if (signal(SIGHUP, SIG_IGN) != SIG_IGN)
- (void) signal(SIGHUP, intsig);
- (void) signal(SIGTERM, intsig);
- (void) signal(SIGPIPE, SIG_IGN);
+ if (setsignal(SIGINT, SIG_IGN) != SIG_IGN)
+ (void) setsignal(SIGINT, intsig);
+ if (setsignal(SIGHUP, SIG_IGN) != SIG_IGN)
+ (void) setsignal(SIGHUP, intsig);
+ (void) setsignal(SIGTERM, intsig);
+ (void) setsignal(SIGPIPE, SIG_IGN);
OldUmask = umask(022);
OpMode = MD_DELIVER;
FullName = getenv("NAME");
-#ifdef NAMED_BIND
+#if NAMED_BIND
if (tTd(8, 8))
_res.options |= RES_DEBUG;
#endif
@@ -331,14 +328,11 @@ main(argc, argv, envp)
errno = 0;
from = NULL;
- if (readconfig)
- {
- /* initialize some macros, etc. */
- initmacros();
+ /* initialize some macros, etc. */
+ initmacros(CurEnv);
- /* version */
- define('v', Version, CurEnv);
- }
+ /* version */
+ define('v', Version, CurEnv);
/* hostname */
av = myhostname(jbuf, sizeof jbuf);
@@ -348,23 +342,33 @@ main(argc, argv, envp)
if (tTd(0, 4))
printf("canonical name: %s\n", jbuf);
- p = newstr(jbuf);
- define('w', p, CurEnv);
- setclass('w', p);
+ define('w', newstr(jbuf), CurEnv); /* must be new string */
+ define('j', newstr(jbuf), CurEnv);
+ setclass('w', jbuf);
- q = strchr(jbuf, '.');
- if (q != NULL)
+ p = strchr(jbuf, '.');
+ if (p != NULL)
{
- *q++ = '\0';
- define('m', q, CurEnv);
- p = newstr(jbuf);
- setclass('w', p);
+ if (p[1] != '\0')
+ {
+ define('m', newstr(&p[1]), CurEnv);
+ setclass('m', &p[1]);
+ }
+ while (p != NULL && strchr(&p[1], '.') != NULL)
+ {
+ *p = '\0';
+ setclass('w', jbuf);
+ *p++ = '.';
+ p = strchr(p, '.');
+ }
}
if (uname(&utsname) >= 0)
p = utsname.nodename;
else
{
+ if (tTd(0, 22))
+ printf("uname failed (%s)\n", errstring(errno));
makelower(jbuf);
p = jbuf;
}
@@ -372,6 +376,7 @@ main(argc, argv, envp)
printf("UUCP nodename: %s\n", p);
p = newstr(p);
define('k', p, CurEnv);
+ setclass('k', p);
setclass('w', p);
}
while (av != NULL && *av != NULL)
@@ -437,18 +442,16 @@ main(argc, argv, envp)
case MD_TEST:
case MD_INITALIAS:
case MD_PRINT:
-#ifdef FROZENCONFIG
- case MD_FREEZE:
+#ifdef MAYBE_NEXT_RELEASE
+ case MD_ARPAFTP:
#endif
OpMode = j;
break;
-#ifndef FROZENCONFIG
case MD_FREEZE:
usrerr("Frozen configurations unsupported");
ExitStat = EX_USAGE;
break;
-#endif
default:
usrerr("Invalid operation mode %c", j);
@@ -463,15 +466,14 @@ main(argc, argv, envp)
case 'C': /* select configuration file (already done) */
if (RealUid != 0)
- auth_warning(CurEnv,
- "Processed by %s with -C %s",
- RealUserName, optarg);
+ warn_C_flag = TRUE;
+ ConfFile = optarg;
+ (void) setgid(RealGid);
+ (void) setuid(RealUid);
+ safecf = FALSE;
break;
- case 'd': /* debugging -- redo in case frozen */
- tTsetup(tTdvect, sizeof tTdvect, "0-99.1");
- tTflag(optarg);
- setbuf(stdout, (char *) NULL);
+ case 'd': /* debugging -- already done */
break;
case 'f': /* from address */
@@ -484,9 +486,7 @@ main(argc, argv, envp)
}
from = newstr(optarg);
if (strcmp(RealUserName, from) != 0)
- auth_warning(CurEnv,
- "%s set sender to %s using -%c",
- RealUserName, from, j);
+ warn_f_flag = j;
break;
case 'F': /* set full name */
@@ -512,13 +512,13 @@ main(argc, argv, envp)
break;
case 'p': /* set protocol */
- q = strchr(optarg, ':');
- if (q != NULL)
- *q++ = '\0';
+ p = strchr(optarg, ':');
+ if (p != NULL)
+ *p++ = '\0';
if (*optarg != '\0')
define('r', newstr(optarg), CurEnv);
- if (q != NULL && *q != '\0')
- define('s', newstr(q), CurEnv);
+ if (p != NULL && *p != '\0')
+ define('s', newstr(p), CurEnv);
break;
case 'q': /* run queue files at intervals */
@@ -563,7 +563,7 @@ main(argc, argv, envp)
break;
}
#ifdef HASSETVBUF
- setvbuf(TrafficLogFile, NULL, _IOLBF, BUFSIZ);
+ setvbuf(TrafficLogFile, NULL, _IOLBF, 0);
#else
setlinebuf(TrafficLogFile);
#endif
@@ -579,6 +579,9 @@ main(argc, argv, envp)
break;
case 'e': /* error message disposition */
+# if defined(ultrix)
+ case 'M': /* define macro */
+# endif
setoption(j, optarg, FALSE, TRUE, CurEnv);
break;
@@ -596,6 +599,10 @@ main(argc, argv, envp)
case 'x': /* random flag that OSF/1 & AIX mailx passes */
break;
# endif
+# if defined(NeXT)
+ case 'O': /* random flag that NeXT Mail.app passes */
+ break;
+# endif
default:
ExitStat = EX_USAGE;
@@ -611,21 +618,61 @@ main(argc, argv, envp)
** Extract special fields for local use.
*/
- if (OpMode == MD_FREEZE || readconfig)
- readcf(ConfFile, safecf, CurEnv);
+#ifdef XDEBUG
+ checkfd012("before readcf");
+#endif
+ readcf(getcfname(), safecf, CurEnv);
+
+ if (tTd(0, 1))
+ {
+ printf("SYSTEM IDENTITY (after readcf):");
+ printf("\n\t (short domain name) $w = ");
+ xputs(macvalue('w', CurEnv));
+ printf("\n\t(canonical domain name) $j = ");
+ xputs(macvalue('j', CurEnv));
+ printf("\n\t (subdomain name) $m = ");
+ xputs(macvalue('m', CurEnv));
+ printf("\n\t (node name) $k = ");
+ 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);
-#ifdef SYS5TZ
/* Enforce use of local time (null string overrides this) */
if (TimeZoneSpec == NULL)
unsetenv("TZ");
else if (TimeZoneSpec[0] != '\0')
{
- p = xalloc(strlen(TimeZoneSpec) + 4);
- (void) strcpy(p, "TZ=");
- (void) strcat(p, TimeZoneSpec);
- putenv(p);
+ char **evp = UserEnviron;
+ char tzbuf[100];
+
+ strcpy(tzbuf, "TZ=");
+ strcpy(&tzbuf[3], TimeZoneSpec);
+
+ while (*evp != NULL && strncmp(*evp, "TZ=", 3) != 0)
+ evp++;
+ if (*evp == NULL)
+ {
+ *evp++ = newstr(tzbuf);
+ *evp = NULL;
+ }
+ else
+ *evp++ = newstr(tzbuf);
}
-#endif
if (ConfigLevel > MAXCONFIGLEVEL)
{
@@ -633,9 +680,11 @@ main(argc, argv, envp)
ConfigLevel, MAXCONFIGLEVEL);
}
+ if (MeToo)
+ BlankEnvelope.e_flags |= EF_METOO;
# ifdef QUEUE
- if (queuemode && RealUid != 0)
+ if (queuemode && RealUid != 0 && bitset(PRIV_RESTRICTQRUN, PrivacyFlags))
{
struct stat stbuf;
@@ -645,7 +694,7 @@ main(argc, argv, envp)
if (stbuf.st_uid != RealUid)
{
/* nope, really a botch */
- usrerr("Permission denied");
+ usrerr("You do not have permission to process the queue");
exit (EX_NOPERM);
}
}
@@ -653,17 +702,6 @@ main(argc, argv, envp)
switch (OpMode)
{
-# ifdef FROZENCONFIG
- case MD_FREEZE:
- /* this is critical to avoid forgeries of the frozen config */
- (void) setgid(RealGid);
- (void) setuid(RealUid);
-
- /* freeze the configuration */
- freeze(FreezeFile);
- exit(EX_OK);
-# endif
-
case MD_INITALIAS:
Verbose = TRUE;
break;
@@ -672,13 +710,6 @@ main(argc, argv, envp)
/* remove things that don't make sense in daemon mode */
FullName = NULL;
break;
-
- case MD_SMTP:
- if (RealUid != 0)
- auth_warning(CurEnv,
- "%s owned process doing -bs",
- RealUserName);
- break;
}
/* do heuristic mode adjustment */
@@ -700,6 +731,9 @@ main(argc, argv, envp)
expand("\201j", jbuf, &jbuf[sizeof jbuf - 1], CurEnv);
MyHostName = jbuf;
+ /* make certain that this name is part of the $=w class */
+ setclass('w', MyHostName);
+
/* the indices of built-in mailers */
st = stab("local", ST_MAILER, ST_FIND);
if (st == NULL)
@@ -727,7 +761,7 @@ main(argc, argv, envp)
/* operate in queue directory */
- if (chdir(QueueDir) < 0)
+ if (OpMode != MD_TEST && chdir(QueueDir) < 0)
{
syserr("cannot chdir(%s)", QueueDir);
ExitStat = EX_SOFTWARE;
@@ -740,6 +774,10 @@ main(argc, argv, envp)
exit(ExitStat);
}
+#ifdef XDEBUG
+ checkfd012("before main() initmaps");
+#endif
+
/*
** Do operation-mode-dependent initialization.
*/
@@ -838,6 +876,7 @@ main(argc, argv, envp)
char *q;
auto char *delimptr;
extern bool invalidaddr();
+ extern char *crackaddr();
if (Verbose)
printf("> ");
@@ -846,8 +885,20 @@ main(argc, argv, envp)
finis();
if (!Verbose)
printf("> %s", buf);
- if (buf[0] == '#')
+ switch (buf[0])
+ {
+ case '#':
continue;
+
+#ifdef MAYBENEXTRELEASE
+ case 'C': /* try crackaddr */
+ q = crackaddr(&buf[1]);
+ xputs(q);
+ printf("\n");
+ continue;
+#endif
+ }
+
for (p = buf; isascii(*p) && isspace(*p); p++)
continue;
q = p;
@@ -859,13 +910,14 @@ main(argc, argv, envp)
continue;
}
*p = '\0';
- if (invalidaddr(p + 1))
+ if (invalidaddr(p + 1, NULL))
continue;
do
{
char pvpbuf[PSBUFSIZE];
- pvp = prescan(++p, ',', pvpbuf, &delimptr);
+ pvp = prescan(++p, ',', pvpbuf, sizeof pvpbuf,
+ &delimptr);
if (pvp == NULL)
continue;
p = q;
@@ -873,7 +925,7 @@ main(argc, argv, envp)
{
int stat;
- stat = rewrite(pvp, atoi(p), CurEnv);
+ stat = rewrite(pvp, atoi(p), 0, CurEnv);
if (stat != EX_OK)
printf("== Ruleset %s status %d\n",
p, stat);
@@ -919,7 +971,7 @@ main(argc, argv, envp)
exit(0);
/* disconnect from our controlling tty */
- disconnect(TRUE, CurEnv);
+ disconnect(2, CurEnv);
}
dtype[0] = '\0';
@@ -971,23 +1023,25 @@ main(argc, argv, envp)
** commands. This will never return.
*/
- if (OpMode == MD_SMTP)
+ if (OpMode == MD_SMTP || OpMode == MD_DAEMON)
smtp(CurEnv);
# endif /* SMTP */
+ if (OpMode == MD_VERIFY)
+ {
+ CurEnv->e_sendmode = SM_VERIFY;
+ CurEnv->e_errormode = EM_QUIET;
+ }
+ else
+ {
+ /* interactive -- all errors are global */
+ CurEnv->e_flags |= EF_GLOBALERRS;
+ }
+
/*
** Do basic system initialization and set the sender
*/
- /* make sendmail immune from process group signals */
-# ifdef _POSIX_JOB_CONTROL
- (void) setpgid(0, getpid());
-# else
-# ifndef SYSTEM5
- (void) setpgrp(0, getpid());
-# endif
-# endif
-
initsys(CurEnv);
setsender(from, CurEnv, NULL, FALSE);
if (macvalue('s', CurEnv) == NULL)
@@ -995,6 +1049,7 @@ main(argc, argv, envp)
if (*av == NULL && !GrabTo)
{
+ CurEnv->e_flags |= EF_GLOBALERRS;
usrerr("Recipient names must be specified");
/* collect body for UUCP return */
@@ -1002,11 +1057,6 @@ main(argc, argv, envp)
collect(FALSE, FALSE, CurEnv);
finis();
}
- if (OpMode == MD_VERIFY)
- {
- CurEnv->e_sendmode = SM_VERIFY;
- CurEnv->e_errormode = EM_QUIET;
- }
/*
** Scan argv and deliver the message to everyone.
@@ -1024,13 +1074,12 @@ main(argc, argv, envp)
CurEnv->e_to = NULL;
if (OpMode != MD_VERIFY || GrabTo)
+ {
+ CurEnv->e_flags |= EF_GLOBALERRS;
collect(FALSE, FALSE, CurEnv);
+ }
errno = 0;
- /* collect statistics */
- if (OpMode != MD_VERIFY)
- markstats(CurEnv, (ADDRESS *) NULL);
-
if (tTd(1, 1))
printf("From person = \"%s\"\n", CurEnv->e_from.q_paddr);
@@ -1071,7 +1120,11 @@ main(argc, argv, envp)
finis()
{
if (tTd(2, 1))
- printf("\n====finis: stat %d e_flags %o\n", ExitStat, CurEnv->e_flags);
+ printf("\n====finis: stat %d e_flags %o, e_id=%s\n",
+ ExitStat, CurEnv->e_flags,
+ CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id);
+ if (tTd(2, 9))
+ printopenfds(FALSE);
/* clean up temp files */
CurEnv->e_to = NULL;
@@ -1167,7 +1220,8 @@ struct metamac MetaMacros[] =
'\0'
};
-initmacros()
+initmacros(e)
+ register ENVELOPE *e;
{
register struct metamac *m;
char buf[5];
@@ -1177,208 +1231,34 @@ initmacros()
{
buf[0] = m->metaval;
buf[1] = '\0';
- define(m->metaname, newstr(buf), CurEnv);
+ define(m->metaname, newstr(buf), e);
}
buf[0] = MATCHREPL;
buf[2] = '\0';
for (c = '0'; c <= '9'; c++)
{
buf[1] = c;
- define(c, newstr(buf), CurEnv);
- }
-}
- /*
-** FREEZE -- freeze BSS & allocated memory
-**
-** This will be used to efficiently load the configuration file.
-**
-** Parameters:
-** freezefile -- the name of the file to freeze to.
-**
-** Returns:
-** none.
-**
-** Side Effects:
-** Writes BSS and malloc'ed memory to freezefile
-*/
-
-# ifdef FROZENCONFIG
-
-union frz
-{
- char frzpad[BUFSIZ]; /* insure we are on a BUFSIZ boundary */
- struct
- {
- time_t frzstamp; /* timestamp on this freeze */
- char *frzbrk; /* the current break */
- char *frzedata; /* address of edata */
- char *frzend; /* address of end */
- char frzver[252]; /* sendmail version */
- } frzinfo;
-};
-
-#if defined(__hpux) || defined(__alpha)
-#define BRK_TYPE int
-#define SBRK_TYPE void *
-#else
-#define BRK_TYPE char *
-#define SBRK_TYPE char *
-#endif
-
-freeze(freezefile)
- char *freezefile;
-{
- int f;
- union frz fhdr;
- extern SBRK_TYPE sbrk();
- extern char edata, end;
- extern char Version[];
-
- if (freezefile == NULL)
- return;
-
- /* try to open the freeze file */
- f = creat(freezefile, FileMode);
- if (f < 0)
- {
- syserr("Cannot freeze %s", freezefile);
- errno = 0;
- return;
- }
-
- /* build the freeze header */
- fhdr.frzinfo.frzstamp = curtime();
- fhdr.frzinfo.frzbrk = sbrk(0);
- fhdr.frzinfo.frzedata = &edata;
- fhdr.frzinfo.frzend = &end;
- (void) strcpy(fhdr.frzinfo.frzver, Version);
-
- /* write out the freeze header */
- if (write(f, (char *) &fhdr, sizeof fhdr) != sizeof fhdr ||
- write(f, (char *) &edata, (int) (fhdr.frzinfo.frzbrk - &edata)) !=
- (int) (fhdr.frzinfo.frzbrk - &edata))
- {
- syserr("Cannot freeze %s", freezefile);
+ define(c, newstr(buf), e);
}
- /* fine, clean up */
- (void) close(f);
+ /* set defaults for some macros sendmail will use later */
+ define('e', "\201j Sendmail \201v ready at \201b", e);
+ define('l', "From \201g \201d", e);
+ define('n', "MAILER-DAEMON", e);
+ define('o', ".:@[]", e);
+ define('q', "<\201g>", e);
}
/*
-** THAW -- read in the frozen configuration file.
-**
-** Parameters:
-** freezefile -- the name of the file to thaw from.
-** binfile -- the name of the sendmail binary (ok to guess).
-**
-** Returns:
-** TRUE if it successfully read the freeze file.
-** FALSE otherwise.
-**
-** Side Effects:
-** reads freezefile in to BSS area.
-*/
-
-thaw(freezefile, binfile)
- char *freezefile;
- char *binfile;
-{
- int f;
- register char *p;
- union frz fhdr;
- char hbuf[60];
- struct stat fst, sst;
- extern char edata, end;
- extern char Version[];
- extern char **myhostname();
- extern BRK_TYPE brk();
-
- if (freezefile == NULL)
- return (FALSE);
-
- /* open the freeze file */
- f = open(freezefile, 0);
- if (f < 0)
- {
- errno = 0;
- return (FALSE);
- }
-
- if (fstat(f, &fst) < 0 || stat(ConfFile, &sst) < 0 ||
- fst.st_mtime < sst.st_mtime)
- {
- syslog(LOG_WARNING, "Freeze file older than config file");
- (void) close(f);
- return (FALSE);
- }
-
- if (strchr(binfile, '/') != NULL && stat(binfile, &sst) == 0 &&
- fst.st_mtime < sst.st_mtime)
- {
- syslog(LOG_WARNING, "Freeze file older than binary file");
- (void) close(f);
- return (FALSE);
- }
-
- /* read in the header */
- if (read(f, (char *) &fhdr, sizeof fhdr) < sizeof fhdr)
- {
- syslog(LOG_WARNING, "Cannot read frozen config file");
- (void) close(f);
- return (FALSE);
- }
- if (fhdr.frzinfo.frzedata != &edata ||
- fhdr.frzinfo.frzend != &end ||
- strcmp(fhdr.frzinfo.frzver, Version) != 0)
- {
- fprintf(stderr, "Wrong version of frozen config file\n");
- syslog(LOG_WARNING, "Wrong version of frozen config file");
- (void) close(f);
- return (FALSE);
- }
-
- /* arrange to have enough space */
- if (brk(fhdr.frzinfo.frzbrk) == (BRK_TYPE) -1)
- {
- syserr("Cannot break to %x", fhdr.frzinfo.frzbrk);
- (void) close(f);
- return (FALSE);
- }
-
- /* now read in the freeze file */
- if (read(f, (char *) &edata, (int) (fhdr.frzinfo.frzbrk - &edata)) !=
- (int) (fhdr.frzinfo.frzbrk - &edata))
- {
- syserr("Cannot read frozen config file");
- /* oops! we have trashed memory..... */
- (void) write(2, "Cannot read freeze file\n", 24);
- _exit(EX_SOFTWARE);
- }
-
- (void) close(f);
-
- /* verify that the host name was correct on the freeze */
- (void) myhostname(hbuf, sizeof hbuf);
- p = macvalue('w', CurEnv);
- if (p == NULL)
- p = "";
- if (strcmp(hbuf, macvalue('w', CurEnv)) == 0)
- return (TRUE);
- syslog(LOG_WARNING, "Hostname changed since freeze (%s => %s)",
- p, hbuf);
- return (FALSE);
-}
-
-# endif /* FROZENCONFIG */
- /*
** DISCONNECT -- remove our connection with any foreground process
**
** Parameters:
-** fulldrop -- if set, we should also drop the controlling
-** TTY if possible -- this should only be done when
-** setting up the daemon since otherwise UUCP can
-** leave us trying to open a dialin, and we will
-** wait for the carrier.
+** droplev -- how "deeply" we should drop the line.
+** 0 -- ignore signals, mail back errors, make sure
+** output goes to stdout.
+** 1 -- also, make stdout go to transcript.
+** 2 -- also, disconnect from controlling terminal
+** (only for daemon mode).
+** e -- the current envelope.
**
** Returns:
** none
@@ -1388,8 +1268,8 @@ thaw(freezefile, binfile)
** the controlling tty.
*/
-disconnect(fulldrop, e)
- bool fulldrop;
+disconnect(droplev, e)
+ int droplev;
register ENVELOPE *e;
{
int fd;
@@ -1404,14 +1284,15 @@ disconnect(fulldrop, e)
}
/* be sure we don't get nasty signals */
- (void) signal(SIGHUP, SIG_IGN);
- (void) signal(SIGINT, SIG_IGN);
- (void) signal(SIGQUIT, SIG_IGN);
+ (void) setsignal(SIGHUP, SIG_IGN);
+ (void) setsignal(SIGINT, SIG_IGN);
+ (void) setsignal(SIGQUIT, SIG_IGN);
/* we can't communicate with our caller, so.... */
HoldErrs = TRUE;
CurEnv->e_errormode = EM_MAIL;
Verbose = FALSE;
+ DisConnected = TRUE;
/* all input from /dev/null */
if (InChannel != stdin)
@@ -1427,32 +1308,30 @@ disconnect(fulldrop, e)
(void) fclose(OutChannel);
OutChannel = stdout;
}
- if (e->e_xfp == NULL)
- fd = open("/dev/null", O_WRONLY, 0666);
- else
- fd = fileno(e->e_xfp);
- (void) fflush(stdout);
- dup2(fd, STDOUT_FILENO);
- dup2(fd, STDERR_FILENO);
- if (e->e_xfp == NULL)
- close(fd);
+ if (droplev > 0)
+ {
+ if (e->e_xfp == NULL)
+ fd = open("/dev/null", O_WRONLY, 0666);
+ else
+ fd = fileno(e->e_xfp);
+ (void) fflush(stdout);
+ dup2(fd, STDOUT_FILENO);
+ dup2(fd, STDERR_FILENO);
+ if (e->e_xfp == NULL)
+ close(fd);
+ }
/* drop our controlling TTY completely if possible */
- if (fulldrop)
+ if (droplev > 1)
{
(void) setsid();
-#ifdef TIOCNOTTY
- fd = open("/dev/tty", 2);
- if (fd >= 0)
- {
- (void) ioctl(fd, (int) TIOCNOTTY, (char *) 0);
- (void) close(fd);
- }
- (void) setpgrp(0, 0);
-#endif /* TIOCNOTTY */
errno = 0;
}
+#ifdef XDEBUG
+ checkfd012("disconnect");
+#endif
+
# ifdef LOG
if (LogLevel > 71)
syslog(LOG_DEBUG, "in background, pid=%d", getpid());
@@ -1465,7 +1344,8 @@ static void
obsolete(argv)
char *argv[];
{
- char *ap;
+ register char *ap;
+ register char *op;
while ((ap = *++argv) != NULL)
{
@@ -1473,10 +1353,18 @@ obsolete(argv)
if (ap[0] != '-' || ap[1] == '-')
return;
+ /* skip over options that do have a value */
+ op = strchr(OPTIONS, ap[1]);
+ if (op != NULL && *++op == ':' && ap[2] == '\0' &&
+ ap[1] != 'd' && argv[1] != NULL && argv[1][0] != '-')
+ {
+ argv++;
+ continue;
+ }
+
/* If -C doesn't have an argument, use sendmail.cf. */
#define __DEFPATH "sendmail.cf"
- if (ap[1] == 'C' && ap[2] == '\0' &&
- (argv[1] == NULL || argv[1][0] == '-'))
+ if (ap[1] == 'C' && ap[2] == '\0')
{
*argv = xalloc(sizeof(__DEFPATH) + 2);
argv[0][0] = '-';
@@ -1485,13 +1373,11 @@ obsolete(argv)
}
/* If -q doesn't have an argument, run it once. */
- if (ap[1] == 'q' && ap[2] == '\0' &&
- (argv[1] == NULL || argv[1][0] == '-'))
+ if (ap[1] == 'q' && ap[2] == '\0')
*argv = "-q0";
/* if -d doesn't have an argument, use 0-99.1 */
- if (ap[1] == 'd' && ap[2] == '\0' &&
- (argv[1] == NULL || !isdigit(argv[1][0])))
+ if (ap[1] == 'd' && ap[2] == '\0')
*argv = "-d0-99.1";
}
}
@@ -1537,3 +1423,40 @@ auth_warning(e, msg, va_alist)
addheader("X-Authentication-Warning", buf, e);
}
}
+ /*
+** DUMPSTATE -- dump state on user signal
+**
+** For debugging.
+*/
+
+void
+dumpstate()
+{
+#ifdef LOG
+ register char *j = macvalue('j', CurEnv);
+ register STAB *s;
+
+ syslog(LOG_DEBUG, "--- dumping state on user signal: $j = %s ---", j);
+ s = stab(j, ST_CLASS, ST_FIND);
+ if (s == NULL || !bitnset('w', s->s_class))
+ syslog(LOG_DEBUG, "*** $j not in $=w ***");
+ syslog(LOG_DEBUG, "--- open file descriptors: ---");
+ printopenfds(TRUE);
+ syslog(LOG_DEBUG, "--- connection cache: ---");
+ mci_dump_all(TRUE);
+ if (RewriteRules[89] != NULL)
+ {
+ int stat;
+ register char **pvp;
+ char *pv[MAXATOM + 1];
+
+ pv[0] = NULL;
+ stat = rewrite(pv, 89, 0, CurEnv);
+ syslog(LOG_DEBUG, "--- ruleset 89 returns stat %d, pv: ---",
+ stat);
+ for (pvp = pv; *pvp != NULL; pvp++)
+ syslog(LOG_DEBUG, "%s", *pvp);
+ }
+ syslog(LOG_DEBUG, "--- end of state dump ---");
+#endif
+}
diff --git a/usr.sbin/sendmail/src/makesendmail b/usr.sbin/sendmail/src/makesendmail
new file mode 100755
index 000000000000..7c13db9fd9fc
--- /dev/null
+++ b/usr.sbin/sendmail/src/makesendmail
@@ -0,0 +1,113 @@
+#!/bin/sh
+
+# Copyright (c) 1993 Eric P. Allman
+# Copyright (c) 1993 The Regents of the University of California.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# @(#)makesendmail 8.5 (Berkeley) 2/27/94
+#
+
+#
+# A quick-and-dirty script to compile sendmail in the presence of
+# multiple architectures and Makefiles.
+#
+
+# determine machine architecture
+arch=`uname -m`
+case $arch
+in
+ sun4*) arch=sun4;;
+
+ 9000/*) arch=`echo $arch | sed -e 's/9000.//' -e 's/..$/xx/'`;;
+esac
+
+# determine operating system type
+os=`uname -s`
+
+# determine operating system release
+rel=`uname -r`
+rbase=`echo $rel | sed 's/\..*//''`
+
+# now try to find a reasonable object directory
+if [ -r obj.$os.$arch.$rel ]; then
+ obj=obj.$os.$arch.$rel
+elif [ -r obj.$os.$arch.$rbase.x ]; then
+ obj=obj.$os.$arch.$rbase.x
+elif [ -r obj.$os.$rel ]; then
+ obj=obj.$os.$rel
+elif [ -r obj.$os.$rbase.x ]; then
+ obj=obj.$os.$rbase.x
+elif [ -r obj.$os.$arch ]; then
+ obj=obj.$os.$arch
+elif [ -r obj.$arch.$rel ]; then
+ obj=obj.$arch.$rel
+elif [ -r obj.$arch.$rbase.x ]; then
+ obj=obj.$arch.$rbase.x
+elif [ -r obj.$os ]; then
+ obj=obj.$os
+elif [ -r obj.$arch ]; then
+ obj=obj.$arch
+elif [ -r obj.$rel ]; then
+ obj=obj.$rel
+else
+ # no existing obj directory -- try to create one if Makefile found
+ obj=obj.$os.$arch.$rel
+ if [ -r Makefile.$os.$arch.$rel ]; then
+ makefile=Makefile.$os.$arch.$rel
+ elif [ -r Makefile.$os.$arch.$rbase.x ]; then
+ makefile=Makefile.$os.$arch.$rbase.x
+ elif [ -r Makefile.$os.$rel ]; then
+ makefile=Makefile.$os.$rel
+ elif [ -r Makefile.$os.$rbase.x ]; then
+ makefile=Makefile.$os.$rbase.x
+ elif [ -r Makefile.$os.$arch ]; then
+ makefile=Makefile.$os.$arch
+ elif [ -r Makefile.$arch.$rel ]; then
+ makefile=Makefile.$arch.$rel
+ elif [ -r Makefile.$arch.$rbase.x ]; then
+ makefile=Makefile.$arch.$rbase.x
+ elif [ -r Makefile.$os ]; then
+ makefile=Makefile.$os
+ elif [ -r Makefile.$arch ]; then
+ makefile=Makefile.$arch
+ elif [ -r Makefile.$rel ]; then
+ makefile=Makefile.$rel
+ else
+ echo "Cannot determine how to support $arch.$os.$rel"
+ exit 1
+ fi
+ echo "Creating $obj using $makefile"
+ mkdir $obj
+ (cd $obj; ln -s ../*.[ch158] ../sendmail.hf .; ln -s ../$makefile Makefile)
+fi
+echo "Making in $obj"
+cd $obj
+exec make -f Makefile $*
diff --git a/usr.sbin/sendmail/src/map.c b/usr.sbin/sendmail/src/map.c
index bfa2dc03c264..7444cdab7378 100644
--- a/usr.sbin/sendmail/src/map.c
+++ b/usr.sbin/sendmail/src/map.c
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)map.c 8.2 (Berkeley) 7/11/93";
+static char sccsid[] = "@(#)map.c 8.22 (Berkeley) 2/18/94";
#endif /* not lint */
#include "sendmail.h"
@@ -85,6 +85,8 @@ static char sccsid[] = "@(#)map.c 8.2 (Berkeley) 7/11/93";
*/
#define DBMMODE 0644
+
+extern bool aliaswait __P((MAP *, char *, int));
/*
** MAP_PARSEARGS -- parse config line arguments for database lookup
**
@@ -247,8 +249,7 @@ map_rewrite(map, s, slen, av)
c = *bp++;
if (!(isascii(c) && isdigit(c)))
continue;
- c -= 0;
- for (avp = av; --c >= 0 && *avp != NULL; avp++)
+ for (avp = av; --c >= '0' && *avp != NULL; avp++)
continue;
if (*avp == NULL)
continue;
@@ -291,8 +292,7 @@ map_rewrite(map, s, slen, av)
*bp++ = '%';
goto pushc;
}
- c -= '0';
- for (avp = av; --c >= 0 && *avp != NULL; avp++)
+ for (avp = av; --c >= '0' && *avp != NULL; avp++)
continue;
if (*avp == NULL)
continue;
@@ -332,8 +332,22 @@ initmaps(rebuild, e)
{
extern void map_init();
+#ifdef XDEBUG
+ checkfd012("entering initmaps");
+#endif
CurEnv = e;
- stabapply(map_init, rebuild);
+ if (rebuild)
+ {
+ stabapply(map_init, 1);
+ stabapply(map_init, 2);
+ }
+ else
+ {
+ stabapply(map_init, 0);
+ }
+#ifdef XDEBUG
+ checkfd012("exiting initmaps");
+#endif
}
void
@@ -352,8 +366,19 @@ map_init(s, rebuild)
return;
if (tTd(38, 2))
- printf("map_init(%s:%s)\n",
- map->map_class->map_cname, map->map_file);
+ printf("map_init(%s:%s, %d)\n",
+ map->map_class->map_cname == NULL ? "NULL" :
+ map->map_class->map_cname,
+ map->map_file == NULL ? "NULL" : map->map_file,
+ rebuild);
+
+ if (rebuild == (bitset(MF_ALIAS, map->map_mflags) &&
+ bitset(MCF_REBUILDABLE, map->map_class->map_cflags) ? 1 : 2))
+ {
+ if (tTd(38, 3))
+ printf("\twrong pass\n");
+ return;
+ }
/* if already open, close it (for nested open) */
if (bitset(MF_OPEN, map->map_mflags))
@@ -362,26 +387,28 @@ map_init(s, rebuild)
map->map_mflags &= ~(MF_OPEN|MF_WRITABLE);
}
- if (rebuild)
+ if (rebuild == 2)
{
- if (bitset(MF_ALIAS, map->map_mflags) &&
- bitset(MCF_REBUILDABLE, map->map_class->map_cflags))
- rebuildaliases(map, FALSE);
+ rebuildaliases(map, FALSE);
}
else
{
if (map->map_class->map_open(map, O_RDONLY))
{
if (tTd(38, 4))
- printf("%s:%s: valid\n",
- map->map_class->map_cname,
- map->map_file);
+ printf("\t%s:%s: valid\n",
+ map->map_class->map_cname == NULL ? "NULL" :
+ map->map_class->map_cname,
+ map->map_file == NULL ? "NULL" :
+ map->map_file);
map->map_mflags |= MF_OPEN;
}
else if (tTd(38, 4))
- printf("%s:%s: invalid: %s\n",
- map->map_class->map_cname,
- map->map_file,
+ printf("\t%s:%s: invalid: %s\n",
+ map->map_class->map_cname == NULL ? "NULL" :
+ map->map_class->map_cname,
+ map->map_file == NULL ? "NULL" :
+ map->map_file,
errstring(errno));
}
}
@@ -400,7 +427,8 @@ ndbm_map_open(map, mode)
MAP *map;
int mode;
{
- DBM *dbm;
+ register DBM *dbm;
+ struct stat st;
if (tTd(38, 2))
printf("ndbm_map_open(%s, %d)\n", map->map_file, mode);
@@ -412,13 +440,33 @@ ndbm_map_open(map, mode)
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;
}
map->map_db1 = (void *) dbm;
- if (mode == O_RDONLY && bitset(MF_ALIAS, map->map_mflags))
- aliaswait(map, ".pag");
+ if (mode == O_RDONLY)
+ {
+ if (bitset(MF_ALIAS, map->map_mflags) &&
+ !aliaswait(map, ".pag", TRUE))
+ return FALSE;
+ }
+ else
+ {
+ int fd;
+
+ /* exclusive lock for duration of rebuild */
+ fd = dbm_dirfno((DBM *) map->map_db1);
+ if (fd >= 0 && !bitset(MF_LOCKED, map->map_mflags) &&
+ lockfile(fd, map->map_file, ".dir", LOCK_EX))
+ map->map_mflags |= MF_LOCKED;
+ }
+ if (fstat(dbm_dirfno((DBM *) map->map_db1), &st) >= 0)
+ map->map_mtime = st.st_mtime;
return TRUE;
}
@@ -435,6 +483,7 @@ ndbm_map_lookup(map, name, av, statp)
int *statp;
{
datum key, val;
+ int fd;
char keybuf[MAXNAME + 1];
if (tTd(38, 20))
@@ -450,7 +499,9 @@ ndbm_map_lookup(map, name, av, statp)
makelower(keybuf);
key.dptr = keybuf;
}
- (void) lockfile(dbm_dirfno((DBM *) map->map_db1), map->map_file, LOCK_SH);
+ fd = dbm_dirfno((DBM *) map->map_db1);
+ if (fd >= 0 && !bitset(MF_LOCKED, map->map_mflags))
+ (void) lockfile(fd, map->map_file, ".dir", LOCK_SH);
val.dptr = NULL;
if (bitset(MF_TRY0NULL, map->map_mflags))
{
@@ -465,7 +516,8 @@ ndbm_map_lookup(map, name, av, statp)
if (val.dptr != NULL)
map->map_mflags &= ~MF_TRY0NULL;
}
- (void) lockfile(dbm_dirfno((DBM *) map->map_db1), map->map_file, LOCK_UN);
+ if (fd >= 0 && !bitset(MF_LOCKED, map->map_mflags))
+ (void) lockfile(fd, map->map_file, ".dir", LOCK_UN);
if (val.dptr == NULL)
return NULL;
if (bitset(MF_MATCHONLY, map->map_mflags))
@@ -525,14 +577,21 @@ ndbm_map_close(map)
{
if (bitset(MF_WRITABLE, map->map_mflags))
{
-#ifdef YPCOMPAT
+#ifdef NIS
+ bool inclnull;
char buf[200];
+ inclnull = bitset(MF_INCLNULL, map->map_mflags);
+ map->map_mflags &= ~MF_INCLNULL;
+
(void) sprintf(buf, "%010ld", curtime());
ndbm_map_store(map, "YP_LAST_MODIFIED", buf);
- (void) myhostname(buf, sizeof buf);
+ (void) gethostname(buf, sizeof buf);
ndbm_map_store(map, "YP_MASTER_NAME", buf);
+
+ if (inclnull)
+ map->map_mflags |= MF_INCLNULL;
#endif
/* write out the distinguished alias */
@@ -568,6 +627,8 @@ bt_map_open(map, mode)
DB *db;
int i;
int omode;
+ int fd;
+ struct stat st;
char buf[MAXNAME];
if (tTd(38, 2))
@@ -577,7 +638,7 @@ bt_map_open(map, mode)
if (omode == O_RDWR)
{
omode |= O_CREAT|O_TRUNC;
-#if defined(O_EXLOCK) && !defined(LOCKF)
+#if defined(O_EXLOCK) && HASFLOCK
omode |= O_EXLOCK;
# if !defined(OLD_NEWDB)
}
@@ -595,27 +656,45 @@ bt_map_open(map, mode)
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;
}
-#if !defined(OLD_NEWDB) && !defined(LOCKF)
+#if !defined(OLD_NEWDB) && HASFLOCK
+ fd = db->fd(db);
# if !defined(O_EXLOCK)
- if (mode == O_RDWR)
- (void) lockfile(db->fd(db), map->map_file, LOCK_EX);
+ if (mode == O_RDWR && fd >= 0)
+ {
+ if (lockfile(fd, map->map_file, ".db", LOCK_EX))
+ map->map_mflags |= MF_LOCKED;
+ }
# else
- if (mode == O_RDONLY)
- (void) lockfile(db->fd(db), map->map_file, LOCK_UN);
+ if (mode == O_RDONLY && fd >= 0)
+ (void) lockfile(fd, map->map_file, ".db", LOCK_UN);
+ else
+ map->map_mflags |= MF_LOCKED;
# endif
#endif
/* try to make sure that at least the database header is on disk */
if (mode == O_RDWR)
+#ifdef OLD_NEWDB
+ (void) db->sync(db);
+#else
(void) db->sync(db, 0);
+ if (fd >= 0 && fstat(fd, &st) >= 0)
+ map->map_mtime = st.st_mtime;
+#endif
+
map->map_db2 = (void *) db;
if (mode == O_RDONLY && bitset(MF_ALIAS, map->map_mflags))
- aliaswait(map, ".db");
+ if (!aliaswait(map, ".db", TRUE))
+ return FALSE;
return TRUE;
}
@@ -632,6 +711,8 @@ hash_map_open(map, mode)
DB *db;
int i;
int omode;
+ int fd;
+ struct stat st;
char buf[MAXNAME];
if (tTd(38, 2))
@@ -641,7 +722,7 @@ hash_map_open(map, mode)
if (omode == O_RDWR)
{
omode |= O_CREAT|O_TRUNC;
-#if defined(O_EXLOCK) && !defined(LOCKF)
+#if defined(O_EXLOCK) && HASFLOCK
omode |= O_EXLOCK;
# if !defined(OLD_NEWDB)
}
@@ -659,27 +740,45 @@ hash_map_open(map, mode)
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;
}
-#if !defined(OLD_NEWDB) && !defined(LOCKF)
+#if !defined(OLD_NEWDB) && HASFLOCK
+ fd = db->fd(db);
# if !defined(O_EXLOCK)
- if (mode == O_RDWR)
- (void) lockfile(db->fd(db), map->map_file, LOCK_EX);
+ if (mode == O_RDWR && fd >= 0)
+ {
+ if (lockfile(fd, map->map_file, ".db", LOCK_EX))
+ map->map_mflags |= MF_LOCKED;
+ }
# else
- if (mode == O_RDONLY)
- (void) lockfile(db->fd(db), map->map_file, LOCK_UN);
+ if (mode == O_RDONLY && fd >= 0)
+ (void) lockfile(fd, map->map_file, ".db", LOCK_UN);
+ else
+ map->map_mflags |= MF_LOCKED;
# endif
#endif
/* try to make sure that at least the database header is on disk */
if (mode == O_RDWR)
+#ifdef OLD_NEWDB
+ (void) db->sync(db);
+#else
(void) db->sync(db, 0);
+ if (fd >= 0 && fstat(fd, &st) >= 0)
+ map->map_mtime = st.st_mtime;
+#endif
+
map->map_db2 = (void *) db;
if (mode == O_RDONLY && bitset(MF_ALIAS, map->map_mflags))
- aliaswait(map, ".db");
+ if (!aliaswait(map, ".db", TRUE))
+ return FALSE;
return TRUE;
}
@@ -699,6 +798,7 @@ db_map_lookup(map, name, av, statp)
register DB *db = (DB *) map->map_db2;
int st;
int saveerrno;
+ int fd;
char keybuf[MAXNAME + 1];
if (tTd(38, 20))
@@ -712,7 +812,9 @@ db_map_lookup(map, name, av, statp)
if (!bitset(MF_NOFOLDCASE, map->map_mflags))
makelower(keybuf);
#ifndef OLD_NEWDB
- (void) lockfile(db->fd(db), map->map_file, LOCK_SH);
+ fd = db->fd(db);
+ if (fd >= 0 && !bitset(MF_LOCKED, map->map_mflags))
+ (void) lockfile(db->fd(db), map->map_file, ".db", LOCK_SH);
#endif
st = 1;
if (bitset(MF_TRY0NULL, map->map_mflags))
@@ -730,7 +832,8 @@ db_map_lookup(map, name, av, statp)
}
saveerrno = errno;
#ifndef OLD_NEWDB
- (void) lockfile(db->fd(db), map->map_file, LOCK_UN);
+ if (fd >= 0 && !bitset(MF_LOCKED, map->map_mflags))
+ (void) lockfile(fd, map->map_file, ".db", LOCK_UN);
#endif
if (st != 0)
{
@@ -817,6 +920,10 @@ db_map_close(map)
# ifdef NIS
+# ifndef YPERR_BUSY
+# define YPERR_BUSY 16
+# endif
+
/*
** NIS_MAP_OPEN -- open DBM map
*/
@@ -837,7 +944,16 @@ nis_map_open(map, mode)
if (mode != O_RDONLY)
{
- errno = ENODEV;
+ /* issue a pseudo-error message */
+#ifdef ENOSYS
+ errno = ENOSYS;
+#else
+# ifdef EFTYPE
+ errno = EFTYPE;
+# else
+ errno = ENXIO;
+# endif
+#endif
return FALSE;
}
@@ -849,12 +965,20 @@ nis_map_open(map, mode)
map->map_domain = p;
}
- if (map->map_domain == NULL)
- yp_get_default_domain(&map->map_domain);
-
if (*map->map_file == '\0')
map->map_file = "mail.aliases";
+ if (map->map_domain == NULL)
+ {
+ yperr = yp_get_default_domain(&map->map_domain);
+ if (yperr != 0)
+ {
+ syserr("NIS map %s specified, but NIS not running\n",
+ map->map_file);
+ return FALSE;
+ }
+ }
+
/* check to see if this map actually exists */
yperr = yp_match(map->map_domain, map->map_file, "@", 1,
&vp, &vsize);
@@ -1012,6 +1136,9 @@ stab_map_open(map, mode)
register MAP *map;
int mode;
{
+ FILE *af;
+ struct stat st;
+
if (tTd(38, 2))
printf("stab_map_open(%s)\n", map->map_file);
@@ -1021,12 +1148,23 @@ stab_map_open(map, mode)
return FALSE;
}
+ af = fopen(map->map_file, "r");
+ if (af == NULL)
+ return FALSE;
+ readaliases(map, af, TRUE);
+
+ if (fstat(fileno(af), &st) >= 0)
+ map->map_mtime = st.st_mtime;
+ fclose(af);
+
return TRUE;
}
/*
-** STAB_MAP_CLOSE -- close symbol table (???)
+** STAB_MAP_CLOSE -- close symbol table.
+**
+** Since this is in memory, there is nothing to do.
*/
void
@@ -1100,11 +1238,13 @@ impl_map_open(map, mode)
struct stat stb;
if (tTd(38, 2))
- printf("impl_map_open(%s)\n", map->map_file);
+ 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;
}
@@ -1112,7 +1252,7 @@ impl_map_open(map, mode)
map->map_mflags |= MF_IMPL_HASH;
if (hash_map_open(map, mode))
{
-#if defined(NDBM) && defined(YPCOMPAT)
+#if defined(NDBM) && defined(NIS)
if (mode == O_RDONLY || access("/var/yp/Makefile", R_OK) != 0)
#endif
return TRUE;
@@ -1130,9 +1270,12 @@ impl_map_open(map, mode)
map->map_mflags &= ~MF_IMPL_NDBM;
#endif
-#if !defined(NEWDB) && !defined(NDBM)
+#if defined(NEWDB) || defined(NDBM)
if (Verbose)
message("WARNING: cannot open alias database %s", map->map_file);
+#else
+ if (mode != O_RDONLY)
+ usrerr("Cannot rebuild aliases: no database format defined");
#endif
return stab_map_open(map, mode);
diff --git a/usr.sbin/sendmail/src/mci.c b/usr.sbin/sendmail/src/mci.c
index 0d55a665a623..978b8c3cdbc0 100644
--- a/usr.sbin/sendmail/src/mci.c
+++ b/usr.sbin/sendmail/src/mci.c
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)mci.c 8.2 (Berkeley) 7/11/93";
+static char sccsid[] = "@(#)mci.c 8.12 (Berkeley) 2/9/94";
#endif /* not lint */
#include "sendmail.h"
@@ -104,6 +104,16 @@ mci_cache(mci)
if (*mcislot != NULL)
mci_uncache(mcislot, TRUE);
+ if (tTd(42, 5))
+ printf("mci_cache: caching %x (%s) in slot %d\n",
+ mci, mci->mci_host, mcislot - MciCache);
+#ifdef LOG
+ if (tTd(91, 100))
+ syslog(LOG_DEBUG, "%s: mci_cache: caching %x (%s) in slot %d",
+ CurEnv->e_id ? CurEnv->e_id : "NOQUEUE",
+ mci, mci->mci_host, mcislot - MciCache);
+#endif
+
*mcislot = mci;
mci->mci_flags |= MCIF_CACHED;
}
@@ -185,6 +195,16 @@ mci_uncache(mcislot, doquit)
return;
*mcislot = NULL;
+ if (tTd(42, 5))
+ printf("mci_uncache: uncaching %x (%s) from slot %d (%d)\n",
+ mci, mci->mci_host, mcislot - MciCache, doquit);
+#ifdef LOG
+ if (tTd(91, 100))
+ syslog(LOG_DEBUG, "%s: mci_uncache: uncaching %x (%s) from slot %d (%d)",
+ CurEnv->e_id ? CurEnv->e_id : "NOQUEUE",
+ mci, mci->mci_host, mcislot - MciCache, doquit);
+#endif
+
if (doquit)
{
message("Closing connection to %s", mci->mci_host);
@@ -253,8 +273,13 @@ mci_get(host, m)
/* clear CurHostAddr so we don't get a bogus address with this name */
bzero(&CurHostAddr, sizeof CurHostAddr);
-#endif DAEMON
+#endif
+
+ /* clear out any expired connections */
+ mci_scan(NULL);
+ if (m->m_mno < 0)
+ syserr("negative mno %d (%s)", m->m_mno, m->m_name);
s = stab(host, ST_MCI + m->m_mno, ST_ENTER);
mci = &s->s_mci;
mci->mci_host = s->s_name;
@@ -278,6 +303,21 @@ mci_get(host, m)
mci->mci_exitstat = EX_OK;
mci->mci_state = MCIS_CLOSED;
}
+ else
+ {
+ /* get peer host address for logging reasons only */
+ /* (this should really be in the mci struct) */
+ int socksize = sizeof CurHostAddr;
+
+ (void) getpeername(fileno(mci->mci_in),
+ (struct sockaddr *) &CurHostAddr, &socksize);
+ }
+ }
+ if (mci->mci_state == MCIS_CLOSED)
+ {
+ /* copy out any mailer flags needed in connection state */
+ if (bitnset(M_7BITS, m->m_flags))
+ mci->mci_flags |= MCIF_7BIT;
}
return mci;
@@ -295,25 +335,62 @@ mci_get(host, m)
** none.
*/
-mci_dump(mci)
+mci_dump(mci, logit)
register MCI *mci;
+ bool logit;
{
+ register char *p;
+ char *sep;
+ char buf[1000];
extern char *ctime();
- printf("MCI@%x: ", mci);
+ sep = logit ? " " : "\n\t";
+ p = buf;
+ sprintf(p, "MCI@%x: ", mci);
+ p += strlen(p);
if (mci == NULL)
{
- printf("NULL\n");
- return;
+ sprintf(p, "NULL");
+ goto printit;
}
- printf("flags=%o, errno=%d, herrno=%d, exitstat=%d, state=%d, pid=%d,\n",
+ sprintf(p, "flags=%o, errno=%d, herrno=%d, exitstat=%d, state=%d, pid=%d,%s",
mci->mci_flags, mci->mci_errno, mci->mci_herrno,
- mci->mci_exitstat, mci->mci_state, mci->mci_pid);
- printf("\tmaxsize=%ld, phase=%s, mailer=%s,\n",
+ mci->mci_exitstat, mci->mci_state, mci->mci_pid, sep);
+ p += strlen(p);
+ sprintf(p, "maxsize=%ld, phase=%s, mailer=%s,%s",
mci->mci_maxsize,
mci->mci_phase == NULL ? "NULL" : mci->mci_phase,
- mci->mci_mailer == NULL ? "NULL" : mci->mci_mailer->m_name);
- printf("\thost=%s, lastuse=%s\n",
+ mci->mci_mailer == NULL ? "NULL" : mci->mci_mailer->m_name,
+ sep);
+ p += strlen(p);
+ sprintf(p, "host=%s, lastuse=%s",
mci->mci_host == NULL ? "NULL" : mci->mci_host,
ctime(&mci->mci_lastuse));
+printit:
+ if (logit)
+ syslog(LOG_DEBUG, "%s", buf);
+ else
+ printf("%s\n", buf);
+}
+ /*
+** MCI_DUMP_ALL -- print the entire MCI cache
+**
+** Parameters:
+** logit -- if set, log the result instead of printing
+** to stdout.
+**
+** Returns:
+** none.
+*/
+
+mci_dump_all(logit)
+ bool logit;
+{
+ register int i;
+
+ if (MciCache == NULL)
+ return;
+
+ for (i = 0; i < MaxMciCache; i++)
+ mci_dump(MciCache[i], logit);
}
diff --git a/usr.sbin/sendmail/src/newaliases.1 b/usr.sbin/sendmail/src/newaliases.1
index 65cfc5f38e3c..c611b78b62b5 100644
--- a/usr.sbin/sendmail/src/newaliases.1
+++ b/usr.sbin/sendmail/src/newaliases.1
@@ -29,9 +29,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)newaliases.1 8.1 (Berkeley) 6/7/93
+.\" @(#)newaliases.1 8.4 (Berkeley) 2/22/94
.\"
-.Dd June 7, 1993
+.Dd February 22, 1994
.Dt NEWALIASES 1
.Os BSD 4
.Sh NAME
@@ -43,12 +43,23 @@
.Nm Newaliases
rebuilds the random access data base for the mail aliases file
.Pa /etc/aliases .
-It must be run each time
-.Pa /etc/aliases
-is changed in order
+It must be run each time this file is changed in order
for the change to take effect.
+.Pp
+.Nm Newaliases
+is identical to
+.Dq Li "sendmail -bi" .
+.Pp
+The
+.Nm newaliases
+utility exits 0 on success, and >0 if an error occurs.
+.Sh FILES
+.Bl -tag -width /etc/aliases -compact
+.It Pa /etc/aliases
+The mail aliases file
+.El
.Sh SEE ALSO
-.\" .Xr aliases 5 ,
+.Xr aliases 5 ,
.Xr sendmail 8
.Sh HISTORY
The
diff --git a/usr.sbin/sendmail/src/parseaddr.c b/usr.sbin/sendmail/src/parseaddr.c
index 8951cac01cff..800a1372cdcd 100644
--- a/usr.sbin/sendmail/src/parseaddr.c
+++ b/usr.sbin/sendmail/src/parseaddr.c
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)parseaddr.c 8.3 (Berkeley) 7/11/93";
+static char sccsid[] = "@(#)parseaddr.c 8.30 (Berkeley) 2/9/94";
#endif /* not lint */
# include "sendmail.h"
@@ -56,14 +56,8 @@ static char sccsid[] = "@(#)parseaddr.c 8.3 (Berkeley) 7/11/93";
** addr -- the address to parse.
** a -- a pointer to the address descriptor buffer.
** If NULL, a header will be created.
-** copyf -- determines what shall be copied:
-** -1 -- don't copy anything. The printname
-** (q_paddr) is just addr, and the
-** user & host are allocated internally
-** to parse.
-** 0 -- copy out the parsed user & host, but
-** don't copy the printname.
-** +1 -- copy everything.
+** flags -- describe detail for parsing. See RF_ definitions
+** in sendmail.h.
** delim -- the character to terminate the address, passed
** to prescan.
** delimptr -- if non-NULL, set to the location of the
@@ -83,10 +77,10 @@ static char sccsid[] = "@(#)parseaddr.c 8.3 (Berkeley) 7/11/93";
# define DELIMCHARS "()<>,;\r\n" /* default word delimiters */
ADDRESS *
-parseaddr(addr, a, copyf, delim, delimptr, e)
+parseaddr(addr, a, flags, delim, delimptr, e)
char *addr;
register ADDRESS *a;
- int copyf;
+ int flags;
int delim;
char **delimptr;
register ENVELOPE *e;
@@ -106,17 +100,10 @@ parseaddr(addr, a, copyf, delim, delimptr, e)
if (tTd(20, 1))
printf("\n--parseaddr(%s)\n", addr);
- if (invalidaddr(addr))
- {
- if (tTd(20, 1))
- printf("parseaddr-->bad address\n");
- return NULL;
- }
-
if (delimptr == NULL)
delimptr = &delimptrbuf;
- pvp = prescan(addr, delim, pvpbuf, delimptr);
+ pvp = prescan(addr, delim, pvpbuf, sizeof pvpbuf, delimptr);
if (pvp == NULL)
{
if (tTd(20, 1))
@@ -124,42 +111,58 @@ parseaddr(addr, a, copyf, delim, delimptr, e)
return (NULL);
}
+ if (invalidaddr(addr, delim == '\0' ? NULL : *delimptr))
+ {
+ if (tTd(20, 1))
+ printf("parseaddr-->bad address\n");
+ return NULL;
+ }
+
+ /*
+ ** Save addr if we are going to have to.
+ **
+ ** We have to do this early because there is a chance that
+ ** the map lookups in the rewriting rules could clobber
+ ** static memory somewhere.
+ */
+
+ if (bitset(RF_COPYPADDR, flags) && addr != NULL)
+ {
+ char savec = **delimptr;
+
+ if (savec != '\0')
+ **delimptr = '\0';
+ addr = newstr(addr);
+ if (savec != '\0')
+ **delimptr = savec;
+ }
+
/*
** Apply rewriting rules.
** Ruleset 0 does basic parsing. It must resolve.
*/
queueup = FALSE;
- if (rewrite(pvp, 3, e) == EX_TEMPFAIL)
+ if (rewrite(pvp, 3, 0, e) == EX_TEMPFAIL)
queueup = TRUE;
- if (rewrite(pvp, 0, e) == EX_TEMPFAIL)
+ if (rewrite(pvp, 0, 0, e) == EX_TEMPFAIL)
queueup = TRUE;
- /*
- ** See if we resolved to a real mailer.
- */
-
- if (pvp[0] == NULL || (pvp[0][0] & 0377) != CANONNET)
- {
- setstat(EX_USAGE);
- syserr("554 cannot resolve name %s", addr);
- return (NULL);
- }
/*
** Build canonical address from pvp.
*/
- a = buildaddr(pvp, a, e);
- if (a == NULL)
- return (NULL);
+ a = buildaddr(pvp, a, flags, e);
/*
** Make local copies of the host & user and then
** transport them out.
*/
- allocaddr(a, copyf, addr, *delimptr);
+ allocaddr(a, flags, addr);
+ if (bitset(QBADADDR, a->q_flags))
+ return a;
/*
** If there was a parsing failure, mark it for queueing.
@@ -201,18 +204,43 @@ parseaddr(addr, a, copyf, delim, delimptr, e)
*/
bool
-invalidaddr(addr)
+invalidaddr(addr, delimptr)
register char *addr;
+ char *delimptr;
{
+ char savedelim;
+
+ if (delimptr != NULL)
+ {
+ savedelim = *delimptr;
+ if (savedelim != '\0')
+ *delimptr = '\0';
+ }
+#if 0
+ /* for testing.... */
+ if (strcmp(addr, "INvalidADDR") == 0)
+ {
+ usrerr("553 INvalid ADDRess");
+ goto addrfailure;
+ }
+#endif
for (; *addr != '\0'; addr++)
{
- if ((*addr & 0340) != 0200)
- continue;
- setstat(EX_USAGE);
- usrerr("553 Address contained invalid control characters");
- return TRUE;
+ if ((*addr & 0340) == 0200)
+ break;
}
- return FALSE;
+ if (*addr == '\0')
+ {
+ if (savedelim != '\0' && delimptr != NULL)
+ *delimptr = savedelim;
+ return FALSE;
+ }
+ setstat(EX_USAGE);
+ usrerr("553 Address contained invalid control characters");
+ addrfailure:
+ if (savedelim != '\0' && delimptr != NULL)
+ *delimptr = savedelim;
+ return TRUE;
}
/*
** ALLOCADDR -- do local allocations of address on demand.
@@ -221,9 +249,9 @@ invalidaddr(addr)
**
** Parameters:
** a -- the address to reallocate.
-** copyf -- the copy flag (see parseaddr for description).
+** flags -- the copy flag (see RF_ definitions in sendmail.h
+** for a description).
** paddr -- the printname of the address.
-** delimptr -- a pointer to the address delimiter. Must be set.
**
** Returns:
** none.
@@ -232,34 +260,22 @@ invalidaddr(addr)
** Copies portions of a into local buffers as requested.
*/
-allocaddr(a, copyf, paddr, delimptr)
+allocaddr(a, flags, paddr)
register ADDRESS *a;
- int copyf;
+ int flags;
char *paddr;
- char *delimptr;
{
if (tTd(24, 4))
- printf("allocaddr(copyf=%d, paddr=%s)\n", copyf, paddr);
+ printf("allocaddr(flags=%o, paddr=%s)\n", flags, paddr);
- if (copyf > 0 && paddr != NULL)
- {
- char savec = *delimptr;
-
- if (savec != '\0')
- *delimptr = '\0';
- a->q_paddr = newstr(paddr);
- if (savec != '\0')
- *delimptr = savec;
- }
- else
- a->q_paddr = paddr;
+ a->q_paddr = paddr;
if (a->q_user == NULL)
a->q_user = "";
if (a->q_host == NULL)
a->q_host = "";
- if (copyf >= 0)
+ if (bitset(RF_COPYPARSE, flags))
{
a->q_host = newstr(a->q_host);
if (a->q_user != a->q_paddr)
@@ -292,6 +308,7 @@ allocaddr(a, copyf, paddr, delimptr)
** If '\t' then we are reading the .cf file.
** pvpbuf -- place to put the saved text -- note that
** the pointers are static.
+** pvpbsize -- size of pvpbuf.
** delimptr -- if non-NULL, set to the location of the
** terminating delimiter.
**
@@ -325,10 +342,34 @@ static short StateTab[NSTATES][NSTATES] =
/*ONE*/ OPR, OPR, OPR, OPR, OPR,
};
+/* token type table -- it gets modified with $o characters */
+static TokTypeTab[256] =
+{
+ ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,SPC,SPC,SPC,SPC,SPC,ATM,ATM,
+ ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
+ SPC,ATM,QST,ATM,ATM,ATM,ATM,ATM,ATM,SPC,ATM,ATM,ATM,ATM,ATM,ATM,
+ ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
+ ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
+ ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
+ ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
+ ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
+ OPR,OPR,ONE,OPR,OPR,OPR,OPR,OPR,OPR,OPR,OPR,OPR,OPR,OPR,OPR,OPR,
+ OPR,OPR,OPR,ONE,ONE,ONE,OPR,OPR,OPR,OPR,OPR,OPR,OPR,OPR,OPR,OPR,
+ ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
+ ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
+ ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
+ ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
+ ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
+ ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
+};
+
+#define toktype(c) ((int) TokTypeTab[(c) & 0xff])
+
+
# define NOCHAR -1 /* signal nothing in lookahead token */
char **
-prescan(addr, delim, pvpbuf, delimptr)
+prescan(addr, delim, pvpbuf, pvpbsize, delimptr)
char *addr;
char delim;
char pvpbuf[];
@@ -346,8 +387,24 @@ prescan(addr, delim, pvpbuf, delimptr)
int newstate;
char *saveto = CurEnv->e_to;
static char *av[MAXATOM+1];
+ static char firsttime = TRUE;
extern int errno;
+ if (firsttime)
+ {
+ /* initialize the token type table */
+ char obuf[50];
+
+ firsttime = FALSE;
+ expand("\201o", obuf, &obuf[sizeof obuf - sizeof DELIMCHARS], CurEnv);
+ strcat(obuf, DELIMCHARS);
+ for (p = obuf; *p != '\0'; p++)
+ {
+ if (TokTypeTab[*p & 0xff] == ATM)
+ TokTypeTab[*p & 0xff] = OPR;
+ }
+ }
+
/* make sure error messages don't have garbage on them */
errno = 0;
@@ -377,9 +434,10 @@ prescan(addr, delim, pvpbuf, delimptr)
if (c != NOCHAR && !bslashmode)
{
/* see if there is room */
- if (q >= &pvpbuf[PSBUFSIZE - 5])
+ if (q >= &pvpbuf[pvpbsize - 5])
{
usrerr("553 Address too long");
+ returnnull:
if (delimptr != NULL)
*delimptr = p;
CurEnv->e_to = saveto;
@@ -397,18 +455,18 @@ prescan(addr, delim, pvpbuf, delimptr)
/* diagnose and patch up bad syntax */
if (state == QST)
{
- usrerr("553 Unbalanced '\"'");
+ usrerr("653 Unbalanced '\"'");
c = '"';
}
else if (cmntcnt > 0)
{
- usrerr("553 Unbalanced '('");
+ usrerr("653 Unbalanced '('");
c = ')';
}
else if (anglecnt > 0)
{
c = '>';
- usrerr("553 Unbalanced '<'");
+ usrerr("653 Unbalanced '<'");
}
else
break;
@@ -458,11 +516,8 @@ prescan(addr, delim, pvpbuf, delimptr)
{
if (cmntcnt <= 0)
{
- usrerr("553 Unbalanced ')'");
- if (delimptr != NULL)
- *delimptr = p;
- CurEnv->e_to = saveto;
- return (NULL);
+ usrerr("653 Unbalanced ')'");
+ c = NOCHAR;
}
else
cmntcnt--;
@@ -475,13 +530,11 @@ prescan(addr, delim, pvpbuf, delimptr)
{
if (anglecnt <= 0)
{
- usrerr("553 Unbalanced '>'");
- if (delimptr != NULL)
- *delimptr = p;
- CurEnv->e_to = saveto;
- return (NULL);
+ usrerr("653 Unbalanced '>'");
+ c = NOCHAR;
}
- anglecnt--;
+ else
+ anglecnt--;
}
else if (delim == ' ' && isascii(c) && isspace(c))
c = ' ';
@@ -516,10 +569,12 @@ prescan(addr, delim, pvpbuf, delimptr)
if (avp >= &av[MAXATOM])
{
syserr("553 prescan: too many tokens");
- if (delimptr != NULL)
- *delimptr = p;
- CurEnv->e_to = saveto;
- return (NULL);
+ goto returnnull;
+ }
+ if (q - tok > MAXNAME)
+ {
+ syserr("553 prescan: token too long");
+ goto returnnull;
}
*avp++ = tok;
}
@@ -535,50 +590,12 @@ prescan(addr, delim, pvpbuf, delimptr)
}
CurEnv->e_to = saveto;
if (av[0] == NULL)
- return (NULL);
- return (av);
-}
- /*
-** TOKTYPE -- return token type
-**
-** Parameters:
-** c -- the character in question.
-**
-** Returns:
-** Its type.
-**
-** Side Effects:
-** none.
-*/
-
-toktype(c)
- register int c;
-{
- static char buf[50];
- static bool firstime = TRUE;
-
- if (firstime)
{
- firstime = FALSE;
- expand("\201o", buf, &buf[sizeof buf - 1], CurEnv);
- (void) strcat(buf, DELIMCHARS);
+ if (tTd(22, 1))
+ printf("prescan: null leading token\n");
+ return (NULL);
}
- c &= 0377;
- if (c == MATCHCLASS || c == MATCHREPL || c == MATCHNCLASS)
- return (ONE);
- if (c == MACRODEXPAND)
- return (ONE);
- if (c == '"')
- return (QST);
- if ((c & 0340) == 0200)
- return (OPR);
- if (!isascii(c))
- return (ATM);
- if (isspace(c) || c == ')')
- return (SPC);
- if (strchr(buf, c) != NULL)
- return (OPR);
- return (ATM);
+ return (av);
}
/*
** REWRITE -- apply rewrite rules to token vector.
@@ -605,6 +622,7 @@ toktype(c)
** Parameters:
** pvp -- pointer to token vector.
** ruleset -- the ruleset to use for rewriting.
+** reclevel -- recursion level (to catch loops).
** e -- the current envelope.
**
** Returns:
@@ -624,11 +642,16 @@ struct match
# define MAXMATCH 9 /* max params per rewrite */
+# ifndef MAXRULERECURSION
+# define MAXRULERECURSION 50 /* max recursion depth */
+# endif
+
int
-rewrite(pvp, ruleset, e)
+rewrite(pvp, ruleset, reclevel, e)
char **pvp;
int ruleset;
+ int reclevel;
register ENVELOPE *e;
{
register char *ap; /* address pointer */
@@ -639,6 +662,7 @@ rewrite(pvp, ruleset, e)
register struct rewrite *rwr; /* pointer to current rewrite rule */
int ruleno; /* current rule number */
int rstat = EX_OK; /* return status */
+ int loopcount;
struct match mlist[MAXMATCH]; /* stores match on LHS */
char *npvp[MAXATOM+1]; /* temporary space for rebuild */
@@ -652,6 +676,11 @@ rewrite(pvp, ruleset, e)
syserr("554 rewrite: illegal ruleset number %d", ruleset);
return EX_CONFIG;
}
+ if (reclevel++ > MAXRULERECURSION)
+ {
+ syserr("rewrite: infinite recursion, ruleset %d", ruleset);
+ return EX_CONFIG;
+ }
if (pvp == NULL)
return EX_USAGE;
@@ -661,10 +690,9 @@ rewrite(pvp, ruleset, e)
*/
ruleno = 1;
+ loopcount = 0;
for (rwr = RewriteRules[ruleset]; rwr != NULL; )
{
- int loopcount = 0;
-
if (tTd(21, 12))
{
printf("-----trying rule:");
@@ -874,6 +902,7 @@ rewrite(pvp, ruleset, e)
printf("----- rule fails\n");
rwr = rwr->r_next;
ruleno++;
+ loopcount = 0;
continue;
}
@@ -890,6 +919,7 @@ rewrite(pvp, ruleset, e)
rvp++;
rwr = rwr->r_next;
ruleno++;
+ loopcount = 0;
}
else if ((*rp & 0377) == CANONHOST)
{
@@ -984,6 +1014,7 @@ rewrite(pvp, ruleset, e)
char *pvpb1[MAXATOM + 1];
char *argvect[10];
char pvpbuf[PSBUFSIZE];
+ char *nullpvp[1];
if ((**rvp & 0377) != HOSTBEGIN &&
(**rvp & 0377) != LOOKUPBEGIN)
@@ -1101,10 +1132,17 @@ rewrite(pvp, ruleset, e)
{
xpvp = key_rvp;
}
+ else if (*replac == '\0')
+ {
+ /* null replacement */
+ nullpvp[0] = NULL;
+ xpvp = nullpvp;
+ }
else
{
/* scan the new replacement */
- xpvp = prescan(replac, '\0', pvpbuf, NULL);
+ xpvp = prescan(replac, '\0', pvpbuf,
+ sizeof pvpbuf, NULL);
if (xpvp == NULL)
{
/* prescan already printed error */
@@ -1136,15 +1174,24 @@ rewrite(pvp, ruleset, e)
{
int stat;
- bcopy((char *) &npvp[2], (char *) pvp,
- (int) (avp - npvp - 2) * sizeof *avp);
- if (tTd(21, 3))
- printf("-----callsubr %s\n", npvp[1]);
- stat = rewrite(pvp, atoi(npvp[1]), e);
- if (rstat == EX_OK || stat == EX_TEMPFAIL)
- rstat = stat;
- if ((**pvp & 0377) == CANONNET)
+ if (npvp[1] == NULL)
+ {
+ syserr("parseaddr: NULL subroutine call in ruleset %d, rule %d",
+ ruleset, ruleno);
+ *pvp = NULL;
+ }
+ else
+ {
+ bcopy((char *) &npvp[2], (char *) pvp,
+ (int) (avp - npvp - 2) * sizeof *avp);
+ if (tTd(21, 3))
+ printf("-----callsubr %s\n", npvp[1]);
+ stat = rewrite(pvp, atoi(npvp[1]), reclevel, e);
+ if (rstat == EX_OK || stat == EX_TEMPFAIL)
+ rstat = stat;
+ if (*pvp != NULL && (**pvp & 0377) == CANONNET)
rwr = NULL;
+ }
}
else
{
@@ -1173,6 +1220,8 @@ rewrite(pvp, ruleset, e)
** tv -- token vector.
** a -- pointer to address descriptor to fill.
** If NULL, one will be allocated.
+** flags -- info regarding whether this is a sender or
+** a recipient.
** e -- the current envelope.
**
** Returns:
@@ -1203,26 +1252,45 @@ struct errcodes
};
ADDRESS *
-buildaddr(tv, a, e)
+buildaddr(tv, a, flags, e)
register char **tv;
register ADDRESS *a;
+ int flags;
register ENVELOPE *e;
{
struct mailer **mp;
register struct mailer *m;
char *bp;
int spaceleft;
+ static MAILER errormailer;
+ static char *errorargv[] = { "ERROR", NULL };
static char buf[MAXNAME];
+ if (tTd(24, 5))
+ {
+ printf("buildaddr, flags=%o, tv=", flags);
+ printav(tv);
+ }
+
if (a == NULL)
a = (ADDRESS *) xalloc(sizeof *a);
bzero((char *) a, sizeof *a);
/* figure out what net/mailer to use */
- if ((**tv & 0377) != CANONNET)
+ if (*tv == NULL || (**tv & 0377) != CANONNET)
{
syserr("554 buildaddr: no net");
- return (NULL);
+badaddr:
+ a->q_flags |= QBADADDR;
+ a->q_mailer = &errormailer;
+ if (errormailer.m_name == NULL)
+ {
+ /* initialize the bogus mailer */
+ errormailer.m_name = "*error*";
+ errormailer.m_mailer = "ERROR";
+ errormailer.m_argv = errorargv;
+ }
+ return a;
}
tv++;
if (strcasecmp(*tv, "error") == 0)
@@ -1244,12 +1312,28 @@ buildaddr(tv, a, e)
}
tv++;
}
+ else
+ setstat(EX_UNAVAILABLE);
if ((**tv & 0377) != CANONUSER)
syserr("554 buildaddr: error: no user");
cataddr(++tv, NULL, buf, sizeof buf, ' ');
stripquotes(buf);
- usrerr(buf);
- return (NULL);
+ if (isascii(buf[0]) && isdigit(buf[0]) &&
+ isascii(buf[1]) && isdigit(buf[1]) &&
+ isascii(buf[2]) && isdigit(buf[2]) &&
+ buf[3] == ' ')
+ {
+ char fmt[10];
+
+ strncpy(fmt, buf, 3);
+ strcpy(&fmt[3], " %s");
+ usrerr(fmt, buf + 4);
+ }
+ else
+ {
+ usrerr("553 %s", buf);
+ }
+ goto badaddr;
}
for (mp = Mailer; (m = *mp++) != NULL; )
@@ -1260,7 +1344,7 @@ buildaddr(tv, a, e)
if (m == NULL)
{
syserr("554 buildaddr: unknown mailer %s", *tv);
- return (NULL);
+ goto badaddr;
}
a->q_mailer = m;
@@ -1297,7 +1381,7 @@ buildaddr(tv, a, e)
if (!bitnset(M_LOCALMAILER, m->m_flags))
{
syserr("554 buildaddr: no host");
- return (NULL);
+ goto badaddr;
}
a->q_host = NULL;
}
@@ -1306,7 +1390,7 @@ buildaddr(tv, a, e)
if (*tv == NULL || (**tv & 0377) != CANONUSER)
{
syserr("554 buildaddr: no user");
- return (NULL);
+ goto badaddr;
}
tv++;
@@ -1342,8 +1426,16 @@ buildaddr(tv, a, e)
a->q_flags |= QNOTREMOTE;
}
- /* do cleanup of final address */
- (void) rewrite(tv, 4, e);
+ /* rewrite according recipient mailer rewriting rules */
+ define('h', a->q_host, e);
+ if (!bitset(RF_SENDERADDR|RF_HEADERADDR, flags))
+ {
+ /* sender addresses done later */
+ (void) rewrite(tv, 2, 0, e);
+ if (m->m_re_rwset > 0)
+ (void) rewrite(tv, m->m_re_rwset, 0, e);
+ }
+ (void) rewrite(tv, 4, 0, e);
/* save the result for the command line/RCPT argument */
cataddr(tv, NULL, buf, sizeof buf, '\0');
@@ -1437,6 +1529,8 @@ sameaddr(a, b)
register ADDRESS *a;
register ADDRESS *b;
{
+ register ADDRESS *ca, *cb;
+
/* if they don't have the same mailer, forget it */
if (a->q_mailer != b->q_mailer)
return (FALSE);
@@ -1445,9 +1539,16 @@ sameaddr(a, b)
if (strcmp(a->q_user, b->q_user) != 0)
return (FALSE);
- /* if we have good uids for both but the differ, these are different */
- if (bitset(QGOODUID, a->q_flags & b->q_flags) && a->q_uid != b->q_uid)
- return (FALSE);
+ /* if we have good uids for both but they differ, these are different */
+ if (a->q_mailer == ProgMailer)
+ {
+ ca = getctladdr(a);
+ cb = getctladdr(b);
+ if (ca != NULL && cb != NULL &&
+ bitset(QGOODUID, ca->q_flags & cb->q_flags) &&
+ ca->q_uid != cb->q_uid)
+ return (FALSE);
+ }
/* otherwise compare hosts (but be careful for NULL ptrs) */
if (a->q_host == b->q_host)
@@ -1592,10 +1693,10 @@ remotename(name, m, flags, pstat, e)
** domain will be appended.
*/
- pvp = prescan(name, '\0', pvpbuf, NULL);
+ pvp = prescan(name, '\0', pvpbuf, sizeof pvpbuf, NULL);
if (pvp == NULL)
return (name);
- if (rewrite(pvp, 3, e) == EX_TEMPFAIL)
+ if (rewrite(pvp, 3, 0, e) == EX_TEMPFAIL)
*pstat = EX_TEMPFAIL;
if (bitset(RF_ADDDOMAIN, flags) && e->e_fromdomain != NULL)
{
@@ -1612,7 +1713,7 @@ remotename(name, m, flags, pstat, e)
while ((*pxp++ = *qxq++) != NULL)
continue;
- if (rewrite(pvp, 3, e) == EX_TEMPFAIL)
+ if (rewrite(pvp, 3, 0, e) == EX_TEMPFAIL)
*pstat = EX_TEMPFAIL;
}
}
@@ -1626,17 +1727,17 @@ remotename(name, m, flags, pstat, e)
if (bitset(RF_SENDERADDR, flags))
{
- if (rewrite(pvp, 1, e) == EX_TEMPFAIL)
+ if (rewrite(pvp, 1, 0, e) == EX_TEMPFAIL)
*pstat = EX_TEMPFAIL;
}
else
{
- if (rewrite(pvp, 2, e) == EX_TEMPFAIL)
+ if (rewrite(pvp, 2, 0, e) == EX_TEMPFAIL)
*pstat = EX_TEMPFAIL;
}
if (rwset > 0)
{
- if (rewrite(pvp, rwset, e) == EX_TEMPFAIL)
+ if (rewrite(pvp, rwset, 0, e) == EX_TEMPFAIL)
*pstat = EX_TEMPFAIL;
}
@@ -1647,7 +1748,7 @@ remotename(name, m, flags, pstat, e)
** may be used as a default to the above rules.
*/
- if (rewrite(pvp, 4, e) == EX_TEMPFAIL)
+ if (rewrite(pvp, 4, 0, e) == EX_TEMPFAIL)
*pstat = EX_TEMPFAIL;
/*
@@ -1656,7 +1757,13 @@ remotename(name, m, flags, pstat, e)
cataddr(pvp, NULL, lbuf, sizeof lbuf, '\0');
define('g', lbuf, e);
- expand(fancy, buf, &buf[sizeof buf - 1], e);
+
+ /* need to make sure route-addrs have <angle brackets> */
+ if (bitset(RF_CANONICAL, flags) && lbuf[0] == '@')
+ expand("<\201g>", buf, &buf[sizeof buf - 1], e);
+ else
+ expand(fancy, buf, &buf[sizeof buf - 1], e);
+
define('g', oldg, e);
if (tTd(12, 1))
@@ -1690,16 +1797,16 @@ maplocaluser(a, sendq, e)
printf("maplocaluser: ");
printaddr(a, FALSE);
}
- pvp = prescan(a->q_user, '\0', pvpbuf, &delimptr);
+ pvp = prescan(a->q_user, '\0', pvpbuf, sizeof pvpbuf, &delimptr);
if (pvp == NULL)
return;
- (void) rewrite(pvp, 5, e);
+ (void) rewrite(pvp, 5, 0, e);
if (pvp[0] == NULL || (pvp[0][0] & 0377) != CANONNET)
return;
/* if non-null, mailer destination specified -- has it changed? */
- a1 = buildaddr(pvp, NULL, e);
+ a1 = buildaddr(pvp, NULL, 0, e);
if (a1 == NULL || sameaddr(a, a1))
return;
@@ -1711,7 +1818,7 @@ maplocaluser(a, sendq, e)
printaddr(a, FALSE);
}
a1->q_alias = a;
- allocaddr(a1, 1, NULL, delimptr);
+ allocaddr(a1, RF_COPYALL, NULL);
(void) recipient(a1, sendq, e);
}
/*
diff --git a/usr.sbin/sendmail/src/pathnames.h b/usr.sbin/sendmail/src/pathnames.h
index be9a07261718..a611c0b0b2b0 100644
--- a/usr.sbin/sendmail/src/pathnames.h
+++ b/usr.sbin/sendmail/src/pathnames.h
@@ -30,17 +30,13 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)pathnames.h 8.1 (Berkeley) 6/7/93
+ * @(#)pathnames.h 8.2 (Berkeley) 8/20/93
*/
#ifndef _PATH_SENDMAILCF
# define _PATH_SENDMAILCF "/etc/sendmail.cf"
#endif
-#ifndef _PATH_SENDMAILFC
-# define _PATH_SENDMAILFC "/etc/sendmail.fc"
-#endif
-
#ifndef _PATH_SENDMAILPID
# ifdef BSD4_4
# define _PATH_SENDMAILPID "/var/run/sendmail.pid"
diff --git a/usr.sbin/sendmail/src/queue.c b/usr.sbin/sendmail/src/queue.c
index 5b55217774ec..99e851efad7d 100644
--- a/usr.sbin/sendmail/src/queue.c
+++ b/usr.sbin/sendmail/src/queue.c
@@ -36,13 +36,12 @@
#ifndef lint
#ifdef QUEUE
-static char sccsid[] = "@(#)queue.c 8.3 (Berkeley) 7/13/93 (with queueing)";
+static char sccsid[] = "@(#)queue.c 8.40 (Berkeley) 3/6/94 (with queueing)";
#else
-static char sccsid[] = "@(#)queue.c 8.3 (Berkeley) 7/13/93 (without queueing)";
+static char sccsid[] = "@(#)queue.c 8.40 (Berkeley) 3/6/94 (without queueing)";
#endif
#endif /* not lint */
-# include <signal.h>
# include <errno.h>
# include <pwd.h>
# include <dirent.h>
@@ -95,49 +94,79 @@ queueup(e, queueall, announce)
bool newid;
register char *p;
MAILER nullmailer;
+ MCI mcibuf;
char buf[MAXLINE], tf[MAXLINE];
/*
** Create control file.
*/
- newid = (e->e_id == NULL);
+ newid = (e->e_id == NULL) || !bitset(EF_INQUEUE, e->e_flags);
+
+ /* if newid, queuename will create a locked qf file in e->lockfp */
strcpy(tf, queuename(e, 't'));
tfp = e->e_lockfp;
if (tfp == NULL)
newid = FALSE;
- if (newid)
- {
- tfp = e->e_lockfp;
- }
- else
+
+ /* if newid, just write the qf file directly (instead of tf file) */
+ if (!newid)
{
/* get a locked tf file */
- for (i = 100; --i >= 0; )
+ for (i = 0; i < 128; i++)
{
fd = open(tf, O_CREAT|O_WRONLY|O_EXCL, FileMode);
if (fd < 0)
{
- if (errno == EEXIST)
- continue;
-notemp:
- syserr("!queueup: cannot create temp file %s", tf);
+ if (errno != EEXIST)
+ break;
+#ifdef LOG
+ if (LogLevel > 0 && (i % 32) == 0)
+ syslog(LOG_ALERT, "queueup: cannot create %s, uid=%d: %s",
+ tf, geteuid(), errstring(errno));
+#endif
+ }
+ else
+ {
+ if (lockfile(fd, tf, NULL, LOCK_EX|LOCK_NB))
+ break;
+#ifdef LOG
+ else if (LogLevel > 0 && (i % 32) == 0)
+ syslog(LOG_ALERT, "queueup: cannot lock %s: %s",
+ tf, errstring(errno));
+#endif
+ close(fd);
}
- if (lockfile(fd, tf, LOCK_EX|LOCK_NB))
- break;
-
- close(fd);
- sleep(i);
+ if ((i % 32) == 31)
+ {
+ /* save the old temp file away */
+ (void) rename(tf, queuename(e, 'T'));
+ }
+ else
+ sleep(i % 32);
+ }
+ if (fd < 0 || (tfp = fdopen(fd, "w")) == NULL)
+ {
+ printopenfds(TRUE);
+ syserr("!queueup: cannot create queue temp file %s, uid=%d",
+ tf, geteuid());
}
- if (fd < 0)
- goto notemp;
-
- tfp = fdopen(fd, "w");
}
if (tTd(40, 1))
- printf("queueing %s\n", e->e_id);
+ printf("\n>>>>> queueing %s%s >>>>>\n", e->e_id,
+ newid ? " (new id)" : "");
+ if (tTd(40, 9))
+ {
+ printf(" tfp=");
+ dumpfd(fileno(tfp), TRUE, FALSE);
+ printf(" lockfp=");
+ if (e->e_lockfp == NULL)
+ printf("NULL\n");
+ else
+ dumpfd(fileno(e->e_lockfp), TRUE, FALSE);
+ }
/*
** If there is no data file yet, create one.
@@ -148,12 +177,16 @@ notemp:
register FILE *dfp;
extern putbody();
- e->e_df = newstr(queuename(e, 'd'));
+ e->e_df = queuename(e, 'd');
+ e->e_df = newstr(e->e_df);
fd = open(e->e_df, O_WRONLY|O_CREAT, FileMode);
- if (fd < 0)
- syserr("!queueup: cannot create %s", e->e_df);
- dfp = fdopen(fd, "w");
- (*e->e_putbody)(dfp, FileMailer, e, NULL);
+ if (fd < 0 || (dfp = fdopen(fd, "w")) == NULL)
+ syserr("!queueup: cannot create data temp file %s, uid=%d",
+ e->e_df, geteuid());
+ bzero(&mcibuf, sizeof mcibuf);
+ mcibuf.mci_out = dfp;
+ mcibuf.mci_mailer = FileMailer;
+ (*e->e_putbody)(&mcibuf, e, NULL);
(void) xfclose(dfp, "queueup dfp", e->e_id);
e->e_putbody = putbody;
}
@@ -224,7 +257,7 @@ notemp:
e->e_to = q->q_paddr;
message("queued");
if (LogLevel > 8)
- logdelivery(NULL, NULL, "queued", e);
+ logdelivery(NULL, NULL, "queued", NULL, e);
e->e_to = NULL;
}
if (tTd(40, 1))
@@ -249,6 +282,9 @@ notemp:
nullmailer.m_re_rwset = nullmailer.m_rh_rwset =
nullmailer.m_se_rwset = nullmailer.m_sh_rwset = -1;
nullmailer.m_eol = "\n";
+ bzero(&mcibuf, sizeof mcibuf);
+ mcibuf.mci_mailer = &nullmailer;
+ mcibuf.mci_out = tfp;
define('g', "\201f", e);
for (h = e->e_header; h != NULL; h = h->h_link)
@@ -263,6 +299,14 @@ notemp:
if (bitset(H_RESENT, h->h_flags) && !bitset(EF_RESENT, e->e_flags))
continue;
+ /* expand macros; if null, don't output header at all */
+ if (bitset(H_DEFAULT, h->h_flags))
+ {
+ (void) expand(h->h_value, buf, &buf[sizeof buf], e);
+ if (buf[0] == '\0')
+ continue;
+ }
+
/* output this header */
fprintf(tfp, "H");
@@ -281,7 +325,6 @@ notemp:
/* output the header: expand macros, convert addresses */
if (bitset(H_DEFAULT, h->h_flags))
{
- (void) expand(h->h_value, buf, &buf[sizeof buf], e);
fprintf(tfp, "%s: %s\n", h->h_field, buf);
}
else if (bitset(H_FROM|H_RCPT, h->h_flags))
@@ -294,8 +337,7 @@ notemp:
if (bitset(H_FROM, h->h_flags))
oldstyle = FALSE;
- commaize(h, h->h_value, tfp, oldstyle,
- &nullmailer, e);
+ commaize(h, h->h_value, oldstyle, &mcibuf, e);
TrafficLogFile = savetrace;
}
@@ -307,9 +349,7 @@ notemp:
** Clean up.
*/
- fflush(tfp);
- fsync(fileno(tfp));
- if (ferror(tfp))
+ if (fflush(tfp) < 0 || fsync(fileno(tfp)) < 0 || ferror(tfp))
{
if (newid)
syserr("!552 Error writing control file %s", tf);
@@ -319,9 +359,13 @@ notemp:
if (!newid)
{
+ /* rename (locked) tf to be (locked) qf */
qf = queuename(e, 'q');
if (rename(tf, qf) < 0)
- syserr("cannot rename(%s, %s), df=%s", tf, qf, e->e_df);
+ syserr("cannot rename(%s, %s), df=%s, uid=%d",
+ tf, qf, e->e_df, geteuid());
+
+ /* close and unlock old (locked) qf */
if (e->e_lockfp != NULL)
(void) xfclose(e->e_lockfp, "queueup lockfp", e->e_id);
e->e_lockfp = tfp;
@@ -329,12 +373,16 @@ notemp:
else
qf = tf;
errno = 0;
+ e->e_flags |= EF_INQUEUE;
# ifdef LOG
/* save log info */
if (LogLevel > 79)
syslog(LOG_DEBUG, "%s: queueup, qf=%s, df=%s\n", e->e_id, qf, e->e_df);
# endif /* LOG */
+
+ if (tTd(40, 1))
+ printf("<<<<< done queueing %s <<<<<\n\n", e->e_id);
return;
}
@@ -350,7 +398,7 @@ printctladdr(a, tfp)
static uid_t lastuid;
/* initialization */
- if (a == NULL || tfp == NULL)
+ if (a == NULL || a->q_alias == NULL || tfp == NULL)
{
if (lastctladdr != NULL && tfp != NULL)
fprintf(tfp, "C\n");
@@ -365,10 +413,7 @@ printctladdr(a, tfp)
uid = 0;
else
uid = q->q_uid;
-
- /* if a is an alias, use that for printing */
- if (a->q_alias != NULL)
- a = a->q_alias;
+ a = a->q_alias;
/* check to see if this is the same as last time */
if (lastctladdr != NULL && uid == lastuid &&
@@ -434,17 +479,18 @@ runqueue(forkflag)
if (forkflag)
{
int pid;
+#ifdef SIGCHLD
+ extern void reapchild();
+
+ (void) setsignal(SIGCHLD, reapchild);
+#endif
pid = dofork();
if (pid != 0)
{
- extern void reapchild();
-
/* parent -- pick up intermediate zombie */
#ifndef SIGCHLD
(void) waitfor(pid);
-#else /* SIGCHLD */
- (void) signal(SIGCHLD, reapchild);
#endif /* SIGCHLD */
if (QueueIntvl != 0)
(void) setevent(QueueIntvl, runqueue, TRUE);
@@ -455,7 +501,7 @@ runqueue(forkflag)
if (fork() != 0)
exit(EX_OK);
#else /* SIGCHLD */
- (void) signal(SIGCHLD, SIG_DFL);
+ (void) setsignal(SIGCHLD, SIG_DFL);
#endif /* SIGCHLD */
}
@@ -475,6 +521,9 @@ runqueue(forkflag)
clrdaemon();
# endif /* DAEMON */
+ /* force it to run expensive jobs */
+ NoConnect = FALSE;
+
/*
** Create ourselves an envelope
*/
@@ -517,7 +566,13 @@ runqueue(forkflag)
}
else
{
- dowork(w->w_name + 2, ForkQueueRuns, FALSE, e);
+ pid_t pid;
+ extern pid_t dowork();
+
+ pid = dowork(w->w_name + 2, ForkQueueRuns, FALSE, e);
+ errno = 0;
+ if (pid != 0)
+ (void) waitfor(pid);
}
free(w->w_name);
free((char *) w);
@@ -597,6 +652,7 @@ orderq(doall)
while ((d = readdir(f)) != NULL)
{
FILE *cf;
+ register char *p;
char lbuf[MAXNAME];
extern bool strcontainedin();
@@ -613,8 +669,16 @@ orderq(doall)
** both old and new type ids.
*/
- i = strlen(d->d_name);
- if (i != 9 && i != 10)
+ p = d->d_name + 2;
+ if (isupper(p[0]) && isupper(p[2]))
+ p += 3;
+ else if (isupper(p[1]))
+ p += 2;
+ else
+ p = d->d_name;
+ for (i = 0; isdigit(*p); p++)
+ i++;
+ if (i < 5 || *p != '\0')
{
if (Verbose)
printf("orderq: bogus qf name %s\n", d->d_name);
@@ -775,19 +839,20 @@ workcmpf(a, b)
** e - the envelope in which to run it.
**
** Returns:
-** none.
+** process id of process that is running the queue job.
**
** Side Effects:
** The work request is satisfied if possible.
*/
+pid_t
dowork(id, forkflag, requeueflag, e)
char *id;
bool forkflag;
bool requeueflag;
register ENVELOPE *e;
{
- register int i;
+ register pid_t pid;
extern bool readqf();
if (tTd(40, 1))
@@ -799,19 +864,24 @@ dowork(id, forkflag, requeueflag, e)
if (forkflag)
{
- i = fork();
- if (i < 0)
+ pid = fork();
+ if (pid < 0)
{
syserr("dowork: cannot fork");
- return;
+ return 0;
+ }
+ else if (pid > 0)
+ {
+ /* parent -- clean out connection cache */
+ mci_flush(FALSE, NULL);
}
}
else
{
- i = 0;
+ pid = 0;
}
- if (i == 0)
+ if (pid == 0)
{
/*
** CHILD
@@ -824,9 +894,16 @@ dowork(id, forkflag, requeueflag, e)
/* set basic modes, etc. */
(void) alarm(0);
clearenvelope(e, FALSE);
- e->e_flags |= EF_QUEUERUN;
+ e->e_flags |= EF_QUEUERUN|EF_GLOBALERRS;
e->e_errormode = EM_MAIL;
e->e_id = id;
+ GrabTo = UseErrorsTo = FALSE;
+ ExitStat = EX_OK;
+ if (forkflag)
+ {
+ disconnect(1, e);
+ OpMode = MD_DELIVER;
+ }
# ifdef LOG
if (LogLevel > 76)
syslog(LOG_DEBUG, "%s: dowork, pid=%d", e->e_id,
@@ -844,7 +921,7 @@ dowork(id, forkflag, requeueflag, e)
if (forkflag)
exit(EX_OK);
else
- return;
+ return 0;
}
e->e_flags |= EF_INQUEUE;
@@ -862,15 +939,8 @@ dowork(id, forkflag, requeueflag, e)
else
dropenvelope(e);
}
- else if (!requeueflag)
- {
- /*
- ** Parent -- pick up results.
- */
-
- errno = 0;
- (void) waitfor(i);
- }
+ e->e_id = NULL;
+ return pid;
}
/*
** READQF -- read queue file and set up environment.
@@ -915,6 +985,21 @@ readqf(e)
return FALSE;
}
+ if (!lockfile(fileno(qfp), qf, NULL, LOCK_EX|LOCK_NB))
+ {
+ /* being processed by another queuer */
+ if (tTd(40, 8))
+ printf("readqf(%s): locked\n", qf);
+ if (Verbose)
+ printf("%s: locked\n", e->e_id);
+# ifdef LOG
+ if (LogLevel > 19)
+ syslog(LOG_DEBUG, "%s: locked", e->e_id);
+# endif /* LOG */
+ (void) fclose(qfp);
+ return FALSE;
+ }
+
/*
** Check the queue file for plausibility to avoid attacks.
*/
@@ -929,7 +1014,7 @@ readqf(e)
return FALSE;
}
- if (st.st_uid != geteuid() || (st.st_mode & 07777) != FileMode)
+ if (st.st_uid != geteuid())
{
# ifdef LOG
if (LogLevel > 0)
@@ -940,42 +1025,40 @@ readqf(e)
# endif /* LOG */
if (tTd(40, 8))
printf("readqf(%s): bogus file\n", qf);
- fclose(qfp);
rename(qf, queuename(e, 'Q'));
+ fclose(qfp);
return FALSE;
}
- if (!lockfile(fileno(qfp), qf, LOCK_EX|LOCK_NB))
+ if (st.st_size == 0)
{
- /* being processed by another queuer */
- if (tTd(40, 8))
- printf("readqf(%s): locked\n", qf);
- if (Verbose)
- printf("%s: locked\n", e->e_id);
-# ifdef LOG
- if (LogLevel > 19)
- syslog(LOG_DEBUG, "%s: locked", e->e_id);
-# endif /* LOG */
- (void) fclose(qfp);
+ /* must be a bogus file -- just remove it */
+ (void) unlink(qf);
+ fclose(qfp);
return FALSE;
}
- if (st.st_size == 0)
+ if (st.st_nlink == 0)
{
- /* must be a bogus file -- just remove it */
- (void) unlink(qf);
+ /*
+ ** Race condition -- we got a file just as it was being
+ ** unlinked. Just assume it is zero length.
+ */
+
fclose(qfp);
return FALSE;
}
- /* save this lock */
+ /* good file -- save this lock */
e->e_lockfp = qfp;
/* do basic system initialization */
initsys(e);
+ define('i', e->e_id, e);
- FileName = qf;
LineNumber = 0;
+ e->e_flags |= EF_GLOBALERRS;
+ OpMode = MD_DELIVER;
if (Verbose)
printf("\nRunning %s\n", e->e_id);
ctladdr = NULL;
@@ -1005,7 +1088,7 @@ readqf(e)
break;
case 'M': /* message */
- e->e_message = newstr(&bp[1]);
+ /* ignore this; we want a new message next time */
break;
case 'S': /* sender */
@@ -1060,8 +1143,8 @@ readqf(e)
break;
default:
- syserr("readqf: bad line \"%s\"", e->e_id,
- LineNumber, bp);
+ syserr("readqf: %s: line %d: bad line \"%s\"",
+ qf, LineNumber, bp);
fclose(qfp);
rename(qf, queuename(e, 'Q'));
return FALSE;
@@ -1071,8 +1154,6 @@ readqf(e)
free(bp);
}
- FileName = NULL;
-
/*
** If we haven't read any lines, this queue file is empty.
** Arrange to remove it without referencing any null pointers.
@@ -1109,12 +1190,12 @@ printqueue()
** Check for permission to print the queue
*/
- if (bitset(PRIV_RESTRMAILQ, PrivacyFlags) && RealUid != 0)
+ if (bitset(PRIV_RESTRICTMAILQ, PrivacyFlags) && RealUid != 0)
{
struct stat st;
# ifdef NGROUPS
int n;
- int gidset[NGROUPS];
+ GIDSET_T gidset[NGROUPS];
# endif
if (stat(QueueDir, &st) < 0)
@@ -1175,14 +1256,15 @@ printqueue()
char message[MAXLINE];
char bodytype[MAXNAME];
+ printf("%8s", w->w_name + 2);
f = fopen(w->w_name, "r");
if (f == NULL)
{
+ printf(" (job completed)\n");
errno = 0;
continue;
}
- printf("%8s", w->w_name + 2);
- if (!lockfile(fileno(f), w->w_name, LOCK_SH|LOCK_NB))
+ if (!lockfile(fileno(f), w->w_name, NULL, LOCK_SH|LOCK_NB))
printf("*");
else if (shouldqueue(w->w_pri, w->w_ctime))
printf("X");
@@ -1344,11 +1426,11 @@ queuename(e, type)
{
if (errno == EEXIST)
continue;
- syserr("queuename: Cannot create \"%s\" in \"%s\"",
- qf, QueueDir);
+ syserr("queuename: Cannot create \"%s\" in \"%s\" (euid=%d)",
+ qf, QueueDir, geteuid());
exit(EX_UNAVAILABLE);
}
- if (lockfile(i, qf, LOCK_EX|LOCK_NB))
+ if (lockfile(i, qf, NULL, LOCK_EX|LOCK_NB))
{
e->e_lockfp = fdopen(i, "w");
break;
@@ -1359,14 +1441,19 @@ queuename(e, type)
}
if (c1 >= '~' && c2 >= 'Z')
{
- syserr("queuename: Cannot create \"%s\" in \"%s\"",
- qf, QueueDir);
+ syserr("queuename: Cannot create \"%s\" in \"%s\" (euid=%d)",
+ qf, QueueDir, geteuid());
exit(EX_OSERR);
}
e->e_id = newstr(&qf[2]);
define('i', e->e_id, e);
if (tTd(7, 1))
printf("queuename: assigned id %s, env=%x\n", e->e_id, e);
+ if (tTd(7, 9))
+ {
+ printf(" lockfd=");
+ dumpfd(fileno(e->e_lockfp), TRUE, FALSE);
+ }
# ifdef LOG
if (LogLevel > 93)
syslog(LOG_DEBUG, "%s: assigned id", e->e_id);
@@ -1445,8 +1532,8 @@ setctluser(user)
** See if this clears our concept of controlling user.
*/
- if (user == NULL)
- user = "";
+ if (user == NULL || *user == '\0')
+ return NULL;
/*
** Set up addr fields for controlling user.
@@ -1460,7 +1547,10 @@ setctluser(user)
*p++ = '\0';
if (*user != '\0' && (pw = getpwnam(user)) != NULL)
{
- a->q_home = newstr(pw->pw_dir);
+ if (strcmp(pw->pw_dir, "/") == 0)
+ a->q_home = "";
+ else
+ a->q_home = newstr(pw->pw_dir);
a->q_uid = pw->pw_uid;
a->q_gid = pw->pw_gid;
a->q_user = newstr(user);
diff --git a/usr.sbin/sendmail/src/readcf.c b/usr.sbin/sendmail/src/readcf.c
index 7af9d5a4c380..bd902c0cf66c 100644
--- a/usr.sbin/sendmail/src/readcf.c
+++ b/usr.sbin/sendmail/src/readcf.c
@@ -33,11 +33,13 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)readcf.c 8.2 (Berkeley) 7/13/93";
+static char sccsid[] = "@(#)readcf.c 8.23 (Berkeley) 3/18/94";
#endif /* not lint */
# include "sendmail.h"
-#ifdef NAMED_BIND
+# include <pwd.h>
+# include <grp.h>
+#if NAMED_BIND
# include <arpa/nameser.h>
# include <resolv.h>
#endif
@@ -68,7 +70,9 @@ static char sccsid[] = "@(#)readcf.c 8.2 (Berkeley) 7/13/93";
** Args specify mailer parameters.
** Oxvalue Set option x to value.
** Pname=value Set precedence name to value.
-** Vversioncode Version level of configuration syntax.
+** Vversioncode[/vendorcode]
+** Version level/vendor name of
+** configuration syntax.
** Kmapname mapclass arguments....
** Define keyed lookup of a given class.
** Arguments are class dependent.
@@ -96,13 +100,16 @@ readcf(cfname, safe, e)
char *q;
struct rewrite *rwp = NULL;
char *bp;
+ auto char *ep;
int nfuzzy;
+ char *file;
+ bool optional;
char buf[MAXLINE];
register char *p;
extern char **copyplist();
struct stat statb;
char exbuf[MAXLINE];
- char pvpbuf[PSBUFSIZE];
+ char pvpbuf[MAXLINE + MAXATOM];
extern char *munchstring();
extern void makemapentry();
@@ -201,6 +208,7 @@ readcf(cfname, safe, e)
}
/* interpret this line */
+ errno = 0;
switch (bp[0])
{
case '\0':
@@ -213,7 +221,7 @@ readcf(cfname, safe, e)
if (*p == '\0')
{
- syserr("invalid rewrite line \"%s\"", bp);
+ syserr("invalid rewrite line \"%s\" (tab expected)", bp);
break;
}
@@ -233,7 +241,8 @@ readcf(cfname, safe, e)
/* expand and save the LHS */
*p = '\0';
expand(&bp[1], exbuf, &exbuf[sizeof exbuf], e);
- rwp->r_lhs = prescan(exbuf, '\t', pvpbuf, NULL);
+ rwp->r_lhs = prescan(exbuf, '\t', pvpbuf,
+ sizeof pvpbuf, NULL);
nfuzzy = 0;
if (rwp->r_lhs != NULL)
{
@@ -317,7 +326,8 @@ readcf(cfname, safe, e)
p++;
*p = '\0';
expand(q, exbuf, &exbuf[sizeof exbuf], e);
- rwp->r_rhs = prescan(exbuf, '\t', pvpbuf, NULL);
+ rwp->r_rhs = prescan(exbuf, '\t', pvpbuf,
+ sizeof pvpbuf, NULL);
if (rwp->r_rhs != NULL)
{
register char **ap;
@@ -371,7 +381,15 @@ readcf(cfname, safe, e)
break;
case 'S': /* select rewriting set */
- ruleset = atoi(&bp[1]);
+ for (p = &bp[1]; isascii(*p) && isspace(*p); p++)
+ continue;
+ if (!isascii(*p) || !isdigit(*p))
+ {
+ syserr("invalid argument to S line: \"%.20s\"",
+ &bp[1]);
+ break;
+ }
+ ruleset = atoi(p);
if (ruleset >= MAXRWSETS || ruleset < 0)
{
syserr("bad ruleset %d (%d max)", ruleset, MAXRWSETS);
@@ -381,7 +399,8 @@ readcf(cfname, safe, e)
break;
case 'D': /* macro definition */
- define(bp[1], newstr(munchstring(&bp[2], NULL)), e);
+ p = munchstring(&bp[2], NULL);
+ define(bp[1], newstr(p), e);
break;
case 'H': /* required header line */
@@ -390,7 +409,8 @@ readcf(cfname, safe, e)
case 'C': /* word class */
/* scan the list of words and set class for all */
- for (p = &bp[2]; *p != '\0'; )
+ expand(&bp[2], exbuf, &exbuf[sizeof exbuf], e);
+ for (p = exbuf; *p != '\0'; )
{
register char *wd;
char delim;
@@ -403,23 +423,27 @@ readcf(cfname, safe, e)
delim = *p;
*p = '\0';
if (wd[0] != '\0')
- {
- if (tTd(37, 2))
- printf("setclass(%c, %s)\n",
- bp[1], wd);
setclass(bp[1], wd);
- }
*p = delim;
}
break;
case 'F': /* word class from file */
- /* read list of words from argument or file */
- /* read from file */
- for (p = &bp[2];
- *p != '\0' && !(isascii(*p) && isspace(*p));
- p++)
- continue;
+ for (p = &bp[2]; isascii(*p) && isspace(*p); )
+ p++;
+ if (p[0] == '-' && p[1] == 'o')
+ {
+ optional = TRUE;
+ while (*p != '\0' && !(isascii(*p) && isspace(*p)))
+ p++;
+ while (isascii(*p) && isspace(*p))
+ *p++;
+ }
+ else
+ optional = FALSE;
+ file = p;
+ while (*p != '\0' && !(isascii(*p) && isspace(*p)))
+ p++;
if (*p == '\0')
p = "%s";
else
@@ -428,7 +452,7 @@ readcf(cfname, safe, e)
while (isascii(*++p) && isspace(*p))
continue;
}
- fileclass(bp[1], &bp[2], p, safe);
+ fileclass(bp[1], file, p, safe, optional);
break;
#ifdef XLA
@@ -466,7 +490,33 @@ readcf(cfname, safe, e)
break;
case 'V': /* configuration syntax version */
- ConfigLevel = atoi(&bp[1]);
+ for (p = &bp[1]; isascii(*p) && isspace(*p); p++)
+ continue;
+ if (!isascii(*p) || !isdigit(*p))
+ {
+ syserr("invalid argument to V line: \"%.20s\"",
+ &bp[1]);
+ break;
+ }
+ ConfigLevel = strtol(p, &ep, 10);
+ if (ConfigLevel >= 5)
+ {
+ /* level 5 configs have short name in $w */
+ p = macvalue('w', e);
+ 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':
@@ -492,8 +542,10 @@ readcf(cfname, safe, e)
{
/* user didn't initialize: set up host map */
strcpy(buf, "host host");
+#if NAMED_BIND
if (ConfigLevel >= 2)
strcat(buf, " -a.");
+#endif
makemapentry(buf);
}
}
@@ -524,6 +576,9 @@ toomany(id, maxcnt)
** class -- class to define.
** filename -- name of file to read.
** fmt -- scanf string to use for match.
+** safe -- if set, this is a safe read.
+** optional -- if set, it is not an error for the file to
+** not exist.
**
** Returns:
** none
@@ -534,19 +589,32 @@ toomany(id, maxcnt)
** the named class.
*/
-fileclass(class, filename, fmt, safe)
+fileclass(class, filename, fmt, safe, optional)
int class;
char *filename;
char *fmt;
bool safe;
+ bool optional;
{
FILE *f;
struct stat stbuf;
char buf[MAXLINE];
+ if (tTd(37, 2))
+ printf("fileclass(%s, fmt=%s)\n", filename, fmt);
+
+ if (filename[0] == '|')
+ {
+ syserr("fileclass: pipes (F%c%s) not supported due to security problems",
+ class, filename);
+ return;
+ }
if (stat(filename, &stbuf) < 0)
{
- syserr("fileclass: cannot stat %s", filename);
+ if (tTd(37, 2))
+ printf(" cannot stat (%s)\n", errstring(errno));
+ if (!optional)
+ syserr("fileclass: cannot stat %s", filename);
return;
}
if (!S_ISREG(stbuf.st_mode))
@@ -602,8 +670,7 @@ fileclass(class, filename, fmt, safe)
*p++ = '\0';
/* enter the word in the symbol table */
- s = stab(q, ST_CLASS, ST_ENTER);
- setbitn(class, s->s_class);
+ setclass(class, q);
}
}
@@ -950,7 +1017,7 @@ printrules()
static BITMAP StickyOpt; /* set if option is stuck */
-#ifdef NAMED_BIND
+#if NAMED_BIND
struct resolverflags
{
@@ -967,6 +1034,7 @@ struct resolverflags
"defnames", RES_DEFNAMES,
"stayopen", RES_STAYOPEN,
"dnsrch", RES_DNSRCH,
+ "true", 0, /* to avoid error on old syntax */
NULL, 0
};
@@ -984,6 +1052,7 @@ setoption(opt, val, safe, sticky, e)
extern time_t convtime();
extern int QueueLA;
extern int RefuseLA;
+ extern bool Warn_Q_option;
extern bool trusteduser();
if (tTd(37, 1))
@@ -1006,7 +1075,7 @@ setoption(opt, val, safe, sticky, e)
if (!safe && RealUid == 0)
safe = TRUE;
- if (!safe && strchr("bdeEijLmoprsvC7", opt) == NULL)
+ if (!safe && strchr("bCdeijLmoprsvw7", opt) == NULL)
{
if (opt != 'M' || (val[0] != 'r' && val[0] != 's'))
{
@@ -1039,9 +1108,9 @@ setoption(opt, val, safe, sticky, e)
case 'a': /* look N minutes for "@:@" in alias file */
if (val[0] == '\0')
- SafeAlias = 5;
+ SafeAlias = 5 * 60; /* five minutes */
else
- SafeAlias = atoi(val);
+ SafeAlias = convtime(val, 'm');
break;
case 'B': /* substitution for blank character */
@@ -1130,7 +1199,19 @@ setoption(opt, val, safe, sticky, e)
break;
case 'g': /* default gid */
- DefGid = atoi(val);
+ if (isascii(*val) && isdigit(*val))
+ DefGid = atoi(val);
+ else
+ {
+ register struct group *gr;
+
+ DefGid = -1;
+ gr = getgrnam(val);
+ if (gr == NULL)
+ syserr("readcf: option g: unknown group %s", val);
+ else
+ DefGid = gr->gr_gid;
+ }
break;
case 'H': /* help file */
@@ -1145,7 +1226,7 @@ setoption(opt, val, safe, sticky, e)
break;
case 'I': /* use internet domain name server */
-#ifdef NAMED_BIND
+#if NAMED_BIND
UseNameServer = TRUE;
for (p = val; *p != 0; )
{
@@ -1173,7 +1254,9 @@ setoption(opt, val, safe, sticky, e)
if (strcasecmp(q, rfp->rf_name) == 0)
break;
}
- if (clearmode)
+ if (rfp->rf_name == NULL)
+ syserr("readcf: I option value %s unrecognized", q);
+ else if (clearmode)
_res.options &= ~rfp->rf_bits;
else
_res.options |= rfp->rf_bits;
@@ -1212,7 +1295,8 @@ setoption(opt, val, safe, sticky, e)
break;
case 'L': /* log level */
- LogLevel = atoi(val);
+ if (safe || LogLevel < atoi(val))
+ LogLevel = atoi(val);
break;
case 'M': /* define macro */
@@ -1283,7 +1367,7 @@ setoption(opt, val, safe, sticky, e)
else
QueueDir = newstr(val);
if (RealUid != 0 && !safe)
- auth_warning(e, "Processed from queue %s", QueueDir);
+ Warn_Q_option = TRUE;
break;
case 'R': /* don't prune routes */
@@ -1324,7 +1408,19 @@ setoption(opt, val, safe, sticky, e)
break;
case 'u': /* set default uid */
- DefUid = atoi(val);
+ if (isascii(*val) && isdigit(*val))
+ DefUid = atoi(val);
+ else
+ {
+ register struct passwd *pw;
+
+ DefUid = -1;
+ pw = getpwnam(val);
+ if (pw == NULL)
+ syserr("readcf: option u: unknown user %s", val);
+ else
+ DefUid = pw->pw_uid;
+ }
setdefuser();
break;
@@ -1336,7 +1432,9 @@ setoption(opt, val, safe, sticky, e)
Verbose = atobool(val);
break;
- /* 'w' available -- was "no wildcard MX matching" */
+ case 'w': /* if we are best MX, try host directly */
+ TryNullMXList = atobool(val);
+ break;
/* 'W' available -- was wizard password */
@@ -1392,7 +1490,7 @@ setclass(class, word)
register STAB *s;
if (tTd(37, 8))
- printf("%s added to class %c\n", word, class);
+ printf("setclass(%c, %s)\n", class, word);
s = stab(word, ST_CLASS, ST_ENTER);
setbitn(class, s->s_class);
}
@@ -1417,7 +1515,7 @@ makemapentry(line)
register char *p;
char *mapname;
char *classname;
- register STAB *map;
+ register STAB *s;
STAB *class;
for (p = line; isascii(*p) && isspace(*p); p++)
@@ -1457,12 +1555,24 @@ makemapentry(line)
}
/* enter the map */
- map = stab(mapname, ST_MAP, ST_ENTER);
- map->s_map.map_class = &class->s_mapclass;
- map->s_map.map_mname = newstr(mapname);
+ s = stab(mapname, ST_MAP, ST_ENTER);
+ s->s_map.map_class = &class->s_mapclass;
+ s->s_map.map_mname = newstr(mapname);
- if (class->s_mapclass.map_parse(&map->s_map, p))
- map->s_map.map_mflags |= MF_VALID;
+ if (class->s_mapclass.map_parse(&s->s_map, p))
+ s->s_map.map_mflags |= MF_VALID;
+
+ if (tTd(37, 5))
+ {
+ printf("map %s, class %s, flags %x, file %s,\n",
+ s->s_map.map_mname, s->s_map.map_class->map_cname,
+ s->s_map.map_mflags,
+ s->s_map.map_file == NULL ? "(null)" : s->s_map.map_file);
+ printf("\tapp %s, domain %s, rebuild %s\n",
+ s->s_map.map_app == NULL ? "(null)" : s->s_map.map_app,
+ s->s_map.map_domain == NULL ? "(null)" : s->s_map.map_domain,
+ s->s_map.map_rebuild == NULL ? "(null)" : s->s_map.map_rebuild);
+ }
}
/*
** SETTIMEOUTS -- parse and set timeout values
@@ -1478,6 +1588,7 @@ makemapentry(line)
** Initializes the TimeOuts structure
*/
+#define SECONDS
#define MINUTES * 60
#define HOUR * 3600
@@ -1500,6 +1611,7 @@ settimeouts(val)
TimeOuts.to_quit = (time_t) 2 MINUTES;
TimeOuts.to_nextcommand = (time_t) 1 HOUR;
TimeOuts.to_miscshort = (time_t) 2 MINUTES;
+ TimeOuts.to_ident = (time_t) 30 SECONDS;
return;
}
@@ -1560,6 +1672,8 @@ settimeouts(val)
TimeOuts.to_quit = to;
else if (strcasecmp(val, "misc") == 0)
TimeOuts.to_miscshort = to;
+ else if (strcasecmp(val, "ident") == 0)
+ TimeOuts.to_ident = to;
else
syserr("settimeouts: invalid timeout %s", val);
}
diff --git a/usr.sbin/sendmail/src/recipient.c b/usr.sbin/sendmail/src/recipient.c
index bcdf5bfb3bfc..98d800d006ab 100644
--- a/usr.sbin/sendmail/src/recipient.c
+++ b/usr.sbin/sendmail/src/recipient.c
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)recipient.c 8.3 (Berkeley) 7/13/93";
+static char sccsid[] = "@(#)recipient.c 8.44 (Berkeley) 2/28/94";
#endif /* not lint */
# include "sendmail.h"
@@ -75,6 +75,13 @@ sendtolist(list, ctladdr, sendq, e)
bool firstone; /* set on first address sent */
char delimiter; /* the address delimiter */
int naddrs;
+ char *oldto = e->e_to;
+
+ if (list == NULL)
+ {
+ syserr("sendtolist: null list");
+ return 0;
+ }
if (tTd(25, 1))
{
@@ -103,7 +110,7 @@ sendtolist(list, ctladdr, sendq, e)
/* parse the address */
while ((isascii(*p) && isspace(*p)) || *p == ',')
p++;
- a = parseaddr(p, (ADDRESS *) NULL, 1, delimiter, &delimptr, e);
+ a = parseaddr(p, NULLADDR, RF_COPYALL, delimiter, &delimptr, e);
p = delimptr;
if (a == NULL)
continue;
@@ -135,7 +142,7 @@ sendtolist(list, ctladdr, sendq, e)
naddrs++;
}
- e->e_to = NULL;
+ e->e_to = oldto;
return (naddrs);
}
/*
@@ -182,6 +189,15 @@ recipient(a, sendq, e)
printaddr(a, FALSE);
}
+ /* if this is primary, add it to the original recipient list */
+ if (a->q_alias == NULL)
+ {
+ if (e->e_origrcpt == NULL)
+ e->e_origrcpt = a->q_paddr;
+ else if (e->e_origrcpt != a->q_paddr)
+ e->e_origrcpt = "";
+ }
+
/* break aliasing loops */
if (AliasLevel > MAXRCRSN)
{
@@ -206,11 +222,25 @@ recipient(a, sendq, e)
stripquotes(buf);
/* check for direct mailing to restricted mailers */
- if (a->q_alias == NULL && m == ProgMailer &&
- !bitset(EF_QUEUERUN, e->e_flags))
+ if (m == ProgMailer)
{
- a->q_flags |= QBADADDR;
- usrerr("550 Cannot mail directly to programs", m->m_name);
+ if (a->q_alias == NULL)
+ {
+ a->q_flags |= QBADADDR;
+ usrerr("550 Cannot mail directly to programs");
+ }
+ else if (bitset(QBOGUSSHELL, a->q_alias->q_flags))
+ {
+ a->q_flags |= QBADADDR;
+ usrerr("550 User %s@%s doesn't have a valid shell for mailing to programs",
+ a->q_alias->q_ruser, MyHostName);
+ }
+ else if (bitset(QUNSAFEADDR, a->q_alias->q_flags))
+ {
+ a->q_flags |= QBADADDR;
+ usrerr("550 Address %s is unsafe for mailing to programs",
+ a->q_alias->q_paddr);
+ }
}
/*
@@ -237,7 +267,10 @@ recipient(a, sendq, e)
message("duplicate suppressed");
q->q_flags |= a->q_flags;
}
- return (q);
+ else if (bitset(QSELFREF, q->q_flags))
+ q->q_flags |= a->q_flags & ~QDONTSEND;
+ a = q;
+ goto testselfdestruct;
}
}
@@ -254,12 +287,12 @@ recipient(a, sendq, e)
printf("at trylocaluser %s\n", a->q_user);
if (bitset(QDONTSEND|QBADADDR|QVERIFIED, a->q_flags))
- return (a);
+ goto testselfdestruct;
if (m == InclMailer)
{
a->q_flags |= QDONTSEND;
- if (a->q_alias == NULL && !bitset(EF_QUEUERUN, e->e_flags))
+ if (a->q_alias == NULL)
{
a->q_flags |= QBADADDR;
usrerr("550 Cannot mail directly to :include:s");
@@ -274,38 +307,49 @@ recipient(a, sendq, e)
{
#ifdef LOG
if (LogLevel > 2)
- syslog(LOG_ERR, "%s: include %s: transient error: %e",
- e->e_id, a->q_user, errstring(ret));
+ syslog(LOG_ERR, "%s: include %s: transient error: %s",
+ e->e_id == NULL ? "NOQUEUE" : e->e_id,
+ a->q_user, errstring(ret));
#endif
- a->q_flags |= QQUEUEUP|QDONTSEND;
+ a->q_flags |= QQUEUEUP;
+ a->q_flags &= ~QDONTSEND;
usrerr("451 Cannot open %s: %s",
a->q_user, errstring(ret));
}
else if (ret != 0)
{
+ a->q_flags |= QBADADDR;
usrerr("550 Cannot open %s: %s",
a->q_user, errstring(ret));
- a->q_flags |= QBADADDR;
}
}
}
else if (m == FileMailer)
{
- struct stat stb;
extern bool writable();
- p = strrchr(buf, '/');
/* check if writable or creatable */
- if (a->q_alias == NULL && !bitset(EF_QUEUERUN, e->e_flags))
+ if (a->q_alias == NULL)
{
a->q_flags |= QBADADDR;
usrerr("550 Cannot mail directly to files");
}
- else if ((stat(buf, &stb) >= 0) ? (!writable(&stb)) :
- (*p = '\0', safefile(buf, RealUid, TRUE, S_IWRITE|S_IEXEC) != 0))
+ else if (bitset(QBOGUSSHELL, a->q_alias->q_flags))
+ {
+ a->q_flags |= QBADADDR;
+ usrerr("550 User %s@%s doesn't have a valid shell for mailing to files",
+ a->q_alias->q_ruser, MyHostName);
+ }
+ else if (bitset(QUNSAFEADDR, a->q_alias->q_flags))
{
a->q_flags |= QBADADDR;
- giveresponse(EX_CANTCREAT, m, NULL, e);
+ usrerr("550 Address %s is unsafe for mailing to files",
+ a->q_alias->q_paddr);
+ }
+ else if (!writable(buf, getctladdr(a), SFF_ANYFILE))
+ {
+ a->q_flags |= QBADADDR;
+ giveresponse(EX_CANTCREAT, m, NULL, a->q_alias, e);
}
}
@@ -313,7 +357,7 @@ recipient(a, sendq, e)
{
if (!bitset(QDONTSEND, a->q_flags))
e->e_nrcpts++;
- return (a);
+ goto testselfdestruct;
}
/* try aliasing */
@@ -324,29 +368,29 @@ recipient(a, sendq, e)
if (!bitset(QDONTSEND|QNOTREMOTE|QVERIFIED, a->q_flags))
{
extern int udbexpand();
- extern int errno;
if (udbexpand(a, sendq, e) == EX_TEMPFAIL)
{
- a->q_flags |= QQUEUEUP|QDONTSEND;
+ a->q_flags |= QQUEUEUP;
if (e->e_message == NULL)
e->e_message = newstr("Deferred: user database error");
# ifdef LOG
if (LogLevel > 8)
syslog(LOG_INFO, "%s: deferred: udbexpand: %s",
- e->e_id, errstring(errno));
+ e->e_id == NULL ? "NOQUEUE" : e->e_id,
+ errstring(errno));
# endif
message("queued (user database error): %s",
errstring(errno));
e->e_nrcpts++;
- return (a);
+ goto testselfdestruct;
}
}
# endif
/* if it was an alias or a UDB expansion, just return now */
if (bitset(QDONTSEND|QQUEUEUP|QVERIFIED, a->q_flags))
- return (a);
+ goto testselfdestruct;
/*
** If we have a level two config file, then pass the name through
@@ -383,7 +427,7 @@ recipient(a, sendq, e)
if (pw == NULL)
{
a->q_flags |= QBADADDR;
- giveresponse(EX_NOUSER, m, NULL, e);
+ giveresponse(EX_NOUSER, m, NULL, a->q_alias, e);
}
else
{
@@ -405,7 +449,10 @@ recipient(a, sendq, e)
(void) strcpy(buf, pw->pw_name);
goto trylocaluser;
}
- a->q_home = newstr(pw->pw_dir);
+ if (strcmp(pw->pw_dir, "/") == 0)
+ a->q_home = "";
+ else
+ a->q_home = newstr(pw->pw_dir);
a->q_uid = pw->pw_uid;
a->q_gid = pw->pw_gid;
a->q_ruser = newstr(pw->pw_name);
@@ -413,12 +460,36 @@ recipient(a, sendq, e)
buildfname(pw->pw_gecos, pw->pw_name, nbuf);
if (nbuf[0] != '\0')
a->q_fullname = newstr(nbuf);
+ if (pw->pw_shell != NULL && pw->pw_shell[0] != '\0' &&
+ !usershellok(pw->pw_shell))
+ {
+ a->q_flags |= QBOGUSSHELL;
+ }
if (!quoted)
forward(a, sendq, e);
}
}
if (!bitset(QDONTSEND, a->q_flags))
e->e_nrcpts++;
+
+ testselfdestruct:
+ if (tTd(26, 8))
+ {
+ printf("testselfdestruct: ");
+ printaddr(a, TRUE);
+ }
+ if (a->q_alias == NULL && a != &e->e_from &&
+ bitset(QDONTSEND, a->q_flags))
+ {
+ q = *sendq;
+ while (q != NULL && bitset(QDONTSEND, q->q_flags))
+ q = q->q_next;
+ if (q == NULL)
+ {
+ a->q_flags |= QBADADDR;
+ usrerr("554 aliasing/forwarding loop broken");
+ }
+ }
return (a);
}
/*
@@ -459,6 +530,17 @@ finduser(name, fuzzyp)
*fuzzyp = FALSE;
+ /* DEC Hesiod getpwnam accepts numeric strings -- short circuit it */
+ for (p = name; *p != '\0'; p++)
+ if (!isascii(*p) || !isdigit(*p))
+ break;
+ if (*p == '\0')
+ {
+ if (tTd(29, 4))
+ printf("failed (numeric input)\n");
+ return NULL;
+ }
+
/* look up this login name using fast path */
if ((pw = getpwnam(name)) != NULL)
{
@@ -517,7 +599,9 @@ finduser(name, fuzzyp)
** not writable. This is also enforced by mailfile.
**
** Parameters:
-** s -- pointer to a stat struct for the file.
+** filename -- the file name to check.
+** ctladdr -- the controlling address for this file.
+** flags -- SFF_* flags to control the function.
**
** Returns:
** TRUE -- if we will be able to write this file.
@@ -528,35 +612,98 @@ finduser(name, fuzzyp)
*/
bool
-writable(s)
- register struct stat *s;
+writable(filename, ctladdr, flags)
+ char *filename;
+ ADDRESS *ctladdr;
+ int flags;
{
uid_t euid;
gid_t egid;
int bits;
+ register char *p;
+ char *uname;
+ struct stat stb;
+ extern char RealUserName[];
- if (bitset(0111, s->st_mode))
- return (FALSE);
- euid = RealUid;
- egid = RealGid;
- if (geteuid() == 0)
+ if (tTd(29, 5))
+ printf("writable(%s, %x)\n", filename, flags);
+
+#ifdef HASLSTAT
+ if ((bitset(SFF_NOSLINK, flags) ? lstat(filename, &stb)
+ : stat(filename, &stb)) < 0)
+#else
+ if (stat(filename, &stb) < 0)
+#endif
+ {
+ /* file does not exist -- see if directory is safe */
+ p = strrchr(filename, '/');
+ if (p == NULL)
+ {
+ errno = ENOTDIR;
+ return FALSE;
+ }
+ *p = '\0';
+ errno = safefile(filename, RealUid, RealGid, RealUserName,
+ SFF_MUSTOWN, S_IWRITE|S_IEXEC);
+ *p = '/';
+ return errno == 0;
+ }
+
+#ifdef SUID_ROOT_FILES_OK
+ /* really ought to be passed down -- and not a good idea */
+ flags |= SFF_ROOTOK;
+#endif
+
+ /*
+ ** File does exist -- check that it is writable.
+ */
+
+ if (bitset(0111, stb.st_mode))
{
- if (bitset(S_ISUID, s->st_mode))
- euid = s->st_uid;
- if (bitset(S_ISGID, s->st_mode))
- egid = s->st_gid;
+ if (tTd(29, 5))
+ printf("failed (mode %o: x bits)\n", stb.st_mode);
+ errno = EPERM;
+ return (FALSE);
}
+ if (ctladdr != NULL && geteuid() == 0)
+ {
+ euid = ctladdr->q_uid;
+ egid = ctladdr->q_gid;
+ uname = ctladdr->q_user;
+ }
+ else
+ {
+ euid = RealUid;
+ egid = RealGid;
+ uname = RealUserName;
+ }
if (euid == 0)
- return (TRUE);
- bits = S_IWRITE;
- if (euid != s->st_uid)
{
- bits >>= 3;
- if (egid != s->st_gid)
- bits >>= 3;
+ euid = DefUid;
+ uname = DefUser;
+ }
+ if (egid == 0)
+ egid = DefGid;
+ if (geteuid() == 0)
+ {
+ if (bitset(S_ISUID, stb.st_mode) &&
+ (stb.st_uid != 0 || bitset(SFF_ROOTOK, flags)))
+ {
+ euid = stb.st_uid;
+ uname = NULL;
+ }
+ if (bitset(S_ISGID, stb.st_mode) &&
+ (stb.st_gid != 0 || bitset(SFF_ROOTOK, flags)))
+ egid = stb.st_gid;
}
- return ((s->st_mode & bits) != 0);
+
+ if (tTd(29, 5))
+ printf("\teu/gid=%d/%d, st_u/gid=%d/%d\n",
+ euid, egid, stb.st_uid, stb.st_gid);
+
+ errno = safefile(filename, euid, egid, uname, flags, S_IWRITE);
+ return errno == 0;
}
/*
** INCLUDE -- handle :include: specification.
@@ -577,9 +724,32 @@ writable(s)
** Side Effects:
** reads the :include: file and sends to everyone
** listed in that file.
+**
+** Security Note:
+** If you have restricted chown (that is, you can't
+** give a file away), it is reasonable to allow programs
+** and files called from this :include: file to be to be
+** run as the owner of the :include: file. This is bogus
+** if there is any chance of someone giving away a file.
+** We assume that pre-POSIX systems can give away files.
+**
+** There is an additional restriction that if you
+** forward to a :include: file, it will not take on
+** the ownership of the :include: file. This may not
+** be necessary, but shouldn't hurt.
*/
static jmp_buf CtxIncludeTimeout;
+static int includetimeout();
+
+#ifndef S_IWOTH
+# define S_IWOTH (S_IWRITE >> 6)
+#endif
+
+#if defined(__FreeBSD__) && defined(_POSIX_CHOWN_RESTRICTED)
+# undef _POSIX_CHOWN_RESTRICTED
+# define _POSIX_CHOWN_RESTRICTED 1
+#endif
int
include(fname, forwarding, ctladdr, sendq, e)
@@ -589,84 +759,184 @@ include(fname, forwarding, ctladdr, sendq, e)
ADDRESS **sendq;
ENVELOPE *e;
{
- register FILE *fp;
+ register FILE *fp = NULL;
char *oldto = e->e_to;
char *oldfilename = FileName;
int oldlinenumber = LineNumber;
register EVENT *ev = NULL;
int nincludes;
- int ret;
- ADDRESS *ca;
- uid_t uid;
+ register ADDRESS *ca;
+ uid_t saveduid, uid;
+ gid_t savedgid, gid;
+ char *uname;
+ int rval = 0;
+ int sfflags = forwarding ? SFF_MUSTOWN : SFF_ANYFILE;
+ struct stat st;
char buf[MAXLINE];
- static int includetimeout();
+#ifdef _POSIX_CHOWN_RESTRICTED
+# if _POSIX_CHOWN_RESTRICTED == -1
+# define safechown FALSE
+# else
+# define safechown TRUE
+# endif
+#else
+# ifdef _PC_CHOWN_RESTRICTED
+ bool safechown;
+# else
+# ifdef BSD
+# define safechown TRUE
+# else
+# define safechown FALSE
+# endif
+# endif
+#endif
+ extern bool chownsafe();
if (tTd(27, 2))
printf("include(%s)\n", fname);
+ if (tTd(27, 4))
+ printf(" ruid=%d euid=%d\n", getuid(), geteuid());
if (tTd(27, 14))
{
printf("ctladdr ");
printaddr(ctladdr, FALSE);
}
- /*
- ** If home directory is remote mounted but server is down,
- ** this can hang or give errors; use a timeout to avoid this
- */
+ if (tTd(27, 9))
+ printf("include: old uid = %d/%d\n", getuid(), geteuid());
ca = getctladdr(ctladdr);
if (ca == NULL)
- uid = 0;
+ {
+ uid = DefUid;
+ gid = DefGid;
+ uname = DefUser;
+ saveduid = -1;
+ }
else
+ {
uid = ca->q_uid;
+ gid = ca->q_gid;
+ uname = ca->q_user;
+#ifdef HASSETREUID
+ saveduid = geteuid();
+ savedgid = getegid();
+ if (saveduid == 0)
+ {
+ initgroups(uname, gid);
+ if (uid != 0)
+ (void) setreuid(0, uid);
+ }
+#endif
+ }
+
+ if (tTd(27, 9))
+ printf("include: new uid = %d/%d\n", getuid(), geteuid());
+
+ /*
+ ** If home directory is remote mounted but server is down,
+ ** this can hang or give errors; use a timeout to avoid this
+ */
if (setjmp(CtxIncludeTimeout) != 0)
{
- ctladdr->q_flags |= QQUEUEUP|QDONTSEND;
+ ctladdr->q_flags |= QQUEUEUP;
errno = 0;
- usrerr("451 open timeout on %s", fname);
- return ETIMEDOUT;
+
+ /* return pseudo-error code */
+ rval = EOPENTIMEOUT;
+ goto resetuid;
}
ev = setevent((time_t) 60, includetimeout, 0);
/* the input file must be marked safe */
- if ((ret = safefile(fname, uid, forwarding, S_IREAD)) != 0)
+ rval = safefile(fname, uid, gid, uname, sfflags, S_IREAD);
+ if (rval != 0)
{
- /* don't use this .forward file */
- clrevent(ev);
+ /* don't use this :include: file */
if (tTd(27, 4))
printf("include: not safe (uid=%d): %s\n",
- uid, errstring(ret));
- return ret;
+ uid, errstring(rval));
}
-
- fp = fopen(fname, "r");
- if (fp == NULL)
+ else
{
- int ret = errno;
-
- clrevent(ev);
- return ret;
+ fp = fopen(fname, "r");
+ if (fp == NULL)
+ {
+ rval = errno;
+ if (tTd(27, 4))
+ printf("include: open: %s\n", errstring(rval));
+ }
}
+ clrevent(ev);
- if (ca == NULL)
+resetuid:
+
+#ifdef HASSETREUID
+ if (saveduid == 0)
{
- struct stat st;
+ if (uid != 0)
+ if (setreuid(-1, 0) < 0 || setreuid(RealUid, 0) < 0)
+ syserr("setreuid(%d, 0) failure (real=%d, eff=%d)",
+ RealUid, getuid(), geteuid());
+ setgid(savedgid);
+ }
+#endif
- if (fstat(fileno(fp), &st) < 0)
- {
- int ret = errno;
+ if (tTd(27, 9))
+ printf("include: reset uid = %d/%d\n", getuid(), geteuid());
- clrevent(ev);
- syserr("Cannot fstat %s!", fname);
- return ret;
- }
+ if (rval == EOPENTIMEOUT)
+ usrerr("451 open timeout on %s", fname);
+
+ if (fp == NULL)
+ return rval;
+
+ if (fstat(fileno(fp), &st) < 0)
+ {
+ rval = errno;
+ syserr("Cannot fstat %s!", fname);
+ return rval;
+ }
+
+#ifndef safechown
+ safechown = chownsafe(fileno(fp));
+#endif
+ if (ca == NULL && safechown)
+ {
ctladdr->q_uid = st.st_uid;
ctladdr->q_gid = st.st_gid;
ctladdr->q_flags |= QGOODUID;
}
+ if (ca != NULL && ca->q_uid == st.st_uid)
+ {
+ /* optimization -- avoid getpwuid if we already have info */
+ ctladdr->q_flags |= ca->q_flags & QBOGUSSHELL;
+ ctladdr->q_ruser = ca->q_ruser;
+ }
+ else
+ {
+ char *sh;
+ register struct passwd *pw;
- clrevent(ev);
+ sh = "/SENDMAIL/ANY/SHELL/";
+ pw = getpwuid(st.st_uid);
+ if (pw != NULL)
+ {
+ ctladdr->q_ruser = newstr(pw->pw_name);
+ if (safechown)
+ sh = pw->pw_shell;
+ }
+ if (pw == NULL)
+ ctladdr->q_flags |= QBOGUSSHELL;
+ else if(!usershellok(sh))
+ {
+ if (safechown)
+ ctladdr->q_flags |= QBOGUSSHELL;
+ else
+ ctladdr->q_flags |= QUNSAFEADDR;
+ }
+ }
if (bitset(EF_VRFYONLY, e->e_flags))
{
@@ -674,9 +944,22 @@ include(fname, forwarding, ctladdr, sendq, e)
ctladdr->q_flags |= QVERIFIED;
e->e_nrcpts++;
xfclose(fp, "include", fname);
- return 0;
+ return rval;
}
+ /*
+ ** Check to see if some bad guy can write this file
+ **
+ ** This should really do something clever with group
+ ** permissions; currently we just view world writable
+ ** as unsafe. Also, we don't check for writable
+ ** directories in the path. We've got to leave
+ ** something for the local sysad to do.
+ */
+
+ if (bitset(S_IWOTH, st.st_mode))
+ ctladdr->q_flags |= QUNSAFEADDR;
+
/* read the file -- each line is a comma-separated list. */
FileName = fname;
LineNumber = 0;
@@ -697,13 +980,17 @@ include(fname, forwarding, ctladdr, sendq, e)
#ifdef LOG
if (forwarding && LogLevel > 9)
syslog(LOG_INFO, "%s: forward %s => %s",
- e->e_id, oldto, buf);
+ e->e_id == NULL ? "NOQUEUE" : e->e_id,
+ oldto, buf);
#endif
AliasLevel++;
nincludes += sendtolist(buf, ctladdr, sendq, e);
AliasLevel--;
}
+
+ if (ferror(fp) && tTd(27, 3))
+ printf("include: read error: %s\n", errstring(errno));
if (nincludes > 0 && !bitset(QSELFREF, ctladdr->q_flags))
{
if (tTd(27, 5))
@@ -717,7 +1004,8 @@ include(fname, forwarding, ctladdr, sendq, e)
(void) xfclose(fp, "include", fname);
FileName = oldfilename;
LineNumber = oldlinenumber;
- return 0;
+ e->e_to = oldto;
+ return rval;
}
static
@@ -748,7 +1036,7 @@ sendtoargv(argv, e)
while ((p = *argv++) != NULL)
{
- (void) sendtolist(p, (ADDRESS *) NULL, &e->e_sendqueue, e);
+ (void) sendtolist(p, NULLADDR, &e->e_sendqueue, e);
}
}
/*
diff --git a/usr.sbin/sendmail/src/savemail.c b/usr.sbin/sendmail/src/savemail.c
index f47fc4e0e8cd..6467defcfdbf 100644
--- a/usr.sbin/sendmail/src/savemail.c
+++ b/usr.sbin/sendmail/src/savemail.c
@@ -33,11 +33,11 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)savemail.c 8.3 (Berkeley) 7/13/93";
+static char sccsid[] = "@(#)savemail.c 8.28 (Berkeley) 3/11/94";
#endif /* not lint */
-# include <pwd.h>
# include "sendmail.h"
+# include <pwd.h>
/*
** SAVEMAIL -- Save mail on error
@@ -69,6 +69,10 @@ static char sccsid[] = "@(#)savemail.c 8.3 (Berkeley) 7/13/93";
# define ESM_PANIC 6 /* leave the locked queue/transcript files */
# define ESM_DONE 7 /* the message is successfully delivered */
+# ifndef _PATH_VARTMP
+# define _PATH_VARTMP "/usr/tmp/"
+# endif
+
savemail(e)
register ENVELOPE *e;
@@ -77,16 +81,19 @@ savemail(e)
register FILE *fp;
int state;
auto ADDRESS *q = NULL;
+ register char *p;
+ MCI mcibuf;
char buf[MAXLINE+1];
extern struct passwd *getpwnam();
- register char *p;
extern char *ttypath();
typedef int (*fnptr)();
+ extern bool writable();
if (tTd(6, 1))
{
- printf("\nsavemail, errormode = %c, id = %s\n e_from=",
- e->e_errormode, e->e_id == NULL ? "NONE" : e->e_id);
+ printf("\nsavemail, errormode = %c, id = %s, ExitStat = %d\n e_from=",
+ e->e_errormode, e->e_id == NULL ? "NONE" : e->e_id,
+ ExitStat);
printaddr(&e->e_from, FALSE);
}
@@ -96,8 +103,6 @@ savemail(e)
return;
}
- e->e_flags &= ~EF_FATALERRS;
-
/*
** In the unhappy event we don't know who to return the mail
** to, make someone up.
@@ -106,7 +111,8 @@ savemail(e)
if (e->e_from.q_paddr == NULL)
{
e->e_sender = "Postmaster";
- if (parseaddr(e->e_sender, &e->e_from, 0, '\0', NULL, e) == NULL)
+ if (parseaddr(e->e_sender, &e->e_from,
+ RF_COPYPARSE|RF_SENDERADDR, '\0', NULL, e) == NULL)
{
syserr("553 Cannot parse Postmaster!");
ExitStat = EX_SOFTWARE;
@@ -238,33 +244,48 @@ savemail(e)
** joe@x, which gives a response, etc. Also force
** the mail to be delivered even if a version of
** it has already been sent to the sender.
+ **
+ ** If this is a configuration or local software
+ ** error, send to the local postmaster as well,
+ ** since the originator can't do anything
+ ** about it anyway. Note that this is a full
+ ** copy of the message (intentionally) so that
+ ** the Postmaster can forward things along.
*/
+ if (ExitStat == EX_CONFIG || ExitStat == EX_SOFTWARE)
+ {
+ (void) sendtolist("postmaster",
+ NULLADDR, &e->e_errorqueue, e);
+ }
if (strcmp(e->e_from.q_paddr, "<>") != 0)
+ {
(void) sendtolist(e->e_from.q_paddr,
- (ADDRESS *) NULL,
- &e->e_errorqueue, e);
+ NULLADDR, &e->e_errorqueue, e);
+ }
- /* deliver a cc: to the postmaster if desired */
- if (PostMasterCopy != NULL)
- {
- auto ADDRESS *rlist = NULL;
+ /*
+ ** Deliver a non-delivery report to the
+ ** Postmaster-designate (not necessarily
+ ** Postmaster). This does not include the
+ ** body of the message, for privacy reasons.
+ ** You really shouldn't need this.
+ */
- (void) sendtolist(PostMasterCopy,
- (ADDRESS *) NULL,
- &rlist, e);
- (void) returntosender(e->e_message,
- rlist, FALSE, e);
- }
- q = e->e_errorqueue;
+ e->e_flags |= EF_PM_NOTIFY;
+
+ /* check to see if there are any good addresses */
+ for (q = e->e_errorqueue; q != NULL; q = q->q_next)
+ if (!bitset(QBADADDR|QDONTSEND, q->q_flags))
+ break;
if (q == NULL)
{
/* this is an error-error */
state = ESM_POSTMASTER;
break;
}
- if (returntosender(e->e_message,
- q, (e->e_class >= 0), e) == 0)
+ if (returntosender(e->e_message, e->e_errorqueue,
+ (e->e_class >= 0), e) == 0)
{
state = ESM_DONE;
break;
@@ -335,7 +356,9 @@ savemail(e)
e->e_to = buf;
q = NULL;
(void) sendtolist(buf, &e->e_from, &q, e);
- if (deliver(e, q) == 0)
+ if (q != NULL &&
+ !bitset(QBADADDR, q->q_flags) &&
+ deliver(e, q) == 0)
state = ESM_DONE;
else
state = ESM_MAIL;
@@ -358,19 +381,31 @@ savemail(e)
break;
}
- fp = dfopen("/usr/tmp/dead.letter",
- O_WRONLY|O_CREAT|O_APPEND, FileMode);
+ strcpy(buf, _PATH_VARTMP);
+ strcat(buf, "dead.letter");
+ if (!writable(buf, NULLADDR, SFF_NOSLINK))
+ {
+ state = ESM_PANIC;
+ break;
+ }
+ fp = dfopen(buf, O_WRONLY|O_CREAT|O_APPEND, FileMode);
if (fp == NULL)
{
state = ESM_PANIC;
break;
}
- putfromline(fp, FileMailer, e);
- (*e->e_puthdr)(fp, FileMailer, e);
- putline("\n", fp, FileMailer);
- (*e->e_putbody)(fp, FileMailer, e, NULL);
- putline("\n", fp, FileMailer);
+ bzero(&mcibuf, sizeof mcibuf);
+ mcibuf.mci_out = fp;
+ mcibuf.mci_mailer = FileMailer;
+ if (bitnset(M_7BITS, FileMailer->m_flags))
+ mcibuf.mci_flags |= MCIF_7BIT;
+
+ putfromline(&mcibuf, e);
+ (*e->e_puthdr)(&mcibuf, e);
+ putline("\n", &mcibuf);
+ (*e->e_putbody)(&mcibuf, e, NULL);
+ putline("\n", &mcibuf);
(void) fflush(fp);
state = ferror(fp) ? ESM_PANIC : ESM_DONE;
(void) xfclose(fp, "savemail", "/usr/tmp/dead.letter");
@@ -383,8 +418,7 @@ savemail(e)
case ESM_PANIC:
/* leave the locked queue & transcript files around */
- syserr("554 savemail: cannot save rejected email anywhere");
- exit(EX_SOFTWARE);
+ syserr("!554 savemail: cannot save rejected email anywhere");
}
}
}
@@ -450,6 +484,7 @@ returntosender(msg, returnq, sendbody, e)
SendBody = sendbody;
define('g', e->e_from.q_paddr, e);
+ define('u', NULL, e);
ee = newenvelope(&errenvelope, e);
define('a', "\201b", ee);
define('r', "internal", ee);
@@ -457,12 +492,14 @@ returntosender(msg, returnq, sendbody, e)
define('_', "localhost", ee);
ee->e_puthdr = putheader;
ee->e_putbody = errbody;
- ee->e_flags |= EF_RESPONSE;
+ ee->e_flags |= EF_RESPONSE|EF_METOO;
if (!bitset(EF_OLDSTYLE, e->e_flags))
ee->e_flags &= ~EF_OLDSTYLE;
ee->e_sendqueue = returnq;
- ee->e_msgsize = e->e_msgsize + ERRORFUDGE;
- openxscript(ee);
+ ee->e_msgsize = ERRORFUDGE;
+ if (!NoReturn)
+ ee->e_msgsize += e->e_msgsize;
+ initsys(ee);
for (q = returnq; q != NULL; q = q->q_next)
{
if (bitset(QBADADDR, q->q_flags))
@@ -472,7 +509,7 @@ returntosender(msg, returnq, sendbody, e)
ee->e_nrcpts++;
if (!DontPruneRoutes && pruneroute(q->q_paddr))
- parseaddr(q->q_paddr, q, 0, '\0', NULL, e);
+ parseaddr(q->q_paddr, q, RF_COPYPARSE, '\0', NULL, e);
if (q->q_alias == NULL)
addheader("To", q->q_paddr, ee);
@@ -499,7 +536,7 @@ returntosender(msg, returnq, sendbody, e)
/* fake up an address header for the from person */
expand("\201n", buf, &buf[sizeof buf - 1], e);
- if (parseaddr(buf, &ee->e_from, 1, '\0', NULL, e) == NULL)
+ if (parseaddr(buf, &ee->e_from, RF_COPYALL|RF_SENDERADDR, '\0', NULL, e) == NULL)
{
syserr("553 Can't parse myself!");
ExitStat = EX_SOFTWARE;
@@ -515,7 +552,7 @@ returntosender(msg, returnq, sendbody, e)
eatheader(ee, TRUE);
/* mark statistics */
- markstats(ee, (ADDRESS *) NULL);
+ markstats(ee, NULLADDR);
/* actually deliver the error message */
sendall(ee, SM_DEFAULT);
@@ -535,8 +572,7 @@ returntosender(msg, returnq, sendbody, e)
** original offending message.
**
** Parameters:
-** fp -- the output file.
-** m -- the mailer to output to.
+** mci -- the mailer connection information.
** e -- the envelope we are working in.
**
** Returns:
@@ -546,9 +582,8 @@ returntosender(msg, returnq, sendbody, e)
** Outputs the body of an error message.
*/
-errbody(fp, m, e)
- register FILE *fp;
- register struct mailer *m;
+errbody(mci, e)
+ register MCI *mci;
register ENVELOPE *e;
{
register FILE *xfile;
@@ -560,7 +595,7 @@ errbody(fp, m, e)
if (e->e_parent == NULL)
{
syserr("errbody: null parent");
- putline(" ----- Original message lost -----\n", fp, m);
+ putline(" ----- Original message lost -----\n", mci);
return;
}
@@ -570,12 +605,39 @@ errbody(fp, m, e)
if (e->e_msgboundary != NULL)
{
- putline("This is a MIME-encapsulated message", fp, m);
- putline("", fp, m);
+ putline("This is a MIME-encapsulated message", mci);
+ putline("", mci);
(void) sprintf(buf, "--%s", e->e_msgboundary);
- putline(buf, fp, m);
- putline("", fp, m);
+ putline(buf, mci);
+ putline("", mci);
+ }
+
+ /*
+ ** 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 &&
+ !bitset(EF_FATALERRS|EF_SENDRECEIPT, e->e_parent->e_flags))
+ {
+ putline(" **********************************************",
+ mci);
+ putline(" ** THIS IS A WARNING MESSAGE ONLY **",
+ mci);
+ putline(" ** YOU DO NOT NEED TO RESEND YOUR MESSAGE **",
+ mci);
+ putline(" **********************************************",
+ mci);
+ putline("", mci);
}
+ sprintf(buf, "The original message was received at %s",
+ arpadate(ctime(&e->e_parent->e_ctime)));
+ putline(buf, mci);
+ expand("from \201_", buf, &buf[sizeof buf - 1], e->e_parent);
+ putline(buf, mci);
+ putline("", mci);
/*
** Output error message header (if specified and available).
@@ -591,17 +653,17 @@ errbody(fp, m, e)
while (fgets(buf, sizeof buf, xfile) != NULL)
{
expand(buf, buf, &buf[sizeof buf - 1], e);
- putline(buf, fp, m);
+ putline(buf, mci);
}
(void) fclose(xfile);
- putline("\n", fp, m);
+ putline("\n", mci);
}
}
else
{
expand(ErrMsgFile, buf, &buf[sizeof buf - 1], e);
- putline(buf, fp, m);
- putline("", fp, m);
+ putline(buf, mci);
+ putline("", mci);
}
}
@@ -617,22 +679,26 @@ errbody(fp, m, e)
if (printheader)
{
putline(" ----- The following addresses had delivery problems -----",
- fp, m);
+ mci);
printheader = FALSE;
}
- if (q->q_alias != NULL)
- strcpy(buf, q->q_alias->q_paddr);
- else
- strcpy(buf, q->q_paddr);
+ strcpy(buf, q->q_paddr);
if (bitset(QBADADDR, q->q_flags))
- strcat(buf, " (hard error -- address deleted)");
+ strcat(buf, " (unrecoverable error)");
else
- strcat(buf, " (temporary failure -- will retry)");
- putline(buf, fp, m);
+ strcat(buf, " (transient failure)");
+ putline(buf, mci);
+ if (q->q_alias != NULL)
+ {
+ strcpy(buf, " (expanded from: ");
+ strcat(buf, q->q_alias->q_paddr);
+ strcat(buf, ")");
+ putline(buf, mci);
+ }
}
}
if (!printheader)
- putline("\n", fp, m);
+ putline("\n", mci);
/*
** Output transcript of errors
@@ -643,15 +709,15 @@ errbody(fp, m, e)
if ((xfile = fopen(p, "r")) == NULL)
{
syserr("Cannot open %s", p);
- putline(" ----- Transcript of session is unavailable -----\n", fp, m);
+ putline(" ----- Transcript of session is unavailable -----\n", mci);
}
else
{
- putline(" ----- Transcript of session follows -----\n", fp, m);
+ putline(" ----- Transcript of session follows -----\n", mci);
if (e->e_xfp != NULL)
(void) fflush(e->e_xfp);
while (fgets(buf, sizeof buf, xfile) != NULL)
- putline(buf, fp, m);
+ putline(buf, mci);
(void) xfclose(xfile, "errbody xscript", p);
}
errno = 0;
@@ -662,42 +728,42 @@ errbody(fp, m, e)
if (NoReturn)
SendBody = FALSE;
- putline("", fp, m);
+ putline("", mci);
if (e->e_parent->e_df != NULL)
{
if (SendBody)
- putline(" ----- Unsent message follows -----\n", fp, m);
+ putline(" ----- Original message follows -----\n", mci);
else
- putline(" ----- Message header follows -----\n", fp, m);
- (void) fflush(fp);
+ putline(" ----- Message header follows -----\n", mci);
+ (void) fflush(mci->mci_out);
if (e->e_msgboundary != NULL)
{
- putline("", fp, m);
+ putline("", mci);
(void) sprintf(buf, "--%s", e->e_msgboundary);
- putline(buf, fp, m);
- putline("Content-Type: message/rfc822", fp, m);
- putline("", fp, m);
+ putline(buf, mci);
+ putline("Content-Type: message/rfc822", mci);
+ putline("", mci);
}
- putheader(fp, m, e->e_parent);
- putline("", fp, m);
+ putheader(mci, e->e_parent);
+ putline("", mci);
if (SendBody)
- putbody(fp, m, e->e_parent, e->e_msgboundary);
+ putbody(mci, e->e_parent, e->e_msgboundary);
else
- putline(" ----- Message body suppressed -----", fp, m);
+ putline(" ----- Message body suppressed -----", mci);
}
else
{
- putline(" ----- No message was collected -----\n", fp, m);
+ putline(" ----- No message was collected -----\n", mci);
}
if (e->e_msgboundary != NULL)
{
- putline("", fp, m);
+ putline("", mci);
(void) sprintf(buf, "--%s--", e->e_msgboundary);
- putline(buf, fp, m);
+ putline(buf, mci);
}
- putline("", fp, m);
+ putline("", mci);
/*
** Cleanup and exit
@@ -726,7 +792,7 @@ errbody(fp, m, e)
pruneroute(addr)
char *addr;
{
-#ifdef NAMED_BIND
+#if NAMED_BIND
char *start, *at, *comma;
char c;
int rcode;
diff --git a/usr.sbin/sendmail/src/sendmail.8 b/usr.sbin/sendmail/src/sendmail.8
index c2e067885990..ee0f700d83a0 100644
--- a/usr.sbin/sendmail/src/sendmail.8
+++ b/usr.sbin/sendmail/src/sendmail.8
@@ -29,9 +29,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)sendmail.8 8.2 (Berkeley) 7/11/93
+.\" @(#)sendmail.8 8.4 (Berkeley) 12/11/93
.\"
-.Dd July 11, 1993
+.Dd December 11, 1993
.Dt SENDMAIL 8
.Os BSD 4
.Sh NAME
@@ -132,16 +132,14 @@ it is used for debugging configuration tables.
Verify names only \- do not try to collect or deliver a message.
Verify mode is normally used for validating
users or mailing lists.
-.It Fl bz
-Create the configuration freeze file.
.It Fl C Ns Ar file
Use alternate configuration file.
.Nm Sendmail
refuses to run as root if an alternate configuration file is specified.
-The frozen configuration file is bypassed.
.It Fl d Ns Ar X
Set debugging value to
.Ar X .
+.ne 1i
.It Fl F Ns Ar fullname
Set the full name of the sender.
.It Fl f Ns Ar name
@@ -463,8 +461,6 @@ raw data for alias names
data base of alias names
.It Pa /etc/sendmail.cf
configuration file
-.It Pa /etc/sendmail.fc
-frozen configuration
.It Pa /etc/sendmail.hf
help file
.It Pa /var/log/sendmail.st
@@ -491,12 +487,12 @@ Internet Request For Comments
.Rs
.%T "Sendmail \- An Internetwork Mail Router"
.%V SMM
-.%N \&No. 16
+.%N \&No. 9
.Re
.Rs
.%T "Sendmail Installation and Operation Guide"
.%V SMM
-.%N \&No. 7
+.%N \&No. 8
.Re
.Sh HISTORY
The
diff --git a/usr.sbin/sendmail/src/sendmail.h b/usr.sbin/sendmail/src/sendmail.h
index ef9107eae781..ca6af5fef143 100644
--- a/usr.sbin/sendmail/src/sendmail.h
+++ b/usr.sbin/sendmail/src/sendmail.h
@@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)sendmail.h 8.3 (Berkeley) 7/13/93
+ * @(#)sendmail.h 8.41 (Berkeley) 2/6/94
*/
/*
@@ -41,7 +41,7 @@
# ifdef _DEFINE
# define EXTERN
# ifndef lint
-static char SmailSccsId[] = "@(#)sendmail.h 8.3 7/13/93";
+static char SmailSccsId[] = "@(#)sendmail.h 8.41 2/6/94";
# endif
# else /* _DEFINE */
# define EXTERN extern
@@ -68,6 +68,9 @@ static char SmailSccsId[] = "@(#)sendmail.h 8.3 7/13/93";
# ifdef DAEMON
# include <sys/socket.h>
# endif
+# ifdef NETUNIX
+# include <sys/un.h>
+# endif
# ifdef NETINET
# include <netinet/in.h>
# endif
@@ -147,6 +150,10 @@ typedef struct address ADDRESS;
# define QSELFREF 000200 /* this address references itself */
# define QVERIFIED 000400 /* verified, but not expanded */
# define QREPORT 001000 /* report this address in return message */
+# define QBOGUSSHELL 002000 /* this entry has an invalid shell listed */
+# define QUNSAFEADDR 004000 /* address aquired through an unsafe path */
+
+# define NULLADDR ((ADDRESS *) NULL)
/*
** Mailer definition structure.
** Every mailer known to the system is declared in this
@@ -190,14 +197,14 @@ typedef struct mailer MAILER;
/* 'F' /* CF: include From: or Resent-From: */
# define M_NO_NULL_FROM 'g' /* sender of errors should be $g */
# define M_HST_UPPER 'h' /* preserve host case distinction */
- /* 'H' /* UIUC: MAIL11V3: preview headers */
+# define M_PREHEAD 'H' /* MAIL11V3: preview headers */
# define M_INTERNAL 'I' /* SMTP to another sendmail site */
# define M_LOCALMAILER 'l' /* delivery is to this host */
# define M_LIMITS 'L' /* must enforce SMTP line limits */
# define M_MUSER 'm' /* can handle multiple users at once */
/* 'M' /* CF: include Message-Id: */
# define M_NHDR 'n' /* don't insert From line */
- /* 'N' /* UIUC: MAIL11V3: DATA returns multi-status */
+# define M_MANYSTATUS 'N' /* MAIL11V3: DATA returns multi-status */
# define M_FROMPATH 'p' /* use reverse-path in MAIL FROM: */
/* 'P' /* CF: include Return-Path: */
# define M_ROPT 'r' /* mailer takes picky -r flag */
@@ -261,6 +268,50 @@ extern struct hdrinfo HdrInfo[];
# define H_RECEIPTTO 02000 /* this field has return receipt info */
# define H_ERRORSTO 04000 /* this field has error address info */
/*
+** Information about currently open connections to mailers, or to
+** hosts that we have looked up recently.
+*/
+
+# define MCI struct mailer_con_info
+
+MCI
+{
+ short mci_flags; /* flag bits, see below */
+ short mci_errno; /* error number on last connection */
+ short mci_herrno; /* h_errno from last DNS lookup */
+ short mci_exitstat; /* exit status from last connection */
+ short mci_state; /* SMTP state */
+ long mci_maxsize; /* max size this server will accept */
+ FILE *mci_in; /* input side of connection */
+ FILE *mci_out; /* output side of connection */
+ int mci_pid; /* process id of subordinate proc */
+ char *mci_phase; /* SMTP phase string */
+ struct mailer *mci_mailer; /* ptr to the mailer for this conn */
+ char *mci_host; /* host name */
+ time_t mci_lastuse; /* last usage time */
+};
+
+
+/* flag bits */
+#define MCIF_VALID 000001 /* this entry is valid */
+#define MCIF_TEMP 000002 /* don't cache this connection */
+#define MCIF_CACHED 000004 /* currently in open cache */
+#define MCIF_ESMTP 000010 /* this host speaks ESMTP */
+#define MCIF_EXPN 000020 /* EXPN command supported */
+#define MCIF_SIZE 000040 /* SIZE option supported */
+#define MCIF_8BITMIME 000100 /* BODY=8BITMIME supported */
+#define MCIF_7BIT 000200 /* strip this message to 7 bits */
+#define MCIF_MULTSTAT 000400 /* MAIL11V3: handles MULT status */
+
+/* states */
+#define MCIS_CLOSED 0 /* no traffic on this connection */
+#define MCIS_OPENING 1 /* sending initial protocol */
+#define MCIS_OPEN 2 /* open, initial protocol sent */
+#define MCIS_ACTIVE 3 /* message being sent */
+#define MCIS_QUITING 4 /* running quit protocol */
+#define MCIS_SSD 5 /* service shutting down */
+#define MCIS_ERROR 6 /* I/O error on connection */
+ /*
** Envelope structure.
** This structure defines the message itself. There is usually
** only one of these -- for the message that we originally read
@@ -284,16 +335,16 @@ ENVELOPE
ADDRESS *e_sendqueue; /* list of message recipients */
ADDRESS *e_errorqueue; /* the queue for error responses */
long e_msgsize; /* size of the message in bytes */
+ long e_flags; /* flags, see below */
int e_nrcpts; /* number of recipients */
short e_class; /* msg class (priority, junk, etc.) */
- short e_flags; /* flags, see below */
short e_hopcount; /* number of times processed */
short e_nsent; /* number of sends since checkpoint */
short e_sendmode; /* message send mode */
short e_errormode; /* error return mode */
- int (*e_puthdr)__P((FILE *, MAILER *, ENVELOPE *));
+ int (*e_puthdr)__P((MCI *, ENVELOPE *));
/* function to put header of message */
- int (*e_putbody)__P((FILE *, MAILER *, ENVELOPE *, char *));
+ int (*e_putbody)__P((MCI *, ENVELOPE *, char *));
/* function to put body of message */
struct envelope *e_parent; /* the message this one encloses */
struct envelope *e_sibling; /* the next envelope of interest */
@@ -306,22 +357,26 @@ ENVELOPE
char *e_message; /* error message */
char *e_statmsg; /* stat msg (changes per delivery) */
char *e_msgboundary; /* MIME-style message part boundary */
+ char *e_origrcpt; /* original recipient (one only) */
char *e_macro[128]; /* macro definitions */
};
/* values for e_flags */
-#define EF_OLDSTYLE 000001 /* use spaces (not commas) in hdrs */
-#define EF_INQUEUE 000002 /* this message is fully queued */
-#define EF_TIMEOUT 000004 /* this message is too old */
-#define EF_CLRQUEUE 000010 /* disk copy is no longer needed */
-#define EF_SENDRECEIPT 000020 /* send a return receipt */
-#define EF_FATALERRS 000040 /* fatal errors occured */
-#define EF_KEEPQUEUE 000100 /* keep queue files always */
-#define EF_RESPONSE 000200 /* this is an error or return receipt */
-#define EF_RESENT 000400 /* this message is being forwarded */
-#define EF_VRFYONLY 001000 /* verify only (don't expand aliases) */
-#define EF_WARNING 002000 /* warning message has been sent */
-#define EF_QUEUERUN 004000 /* this envelope is from queue */
+#define EF_OLDSTYLE 0x0000001 /* use spaces (not commas) in hdrs */
+#define EF_INQUEUE 0x0000002 /* this message is fully queued */
+#define EF_CLRQUEUE 0x0000008 /* disk copy is no longer needed */
+#define EF_SENDRECEIPT 0x0000010 /* send a return receipt */
+#define EF_FATALERRS 0x0000020 /* fatal errors occured */
+#define EF_KEEPQUEUE 0x0000040 /* keep queue files always */
+#define EF_RESPONSE 0x0000080 /* this is an error or return receipt */
+#define EF_RESENT 0x0000100 /* this message is being forwarded */
+#define EF_VRFYONLY 0x0000200 /* verify only (don't expand aliases) */
+#define EF_WARNING 0x0000400 /* warning message has been sent */
+#define EF_QUEUERUN 0x0000800 /* this envelope is from queue */
+#define EF_GLOBALERRS 0x0001000 /* treat errors as global */
+#define EF_PM_NOTIFY 0x0002000 /* send return mail to postmaster */
+#define EF_METOO 0x0004000 /* send to me too */
+#define EF_LOGSENDER 0x0008000 /* need to log the sender */
EXTERN ENVELOPE *CurEnv; /* envelope currently being processed */
/*
@@ -415,51 +470,9 @@ EXTERN struct rewrite *RewriteRules[MAXRWSETS];
struct metamac
{
char metaname; /* external code (after $) */
- char metaval; /* internal code (as above) */
+ u_char metaval; /* internal code (as above) */
};
/*
-** Information about currently open connections to mailers, or to
-** hosts that we have looked up recently.
-*/
-
-# define MCI struct mailer_con_info
-
-MCI
-{
- short mci_flags; /* flag bits, see below */
- short mci_errno; /* error number on last connection */
- short mci_herrno; /* h_errno from last DNS lookup */
- short mci_exitstat; /* exit status from last connection */
- short mci_state; /* SMTP state */
- long mci_maxsize; /* max size this server will accept */
- FILE *mci_in; /* input side of connection */
- FILE *mci_out; /* output side of connection */
- int mci_pid; /* process id of subordinate proc */
- char *mci_phase; /* SMTP phase string */
- struct mailer *mci_mailer; /* ptr to the mailer for this conn */
- char *mci_host; /* host name */
- time_t mci_lastuse; /* last usage time */
-};
-
-
-/* flag bits */
-#define MCIF_VALID 000001 /* this entry is valid */
-#define MCIF_TEMP 000002 /* don't cache this connection */
-#define MCIF_CACHED 000004 /* currently in open cache */
-#define MCIF_ESMTP 000010 /* this host speaks ESMTP */
-#define MCIF_EXPN 000020 /* EXPN command supported */
-#define MCIF_SIZE 000040 /* SIZE option supported */
-#define MCIF_8BITMIME 000100 /* BODY=8BITMIME supported */
-
-/* states */
-#define MCIS_CLOSED 0 /* no traffic on this connection */
-#define MCIS_OPENING 1 /* sending initial protocol */
-#define MCIS_OPEN 2 /* open, initial protocol sent */
-#define MCIS_ACTIVE 3 /* message being sent */
-#define MCIS_QUITING 4 /* running quit protocol */
-#define MCIS_SSD 5 /* service shutting down */
-#define MCIS_ERROR 6 /* I/O error on connection */
- /*
** Name canonification short circuit.
**
** If the name server for a host is down, the process of trying to
@@ -503,11 +516,12 @@ MAP
char *map_mname; /* name of this map */
int map_mflags; /* flags, see below */
char *map_file; /* the (nominal) filename */
- void *map_db1; /* the open database ptr */
- void *map_db2; /* an "extra" database pointer */
+ ARBPTR_T map_db1; /* the open database ptr */
+ ARBPTR_T map_db2; /* an "extra" database pointer */
char *map_app; /* to append to successful matches */
char *map_domain; /* the (nominal) NIS domain */
char *map_rebuild; /* program to run to do auto-rebuild */
+ time_t map_mtime; /* last database modification time */
};
/* bit values for map_flags */
@@ -521,6 +535,8 @@ MAP
# define MF_ALIAS 0x0080 /* this is an alias file */
# define MF_TRY0NULL 0x0100 /* try with no null byte */
# define MF_TRY1NULL 0x0200 /* try with the null byte */
+# define MF_LOCKED 0x0400 /* this map is currently locked */
+# define MF_ALIASWAIT 0x0800 /* alias map in aliaswait state */
# define MF_IMPL_HASH 0x1000 /* implicit: underlying hash database */
# define MF_IMPL_NDBM 0x2000 /* implicit: underlying NDBM database */
@@ -645,6 +661,7 @@ EXTERN char OpMode; /* operation mode, see below */
#define MD_DELIVER 'm' /* be a mail sender */
#define MD_SMTP 's' /* run SMTP on standard input */
+#define MD_ARPAFTP 'a' /* obsolete ARPANET mode (Grey Book) */
#define MD_DAEMON 'd' /* run as a daemon */
#define MD_VERIFY 'v' /* verify: don't collect or deliver */
#define MD_TEST 't' /* test mode: resolve addrs only */
@@ -675,10 +692,6 @@ EXTERN char OpMode; /* operation mode, see below */
*/
-/* Offset used to ensure that name server error * codes are unique */
-#define MAX_ERRNO 100
-
-
/*
** Privacy flags
** These are bit values for the PrivacyFlags word.
@@ -691,7 +704,8 @@ EXTERN char OpMode; /* operation mode, see below */
#define PRIV_NOEXPN 00010 /* disallow EXPN command entirely */
#define PRIV_NOVRFY 00020 /* disallow VRFY command entirely */
#define PRIV_AUTHWARNINGS 00040 /* flag possible authorization probs */
-#define PRIV_RESTRMAILQ 01000 /* restrict mailq command */
+#define PRIV_RESTRICTMAILQ 01000 /* restrict mailq command */
+#define PRIV_RESTRICTQRUN 02000 /* restrict queue run */
#define PRIV_GOAWAY 00777 /* don't give no info, anyway, anyhow */
/* struct defining such things */
@@ -703,13 +717,27 @@ struct prival
/*
-** Flags passed to remotename
+** Flags passed to remotename, parseaddr, allocaddr, and buildaddr.
*/
#define RF_SENDERADDR 0001 /* this is a sender address */
#define RF_HEADERADDR 0002 /* this is a header address */
#define RF_CANONICAL 0004 /* strip comment information */
#define RF_ADDDOMAIN 0010 /* OK to do domain extension */
+#define RF_COPYPARSE 0020 /* copy parsed user & host */
+#define RF_COPYPADDR 0040 /* copy print address */
+#define RF_COPYALL (RF_COPYPARSE|RF_COPYPADDR)
+#define RF_COPYNONE 0
+
+
+/*
+** Flags passed to safefile.
+*/
+
+#define SFF_ANYFILE 0 /* no special restrictions */
+#define SFF_MUSTOWN 0x0001 /* user must own this file */
+#define SFF_NOSLINK 0x0002 /* file cannot be a symbolic link */
+#define SFF_ROOTOK 0x0004 /* ok for root to own this file */
/*
@@ -720,6 +748,9 @@ struct prival
union bigsockaddr
{
struct sockaddr sa; /* general version */
+#ifdef NETUNIX
+ struct sockaddr_un sunix; /* UNIX family */
+#endif
#ifdef NETINET
struct sockaddr_in sin; /* INET family */
#endif
@@ -735,7 +766,6 @@ union bigsockaddr
};
#define SOCKADDR union bigsockaddr
-
/*
** Global variables.
*/
@@ -757,7 +787,7 @@ EXTERN bool CheckAliases; /* parse addresses during newaliases */
EXTERN bool NoAlias; /* suppress aliasing */
EXTERN bool UseNameServer; /* use internet domain name server */
EXTERN bool SevenBit; /* force 7-bit data */
-EXTERN int SafeAlias; /* minutes to wait until @:@ in alias file */
+EXTERN time_t SafeAlias; /* interval to wait until @:@ in alias file */
EXTERN FILE *InChannel; /* input connection */
EXTERN FILE *OutChannel; /* output connection */
EXTERN uid_t RealUid; /* when Daemon, real uid of caller */
@@ -793,10 +823,13 @@ EXTERN bool LogUsrErrs; /* syslog user errors (e.g., SMTP RCPT cmd) */
EXTERN bool SendMIMEErrors; /* send error messages in MIME format */
EXTERN bool MatchGecos; /* look for user names in gecos field */
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 bool DisConnected; /* running with OutChannel redirected to xf */
EXTERN char SpaceSub; /* substitution for <lwsp> */
EXTERN int PrivacyFlags; /* privacy flags */
-extern char *ConfFile; /* location of configuration file [conf.c] */
-extern char *FreezeFile; /* location of frozen memory image [conf.c] */
+EXTERN char *ConfFile; /* location of configuration file [conf.c] */
extern char *PidFile; /* location of proc id file [conf.c] */
extern ADDRESS NullAddress; /* a null (template) address [main.c] */
EXTERN long WkClassFact; /* multiplier for message class -> priority */
@@ -813,12 +846,14 @@ EXTERN long MaxMessageSize; /* advertised max size we will accept */
EXTERN char *PostMasterCopy; /* address to get errs cc's */
EXTERN int CheckpointInterval; /* queue file checkpoint interval */
EXTERN bool DontPruneRoutes; /* don't prune source routes */
+extern bool BrokenSmtpPeers; /* peers can't handle 2-line greeting */
EXTERN int MaxMciCache; /* maximum entries in MCI cache */
EXTERN time_t MciCacheTimeout; /* maximum idle time on connections */
EXTERN char *QueueLimitRecipient; /* limit queue runs to this recipient */
EXTERN char *QueueLimitSender; /* limit queue runs to this sender */
EXTERN char *QueueLimitId; /* limit queue runs to this id */
EXTERN FILE *TrafficLogFile; /* file in which to log all traffic */
+extern int errno;
/*
@@ -829,6 +864,7 @@ EXTERN FILE *TrafficLogFile; /* file in which to log all traffic */
EXTERN struct
{
+ /* RFC 1123-specified timeouts [minimum value] */
time_t to_initial; /* initial greeting timeout [5m] */
time_t to_mail; /* MAIL command [5m] */
time_t to_rcpt; /* RCPT command [5m] */
@@ -841,6 +877,7 @@ EXTERN struct
time_t to_helo; /* HELO command */
time_t to_quit; /* QUIT command */
time_t to_miscshort; /* misc short commands (NOOP, VERB, etc) */
+ time_t to_ident; /* IDENT protocol requests */
/* following are per message */
time_t to_q_return; /* queue return timeout */
time_t to_q_warning; /* queue warning timeout */
@@ -894,7 +931,8 @@ extern const char *errstring __P((int));
extern void expand __P((char *, char *, char *, ENVELOPE *));
extern void define __P((int, char *, ENVELOPE *));
extern char *macvalue __P((int, ENVELOPE *));
-extern char **prescan __P((char *, int, char[], char **));
+extern char **prescan __P((char *, int, char[], int, char **));
+extern int rewrite __P((char **, int, int, ENVELOPE *));
extern char *fgetfolded __P((char *, int, FILE *));
extern ADDRESS *recipient __P((ADDRESS *, ADDRESS **, ENVELOPE *));
extern ENVELOPE *newenvelope __P((ENVELOPE *, ENVELOPE *));
@@ -908,10 +946,14 @@ extern ADDRESS *getctladdr __P((ADDRESS *));
extern char *anynet_ntoa __P((SOCKADDR *));
extern char *remotename __P((char *, MAILER *, int, int *, ENVELOPE *));
extern bool shouldqueue __P((long, time_t));
-extern bool lockfile __P((int, char *, int));
+extern bool lockfile __P((int, char *, char *, int));
extern char *hostsignature __P((MAILER *, char *, ENVELOPE *));
extern void openxscript __P((ENVELOPE *));
extern void closexscript __P((ENVELOPE *));
+extern sigfunc_t setsignal __P((int, sigfunc_t));
+extern char *shortenstring __P((char *, int));
+extern bool usershellok __P((char *));
+extern void commaize __P((HDR *, char *, int, MCI *, ENVELOPE *));
/* ellipsis is a different case though */
#ifdef __STDC__
diff --git a/usr.sbin/sendmail/src/sendmail.hf b/usr.sbin/sendmail/src/sendmail.hf
index ff208bad7d99..142a7f577054 100644
--- a/usr.sbin/sendmail/src/sendmail.hf
+++ b/usr.sbin/sendmail/src/sendmail.hf
@@ -3,7 +3,7 @@ cpyr Copyright (c) 1983 Eric P. Allman
cpyr Copyright (c) 1988, 1993
cpyr The Regents of the University of California. All rights reserved.
cpyr
-cpyr @(#)sendmail.hf 8.1 (Berkeley) 6/7/93
+cpyr @(#)sendmail.hf 8.2 (Berkeley) 7/16/93
cpyr
smtp Commands:
smtp HELO EHLO MAIL RCPT DATA
@@ -16,8 +16,7 @@ smtp For local information send email to Postmaster at your site.
help HELP [ <topic> ]
help The HELP command gives help info.
helo HELO <hostname>
-helo Introduce yourself. I am a boor, so I really don't
-helo care if you do.
+helo Introduce yourself.
ehlo EHLO <hostname>
ehlo Introduce yourself, and request extended SMTP mode.
mail MAIL FROM: <sender>
diff --git a/usr.sbin/sendmail/src/srvrsmtp.c b/usr.sbin/sendmail/src/srvrsmtp.c
index 39dabe0a49e7..e049de3ff174 100644
--- a/usr.sbin/sendmail/src/srvrsmtp.c
+++ b/usr.sbin/sendmail/src/srvrsmtp.c
@@ -36,14 +36,13 @@
#ifndef lint
#ifdef SMTP
-static char sccsid[] = "@(#)srvrsmtp.c 8.3 (Berkeley) 7/13/93 (with SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 8.32 (Berkeley) 3/8/94 (with SMTP)";
#else
-static char sccsid[] = "@(#)srvrsmtp.c 8.3 (Berkeley) 7/13/93 (without SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 8.32 (Berkeley) 3/8/94 (without SMTP)";
#endif
#endif /* not lint */
# include <errno.h>
-# include <signal.h>
# ifdef SMTP
@@ -83,6 +82,8 @@ struct cmd
/* non-standard commands */
# define CMDONEX 16 /* onex -- sending one transaction only */
# define CMDVERB 17 /* verb -- go into verbose mode */
+/* use this to catch and log "door handle" attempts on your system */
+# define CMDLOGBOGUS 23 /* bogus command that should be logged */
/* debugging-only commands, only enabled if SMTPDEBUG is defined */
# define CMDDBGQSHOW 24 /* showq -- show send queue */
# define CMDDBGDEBUG 25 /* debug -- set debug mode */
@@ -108,13 +109,18 @@ static struct cmd CmdTab[] =
*/
"showq", CMDDBGQSHOW,
"debug", CMDDBGDEBUG,
+ "wiz", CMDLOGBOGUS,
NULL, CMDERROR,
};
-bool InChild = FALSE; /* true if running in a subprocess */
bool OneXact = FALSE; /* one xaction only this run */
+char *CurSmtpClient; /* who's at the other end of channel */
-#define EX_QUIT 22 /* special code for QUIT command */
+static char *skipword();
+extern char RealUserName[];
+
+
+#define MAXBADCOMMANDS 25 /* maximum number of bad commands */
smtp(e)
register ENVELOPE *e;
@@ -122,7 +128,6 @@ smtp(e)
register char *p;
register struct cmd *c;
char *cmd;
- static char *skipword();
auto ADDRESS *vrfyqueue;
ADDRESS *a;
bool gotmail; /* mail command received */
@@ -131,10 +136,12 @@ smtp(e)
char *protocol; /* sending protocol */
char *sendinghost; /* sending hostname */
long msize; /* approximate maximum message size */
+ char *peerhostname; /* name of SMTP peer or "localhost" */
auto char *delimptr;
char *id;
int nrcpts; /* number of RCPT commands */
bool doublequeue;
+ int badcommands = 0; /* count of bad commands */
char inp[MAXLINE];
char cmdbuf[MAXLINE];
extern char Version[];
@@ -146,11 +153,25 @@ smtp(e)
(void) dup2(fileno(OutChannel), fileno(stdout));
}
settime(e);
- CurHostName = RealHostName;
- setproctitle("server %s startup", CurHostName);
+ peerhostname = RealHostName;
+ if (peerhostname == NULL)
+ peerhostname = "localhost";
+ CurHostName = peerhostname;
+ CurSmtpClient = macvalue('_', e);
+ if (CurSmtpClient == NULL)
+ CurSmtpClient = CurHostName;
+
+ setproctitle("server %s startup", CurSmtpClient);
expand("\201e", inp, &inp[sizeof inp], e);
- message("220-%s", inp);
- message("220 ESMTP spoken here");
+ if (BrokenSmtpPeers)
+ {
+ message("220 %s", inp);
+ }
+ else
+ {
+ message("220-%s", inp);
+ message("220 ESMTP spoken here");
+ }
protocol = NULL;
sendinghost = macvalue('s', e);
gothello = FALSE;
@@ -158,16 +179,20 @@ smtp(e)
for (;;)
{
/* arrange for backout */
- if (setjmp(TopFrame) > 0 && InChild)
+ if (setjmp(TopFrame) > 0)
{
- QuickAbort = FALSE;
- SuprErrs = TRUE;
- finis();
+ /* if() nesting is necessary for Cray UNICOS */
+ if (InChild)
+ {
+ QuickAbort = FALSE;
+ SuprErrs = TRUE;
+ finis();
+ }
}
QuickAbort = FALSE;
HoldErrs = FALSE;
LogUsrErrs = FALSE;
- e->e_flags &= ~EF_VRFYONLY;
+ e->e_flags &= ~(EF_VRFYONLY|EF_GLOBALERRS);
/* setup for the read */
e->e_to = NULL;
@@ -184,12 +209,13 @@ smtp(e)
if (p == NULL)
{
/* end of file, just die */
+ disconnect(1, e);
message("421 %s Lost input channel from %s",
- MyHostName, CurHostName);
+ MyHostName, CurSmtpClient);
#ifdef LOG
- if (LogLevel > 1)
+ if (LogLevel > (gotmail ? 1 : 19))
syslog(LOG_NOTICE, "lost input channel from %s",
- CurHostName);
+ CurSmtpClient);
#endif
if (InChild)
ExitStat = EX_QUIT;
@@ -204,9 +230,9 @@ smtp(e)
fprintf(e->e_xfp, "<<< %s\n", inp);
if (e->e_id == NULL)
- setproctitle("%s: %s", CurHostName, inp);
+ setproctitle("%s: %.80s", CurSmtpClient, inp);
else
- setproctitle("%s %s: %s", e->e_id, CurHostName, inp);
+ setproctitle("%s %s: %.80s", e->e_id, CurSmtpClient, inp);
/* break off command */
for (p = inp; isascii(*p) && isspace(*p); p++)
@@ -248,21 +274,12 @@ smtp(e)
SmtpPhase = "server HELO";
}
sendinghost = newstr(p);
- if (strcasecmp(p, RealHostName) != 0)
- {
- auth_warning(e, "Host %s claimed to be %s",
- RealHostName, p);
- }
- p = macvalue('_', e);
- if (p == NULL)
- p = RealHostName;
-
gothello = TRUE;
if (c->cmdcode != CMDEHLO)
{
/* print old message and be done with it */
message("250 %s Hello %s, pleased to meet you",
- MyHostName, p);
+ MyHostName, CurSmtpClient);
break;
}
@@ -286,7 +303,7 @@ smtp(e)
{
/* set sending host to our known value */
if (sendinghost == NULL)
- sendinghost = RealHostName;
+ sendinghost = peerhostname;
if (bitset(PRIV_NEEDMAILHELO, PrivacyFlags))
{
@@ -297,6 +314,8 @@ smtp(e)
if (gotmail)
{
message("503 Sender already specified");
+ if (InChild)
+ finis();
break;
}
if (InChild)
@@ -313,15 +332,26 @@ smtp(e)
{
auth_warning(e,
"Host %s didn't use HELO protocol",
- RealHostName);
+ peerhostname);
+ }
+#ifdef PICKY_HELO_CHECK
+ if (strcasecmp(sendinghost, peerhostname) != 0 &&
+ (strcasecmp(peerhostname, "localhost") != 0 ||
+ strcasecmp(sendinghost, MyHostName) != 0))
+ {
+ auth_warning(e, "Host %s claimed to be %s",
+ peerhostname, sendinghost);
}
+#endif
+
if (protocol == NULL)
protocol = "SMTP";
define('r', protocol, e);
define('s', sendinghost, e);
initsys(e);
nrcpts = 0;
- setproctitle("%s %s: %s", e->e_id, CurHostName, inp);
+ e->e_flags |= EF_LOGSENDER;
+ setproctitle("%s %s: %.80s", e->e_id, CurSmtpClient, inp);
/* child -- go do the processing */
p = skipword(p, "from");
@@ -348,12 +378,21 @@ smtp(e)
if (p != NULL && *p != '\0')
*p++ = '\0';
+ /* check for possible spoofing */
+ if (RealUid != 0 && OpMode == MD_SMTP &&
+ (e->e_from.q_mailer != LocalMailer &&
+ strcmp(e->e_from.q_user, RealUserName) != 0))
+ {
+ auth_warning(e, "%s owned process doing -bs",
+ RealUserName);
+ }
+
/* now parse ESMTP arguments */
msize = 0;
for (; p != NULL && *p != '\0'; p++)
{
char *kp;
- char *vp;
+ char *vp = NULL;
/* locate the beginning of the keyword */
while (isascii(*p) && isspace(*p))
@@ -462,7 +501,7 @@ smtp(e)
p = skipword(p, "to");
if (p == NULL)
break;
- a = parseaddr(p, (ADDRESS *) NULL, 1, ' ', NULL, e);
+ a = parseaddr(p, NULLADDR, RF_COPYALL, ' ', NULL, e);
if (a == NULL)
break;
a->q_flags |= QPRIMARY;
@@ -474,7 +513,9 @@ smtp(e)
e->e_to = p;
if (!bitset(QBADADDR, a->q_flags))
{
- message("250 Recipient ok");
+ message("250 Recipient ok%s",
+ bitset(QQUEUEUP, a->q_flags) ?
+ " (will queue)" : "");
nrcpts++;
}
else
@@ -492,7 +533,7 @@ smtp(e)
message("503 Need MAIL command");
break;
}
- else if (e->e_nrcpts <= 0)
+ else if (nrcpts <= 0)
{
message("503 Need RCPT (recipient)");
break;
@@ -519,9 +560,9 @@ smtp(e)
/* collect the text of the message */
SmtpPhase = "collect";
collect(TRUE, doublequeue, e);
- e->e_flags &= ~EF_FATALERRS;
if (Errors != 0)
goto abortmessage;
+ HoldErrs = TRUE;
/*
** Arrange to send to everyone.
@@ -554,9 +595,6 @@ smtp(e)
sendall(e, doublequeue ? SM_QUEUE : SM_DEFAULT);
e->e_to = NULL;
- /* save statistics */
- markstats(e, (ADDRESS *) NULL);
-
/* issue success if appropriate and reset */
if (Errors == 0 || HoldErrs)
message("250 %s Message accepted for delivery", id);
@@ -576,9 +614,10 @@ smtp(e)
/* if we just queued, poke it */
if (doublequeue && e->e_sendmode != SM_QUEUE)
{
+ extern pid_t dowork();
+
unlockqueue(e);
- dowork(id, TRUE, TRUE, e);
- e->e_id = NULL;
+ (void) dowork(id, TRUE, TRUE, e);
}
}
@@ -596,6 +635,7 @@ smtp(e)
case CMDRSET: /* rset -- reset state */
message("250 Reset state");
+ e->e_flags |= EF_CLRQUEUE;
if (InChild)
finis();
@@ -614,7 +654,12 @@ smtp(e)
if (vrfy)
message("252 Who's to say?");
else
- message("502 That's none of your business");
+ message("502 Sorry, we do not allow this operation");
+#ifdef LOG
+ if (LogLevel > 5)
+ syslog(LOG_INFO, "%s: %s [rejected]",
+ CurSmtpClient, inp);
+#endif
break;
}
else if (!gothello &&
@@ -628,7 +673,7 @@ smtp(e)
break;
#ifdef LOG
if (LogLevel > 5)
- syslog(LOG_INFO, "%s: %s", CurHostName, inp);
+ syslog(LOG_INFO, "%s: %s", CurSmtpClient, inp);
#endif
vrfyqueue = NULL;
QuickAbort = TRUE;
@@ -643,8 +688,7 @@ smtp(e)
}
else
{
- (void) sendtolist(p, (ADDRESS *) NULL,
- &vrfyqueue, e);
+ (void) sendtolist(p, NULLADDR, &vrfyqueue, e);
}
if (Errors != 0)
{
@@ -658,16 +702,13 @@ smtp(e)
}
while (vrfyqueue != NULL)
{
- register ADDRESS *a = vrfyqueue->q_next;
-
- while (a != NULL && bitset(QDONTSEND|QBADADDR, a->q_flags))
- a = a->q_next;
-
+ a = vrfyqueue;
+ while ((a = a->q_next) != NULL &&
+ bitset(QDONTSEND|QBADADDR, a->q_flags))
+ continue;
if (!bitset(QDONTSEND|QBADADDR, vrfyqueue->q_flags))
printvrfyaddr(vrfyqueue, a == NULL);
- else if (a == NULL)
- message("554 Self destructive alias loop");
- vrfyqueue = a;
+ vrfyqueue = vrfyqueue->q_next;
}
if (InChild)
finis();
@@ -678,14 +719,15 @@ smtp(e)
break;
case CMDNOOP: /* noop -- do nothing */
- message("200 OK");
+ message("250 OK");
break;
case CMDQUIT: /* quit -- leave mail */
message("221 %s closing connection", MyHostName);
+doquit:
/* avoid future 050 messages */
- Verbose = FALSE;
+ disconnect(1, e);
if (InChild)
ExitStat = EX_QUIT;
@@ -721,20 +763,27 @@ smtp(e)
break;
# else /* not SMTPDEBUG */
-
case CMDDBGQSHOW: /* show queues */
case CMDDBGDEBUG: /* set debug mode */
+# endif /* SMTPDEBUG */
+ case CMDLOGBOGUS: /* bogus command */
# ifdef LOG
if (LogLevel > 0)
- syslog(LOG_NOTICE,
+ syslog(LOG_CRIT,
"\"%s\" command from %s (%s)",
- c->cmdname, RealHostName,
+ c->cmdname, peerhostname,
anynet_ntoa(&RealHostAddr));
# endif
/* FALL THROUGH */
-# endif /* SMTPDEBUG */
case CMDERROR: /* unknown command */
+ if (++badcommands > MAXBADCOMMANDS)
+ {
+ message("421 %s Too many bad commands; closing connection",
+ MyHostName);
+ goto doquit;
+ }
+
message("500 Command unrecognized");
break;
@@ -766,6 +815,7 @@ skipword(p, w)
char *w;
{
register char *q;
+ char *firstp = p;
/* find beginning of word */
while (isascii(*p) && isspace(*p))
@@ -780,7 +830,8 @@ skipword(p, w)
if (*p != ':')
{
syntax:
- message("501 Syntax error in parameters");
+ message("501 Syntax error in parameters scanning \"%s\"",
+ firstp);
Errors++;
return (NULL);
}
@@ -934,10 +985,16 @@ runinchild(label, e)
st = waitfor(childpid);
if (st == -1)
syserr("%s: lost child", label);
+ else if (!WIFEXITED(st))
+ syserr("%s: died on signal %d",
+ label, st & 0177);
/* if we exited on a QUIT command, complete the process */
- if (st == (EX_QUIT << 8))
+ if (WEXITSTATUS(st) == EX_QUIT)
+ {
+ disconnect(1, e);
finis();
+ }
return (1);
}
diff --git a/usr.sbin/sendmail/src/stats.c b/usr.sbin/sendmail/src/stats.c
index 94bead6d343a..2dc68272fbc1 100644
--- a/usr.sbin/sendmail/src/stats.c
+++ b/usr.sbin/sendmail/src/stats.c
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)stats.c 8.2 (Berkeley) 7/11/93";
+static char sccsid[] = "@(#)stats.c 8.3 (Berkeley) 8/28/93";
#endif /* not lint */
# include "sendmail.h"
@@ -95,12 +95,13 @@ poststats(sfile)
(void) time(&Stat.stat_itime);
Stat.stat_size = sizeof Stat;
- fd = open(sfile, 2);
+ fd = open(sfile, O_RDWR);
if (fd < 0)
{
errno = 0;
return;
}
+ (void) lockfile(fd, sfile, NULL, LOCK_EX);
if (read(fd, (char *) &stat, sizeof stat) == sizeof stat &&
stat.stat_size == sizeof stat)
{
diff --git a/usr.sbin/sendmail/src/trace.c b/usr.sbin/sendmail/src/trace.c
index f27d70b318ed..29421eee3c6b 100644
--- a/usr.sbin/sendmail/src/trace.c
+++ b/usr.sbin/sendmail/src/trace.c
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)trace.c 8.1 (Berkeley) 6/7/93";
+static char sccsid[] = "@(#)trace.c 8.2 (Berkeley) 3/14/94";
#endif /* not lint */
# include "sendmail.h"
@@ -82,8 +82,8 @@ tTsetup(vect, size, defflags)
tTflag(s)
register char *s;
{
- int first, last;
- register int i;
+ unsigned int first, last;
+ register unsigned int i;
if (*s == '\0')
s = DefFlags;
diff --git a/usr.sbin/sendmail/src/udb.c b/usr.sbin/sendmail/src/udb.c
index d0987d407f51..dbd1d046c190 100644
--- a/usr.sbin/sendmail/src/udb.c
+++ b/usr.sbin/sendmail/src/udb.c
@@ -36,15 +36,14 @@
#ifndef lint
#ifdef USERDB
-static char sccsid [] = "@(#)udb.c 8.1 (Berkeley) 6/7/93 (with USERDB)";
+static char sccsid [] = "@(#)udb.c 8.6 (Berkeley) 3/11/94 (with USERDB)";
#else
-static char sccsid [] = "@(#)udb.c 8.1 (Berkeley) 6/7/93 (without USERDB)";
+static char sccsid [] = "@(#)udb.c 8.6 (Berkeley) 3/11/94 (without USERDB)";
#endif
#endif
#ifdef USERDB
-#include <sys/time.h>
#include <errno.h>
#include <netdb.h>
#include <db.h>
@@ -197,12 +196,14 @@ udbexpand(a, sendq, e)
key.data = keybuf;
key.size = keylen;
if (tTd(28, 80))
- printf("udbexpand: trying %s\n", keybuf);
+ printf("udbexpand: trying %s (%d)\n",
+ keybuf, keylen);
i = (*up->udb_dbp->seq)(up->udb_dbp, &key, &info, R_CURSOR);
if (i > 0 || info.size <= 0)
{
if (tTd(28, 2))
- printf("udbexpand: no match on %s\n", keybuf);
+ printf("udbexpand: no match on %s (%d)\n",
+ keybuf, keylen);
continue;
}
if (tTd(28, 80))
@@ -346,6 +347,17 @@ char *
udbsender(sender)
char *sender;
{
+ extern char *udbmatch();
+
+ return udbmatch(sender, "mailname");
+}
+
+
+char *
+udbmatch(user, field)
+ char *user;
+ char *field;
+{
register char *p;
register struct udbent *up;
int i;
@@ -354,7 +366,7 @@ udbsender(sender)
char keybuf[MAXKEY];
if (tTd(28, 1))
- printf("udbsender(%s)\n", sender);
+ printf("udbmatch(%s, %s)\n", user, field);
if (!UdbInitialized)
{
@@ -367,16 +379,17 @@ udbsender(sender)
return NULL;
/* long names can never match and are a pain to deal with */
- if (strlen(sender) > sizeof keybuf - 12)
+ if ((strlen(user) + strlen(field)) > sizeof keybuf - 4)
return NULL;
/* names beginning with colons indicate metadata */
- if (sender[0] == ':')
+ if (user[0] == ':')
return NULL;
/* build database key */
- (void) strcpy(keybuf, sender);
- (void) strcat(keybuf, ":mailname");
+ (void) strcpy(keybuf, user);
+ (void) strcat(keybuf, ":");
+ (void) strcat(keybuf, field);
keylen = strlen(keybuf);
for (up = UdbEnts; up->udb_type != UDB_EOLIST; up++)
@@ -394,8 +407,8 @@ udbsender(sender)
if (i != 0 || info.size <= 0)
{
if (tTd(28, 2))
- printf("udbsender: no match on %s\n",
- keybuf);
+ printf("udbmatch: no match on %s (%d)\n",
+ keybuf, keylen);
continue;
}
@@ -403,11 +416,14 @@ udbsender(sender)
bcopy(info.data, p, info.size);
p[info.size] = '\0';
if (tTd(28, 1))
- printf("udbsender ==> %s\n", p);
+ printf("udbmatch ==> %s\n", p);
return p;
}
}
+ if (strcmp(field, "mailname") != 0)
+ return NULL;
+
/*
** Nothing yet. Search again for a default case. But only
** use it if we also have a forward (:maildrop) pointer already
@@ -415,7 +431,7 @@ udbsender(sender)
*/
/* build database key */
- (void) strcpy(keybuf, sender);
+ (void) strcpy(keybuf, user);
(void) strcat(keybuf, ":maildrop");
keylen = strlen(keybuf);
@@ -456,12 +472,12 @@ udbsender(sender)
}
/* they exist -- build the actual address */
- p = xalloc(strlen(sender) + strlen(up->udb_default) + 2);
- (void) strcpy(p, sender);
+ p = xalloc(strlen(user) + strlen(up->udb_default) + 2);
+ (void) strcpy(p, user);
(void) strcat(p, "@");
(void) strcat(p, up->udb_default);
if (tTd(28, 1))
- printf("udbsender ==> %s\n", p);
+ printf("udbmatch ==> %s\n", p);
return p;
}
}
@@ -554,7 +570,7 @@ _udbx_init()
case '*': /* search remote database (expand MX) */
if (*spec == '*')
{
-#ifdef NAMED_BIND
+#if NAMED_BIND
nmx = getmxrr(spec + 1, mxhosts, FALSE, &rcode);
#else
mxhosts[0] = spec + 1;
@@ -586,7 +602,7 @@ _udbx_init()
up->udb_addr.sin_family = h->h_addrtype;
bcopy(h->h_addr_list[0],
(char *) &up->udb_addr.sin_addr,
- h->h_length);
+ sizeof up->udb_addr.sin_addr);
up->udb_addr.sin_port = UdbPort;
up->udb_timeout = UdbTimeout;
up++;
diff --git a/usr.sbin/sendmail/src/useful.h b/usr.sbin/sendmail/src/useful.h
index 944eb5c96292..ba33a792db08 100644
--- a/usr.sbin/sendmail/src/useful.h
+++ b/usr.sbin/sendmail/src/useful.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)useful.h 8.1 (Berkeley) 6/7/93
+ * @(#)useful.h 8.2 (Berkeley) 9/24/93
*/
# include <sys/types.h>
@@ -67,7 +67,11 @@ typedef char bool;
/* sccs id's */
# ifndef lint
-# define SCCSID(arg) static char SccsId[] = "arg";
+# ifdef __STDC__
+# define SCCSID(arg) static char SccsId[] = #arg;
+# else
+# define SCCSID(arg) static char SccsId[] = "arg";
+# endif
# else
-# define SCCSID(arg)
+# define SCCSID(arg)
# endif
diff --git a/usr.sbin/sendmail/src/usersmtp.c b/usr.sbin/sendmail/src/usersmtp.c
index eb6271160504..06acd3f2fc8e 100644
--- a/usr.sbin/sendmail/src/usersmtp.c
+++ b/usr.sbin/sendmail/src/usersmtp.c
@@ -36,9 +36,9 @@
#ifndef lint
#ifdef SMTP
-static char sccsid[] = "@(#)usersmtp.c 8.4 (Berkeley) 7/13/93 (with SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 8.18 (Berkeley) 1/24/94 (with SMTP)";
#else
-static char sccsid[] = "@(#)usersmtp.c 8.4 (Berkeley) 7/13/93 (without SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 8.18 (Berkeley) 1/24/94 (without SMTP)";
#endif
#endif /* not lint */
@@ -61,6 +61,7 @@ char SmtpMsgBuffer[MAXLINE]; /* buffer for commands */
char SmtpReplyBuffer[MAXLINE]; /* buffer for replies */
char SmtpError[MAXLINE] = ""; /* save failure error messages */
int SmtpPid; /* pid of mailer */
+bool SmtpNeedIntro; /* need "while talking" in transcript */
#ifdef __STDC__
extern smtpmessage(char *f, MAILER *m, MCI *mci, ...);
@@ -95,7 +96,7 @@ smtpinit(m, mci, e)
if (tTd(18, 1))
{
printf("smtpinit ");
- mci_dump(mci);
+ mci_dump(mci, FALSE);
}
/*
@@ -104,6 +105,7 @@ smtpinit(m, mci, e)
SmtpError[0] = '\0';
CurHostName = mci->mci_host; /* XXX UGLY XXX */
+ SmtpNeedIntro = TRUE;
switch (mci->mci_state)
{
case MCIS_ACTIVE:
@@ -139,8 +141,10 @@ smtpinit(m, mci, e)
SmtpPhase = mci->mci_phase = "client greeting";
setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
r = reply(m, mci, e, TimeOuts.to_initial, esmtp_check);
- if (r < 0 || REPLYTYPE(r) != 2)
+ if (r < 0 || REPLYTYPE(r) == 4)
goto tempfail1;
+ if (REPLYTYPE(r) != 2)
+ goto unavailable;
/*
** Send the HELO command.
@@ -182,12 +186,15 @@ tryhelo:
** Check to see if we actually ended up talking to ourself.
** This means we didn't know about an alias or MX, or we managed
** to connect to an echo server.
+ **
+ ** If this code remains at all, "CheckLoopBack" should be
+ ** a mailer flag. This is a MAYBENEXTRELEASE feature.
*/
p = strchr(&SmtpReplyBuffer[4], ' ');
if (p != NULL)
*p = '\0';
- if (strcasecmp(&SmtpReplyBuffer[4], MyHostName) == 0)
+ if (CheckLoopBack && strcasecmp(&SmtpReplyBuffer[4], MyHostName) == 0)
{
syserr("553 %s config error: mail loops back to myself",
MyHostName);
@@ -211,8 +218,13 @@ tryhelo:
goto tempfail2;
}
- mci->mci_state = MCIS_OPEN;
- return;
+ if (mci->mci_state != MCIS_CLOSED)
+ {
+ mci->mci_state = MCIS_OPEN;
+ return;
+ }
+
+ /* got a 421 error code during startup */
tempfail1:
tempfail2:
@@ -291,7 +303,10 @@ helo_options(line, m, mci, e)
mci->mci_maxsize = atol(p);
}
else if (strcasecmp(line, "8bitmime") == 0)
+ {
mci->mci_flags |= MCIF_8BITMIME;
+ mci->mci_flags &= ~MCIF_7BIT;
+ }
else if (strcasecmp(line, "expn") == 0)
mci->mci_flags |= MCIF_EXPN;
}
@@ -310,6 +325,7 @@ smtpmailfrom(m, mci, e)
ENVELOPE *e;
{
int r;
+ char *bufp;
char buf[MAXNAME];
char optbuf[MAXLINE];
@@ -317,7 +333,7 @@ smtpmailfrom(m, mci, e)
printf("smtpmailfrom: CurHost=%s\n", CurHostName);
/* set up appropriate options to include */
- if (bitset(MCIF_SIZE, mci->mci_flags))
+ if (bitset(MCIF_SIZE, mci->mci_flags) && e->e_msgsize > 0)
sprintf(optbuf, " SIZE=%ld", e->e_msgsize);
else
strcpy(optbuf, "");
@@ -334,15 +350,25 @@ smtpmailfrom(m, mci, e)
(void) strcpy(buf, "");
else
expand("\201g", buf, &buf[sizeof buf - 1], e);
+ if (buf[0] == '<')
+ {
+ /* strip off <angle brackets> (put back on below) */
+ bufp = &buf[strlen(buf) - 1];
+ if (*bufp == '>')
+ *bufp = '\0';
+ bufp = &buf[1];
+ }
+ else
+ bufp = buf;
if (e->e_from.q_mailer == LocalMailer ||
!bitnset(M_FROMPATH, m->m_flags))
{
- smtpmessage("MAIL From:<%s>%s", m, mci, buf, optbuf);
+ smtpmessage("MAIL From:<%s>%s", m, mci, bufp, optbuf);
}
else
{
smtpmessage("MAIL From:<@%s%c%s>%s", m, mci, MyHostName,
- buf[0] == '@' ? ',' : ':', buf, optbuf);
+ *bufp == '@' ? ',' : ':', bufp, optbuf);
}
SmtpPhase = mci->mci_phase = "client MAIL";
setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
@@ -443,6 +469,7 @@ smtprcpt(to, m, mci, e)
*/
static jmp_buf CtxDataTimeout;
+static int datatimeout();
smtpdata(m, mci, e)
struct mailer *m;
@@ -452,7 +479,6 @@ smtpdata(m, mci, e)
register int r;
register EVENT *ev;
time_t timeout;
- static int datatimeout();
/*
** Send the data.
@@ -513,12 +539,22 @@ smtpdata(m, mci, e)
ev = setevent(timeout, datatimeout, 0);
/* now output the actual message */
- (*e->e_puthdr)(mci->mci_out, m, e);
- putline("\n", mci->mci_out, m);
- (*e->e_putbody)(mci->mci_out, m, e, NULL);
+ (*e->e_puthdr)(mci, e);
+ putline("\n", mci);
+ (*e->e_putbody)(mci, 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);
if (TrafficLogFile != NULL)
@@ -577,7 +613,16 @@ smtpquit(m, mci, e)
register MCI *mci;
ENVELOPE *e;
{
- int i;
+ bool oldSuprErrs = SuprErrs;
+
+ /*
+ ** Suppress errors here -- we may be processing a different
+ ** job when we do the quit connection, and we don't want the
+ ** new job to be penalized for something that isn't it's
+ ** problem.
+ */
+
+ SuprErrs = TRUE;
/* send the quit message if we haven't gotten I/O error */
if (mci->mci_state != MCIS_ERROR)
@@ -585,14 +630,18 @@ smtpquit(m, mci, e)
SmtpPhase = "client QUIT";
smtpmessage("QUIT", m, mci);
(void) reply(m, mci, e, TimeOuts.to_quit, NULL);
+ SuprErrs = oldSuprErrs;
if (mci->mci_state == MCIS_CLOSED)
+ {
+ SuprErrs = oldSuprErrs;
return;
+ }
}
/* now actually close the connection and pick up the zombie */
- i = endmailer(mci, e, m->m_argv);
- if (i != EX_OK)
- syserr("451 smtpquit %s: stat %d", m->m_argv[0], i);
+ (void) endmailer(mci, e, NULL);
+
+ SuprErrs = oldSuprErrs;
}
/*
** SMTPRSET -- send a RSET (reset) command
@@ -724,8 +773,14 @@ reply(m, mci, e, timeout, pfunc)
#ifdef XDEBUG
{
char wbuf[MAXLINE];
- sprintf(wbuf, "%s... reply(%s) during %s",
- e->e_to, mci->mci_host, SmtpPhase);
+ char *p = wbuf;
+ if (e->e_to != NULL)
+ {
+ sprintf(p, "%s... ", e->e_to);
+ p += strlen(p);
+ }
+ sprintf(p, "reply(%s) during %s",
+ mci->mci_host, SmtpPhase);
checkfd012(wbuf);
}
#endif
@@ -739,6 +794,14 @@ reply(m, mci, e, timeout, pfunc)
(bufp[0] == '5' && strncmp(SmtpMsgBuffer, "EHLO", 4) != 0)))
{
/* serious error -- log the previous command */
+ if (SmtpNeedIntro)
+ {
+ /* inform user who we are chatting with */
+ fprintf(CurEnv->e_xfp,
+ "... while talking to %s:\n",
+ CurHostName);
+ SmtpNeedIntro = FALSE;
+ }
if (SmtpMsgBuffer[0] != '\0')
fprintf(e->e_xfp, ">>> %s\n", SmtpMsgBuffer);
SmtpMsgBuffer[0] = '\0';
diff --git a/usr.sbin/sendmail/src/util.c b/usr.sbin/sendmail/src/util.c
index 453a1adc0d7f..ca7612d7673b 100644
--- a/usr.sbin/sendmail/src/util.c
+++ b/usr.sbin/sendmail/src/util.c
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)util.c 8.3 (Berkeley) 7/13/93";
+static char sccsid[] = "@(#)util.c 8.34 (Berkeley) 3/11/94";
#endif /* not lint */
# include "sendmail.h"
@@ -403,8 +403,13 @@ buildfname(gecos, login, buf)
**
** Parameters:
** fn -- filename to check.
-** uid -- uid to compare against.
-** mustown -- to be safe, this uid must own the file.
+** uid -- user id to compare against.
+** gid -- group id to compare against.
+** uname -- user name to compare against (used for group
+** sets).
+** flags -- modifiers:
+** SFF_MUSTOWN -- "uid" must own this file.
+** SFF_NOSLINK -- file cannot be a symbolic link.
** mode -- mode bits that must match.
**
** Returns:
@@ -415,69 +420,144 @@ buildfname(gecos, login, buf)
** none.
*/
+#include <grp.h>
+
#ifndef S_IXOTH
# define S_IXOTH (S_IEXEC >> 6)
#endif
+#ifndef S_IXGRP
+# define S_IXGRP (S_IEXEC >> 3)
+#endif
+
#ifndef S_IXUSR
# define S_IXUSR (S_IEXEC)
#endif
int
-safefile(fn, uid, mustown, mode)
+safefile(fn, uid, gid, uname, flags, mode)
char *fn;
uid_t uid;
- bool mustown;
+ gid_t gid;
+ char *uname;
+ int flags;
int mode;
{
register char *p;
+ register struct group *gr = NULL;
struct stat stbuf;
if (tTd(54, 4))
- printf("safefile(%s, %d, %d, %o): ", fn, uid, mustown, mode);
+ printf("safefile(%s, uid=%d, gid=%d, flags=%x, mode=%o):\n",
+ fn, uid, gid, flags, mode);
errno = 0;
for (p = fn; (p = strchr(++p, '/')) != NULL; *p = '/')
{
*p = '\0';
- if (stat(fn, &stbuf) < 0 ||
- !bitset(stbuf.st_uid == uid ? S_IXUSR : S_IXOTH,
- stbuf.st_mode))
+ if (stat(fn, &stbuf) < 0)
+ break;
+ if (uid == 0 && !bitset(SFF_ROOTOK, flags))
+ {
+ if (bitset(S_IXOTH, stbuf.st_mode))
+ continue;
+ break;
+ }
+ if (stbuf.st_uid == uid && bitset(S_IXUSR, stbuf.st_mode))
+ continue;
+ if (stbuf.st_gid == gid && bitset(S_IXGRP, stbuf.st_mode))
+ continue;
+#ifndef NO_GROUP_SET
+ if (uname != NULL &&
+ ((gr != NULL && gr->gr_gid == stbuf.st_gid) ||
+ (gr = getgrgid(stbuf.st_gid)) != NULL))
{
- int ret = errno;
-
- if (ret == 0)
- ret = EACCES;
- if (tTd(54, 4))
- printf("[dir %s] %s\n", fn, errstring(ret));
- *p = '/';
- return ret;
+ register char **gp;
+
+ for (gp = gr->gr_mem; *gp != NULL; gp++)
+ if (strcmp(*gp, uname) == 0)
+ break;
+ if (*gp != NULL && bitset(S_IXGRP, stbuf.st_mode))
+ continue;
}
+#endif
+ if (!bitset(S_IXOTH, stbuf.st_mode))
+ break;
+ }
+ if (p != NULL)
+ {
+ int ret = errno;
+
+ if (ret == 0)
+ ret = EACCES;
+ if (tTd(54, 4))
+ printf("\t[dir %s] %s\n", fn, errstring(ret));
+ *p = '/';
+ return ret;
}
+#ifdef HASLSTAT
+ if ((bitset(SFF_NOSLINK, flags) ? lstat(fn, &stbuf)
+ : stat(fn, &stbuf)) < 0)
+#else
if (stat(fn, &stbuf) < 0)
+#endif
{
int ret = errno;
if (tTd(54, 4))
- printf("%s\n", errstring(ret));
+ printf("\t%s\n", errstring(ret));
errno = 0;
return ret;
}
- if (stbuf.st_uid != uid || uid == 0 || !mustown)
+
+#ifdef S_ISLNK
+ if (bitset(SFF_NOSLINK, flags) && S_ISLNK(stbuf.st_mode))
+ {
+ if (tTd(54, 4))
+ printf("\t[slink mode %o]\tEPERM\n", stbuf.st_mode);
+ return EPERM;
+ }
+#endif
+
+ if (uid == 0 && !bitset(SFF_ROOTOK, flags))
mode >>= 6;
+ else if (stbuf.st_uid != uid)
+ {
+ mode >>= 3;
+ if (stbuf.st_gid == gid)
+ ;
+#ifndef NO_GROUP_SET
+ else if (uname != NULL &&
+ ((gr != NULL && gr->gr_gid == stbuf.st_gid) ||
+ (gr = getgrgid(stbuf.st_gid)) != NULL))
+ {
+ register char **gp;
+
+ for (gp = gr->gr_mem; *gp != NULL; gp++)
+ if (strcmp(*gp, uname) == 0)
+ break;
+ if (*gp == NULL)
+ mode >>= 3;
+ }
+#endif
+ else
+ mode >>= 3;
+ }
if (tTd(54, 4))
- printf("[uid %d, stat %o] ", stbuf.st_uid, stbuf.st_mode);
- if ((stbuf.st_uid == uid || uid == 0 || !mustown) &&
+ printf("\t[uid %d, stat %o, mode %o] ",
+ stbuf.st_uid, stbuf.st_mode, mode);
+ if ((stbuf.st_uid == uid || stbuf.st_uid == 0 ||
+ !bitset(SFF_MUSTOWN, flags)) &&
(stbuf.st_mode & mode) == mode)
{
if (tTd(54, 4))
- printf("OK\n");
+ printf("\tOK\n");
return 0;
}
if (tTd(54, 4))
- printf("EACCES\n");
+ printf("\tEACCES\n");
return EACCES;
}
/*
@@ -564,8 +644,16 @@ dfopen(filename, omode, cmode)
fd = open(filename, omode, cmode);
if (fd >= 0)
break;
- if (errno != ENFILE && errno != EINTR)
- break;
+ switch (errno)
+ {
+ case ENFILE: /* system file table full */
+ case EINTR: /* interrupted syscall */
+#ifdef ETXTBSY
+ case ETXTBSY: /* Apollo: net file locked */
+#endif
+ continue;
+ }
+ break;
}
if (fd >= 0 && fstat(fd, &st) >= 0 && S_ISREG(st.st_mode))
{
@@ -576,7 +664,7 @@ dfopen(filename, omode, cmode)
locktype = LOCK_EX;
else
locktype = LOCK_SH;
- (void) lockfile(fd, filename, locktype);
+ (void) lockfile(fd, filename, NULL, locktype);
errno = 0;
}
if (fd < 0)
@@ -592,8 +680,7 @@ dfopen(filename, omode, cmode)
**
** Parameters:
** l -- line to put.
-** fp -- file to put it onto.
-** m -- the mailer used to control output.
+** mci -- the mailer connection information.
**
** Returns:
** none
@@ -602,16 +689,16 @@ dfopen(filename, omode, cmode)
** output of l to fp.
*/
-putline(l, fp, m)
+putline(l, mci)
register char *l;
- FILE *fp;
- MAILER *m;
+ register MCI *mci;
{
register char *p;
register char svchar;
+ int slop = 0;
/* strip out 0200 bits -- these can look like TELNET protocol */
- if (bitnset(M_7BITS, m->m_flags))
+ if (bitset(MCIF_7BIT, mci->mci_flags))
{
for (p = l; (svchar = *p) != '\0'; ++p)
if (bitset(0200, svchar))
@@ -629,40 +716,45 @@ putline(l, fp, m)
fprintf(TrafficLogFile, "%05d >>> ", getpid());
/* check for line overflow */
- while (m->m_linelimit > 0 && (p - l) > m->m_linelimit)
+ while (mci->mci_mailer->m_linelimit > 0 &&
+ (p - l + slop) > mci->mci_mailer->m_linelimit)
{
- register char *q = &l[m->m_linelimit - 1];
+ register char *q = &l[mci->mci_mailer->m_linelimit - slop - 1];
svchar = *q;
*q = '\0';
- if (l[0] == '.' && bitnset(M_XDOT, m->m_flags))
+ if (l[0] == '.' && slop == 0 &&
+ bitnset(M_XDOT, mci->mci_mailer->m_flags))
{
- (void) putc('.', fp);
+ (void) putc('.', mci->mci_out);
if (TrafficLogFile != NULL)
(void) putc('.', TrafficLogFile);
}
- fputs(l, fp);
- (void) putc('!', fp);
- fputs(m->m_eol, fp);
+ fputs(l, mci->mci_out);
+ (void) putc('!', mci->mci_out);
+ fputs(mci->mci_mailer->m_eol, mci->mci_out);
+ (void) putc(' ', mci->mci_out);
if (TrafficLogFile != NULL)
- fprintf(TrafficLogFile, "%s!\n%05d >>> ",
+ fprintf(TrafficLogFile, "%s!\n%05d >>> ",
l, getpid());
*q = svchar;
l = q;
+ slop = 1;
}
/* output last part */
- if (l[0] == '.' && bitnset(M_XDOT, m->m_flags))
+ if (l[0] == '.' && slop == 0 &&
+ bitnset(M_XDOT, mci->mci_mailer->m_flags))
{
- (void) putc('.', fp);
+ (void) putc('.', mci->mci_out);
if (TrafficLogFile != NULL)
(void) putc('.', TrafficLogFile);
}
if (TrafficLogFile != NULL)
fprintf(TrafficLogFile, "%.*s\n", p - l, l);
for ( ; l < p; ++l)
- (void) putc(*l, fp);
- fputs(m->m_eol, fp);
+ (void) putc(*l, mci->mci_out);
+ fputs(mci->mci_mailer->m_eol, mci->mci_out);
if (*l == '\n')
++l;
} while (l[0] != '\0');
@@ -716,6 +808,10 @@ xfclose(fp, a, b)
{
if (tTd(53, 99))
printf("xfclose(%x) %s %s\n", fp, a, b);
+#ifdef XDEBUG
+ if (fileno(fp) == 1)
+ syserr("xfclose(%s %s): fd = 1", a, b);
+#endif
if (fclose(fp) < 0 && tTd(53, 99))
printf("xfclose FAILURE: %s\n", errstring(errno));
}
@@ -739,6 +835,7 @@ xfclose(fp, a, b)
*/
static jmp_buf CtxReadTimeout;
+static int readtimeout();
char *
sfgets(buf, siz, fp, timeout, during)
@@ -750,7 +847,12 @@ sfgets(buf, siz, fp, timeout, during)
{
register EVENT *ev = NULL;
register char *p;
- static int readtimeout();
+
+ if (fp == NULL)
+ {
+ buf[0] = '\0';
+ return NULL;
+ }
/* set the timeout */
if (timeout != 0)
@@ -776,12 +878,13 @@ sfgets(buf, siz, fp, timeout, during)
/* try to read */
p = NULL;
- while (p == NULL && !feof(fp) && !ferror(fp))
+ while (!feof(fp) && !ferror(fp))
{
errno = 0;
p = fgets(buf, siz, fp);
- if (errno == EINTR)
- clearerr(fp);
+ if (p != NULL || errno != EINTR)
+ break;
+ clearerr(fp);
}
/* clear the event if it has not sprung */
@@ -927,7 +1030,7 @@ bool
atobool(s)
register char *s;
{
- if (*s == '\0' || strchr("tTyY", *s) != NULL)
+ if (s == NULL || *s == '\0' || strchr("tTyY", *s) != NULL)
return (TRUE);
return (FALSE);
}
@@ -968,10 +1071,15 @@ atooct(s)
** none.
*/
+int
waitfor(pid)
int pid;
{
+#ifdef WAITUNION
+ union wait st;
+#else
auto int st;
+#endif
int i;
do
@@ -980,8 +1088,12 @@ waitfor(pid)
i = wait(&st);
} while ((i >= 0 || errno == EINTR) && i != pid);
if (i < 0)
- st = -1;
- return (st);
+ return -1;
+#ifdef WAITUNION
+ return st.w_status;
+#else
+ return st;
+#endif
}
/*
** BITINTERSECT -- tell if two bitmaps intersect
@@ -1051,18 +1163,23 @@ strcontainedin(a, b)
register char *a;
register char *b;
{
- int l;
-
- l = strlen(a);
- for (;;)
+ int la;
+ int lb;
+ int c;
+
+ la = strlen(a);
+ lb = strlen(b);
+ c = *a;
+ if (isascii(c) && isupper(c))
+ c = tolower(c);
+ for (; lb-- >= la; b++)
{
- b = strchr(b, a[0]);
- if (b == NULL)
- return FALSE;
- if (strncmp(a, b, l) == 0)
+ if (*b != c && isascii(*b) && isupper(*b) && tolower(*b) != c)
+ continue;
+ if (strncasecmp(a, b, la) == 0)
return TRUE;
- b++;
}
+ return FALSE;
}
/*
** CHECKFD012 -- check low numbered file descriptors
@@ -1086,7 +1203,7 @@ checkfd012(where)
for (i = 0; i < 3; i++)
{
- if (fstat(i, &stbuf) < 0)
+ if (fstat(i, &stbuf) < 0 && errno != EOPNOTSUPP)
{
/* oops.... */
int fd;
@@ -1100,5 +1217,197 @@ checkfd012(where)
}
}
}
-#endif XDEBUG
+#endif /* XDEBUG */
+}
+ /*
+** PRINTOPENFDS -- print the open file descriptors (for debugging)
+**
+** Parameters:
+** logit -- if set, send output to syslog; otherwise
+** print for debugging.
+**
+** Returns:
+** none.
+*/
+
+#include <netdb.h>
+#include <arpa/inet.h>
+
+printopenfds(logit)
+ bool logit;
+{
+ register int fd;
+ extern int DtableSize;
+
+ for (fd = 0; fd < DtableSize; fd++)
+ dumpfd(fd, FALSE, logit);
+}
+ /*
+** DUMPFD -- dump a file descriptor
+**
+** Parameters:
+** fd -- the file descriptor to dump.
+** printclosed -- if set, print a notification even if
+** it is closed; otherwise print nothing.
+** logit -- if set, send output to syslog instead of stdout.
+*/
+
+dumpfd(fd, printclosed, logit)
+ int fd;
+ bool printclosed;
+ bool logit;
+{
+ register struct hostent *hp;
+ register char *p;
+ struct sockaddr_in sin;
+ auto int slen;
+ struct stat st;
+ char buf[200];
+
+ p = buf;
+ sprintf(p, "%3d: ", fd);
+ p += strlen(p);
+
+ if (fstat(fd, &st) < 0)
+ {
+ if (printclosed || errno != EBADF)
+ {
+ sprintf(p, "CANNOT STAT (%s)", errstring(errno));
+ goto printit;
+ }
+ return;
+ }
+
+ slen = fcntl(fd, F_GETFL, NULL);
+ if (slen != -1)
+ {
+ sprintf(p, "fl=0x%x, ", slen);
+ p += strlen(p);
+ }
+
+ sprintf(p, "mode=%o: ", st.st_mode);
+ p += strlen(p);
+ switch (st.st_mode & S_IFMT)
+ {
+#ifdef S_IFSOCK
+ case S_IFSOCK:
+ sprintf(p, "SOCK ");
+ p += strlen(p);
+ slen = sizeof sin;
+ if (getsockname(fd, (struct sockaddr *) &sin, &slen) < 0)
+ sprintf(p, "(badsock)");
+ else
+ {
+ hp = gethostbyaddr((char *) &sin.sin_addr, slen, AF_INET);
+ sprintf(p, "%s/%d", hp == NULL ? inet_ntoa(sin.sin_addr)
+ : hp->h_name, ntohs(sin.sin_port));
+ }
+ p += strlen(p);
+ sprintf(p, "->");
+ p += strlen(p);
+ slen = sizeof sin;
+ if (getpeername(fd, (struct sockaddr *) &sin, &slen) < 0)
+ sprintf(p, "(badsock)");
+ else
+ {
+ hp = gethostbyaddr((char *) &sin.sin_addr, slen, AF_INET);
+ sprintf(p, "%s/%d", hp == NULL ? inet_ntoa(sin.sin_addr)
+ : hp->h_name, ntohs(sin.sin_port));
+ }
+ break;
+#endif
+
+ case S_IFCHR:
+ sprintf(p, "CHR: ");
+ p += strlen(p);
+ goto defprint;
+
+ case S_IFBLK:
+ sprintf(p, "BLK: ");
+ p += strlen(p);
+ goto defprint;
+
+#if defined(S_IFIFO) && (!defined(S_IFSOCK) || S_IFIFO != S_IFSOCK)
+ case S_IFIFO:
+ sprintf(p, "FIFO: ");
+ p += strlen(p);
+ goto defprint;
+#endif
+
+#ifdef S_IFDIR
+ case S_IFDIR:
+ sprintf(p, "DIR: ");
+ p += strlen(p);
+ goto defprint;
+#endif
+
+#ifdef S_IFLNK
+ case S_IFLNK:
+ sprintf(p, "LNK: ");
+ p += strlen(p);
+ goto defprint;
+#endif
+
+ default:
+defprint:
+ sprintf(p, "dev=%d/%d, ino=%d, nlink=%d, u/gid=%d/%d, size=%ld",
+ major(st.st_dev), minor(st.st_dev), st.st_ino,
+ st.st_nlink, st.st_uid, st.st_gid, st.st_size);
+ break;
+ }
+
+printit:
+ if (logit)
+ syslog(LOG_DEBUG, "%s", buf);
+ else
+ printf("%s\n", buf);
+}
+ /*
+** SHORTENSTRING -- return short version of a string
+**
+** If the string is already short, just return it. If it is too
+** long, return the head and tail of the string.
+**
+** Parameters:
+** s -- the string to shorten.
+** m -- the max length of the string.
+**
+** Returns:
+** Either s or a short version of s.
+*/
+
+#ifndef MAXSHORTSTR
+# define MAXSHORTSTR 203
+#endif
+
+char *
+shortenstring(s, m)
+ register char *s;
+ int m;
+{
+ int l;
+ static char buf[MAXSHORTSTR + 1];
+
+ l = strlen(s);
+ if (l < m)
+ return s;
+ if (m > MAXSHORTSTR)
+ m = MAXSHORTSTR;
+ else if (m < 10)
+ {
+ if (m < 5)
+ {
+ strncpy(buf, s, m);
+ buf[m] = '\0';
+ return buf;
+ }
+ strncpy(buf, s, m - 3);
+ strcpy(buf + m - 3, "...");
+ return buf;
+ }
+ m = (m - 3) / 2;
+ strncpy(buf, s, m);
+ strcpy(buf + m, "...");
+ strcpy(buf + m + 3, s + l - m);
+ return buf;
}
diff --git a/usr.sbin/sendmail/src/version.c b/usr.sbin/sendmail/src/version.c
index b3cb8a5f6426..1ff28a958b9c 100644
--- a/usr.sbin/sendmail/src/version.c
+++ b/usr.sbin/sendmail/src/version.c
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)version.c 8.3 (Berkeley) 7/13/93";
+static char sccsid[] = "@(#)version.c 8.6.8.1 (Berkeley) 3/18/94";
#endif /* not lint */
-char Version[] = "8.3";
+char Version[] = "8.6.8";
diff --git a/usr.sbin/spkrtest/Makefile b/usr.sbin/spkrtest/Makefile
new file mode 100644
index 000000000000..fac0040a597e
--- /dev/null
+++ b/usr.sbin/spkrtest/Makefile
@@ -0,0 +1,9 @@
+NOMAN= noman
+
+clean depend lint tags obj:
+
+install:
+ install -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
+ ${.CURDIR}/spkrtest.sh ${DESTDIR}/${BINDIR}/spkrtest
+
+.include <bsd.prog.mk>
diff --git a/usr.sbin/spkrtest/spkrtest.sh b/usr.sbin/spkrtest/spkrtest.sh
new file mode 100644
index 000000000000..319f3526760a
--- /dev/null
+++ b/usr.sbin/spkrtest/spkrtest.sh
@@ -0,0 +1,38 @@
+:
+#
+# Test script for the speaker driver
+#
+# v1.0 by Eric S. Raymond (Feb 1990)
+# v1.1 rightstuff contributed by Eric S. Tiedemann (est@snark.thyrsus.com)
+#
+reveille="t255l8c.f.afc~c.f.afc~c.f.afc.f.a..f.~c.f.afc~c.f.afc~c.f.afc~c.f.."
+contact="<cd<a#~<a#>f"
+dance="t240<cfcfgagaa#b#>dc<a#a.~fg.gaa#.agagegc.~cfcfgagaa#b#>dc<a#a.~fg.gga.agfgfgf."
+loony="t255cf8f8edc<a>~cf8f8edd#e~ce8cdce8cd.<a>c8c8c#def8af8"
+sinister="mst200o2ola.l8bc.~a.~>l2d#"
+rightstuff="olcega.a8f>cd2bgc.c8dee2"
+toccata="msl16oldcd4mll8pcb-agf+4.g4p4<msl16dcd4mll8pa.a+f+4p16g4"
+startrek="l2b.f+.p16a.c+.p l4mn<b.>e8a2mspg+e8c+f+8b2"
+
+case $1 in
+reveille) echo $reveille >/dev/speaker;;
+contact) echo $contact >/dev/speaker;;
+dance) echo $dance >/dev/speaker;;
+loony) echo $loony >/dev/speaker;;
+sinister) echo $sinister >/dev/speaker;;
+rightstuff) echo $rightstuff >/dev/speaker;;
+toccata) echo $toccata >/dev/speaker;;
+startrek) echo $startrek >/dev/speaker;;
+*)
+ echo "No such tune. Available tunes are:"
+ echo
+ echo "reveille -- Reveille"
+ echo "contact -- Contact theme from Close Encounters"
+ echo "dance -- Lord of the Dance (aka Simple Gifts)"
+ echo "loony -- Loony Toons theme"
+ echo "sinister -- standard villain's entrance music"
+ echo "rightstuff -- a trope from \"The Right Stuff\" score by Bill Conti"
+ echo "toccata -- opening bars of Bach's Toccata and Fugue in D Minor"
+ echo "startrek -- opening bars of the theme from Star Trek Classic"
+ ;;
+esac
diff --git a/usr.sbin/swapinfo/swapinfo.c b/usr.sbin/swapinfo/swapinfo.c
index 55936ded298c..148094b6e354 100644
--- a/usr.sbin/swapinfo/swapinfo.c
+++ b/usr.sbin/swapinfo/swapinfo.c
@@ -18,9 +18,10 @@
#include <sys/uio.h>
#include <sys/buf.h>
#include <sys/conf.h>
-#include <sys/rlist.h> /* swapmap defined here... */
+#include <sys/rlist.h>
#include <nlist.h>
+struct rlist *swapmap;
static struct nlist nl[] = {{"_swapmap"}, /* list of free swap areas */
#define VM_SWAPMAP 0
diff --git a/usr.sbin/timed/timed/timed.c b/usr.sbin/timed/timed/timed.c
index 030a64c6c251..06aab0621353 100644
--- a/usr.sbin/timed/timed/timed.c
+++ b/usr.sbin/timed/timed/timed.c
@@ -198,6 +198,7 @@ char **argv;
port = srvp->s_port;
server.sin_port = srvp->s_port;
server.sin_family = AF_INET;
+ server.sin_addr.s_addr = htonl(INADDR_ANY);
sock = socket(AF_INET, SOCK_DGRAM, 0);
if (sock < 0) {
syslog(LOG_ERR, "socket: %m");
diff --git a/usr.sbin/timed/timedc/timedc.c b/usr.sbin/timed/timedc/timedc.c
index fe136bd01787..a33c2df6d0c6 100644
--- a/usr.sbin/timed/timedc/timedc.c
+++ b/usr.sbin/timed/timedc/timedc.c
@@ -161,6 +161,8 @@ getcmd(name)
longest = 0;
nmatches = 0;
found = 0;
+ if (name == NULL)
+ return NULL;
for (c = cmdtab; c < &cmdtab[NCMDS]; c++) {
p = c->c_name;
for (q = name; *q == *p++; q++)
diff --git a/usr.sbin/trpt/trpt.c b/usr.sbin/trpt/trpt.c
index e7b92a110da2..017418679f78 100644
--- a/usr.sbin/trpt/trpt.c
+++ b/usr.sbin/trpt/trpt.c
@@ -38,7 +38,9 @@ char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)trpt.c 5.14 (Berkeley) 7/1/91";
+static char sccsid[] = "From: @(#)trpt.c 5.14 (Berkeley) 7/1/91";
+static const char rcsid[] =
+ "$Id: trpt.c,v 1.2 1993/11/09 23:03:33 wollman Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -81,6 +83,9 @@ static char sccsid[] = "@(#)trpt.c 5.14 (Berkeley) 7/1/91";
#include <nlist.h>
#include <paths.h>
+struct tcp_debug tcp_debug[TCP_NDEBUG];
+int tcp_debx;
+
struct nlist nl[] = {
#define N_TCP_DEBUG 0
{ "_tcp_debug" },
diff --git a/usr.sbin/update/Makefile b/usr.sbin/update/Makefile
deleted file mode 100644
index 5f29640740f9..000000000000
--- a/usr.sbin/update/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-# @(#)Makefile 5.5 (Berkeley) 6/29/90
-
-PROG= update
-MAN8= update.8
-LDADD= -lutil
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/yp/Makefile b/usr.sbin/yp/Makefile
new file mode 100644
index 000000000000..5728c48fe1a2
--- /dev/null
+++ b/usr.sbin/yp/Makefile
@@ -0,0 +1,10 @@
+# from: @(#)Makefile 5.8 (Berkeley) 7/28/90
+# Makefile,v 1.4 1993/07/30 11:11:03 mycroft Exp
+
+NOPROG=
+MAN8= yp.8
+
+CFLAGS+=-DYP
+SUBDIR= ypbind ypwhich ypcat ypmatch ypset yppoll # yppasswd
+
+.include <bsd.prog.mk>
diff --git a/usr.sbin/yp/yp.8 b/usr.sbin/yp/yp.8
new file mode 100644
index 000000000000..f25f3868325a
--- /dev/null
+++ b/usr.sbin/yp/yp.8
@@ -0,0 +1,73 @@
+.\" Copyright (c) 1992/3 Theo de Raadt <deraadt@fsa.ca>
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. The name of the author may not be used to endorse or promote
+.\" products derived from this software without specific prior written
+.\" permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" from: @(#)yp.8 1.0 (deraadt) 4/26/93
+.\" $Id: yp.8,v 1.2 1994/01/11 19:01:20 nate Exp $
+.\"
+.Dd April 5, 1993
+.Dt YP 8
+.Os BSD 4.2
+.Sh NAME
+.Nm yp
+.Nd description of the YP system
+.Sh SYNOPSIS
+.Nm yp
+.Sh DESCRIPTION
+The
+.Nm YP
+subsystem allows network management of passwd and group file
+entries through the functions getpwent(3) and getgrent(3).
+The
+.Nm YP
+subsystem is started automatically in
+.Nm /etc/netstart
+if the directory
+.Nm /var/yp
+exists.
+.Sh BUGS
+Only
+.Nm YP
+client functionality exists -- the server code has not yet been
+written. Brave folk can contact the author.
+
+.Nm /etc/passwd
+and
+.Nm /etc/group only supports "+" entries.
+
+Many more manual pages should be written, especially ypclnt(3).
+For the time being, seek out a local Sun machine and read the
+manuals for there.
+
+Neither Sun nor this author have found a clean way to handle
+the problems that occur when ypbind cannot find its server
+upon bootup.
+.Sh HISTORY
+The
+.Nm YP
+subsystem was written from the ground up by Theo de Raadt
+to be compatible to Sun's implimentation. No Sun code was
+referenced.
diff --git a/usr.sbin/yp/ypbind/Makefile b/usr.sbin/yp/ypbind/Makefile
new file mode 100644
index 000000000000..03cd158903d8
--- /dev/null
+++ b/usr.sbin/yp/ypbind/Makefile
@@ -0,0 +1,9 @@
+# from: @(#)Makefile 5.8 (Berkeley) 7/28/90
+# $Id: Makefile,v 1.2 1994/02/17 07:06:06 rgrimes Exp $
+
+PROG= ypbind
+NOMAN=
+CFLAGS+=-DDAEMON
+
+.include <bsd.prog.mk>
+.include "../../Makefile.inc"
diff --git a/usr.sbin/yp/ypbind/ypbind.c b/usr.sbin/yp/ypbind/ypbind.c
new file mode 100644
index 000000000000..18cfd642861a
--- /dev/null
+++ b/usr.sbin/yp/ypbind/ypbind.c
@@ -0,0 +1,672 @@
+/*
+ * Copyright (c) 1992/3 Theo de Raadt <deraadt@fsa.ca>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef LINT
+static char rcsid[] = "$Id: ypbind.c,v 1.2 1994/01/11 19:01:23 nate Exp $";
+#endif
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/signal.h>
+#include <sys/socket.h>
+#include <sys/file.h>
+#include <sys/fcntl.h>
+#include <sys/uio.h>
+#include <sys/syslog.h>
+#include <stdio.h>
+#include <errno.h>
+#include <ctype.h>
+#include <dirent.h>
+#include <netdb.h>
+#include <string.h>
+#include <rpc/rpc.h>
+#include <rpc/xdr.h>
+#include <net/if.h>
+#include <arpa/inet.h>
+#include <rpc/pmap_clnt.h>
+#include <rpc/pmap_prot.h>
+#include <rpc/pmap_rmt.h>
+#include <unistd.h>
+#include <rpcsvc/yp_prot.h>
+#include <rpcsvc/ypclnt.h>
+
+#ifndef BINDINGDIR
+#define BINDINGDIR "/var/yp/binding"
+#endif
+
+struct _dom_binding {
+ struct _dom_binding *dom_pnext;
+ char dom_domain[YPMAXDOMAIN + 1];
+ struct sockaddr_in dom_server_addr;
+ unsigned short int dom_server_port;
+ int dom_socket;
+ CLIENT *dom_client;
+ long int dom_vers;
+ time_t dom_check_t;
+ int dom_lockfd;
+ int dom_alive;
+};
+
+extern bool_t xdr_domainname(), xdr_ypbind_resp();
+extern bool_t xdr_ypreq_key(), xdr_ypresp_val();
+extern bool_t xdr_ypbind_setdom();
+
+char *domainname;
+
+struct _dom_binding *ypbindlist;
+int check;
+
+#define YPSET_NO 0
+#define YPSET_LOCAL 1
+#define YPSET_ALL 2
+int ypsetmode = YPSET_NO;
+
+int rpcsock;
+struct rmtcallargs rmtca;
+struct rmtcallres rmtcr;
+char rmtcr_outval;
+u_long rmtcr_port;
+SVCXPRT *udptransp, *tcptransp;
+
+void *
+ypbindproc_null_2(transp, argp, clnt)
+SVCXPRT *transp;
+void *argp;
+CLIENT *clnt;
+{
+ static char res;
+
+ bzero((char *)&res, sizeof(res));
+ return (void *)&res;
+}
+
+struct ypbind_resp *
+ypbindproc_domain_2(transp, argp, clnt)
+SVCXPRT *transp;
+char *argp;
+CLIENT *clnt;
+{
+ static struct ypbind_resp res;
+ struct _dom_binding *ypdb;
+ char path[MAXPATHLEN];
+
+ bzero((char *)&res, sizeof res);
+ res.ypbind_status = YPBIND_FAIL_VAL;
+
+ for(ypdb=ypbindlist; ypdb; ypdb=ypdb->dom_pnext)
+ if( strcmp(ypdb->dom_domain, argp) == 0)
+ break;
+
+ if(ypdb==NULL) {
+ ypdb = (struct _dom_binding *)malloc(sizeof *ypdb);
+ bzero((char *)ypdb, sizeof *ypdb);
+ strncpy(ypdb->dom_domain, argp, sizeof ypdb->dom_domain);
+ ypdb->dom_vers = YPVERS;
+ ypdb->dom_alive = 0;
+ ypdb->dom_lockfd = -1;
+ sprintf(path, "%s/%s.%d", BINDINGDIR, ypdb->dom_domain, ypdb->dom_vers);
+ unlink(path);
+ ypdb->dom_pnext = ypbindlist;
+ ypbindlist = ypdb;
+ check++;
+ return NULL;
+ }
+
+ if(ypdb->dom_alive==0)
+ return NULL;
+
+#if 0
+ delta = ypdb->dom_check_t - ypdb->dom_ask_t;
+ if( !(ypdb->dom_ask_t==0 || delta > 5)) {
+ ypdb->dom_ask_t = time(NULL);
+ /*
+ * Hmm. More than 2 requests in 5 seconds have indicated that my
+ * binding is possibly incorrect. Ok, make myself unalive, and
+ * find out what the actual state is.
+ */
+ if(ypdb->dom_lockfd!=-1)
+ close(ypdb->dom_lockfd);
+ ypdb->dom_lockfd = -1;
+ ypdb->dom_alive = 0;
+ ypdb->dom_lockfd = -1;
+ sprintf(path, "%s/%s.%d", BINDINGDIR, ypdb->dom_domain, ypdb->dom_vers);
+ unlink(path);
+ check++;
+ return NULL;
+ }
+#endif
+
+answer:
+ res.ypbind_status = YPBIND_SUCC_VAL;
+ res.ypbind_respbody.ypbind_bindinfo.ypbind_binding_addr.s_addr =
+ ypdb->dom_server_addr.sin_addr.s_addr;
+ res.ypbind_respbody.ypbind_bindinfo.ypbind_binding_port =
+ ypdb->dom_server_port;
+ /*printf("domain %s at %s/%d\n", ypdb->dom_domain,
+ inet_ntoa(ypdb->dom_server_addr.sin_addr),
+ ntohs(ypdb->dom_server_addr.sin_port));*/
+ return &res;
+}
+
+bool_t *
+ypbindproc_setdom_2(transp, argp, clnt)
+SVCXPRT *transp;
+struct ypbind_setdom *argp;
+CLIENT *clnt;
+{
+ struct sockaddr_in *fromsin, bindsin;
+ char res;
+
+ bzero((char *)&res, sizeof(res));
+ fromsin = svc_getcaller(transp);
+
+ switch(ypsetmode) {
+ case YPSET_LOCAL:
+ if( fromsin->sin_addr.s_addr != htonl(INADDR_LOOPBACK))
+ return (void *)NULL;
+ break;
+ case YPSET_ALL:
+ break;
+ case YPSET_NO:
+ default:
+ return (void *)NULL;
+ }
+
+ if(ntohs(fromsin->sin_port) >= IPPORT_RESERVED)
+ return (void *)&res;
+
+ if(argp->ypsetdom_vers != YPVERS)
+ return (void *)&res;
+
+ bzero((char *)&bindsin, sizeof bindsin);
+ bindsin.sin_family = AF_INET;
+ bindsin.sin_addr.s_addr = argp->ypsetdom_addr.s_addr;
+ bindsin.sin_port = argp->ypsetdom_port;
+ rpc_received(argp->ypsetdom_domain, &bindsin, 1);
+
+ res = 1;
+ return (void *)&res;
+}
+
+static void
+ypbindprog_2(rqstp, transp)
+struct svc_req *rqstp;
+register SVCXPRT *transp;
+{
+ union {
+ char ypbindproc_domain_2_arg[MAXHOSTNAMELEN];
+ struct ypbind_setdom ypbindproc_setdom_2_arg;
+ } argument;
+ struct authunix_parms *creds;
+ char *result;
+ bool_t (*xdr_argument)(), (*xdr_result)();
+ char *(*local)();
+
+ switch (rqstp->rq_proc) {
+ case YPBINDPROC_NULL:
+ xdr_argument = xdr_void;
+ xdr_result = xdr_void;
+ local = (char *(*)()) ypbindproc_null_2;
+ break;
+
+ case YPBINDPROC_DOMAIN:
+ xdr_argument = xdr_domainname;
+ xdr_result = xdr_ypbind_resp;
+ local = (char *(*)()) ypbindproc_domain_2;
+ break;
+
+ case YPBINDPROC_SETDOM:
+ switch(rqstp->rq_cred.oa_flavor) {
+ case AUTH_UNIX:
+ creds = (struct authunix_parms *)rqstp->rq_clntcred;
+ if( creds->aup_uid != 0) {
+ svcerr_auth(transp, AUTH_BADCRED);
+ return;
+ }
+ break;
+ default:
+ svcerr_auth(transp, AUTH_TOOWEAK);
+ return;
+ }
+
+ xdr_argument = xdr_ypbind_setdom;
+ xdr_result = xdr_void;
+ local = (char *(*)()) ypbindproc_setdom_2;
+ break;
+
+ default:
+ svcerr_noproc(transp);
+ return;
+ }
+ bzero((char *)&argument, sizeof(argument));
+ if (!svc_getargs(transp, xdr_argument, &argument)) {
+ svcerr_decode(transp);
+ return;
+ }
+ result = (*local)(transp, &argument, rqstp);
+ if (result != NULL && !svc_sendreply(transp, xdr_result, result)) {
+ svcerr_systemerr(transp);
+ }
+ return;
+}
+
+main(argc, argv)
+char **argv;
+{
+ char path[MAXPATHLEN];
+ struct timeval tv;
+ fd_set fdsr;
+ int width;
+ int i;
+
+ yp_get_default_domain(&domainname);
+ if( domainname[0] == '\0') {
+ fprintf(stderr, "domainname not set. Aborting.\n");
+ exit(1);
+ }
+
+ for(i=1; i<argc; i++) {
+ if( strcmp("-ypset", argv[i]) == 0)
+ ypsetmode = YPSET_ALL;
+ else if (strcmp("-ypsetme", argv[i]) == 0)
+ ypsetmode = YPSET_LOCAL;
+ }
+
+ /* blow away everything in BINDINGDIR */
+
+
+
+#ifdef DAEMON
+ switch(fork()) {
+ case 0:
+ break;
+ case -1:
+ perror("fork");
+ exit(1);
+ default:
+ exit(0);
+ }
+ setsid();
+#endif
+
+ pmap_unset(YPBINDPROG, YPBINDVERS);
+
+ udptransp = svcudp_create(RPC_ANYSOCK);
+ if (udptransp == NULL) {
+ fprintf(stderr, "cannot create udp service.");
+ exit(1);
+ }
+ if (!svc_register(udptransp, YPBINDPROG, YPBINDVERS, ypbindprog_2,
+ IPPROTO_UDP)) {
+ fprintf(stderr, "unable to register (YPBINDPROG, YPBINDVERS, udp).");
+ exit(1);
+ }
+
+ tcptransp = svctcp_create(RPC_ANYSOCK, 0, 0);
+ if (tcptransp == NULL) {
+ fprintf(stderr, "cannot create tcp service.");
+ exit(1);
+ }
+
+ if (!svc_register(tcptransp, YPBINDPROG, YPBINDVERS, ypbindprog_2,
+ IPPROTO_TCP)) {
+ fprintf(stderr, "unable to register (YPBINDPROG, YPBINDVERS, tcp).");
+ exit(1);
+ }
+
+ if( (rpcsock=socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
+ perror("socket");
+ return -1;
+ }
+
+ fcntl(rpcsock, F_SETFL, fcntl(rpcsock, F_GETFL, 0) | FNDELAY);
+ i = 1;
+ setsockopt(rpcsock, SOL_SOCKET, SO_BROADCAST, &i, sizeof(i));
+ rmtca.prog = YPPROG;
+ rmtca.vers = YPVERS;
+ rmtca.proc = YPPROC_DOMAIN_NONACK;
+ rmtca.xdr_args = NULL; /* set at call time */
+ rmtca.args_ptr = NULL; /* set at call time */
+ rmtcr.port_ptr = &rmtcr_port;
+ rmtcr.xdr_results = xdr_bool;
+ rmtcr.results_ptr = (caddr_t)&rmtcr_outval;
+
+ /* build initial domain binding, make it "unsuccessful" */
+ ypbindlist = (struct _dom_binding *)malloc(sizeof *ypbindlist);
+ bzero((char *)ypbindlist, sizeof *ypbindlist);
+ strncpy(ypbindlist->dom_domain, domainname, sizeof ypbindlist->dom_domain);
+ ypbindlist->dom_vers = YPVERS;
+ ypbindlist->dom_alive = 0;
+ ypbindlist->dom_lockfd = -1;
+ sprintf(path, "%s/%s.%d", BINDINGDIR, ypbindlist->dom_domain,
+ ypbindlist->dom_vers);
+ (void)unlink(path);
+
+ width = getdtablesize();
+ while(1) {
+ fdsr = svc_fdset;
+ FD_SET(rpcsock, &fdsr);
+ tv.tv_sec = 1;
+ tv.tv_usec = 0;
+
+ switch(select(width, &fdsr, NULL, NULL, &tv)) {
+ case 0:
+ checkwork();
+ break;
+ case -1:
+ perror("select\n");
+ break;
+ default:
+ if(FD_ISSET(rpcsock, &fdsr)) {
+ FD_CLR(rpcsock, &fdsr);
+ handle_replies();
+ }
+ svc_getreqset(&fdsr);
+ if(check)
+ checkwork();
+ break;
+ }
+ }
+}
+
+/*
+ * change to do something like this:
+ *
+ * STATE TIME ACTION NEWTIME NEWSTATE
+ * no binding t==* broadcast t=2 no binding
+ * binding t==60 check server t=10 binding
+ * binding t=10 broadcast t=2 no binding
+ */
+checkwork()
+{
+ struct _dom_binding *ypdb;
+ time_t t;
+
+ check = 0;
+
+ time(&t);
+ for(ypdb=ypbindlist; ypdb; ypdb=ypdb->dom_pnext) {
+ if(ypdb->dom_alive==0 || ypdb->dom_check_t < t) {
+ broadcast(ypdb->dom_domain);
+ time(&t);
+ ypdb->dom_check_t = t + 5;
+ }
+ }
+}
+
+broadcast(dom)
+char *dom;
+{
+ struct rpc_msg rpcmsg;
+ char buf[1400], inbuf[8192];
+ enum clnt_stat st;
+ struct timeval tv;
+ int outlen, i, sock, len;
+ struct sockaddr_in bsin;
+ struct ifconf ifc;
+ struct ifreq ifreq, *ifr;
+ struct in_addr in;
+ AUTH *rpcua;
+ XDR rpcxdr;
+
+ rmtca.xdr_args = xdr_domainname;
+ rmtca.args_ptr = dom;
+
+ bzero((char *)&bsin, sizeof bsin);
+ bsin.sin_family = AF_INET;
+ bsin.sin_port = htons(PMAPPORT);
+
+ bzero((char *)&rpcxdr, sizeof rpcxdr);
+ bzero((char *)&rpcmsg, sizeof rpcmsg);
+
+ rpcua = authunix_create_default();
+ if( rpcua == (AUTH *)NULL) {
+ /*printf("cannot get unix auth\n");*/
+ return RPC_SYSTEMERROR;
+ }
+ rpcmsg.rm_direction = CALL;
+ rpcmsg.rm_call.cb_rpcvers = RPC_MSG_VERSION;
+ rpcmsg.rm_call.cb_prog = PMAPPROG;
+ rpcmsg.rm_call.cb_vers = PMAPVERS;
+ rpcmsg.rm_call.cb_proc = PMAPPROC_CALLIT;
+ rpcmsg.rm_call.cb_cred = rpcua->ah_cred;
+ rpcmsg.rm_call.cb_verf = rpcua->ah_verf;
+
+ gettimeofday(&tv, (struct timezone *)0);
+ rpcmsg.rm_xid = (int)dom;
+ tv.tv_usec = 0;
+ xdrmem_create(&rpcxdr, buf, sizeof buf, XDR_ENCODE);
+ if( (!xdr_callmsg(&rpcxdr, &rpcmsg)) ) {
+ st = RPC_CANTENCODEARGS;
+ AUTH_DESTROY(rpcua);
+ return st;
+ }
+ if( (!xdr_rmtcall_args(&rpcxdr, &rmtca)) ) {
+ st = RPC_CANTENCODEARGS;
+ AUTH_DESTROY(rpcua);
+ return st;
+ }
+ outlen = (int)xdr_getpos(&rpcxdr);
+ xdr_destroy(&rpcxdr);
+ if(outlen<1) {
+ AUTH_DESTROY(rpcua);
+ return st;
+ }
+ AUTH_DESTROY(rpcua);
+
+ /* find all networks and send the RPC packet out them all */
+ if( (sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
+ perror("socket");
+ return -1;
+ }
+
+ ifc.ifc_len = sizeof inbuf;
+ ifc.ifc_buf = inbuf;
+ if( ioctl(sock, SIOCGIFCONF, &ifc) < 0) {
+ close(sock);
+ perror("ioctl(SIOCGIFCONF)");
+ return -1;
+ }
+ ifr = ifc.ifc_req;
+ ifreq.ifr_name[0] = '\0';
+ for(i=0; i<ifc.ifc_len; i+=len, ifr=(struct ifreq *)((caddr_t)ifr+len)) {
+#if defined(BSD) && BSD >= 199103
+ len = sizeof ifr->ifr_name + ifr->ifr_addr.sa_len;
+#else
+ len = sizeof ifc.ifc_len / sizeof(struct ifreq);
+#endif
+ ifreq = *ifr;
+ if( ifreq.ifr_addr.sa_family != AF_INET)
+ continue;
+ if( ioctl(sock, SIOCGIFFLAGS, &ifreq) < 0) {
+ perror("ioctl(SIOCGIFFLAGS)");
+ continue;
+ }
+ if( (ifreq.ifr_flags & IFF_UP) == 0)
+ continue;
+
+ ifreq.ifr_flags &= (IFF_LOOPBACK | IFF_BROADCAST);
+ if( ifreq.ifr_flags==IFF_BROADCAST ) {
+ if( ioctl(sock, SIOCGIFBRDADDR, &ifreq) < 0 ) {
+ perror("ioctl(SIOCGIFBRDADDR)");
+ continue;
+ }
+ } else if( ifreq.ifr_flags==IFF_LOOPBACK ) {
+ if( ioctl(sock, SIOCGIFADDR, &ifreq) < 0 ) {
+ perror("ioctl(SIOCGIFADDR)");
+ continue;
+ }
+ } else
+ continue;
+
+ in = ((struct sockaddr_in *)&ifreq.ifr_addr)->sin_addr;
+ bsin.sin_addr = in;
+ if( sendto(rpcsock, buf, outlen, 0, (struct sockaddr *)&bsin,
+ sizeof bsin) < 0 )
+ perror("sendto");
+ }
+ close(sock);
+ return 0;
+}
+
+/*enum clnt_stat*/
+handle_replies()
+{
+ char buf[1400];
+ int fromlen, inlen;
+ struct sockaddr_in raddr;
+ struct rpc_msg msg;
+ XDR xdr;
+
+recv_again:
+ bzero((char *)&xdr, sizeof(xdr));
+ bzero((char *)&msg, sizeof(msg));
+ msg.acpted_rply.ar_verf = _null_auth;
+ msg.acpted_rply.ar_results.where = (caddr_t)&rmtcr;
+ msg.acpted_rply.ar_results.proc = xdr_rmtcallres;
+
+try_again:
+ fromlen = sizeof (struct sockaddr);
+ inlen = recvfrom(rpcsock, buf, sizeof buf, 0,
+ (struct sockaddr *)&raddr, &fromlen);
+ if(inlen<0) {
+ if(errno==EINTR)
+ goto try_again;
+ return RPC_CANTRECV;
+ }
+ if(inlen<sizeof(u_long))
+ goto recv_again;
+
+ /*
+ * see if reply transaction id matches sent id.
+ * If so, decode the results.
+ */
+ xdrmem_create(&xdr, buf, (u_int)inlen, XDR_DECODE);
+ if( xdr_replymsg(&xdr, &msg)) {
+ if( (msg.rm_reply.rp_stat == MSG_ACCEPTED) &&
+ (msg.acpted_rply.ar_stat == SUCCESS)) {
+ raddr.sin_port = htons((u_short)rmtcr_port);
+ rpc_received(msg.rm_xid, &raddr, 0);
+ }
+ }
+ xdr.x_op = XDR_FREE;
+ msg.acpted_rply.ar_results.proc = xdr_void;
+ xdr_destroy(&xdr);
+
+ return RPC_SUCCESS;
+}
+
+/*
+ * LOOPBACK IS MORE IMPORTANT: PUT IN HACK
+ */
+rpc_received(dom, raddrp, force)
+char *dom;
+struct sockaddr_in *raddrp;
+int force;
+{
+ struct _dom_binding *ypdb;
+ struct iovec iov[2];
+ struct ypbind_resp ybr;
+ char path[MAXPATHLEN];
+ int fd;
+
+ /*printf("returned from %s about %s\n", inet_ntoa(raddrp->sin_addr), dom);*/
+
+ if(dom==NULL)
+ return;
+
+ for(ypdb=ypbindlist; ypdb; ypdb=ypdb->dom_pnext)
+ if( strcmp(ypdb->dom_domain, dom) == 0)
+ break;
+
+ if(ypdb==NULL) {
+ if(force==0)
+ return;
+ ypdb = (struct _dom_binding *)malloc(sizeof *ypdb);
+ bzero((char *)ypdb, sizeof *ypdb);
+ strncpy(ypdb->dom_domain, dom, sizeof ypdb->dom_domain);
+ ypdb->dom_lockfd = -1;
+ ypdb->dom_pnext = ypbindlist;
+ ypbindlist = ypdb;
+ }
+
+ /* soft update, alive, less than 30 seconds old */
+ if(ypdb->dom_alive==1 && force==0 && ypdb->dom_check_t<time(NULL)+30)
+ return;
+
+ bcopy((char *)raddrp, (char *)&ypdb->dom_server_addr,
+ sizeof ypdb->dom_server_addr);
+ ypdb->dom_check_t = time(NULL) + 60; /* recheck binding in 60 seconds */
+ ypdb->dom_vers = YPVERS;
+ ypdb->dom_alive = 1;
+
+ if(ypdb->dom_lockfd != -1)
+ close(ypdb->dom_lockfd);
+
+ sprintf(path, "%s/%s.%d", BINDINGDIR,
+ ypdb->dom_domain, ypdb->dom_vers);
+#ifdef O_SHLOCK
+ if( (fd=open(path, O_CREAT|O_SHLOCK|O_RDWR|O_TRUNC, 0644)) == -1) {
+ (void)mkdir(BINDINGDIR, 0755);
+ if( (fd=open(path, O_CREAT|O_SHLOCK|O_RDWR|O_TRUNC, 0644)) == -1)
+ return;
+ }
+#else
+ if( (fd=open(path, O_CREAT|O_RDWR|O_TRUNC, 0644)) == -1) {
+ (void)mkdir(BINDINGDIR, 0755);
+ if( (fd=open(path, O_CREAT|O_RDWR|O_TRUNC, 0644)) == -1)
+ return;
+ }
+ flock(fd, LOCK_SH);
+#endif
+
+ /*
+ * ok, if BINDINGDIR exists, and we can create the binding file,
+ * then write to it..
+ */
+ ypdb->dom_lockfd = fd;
+
+ iov[0].iov_base = (caddr_t)&(udptransp->xp_port);
+ iov[0].iov_len = sizeof udptransp->xp_port;
+ iov[1].iov_base = (caddr_t)&ybr;
+ iov[1].iov_len = sizeof ybr;
+
+ bzero(&ybr, sizeof ybr);
+ ybr.ypbind_status = YPBIND_SUCC_VAL;
+ ybr.ypbind_respbody.ypbind_bindinfo.ypbind_binding_addr = raddrp->sin_addr;
+ ybr.ypbind_respbody.ypbind_bindinfo.ypbind_binding_port = raddrp->sin_port;
+
+ if( writev(ypdb->dom_lockfd, iov, 2) != iov[0].iov_len + iov[1].iov_len) {
+ perror("write");
+ close(ypdb->dom_lockfd);
+ ypdb->dom_lockfd = -1;
+ return;
+ }
+}
diff --git a/usr.sbin/yp/ypcat/Makefile b/usr.sbin/yp/ypcat/Makefile
new file mode 100644
index 000000000000..db0121aeaec7
--- /dev/null
+++ b/usr.sbin/yp/ypcat/Makefile
@@ -0,0 +1,7 @@
+# from: @(#)Makefile 5.8 (Berkeley) 7/28/90
+# $Id: Makefile,v 1.3 1994/02/17 07:06:10 rgrimes Exp $
+
+PROG= ypcat
+BINDIR=/usr/bin
+
+.include <bsd.prog.mk>
diff --git a/usr.sbin/yp/ypcat/ypcat.1 b/usr.sbin/yp/ypcat/ypcat.1
new file mode 100644
index 000000000000..99321b496c3c
--- /dev/null
+++ b/usr.sbin/yp/ypcat/ypcat.1
@@ -0,0 +1,70 @@
+.\" Copyright (c) 1993 Winning Strategies, Inc.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by Winning Strategies, Inc.
+.\" 4. The name of the author may not be used to endorse or promote products
+.\" derived from this software withough specific prior written permission
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" $Id: ypcat.1,v 1.1 1994/01/11 19:01:27 nate Exp $
+.\"
+.Dd December 3, 1993
+.Dt YPCAT 1
+.Os
+.Sh NAME
+.Nm ypcat
+.Nd "print the values of all keys in a YP database"
+.Sh SYNOPSIS
+.Nm ypcat
+.Op Fl kt
+.Op Fl d Ar domainname
+.Ar mapname
+.Nm ypcat
+.Fl x
+.Sh DESCRIPTION
+.Nm Ypcat
+prints out the values of all keys from the
+.Tn YP
+database specified by
+.Ar mapname,
+which may be a map name or a map nickname.
+.Pp
+The options are as follows:
+.Bl -tag -width indent
+.It Fl d Ar domainname
+Specify a domain other than the default domain.
+.It Fl k
+Display map keys.
+This option is useful with maps in which the values are null or the key
+is not part of the value.
+.It Fl t
+Inhibit translation of map nicknames
+to their corresponding map names.
+.It Fl x
+Display the map nickname table.
+.El
+.Sh SEE ALSO
+.Xr ypmatch 1 ,
+.Xr yp 8
+.Sh AUTHOR
+Theo De Raadt
diff --git a/usr.sbin/yp/ypcat/ypcat.c b/usr.sbin/yp/ypcat/ypcat.c
new file mode 100644
index 000000000000..85158a34d341
--- /dev/null
+++ b/usr.sbin/yp/ypcat/ypcat.c
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 1992/3 Theo de Raadt <deraadt@fsa.ca>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef LINT
+static char rcsid[] = "ypcat.c,v 1.2 1993/05/16 02:49:01 deraadt Exp";
+#endif
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <stdio.h>
+#include <ctype.h>
+
+#include <rpc/rpc.h>
+#include <rpc/xdr.h>
+#include <rpcsvc/yp_prot.h>
+#include <rpcsvc/ypclnt.h>
+
+struct ypalias {
+ char *alias, *name;
+} ypaliases[] = {
+ { "passwd", "passwd.byname" },
+ { "group", "group.byname" },
+ { "networks", "networks.byaddr" },
+ { "hosts", "hosts.byaddr" },
+ { "protocols", "protocols.bynumber" },
+ { "services", "services.byname" },
+ { "aliases", "mail.aliases" },
+ { "ethers", "ethers.byname" },
+};
+
+int key;
+
+usage()
+{
+ fprintf(stderr, "Usage:\n");
+ fprintf(stderr, "\typcat [-k] [-d domainname] [-t] mapname\n");
+ fprintf(stderr, "\typcat -x\n");
+ exit(1);
+}
+
+printit(instatus, inkey, inkeylen, inval, invallen, indata)
+int instatus;
+char *inkey;
+int inkeylen;
+char *inval;
+int invallen;
+char *indata;
+{
+ if(instatus != YP_TRUE)
+ return instatus;
+ if(key)
+ printf("%*.*s ", inkeylen, inkeylen, inkey);
+ printf("%*.*s\n", invallen, invallen, inval);
+ return 0;
+}
+
+int
+main(argc, argv)
+char **argv;
+{
+ char *domainname;
+ struct ypall_callback ypcb;
+ char *inmap;
+ extern char *optarg;
+ extern int optind;
+ int notrans;
+ int c, r, i;
+
+ notrans = key = 0;
+ yp_get_default_domain(&domainname);
+
+ while( (c=getopt(argc, argv, "xd:kt")) != -1)
+ switch(c) {
+ case 'x':
+ for(i=0; i<sizeof ypaliases/sizeof ypaliases[0]; i++)
+ printf("Use \"%s\" for \"%s\"\n",
+ ypaliases[i].alias,
+ ypaliases[i].name);
+ exit(0);
+ case 'd':
+ domainname = optarg;
+ break;
+ case 't':
+ notrans++;
+ break;
+ case 'k':
+ key++;
+ break;
+ default:
+ usage();
+ }
+
+ if(optind + 1 != argc )
+ usage();
+
+ inmap = argv[optind];
+ for(i=0; (!notrans) && i<sizeof ypaliases/sizeof ypaliases[0]; i++)
+ if( strcmp(inmap, ypaliases[i].alias) == 0)
+ inmap = ypaliases[i].name;
+ ypcb.foreach = printit;
+ ypcb.data = NULL;
+
+ r = yp_all(domainname, inmap, &ypcb);
+ switch(r) {
+ case 0:
+ break;
+ case YPERR_YPBIND:
+ fprintf(stderr, "ypcat: not running ypbind\n");
+ exit(1);
+ default:
+ fprintf(stderr, "No such map %s. Reason: %s\n",
+ inmap, yperr_string(r));
+ exit(1);
+ }
+ exit(0);
+}
diff --git a/usr.sbin/yp/ypmatch/Makefile b/usr.sbin/yp/ypmatch/Makefile
new file mode 100644
index 000000000000..fa08b29ad249
--- /dev/null
+++ b/usr.sbin/yp/ypmatch/Makefile
@@ -0,0 +1,7 @@
+# from: @(#)Makefile 5.8 (Berkeley) 7/28/90
+# $Id: Makefile,v 1.3 1994/02/17 07:06:13 rgrimes Exp $
+
+PROG= ypmatch
+BINDIR=/usr/bin
+
+.include <bsd.prog.mk>
diff --git a/usr.sbin/yp/ypmatch/ypmatch.1 b/usr.sbin/yp/ypmatch/ypmatch.1
new file mode 100644
index 000000000000..0b7ac89cd86b
--- /dev/null
+++ b/usr.sbin/yp/ypmatch/ypmatch.1
@@ -0,0 +1,71 @@
+.\" Copyright (c) 1993 Winning Strategies, Inc.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by Winning Strategies, Inc.
+.\" 4. The name of the author may not be used to endorse or promote products
+.\" derived from this software withough specific prior written permission
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" $Id: ypmatch.1,v 1.1 1994/01/11 19:01:30 nate Exp $
+.\"
+.Dd December 3, 1993
+.Dt YPMATCH 1
+.Os
+.Sh NAME
+.Nm ypmatch
+.Nd "print the values of one or more keys in a YP database"
+.Sh SYNOPSIS
+.Nm ypmatch
+.Op Fl kt
+.Op Fl d Ar domainname
+.Ar key ...
+.Ar mapname
+.Nm ypmatch
+.Fl x
+.Sh DESCRIPTION
+.Nm Ypmatch
+prints out the values of one or more keys from the
+.Tn YP
+database specified by
+.Ar mapname,
+which may be a map name or a map nickname.
+.Pp
+The options are as follows:
+.Bl -tag -width indent
+.It Fl d Ar domainname
+Specify a domain other than the default domain.
+.It Fl k
+Display map keys.
+This option is useful with maps in which the values are null or the key
+is not part of the value.
+.It Fl t
+Inhibit translation of map nicknames
+to their corresponding map names.
+.It Fl x
+Display the map nickname table.
+.El
+.Sh SEE ALSO
+.Xr ypcat 1 ,
+.Xr yp 8
+.Sh AUTHOR
+Theo De Raadt
diff --git a/usr.sbin/yp/ypmatch/ypmatch.c b/usr.sbin/yp/ypmatch/ypmatch.c
new file mode 100644
index 000000000000..7370e94d3d63
--- /dev/null
+++ b/usr.sbin/yp/ypmatch/ypmatch.c
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 1992/3 Theo de Raadt <deraadt@fsa.ca>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef LINT
+static char rcsid[] = "ypmatch.c,v 1.2 1993/05/16 02:49:03 deraadt Exp";
+#endif
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <stdio.h>
+#include <ctype.h>
+
+#include <rpc/rpc.h>
+#include <rpc/xdr.h>
+#include <rpcsvc/yp_prot.h>
+#include <rpcsvc/ypclnt.h>
+
+struct ypalias {
+ char *alias, *name;
+} ypaliases[] = {
+ { "passwd", "passwd.byname" },
+ { "group", "group.byname" },
+ { "networks", "networks.byaddr" },
+ { "hosts", "hosts.byaddr" },
+ { "protocols", "protocols.bynumber" },
+ { "services", "services.byname" },
+ { "aliases", "mail.aliases" },
+ { "ethers", "ethers.byname" },
+};
+
+usage()
+{
+ fprintf(stderr, "Usage:\n");
+ fprintf(stderr, "\typmatch [-d domain] [-t] [-k] key [key ...] mname\n");
+ fprintf(stderr, "\typmatch -x\n");
+ fprintf(stderr, "where\n");
+ fprintf(stderr, "\tmname may be either a mapname or a nickname for a map\n");
+ fprintf(stderr, "\t-t inhibits map nickname translation\n");
+ fprintf(stderr, "\t-k prints keys as well as values.\n");
+ fprintf(stderr, "\t-x dumps the map nickname translation table.\n");
+ exit(1);
+}
+
+int
+main(argc, argv)
+char **argv;
+{
+ char *domainname;
+ char *inkey, *inmap, *outbuf;
+ extern char *optarg;
+ extern int optind;
+ int outbuflen, key, notrans;
+ int c, r, i;
+
+ notrans = key = 0;
+ yp_get_default_domain(&domainname);
+
+ while( (c=getopt(argc, argv, "xd:kt")) != -1)
+ switch(c) {
+ case 'x':
+ for(i=0; i<sizeof ypaliases/sizeof ypaliases[0]; i++)
+ printf("Use \"%s\" for \"%s\"\n",
+ ypaliases[i].alias,
+ ypaliases[i].name);
+ exit(0);
+ case 'd':
+ domainname = optarg;
+ break;
+ case 't':
+ notrans++;
+ break;
+ case 'k':
+ key++;
+ break;
+ default:
+ usage();
+ }
+
+ if( (argc-optind) < 2 )
+ usage();
+
+ inmap = argv[argc-1];
+ for(i=0; (!notrans) && i<sizeof ypaliases/sizeof ypaliases[0]; i++)
+ if( strcmp(inmap, ypaliases[i].alias) == 0)
+ inmap = ypaliases[i].name;
+ for(; optind < argc-1; optind++) {
+ inkey = argv[optind];
+
+ r = yp_match(domainname, inmap, inkey,
+ strlen(inkey), &outbuf, &outbuflen);
+ switch(r) {
+ case 0:
+ if(key)
+ printf("%s ", inkey);
+ printf("%*.*s\n", outbuflen, outbuflen, outbuf);
+ break;
+ case YPERR_YPBIND:
+ fprintf(stderr, "yp_match: not running ypbind\n");
+ exit(1);
+ default:
+ fprintf(stderr, "Can't match key %s in map %s. Reason: %s\n",
+ inkey, inmap, yperr_string(r));
+ break;
+ }
+ }
+ exit(0);
+}
diff --git a/usr.sbin/yp/yppoll/Makefile b/usr.sbin/yp/yppoll/Makefile
new file mode 100644
index 000000000000..d24b2d81b364
--- /dev/null
+++ b/usr.sbin/yp/yppoll/Makefile
@@ -0,0 +1,8 @@
+# from: @(#)Makefile 5.8 (Berkeley) 7/28/90
+# $Id: Makefile,v 1.2 1994/02/17 07:06:17 rgrimes Exp $
+
+PROG= yppoll
+NOMAN=
+
+.include <bsd.prog.mk>
+.include "../../Makefile.inc"
diff --git a/usr.sbin/yp/yppoll/yppoll.c b/usr.sbin/yp/yppoll/yppoll.c
new file mode 100644
index 000000000000..525e564d6d45
--- /dev/null
+++ b/usr.sbin/yp/yppoll/yppoll.c
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 1992/3 Theo de Raadt <deraadt@fsa.ca>
+ * Copyright (c) 1992/3 John Brezak
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef lint
+static char rcsid[] = "yppoll.c,v 1.2 1993/08/02 17:57:20 mycroft Exp";
+#endif /* not lint */
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <stdio.h>
+#include <time.h>
+
+#include <rpc/rpc.h>
+#include <rpc/xdr.h>
+#include <rpcsvc/yp_prot.h>
+#include <rpcsvc/ypclnt.h>
+
+usage()
+{
+ fprintf(stderr, "Usage:\n");
+ fprintf(stderr, "\typpoll [-h host] [-d domainname] mapname\n");
+ exit(1);
+}
+
+int
+main(argc, argv)
+char **argv;
+{
+ char *domainname;
+ char *hostname = "localhost";
+ char *inmap, *master;
+ int order;
+ extern char *optarg;
+ extern int optind;
+ int c, r;
+
+ yp_get_default_domain(&domainname);
+
+ while( (c=getopt(argc, argv, "h:d:?")) != -1)
+ switch(c) {
+ case 'd':
+ domainname = optarg;
+ break;
+ case 'h':
+ hostname = optarg;
+ break;
+ case '?':
+ usage();
+ /*NOTREACHED*/
+ }
+
+ if(optind + 1 != argc )
+ usage();
+
+ inmap = argv[optind];
+
+ r = yp_order(domainname, inmap, &order);
+ if (r != 0) {
+ fprintf(stderr, "No such map %s. Reason: %s\n",
+ inmap, yperr_string(r));
+ exit(1);
+ }
+ printf("Map %s has order number %d. %s", inmap, order, ctime((time_t *)&order));
+ r = yp_master(domainname, inmap, &master);
+ if (r != 0) {
+ fprintf(stderr, "No such map %s. Reason: %s\n",
+ inmap, yperr_string(r));
+ exit(1);
+ }
+ printf("The master server is %s.\n", master);
+
+ exit(0);
+}
diff --git a/usr.sbin/yp/ypset/Makefile b/usr.sbin/yp/ypset/Makefile
new file mode 100644
index 000000000000..147b045c5a3d
--- /dev/null
+++ b/usr.sbin/yp/ypset/Makefile
@@ -0,0 +1,8 @@
+# from: @(#)Makefile 5.8 (Berkeley) 7/28/90
+# $Id: Makefile,v 1.2 1994/02/17 07:06:19 rgrimes Exp $
+
+PROG= ypset
+NOMAN=
+
+.include <bsd.prog.mk>
+.include "../../Makefile.inc"
diff --git a/usr.sbin/yp/ypset/ypset.c b/usr.sbin/yp/ypset/ypset.c
new file mode 100644
index 000000000000..6a25a97c917b
--- /dev/null
+++ b/usr.sbin/yp/ypset/ypset.c
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 1992/3 Theo de Raadt <deraadt@fsa.ca>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef LINT
+static char rcsid[] = "ypset.c,v 1.3 1993/06/12 00:02:37 deraadt Exp";
+#endif
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <stdio.h>
+#include <netdb.h>
+#include <rpc/rpc.h>
+#include <rpc/xdr.h>
+#include <rpcsvc/yp_prot.h>
+#include <rpcsvc/ypclnt.h>
+#include <arpa/inet.h>
+
+extern bool_t xdr_domainname();
+
+usage()
+{
+ fprintf(stderr, "Usage:\n");
+ fprintf(stderr, "\typset [-h host ] [-d domain] server\n");
+ exit(1);
+}
+
+bind_tohost(sin, dom, server)
+struct sockaddr_in *sin;
+char *dom, *server;
+{
+ struct ypbind_setdom ypsd;
+ struct timeval tv;
+ struct hostent *hp;
+ CLIENT *client;
+ int sock, port;
+ int r;
+ unsigned long server_addr;
+
+ if( (port=htons(getrpcport(server, YPPROG, YPPROC_NULL, IPPROTO_UDP))) == 0) {
+ fprintf(stderr, "%s not running ypserv.\n", server);
+ exit(1);
+ }
+
+ bzero(&ypsd, sizeof ypsd);
+
+ if( (hp = gethostbyname (server)) != NULL ) {
+ /* is this the most compatible way?? */
+ bcopy (hp->h_addr_list[0], &ypsd.ypsetdom_addr,
+ sizeof (ypsd.ypsetdom_addr));
+ } else if( (long)(server_addr = inet_addr (server)) == -1) {
+ fprintf(stderr, "can't find address for %s\n", server);
+ exit(1);
+ } else
+ bcopy (&server_addr, &ypsd.ypsetdom_addr,
+ sizeof (server_addr));
+
+ strncpy(ypsd.ypsetdom_domain, dom, sizeof ypsd.ypsetdom_domain);
+ ypsd.ypsetdom_port = port;
+ ypsd.ypsetdom_vers = YPVERS;
+
+ tv.tv_sec = 15;
+ tv.tv_usec = 0;
+ sock = RPC_ANYSOCK;
+ client = clntudp_create(sin, YPBINDPROG, YPBINDVERS, tv, &sock);
+ if (client==NULL) {
+ fprintf(stderr, "can't yp_bind: Reason: %s\n",
+ yperr_string(YPERR_YPBIND));
+ return YPERR_YPBIND;
+ }
+ client->cl_auth = authunix_create_default();
+
+ r = clnt_call(client, YPBINDPROC_SETDOM,
+ xdr_ypbind_setdom, &ypsd, xdr_void, NULL, tv);
+ if(r) {
+ fprintf(stderr, "Sorry, cannot ypset for domain %s on host.\n", dom);
+ clnt_destroy(client);
+ return YPERR_YPBIND;
+ }
+ clnt_destroy(client);
+ return 0;
+}
+
+int
+main(argc, argv)
+char **argv;
+{
+ struct sockaddr_in sin;
+ struct hostent *hent;
+ extern char *optarg;
+ extern int optind;
+ char *domainname;
+ int c;
+
+ yp_get_default_domain(&domainname);
+
+ bzero(&sin, sizeof sin);
+ sin.sin_family = AF_INET;
+ sin.sin_addr.s_addr = htonl(0x7f000001);
+
+ while( (c=getopt(argc, argv, "h:d:")) != -1)
+ switch(c) {
+ case 'd':
+ domainname = optarg;
+ break;
+ case 'h':
+ if( (sin.sin_addr.s_addr=inet_addr(optarg)) == -1) {
+ hent = gethostbyname(optarg);
+ if(hent==NULL) {
+ fprintf(stderr, "ypset: host %s unknown\n",
+ optarg);
+ exit(1);
+ }
+ bcopy(&hent->h_addr_list[0], &sin.sin_addr,
+ sizeof sin.sin_addr);
+ }
+ break;
+ default:
+ usage();
+ }
+
+ if(optind + 1 != argc )
+ usage();
+
+ if (bind_tohost(&sin, domainname, argv[optind]))
+ exit(1);
+ exit(0);
+}
diff --git a/usr.sbin/yp/ypwhich/Makefile b/usr.sbin/yp/ypwhich/Makefile
new file mode 100644
index 000000000000..604aba8af929
--- /dev/null
+++ b/usr.sbin/yp/ypwhich/Makefile
@@ -0,0 +1,8 @@
+# from: @(#)Makefile 5.8 (Berkeley) 7/28/90
+# $Id: Makefile,v 1.2 1994/02/17 07:06:22 rgrimes Exp $
+
+PROG= ypwhich
+NOMAN=
+BINDIR=/usr/bin
+
+.include <bsd.prog.mk>
diff --git a/usr.sbin/yp/ypwhich/ypwhich.c b/usr.sbin/yp/ypwhich/ypwhich.c
new file mode 100644
index 000000000000..cefac38ffa79
--- /dev/null
+++ b/usr.sbin/yp/ypwhich/ypwhich.c
@@ -0,0 +1,249 @@
+/*
+ * Copyright (c) 1992/3 Theo de Raadt <deraadt@fsa.ca>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef LINT
+static char rcsid[] = "ypwhich.c,v 1.2 1993/05/16 02:49:10 deraadt Exp";
+#endif
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <netdb.h>
+#include <rpc/rpc.h>
+#include <rpc/xdr.h>
+#include <rpcsvc/yp_prot.h>
+#include <rpcsvc/ypclnt.h>
+
+extern bool_t xdr_domainname();
+
+struct ypalias {
+ char *alias, *name;
+} ypaliases[] = {
+ { "passwd", "passwd.byname" },
+ { "group", "group.byname" },
+ { "networks", "networks.byaddr" },
+ { "hosts", "hosts.byaddr" },
+ { "protocols", "protocols.bynumber" },
+ { "services", "services.byname" },
+ { "aliases", "mail.aliases" },
+ { "ethers", "ethers.byname" },
+};
+
+usage()
+{
+ fprintf(stderr, "Usage:\n");
+ fprintf(stderr, "\typwhich [-d domain] [[-t] -m [mname] | host]\n");
+ fprintf(stderr, "\typwhich -x\n");
+ exit(1);
+}
+
+
+/*
+ * Like yp_bind except can query a specific host
+ */
+bind_host(dom, sin)
+char *dom;
+struct sockaddr_in *sin;
+{
+ struct hostent *hent = NULL;
+ struct ypbind_resp ypbr;
+ struct dom_binding *ysd;
+ struct timeval tv;
+ CLIENT *client;
+ int sock, r;
+ u_long ss_addr;
+
+ sock = RPC_ANYSOCK;
+ tv.tv_sec = 15;
+ tv.tv_usec = 0;
+ client = clntudp_create(sin, YPBINDPROG, YPBINDVERS, tv, &sock);
+ if(client==NULL) {
+ fprintf(stderr, "can't clntudp_create: %s\n",
+ yperr_string(YPERR_YPBIND));
+ return YPERR_YPBIND;
+ }
+
+ tv.tv_sec = 5;
+ tv.tv_usec = 0;
+ r = clnt_call(client, YPBINDPROC_DOMAIN,
+ xdr_domainname, dom, xdr_ypbind_resp, &ypbr, tv);
+ if( r != RPC_SUCCESS) {
+ fprintf(stderr, "can't clnt_call: %s\n",
+ yperr_string(YPERR_YPBIND));
+ clnt_destroy(client);
+ return YPERR_YPBIND;
+ } else {
+ if (ypbr.ypbind_status != YPBIND_SUCC_VAL) {
+ fprintf(stderr, "can't yp_bind: Reason: %s\n",
+ yperr_string(ypbr.ypbind_status));
+ clnt_destroy(client);
+ return r;
+ }
+ }
+ clnt_destroy(client);
+
+ ss_addr = ypbr.ypbind_respbody.ypbind_bindinfo.ypbind_binding_addr.s_addr;
+ /*printf("%08x\n", ss_addr);*/
+ hent = gethostbyaddr((char *)&ss_addr, sizeof(ss_addr), AF_INET);
+ if (hent)
+ printf("%s\n", hent->h_name);
+ else
+ printf("%s\n", inet_ntoa(ss_addr));
+ return 0;
+}
+
+int
+main(argc, argv)
+char **argv;
+{
+ char *domainname, *master, *map;
+ struct ypmaplist *ypml, *y;
+ extern char *optarg;
+ extern int optind;
+ struct hostent *hent;
+ struct sockaddr_in sin;
+ int notrans, mode, getmap;
+ int c, r, i;
+
+ yp_get_default_domain(&domainname);
+
+ map = NULL;
+ getmap = notrans = mode = 0;
+ while( (c=getopt(argc, argv, "xd:mt")) != -1)
+ switch(c) {
+ case 'x':
+ for(i=0; i<sizeof ypaliases/sizeof ypaliases[0]; i++)
+ printf("Use \"%s\" for \"%s\"\n",
+ ypaliases[i].alias,
+ ypaliases[i].name);
+ exit(0);
+ case 'd':
+ domainname = optarg;
+ break;
+ case 't':
+ notrans++;
+ break;
+ case 'm':
+ mode++;
+ break;
+ default:
+ usage();
+ }
+
+ if(mode==0) {
+ switch(argc-optind) {
+ case 0:
+ bzero(&sin, sizeof sin);
+ sin.sin_family = AF_INET;
+ sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+
+ if(bind_host(domainname, &sin))
+ exit(1);
+ break;
+ case 1:
+ bzero(&sin, sizeof sin);
+ sin.sin_family = AF_INET;
+ if( (sin.sin_addr.s_addr=inet_addr(argv[optind]))==-1) {
+ hent = gethostbyname(argv[optind]);
+ if(!hent) {
+ fprintf(stderr, "ypwhich: host %s unknown\n",
+ argv[optind]);
+ exit(1);
+ }
+ bcopy((char *)hent->h_addr_list[0],
+ (char *)&sin.sin_addr, sizeof sin.sin_addr);
+ }
+ if(bind_host(domainname, &sin))
+ exit(1);
+ break;
+ default:
+ usage();
+ }
+ exit(0);
+ }
+
+ if( argc-optind > 1)
+ usage();
+
+ if(argv[optind]) {
+ map = argv[optind];
+ for(i=0; (!notrans) && i<sizeof ypaliases/sizeof ypaliases[0]; i++)
+ if( strcmp(map, ypaliases[i].alias) == 0)
+ map = ypaliases[i].name;
+ r = yp_master(domainname, map, &master);
+ switch(r) {
+ case 0:
+ printf("%s\n", master);
+ free(master);
+ break;
+ case YPERR_YPBIND:
+ fprintf(stderr, "ypwhich: not running ypbind\n");
+ exit(1);
+ default:
+ fprintf(stderr, "Can't find master for map %s. Reason: %s\n",
+ map, yperr_string(r));
+ exit(1);
+ }
+ exit(0);
+ }
+
+ ypml = NULL;
+ r = yp_maplist(domainname, &ypml);
+ switch(r) {
+ case 0:
+ for(y=ypml; y; ) {
+ ypml = y;
+ r = yp_master(domainname, ypml->ypml_name, &master);
+ switch(r) {
+ case 0:
+ printf("%s %s\n", ypml->ypml_name, master);
+ free(master);
+ break;
+ default:
+ fprintf(stderr,
+ "YP: can't find the master of %s: Reason: %s\n",
+ ypml->ypml_name, yperr_string(r));
+ break;
+ }
+ y = ypml->ypml_next;
+ free(ypml);
+ }
+ break;
+ case YPERR_YPBIND:
+ fprintf(stderr, "ypwhich: not running ypbind\n");
+ exit(1);
+ default:
+ fprintf(stderr, "Can't get map list for domain %s. Reason: %s\n",
+ domainname, yperr_string(r));
+ exit(1);
+ }
+ exit(0);
+}