mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-17 15:27:36 +00:00
Initial round of conflict resolutions.. I need to do another
pass over this and check it more closely, but my initial concern was to get it to all compile again. Some of the obsoleted files 'cvs rm'ed.
This commit is contained in:
parent
95c20a2b6e
commit
fb1869a787
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=12574
@ -1,7 +1,18 @@
|
||||
# @(#)Makefile 8.5 (Berkeley) 12/1/93
|
||||
# @(#)Makefile 8.17 (Berkeley) 9/12/95
|
||||
|
||||
#
|
||||
# This Makefile uses the new Berkeley "make" program. See Makefile.dist
|
||||
# for a more vanilla version.
|
||||
#
|
||||
# Configuration files are created using "m4 file.mc > file.cf";
|
||||
# this may be easier than tweaking the Makefile. You do need to
|
||||
# have a fairly modern M4 available (GNU m4 works). On SunOS, use
|
||||
# /usr/5bin/m4.
|
||||
#
|
||||
|
||||
M4= m4
|
||||
#M4= /usr/src/usr.bin/m4/obj/m4
|
||||
CFDIR= ..
|
||||
CHMOD= chmod
|
||||
ROMODE= 444
|
||||
RM= rm -f
|
||||
@ -10,73 +21,87 @@ RM= rm -f
|
||||
|
||||
.mc.cf:
|
||||
$(RM) $@
|
||||
(cd ${.CURDIR} && $(M4) ${@:R}.mc ) > $@
|
||||
(cd ${.CURDIR} && $(M4) ${CFDIR}/m4/cf.m4 ${@:R}.mc > $@)
|
||||
$(CHMOD) $(ROMODE) $@
|
||||
|
||||
CLEANFILES= 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 \
|
||||
clientproto.cf tcpproto.cf uucpproto.cf
|
||||
ALL= generic-bsd4.4.cf generic-hpux9.cf generic-hpux10.cf \
|
||||
generic-osf1.cf generic-solaris2.cf \
|
||||
generic-sunos4.1.cf generic-ultrix4.cf \
|
||||
cs-hpux9.cf cs-osf1.cf cs-solaris2.cf \
|
||||
cs-sunos4.1.cf cs-ultrix4.cf \
|
||||
s2k-osf1.cf s2k-ultrix4.cf \
|
||||
chez.cs.cf huginn.cs.cf mail.cs.cf mail.eecs.cf mailspool.cs.cf \
|
||||
python.cs.cf ucbarpa.cf ucbvax.cf vangogh.cs.cf
|
||||
|
||||
all: $(CLEANFILES)
|
||||
all: $(ALL)
|
||||
|
||||
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 \
|
||||
${CFDIR}/domain/Berkeley.EDU.m4 \
|
||||
${CFDIR}/domain/CS.Berkeley.EDU.m4 \
|
||||
${CFDIR}/domain/EECS.Berkeley.EDU.m4 \
|
||||
${CFDIR}/domain/S2K.Berkeley.EDU.m4 \
|
||||
${CFDIR}/feature/allmasquerade.m4 \
|
||||
${CFDIR}/feature/always_add_domain.m4 \
|
||||
${CFDIR}/feature/bestmx_is_local.m4 \
|
||||
${CFDIR}/feature/bitdomain.m4 \
|
||||
${CFDIR}/feature/domaintable.m4 \
|
||||
${CFDIR}/feature/local_procmail.m4 \
|
||||
${CFDIR}/feature/mailertable.m4 \
|
||||
${CFDIR}/feature/nocanonify.m4 \
|
||||
${CFDIR}/feature/nodns.m4 \
|
||||
${CFDIR}/feature/notsticky.m4 \
|
||||
${CFDIR}/feature/nouucp.m4 \
|
||||
${CFDIR}/feature/nullclient.m4 \
|
||||
${CFDIR}/feature/redirect.m4 \
|
||||
${CFDIR}/feature/smrsh.m4 \
|
||||
${CFDIR}/feature/stickyhost.m4 \
|
||||
${CFDIR}/feature/use_cw_file.m4 \
|
||||
${CFDIR}/feature/uucpdomain.m4 \
|
||||
${CFDIR}/hack/cssubdomain.m4 \
|
||||
${CFDIR}/m4/cf.m4 \
|
||||
${CFDIR}/m4/cfhead.m4 \
|
||||
${CFDIR}/m4/nullrelay.m4 \
|
||||
${CFDIR}/m4/proto.m4 \
|
||||
${CFDIR}/m4/version.m4 \
|
||||
${CFDIR}/mailer/cyrus.m4 \
|
||||
${CFDIR}/mailer/fax.m4 \
|
||||
${CFDIR}/mailer/local.m4 \
|
||||
${CFDIR}/mailer/mail11.m4 \
|
||||
${CFDIR}/mailer/pop.m4 \
|
||||
${CFDIR}/mailer/procmail.m4 \
|
||||
${CFDIR}/mailer/smtp.m4 \
|
||||
${CFDIR}/mailer/usenet.m4 \
|
||||
${CFDIR}/mailer/uucp.m4 \
|
||||
${CFDIR}/ostype/aix3.m4 \
|
||||
${CFDIR}/ostype/amdahl-uts.m4 \
|
||||
${CFDIR}/ostype/aux.m4 \
|
||||
${CFDIR}/ostype/bsd4.3.m4 \
|
||||
${CFDIR}/ostype/bsd4.4.m4 \
|
||||
${CFDIR}/ostype/bsdi1.0.m4 \
|
||||
${CFDIR}/ostype/dgux.m4 \
|
||||
${CFDIR}/ostype/domainos.m4 \
|
||||
${CFDIR}/ostype/dynix3.2.m4 \
|
||||
${CFDIR}/ostype/hpux9.m4 \
|
||||
${CFDIR}/ostype/irix4.m4 \
|
||||
${CFDIR}/ostype/irix5.m4 \
|
||||
${CFDIR}/ostype/linux.m4 \
|
||||
${CFDIR}/ostype/nextstep.m4 \
|
||||
${CFDIR}/ostype/osf1.m4 \
|
||||
${CFDIR}/ostype/ptx2.m4 \
|
||||
${CFDIR}/ostype/riscos4.5.m4 \
|
||||
${CFDIR}/ostype/sco3.2.m4 \
|
||||
${CFDIR}/ostype/solaris2.m4 \
|
||||
${CFDIR}/ostype/sunos3.5.m4 \
|
||||
${CFDIR}/ostype/sunos4.1.m4 \
|
||||
${CFDIR}/ostype/svr4.m4 \
|
||||
${CFDIR}/ostype/ultrix4.m4 \
|
||||
${CFDIR}/siteconfig/uucp.cogsci.m4 \
|
||||
${CFDIR}/siteconfig/uucp.old.arpa.m4 \
|
||||
${CFDIR}/siteconfig/uucp.ucbarpa.m4 \
|
||||
${CFDIR}/siteconfig/uucp.ucbvax.m4 \
|
||||
|
||||
$(ALL): $(M4FILES)
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* By John G. Myers, jgm+@cmu.edu
|
||||
* Version 1.1
|
||||
* Version 1.2
|
||||
*
|
||||
* Process a BITNET "internet.listing" file, producing output
|
||||
* suitable for input to makemap.
|
||||
@ -154,7 +154,7 @@ char *domainlen;
|
||||
* if "domain" doesn't have a domain expansion already.
|
||||
*/
|
||||
p = lookup(domain);
|
||||
if (!p || !index(p, '.')) remember(domain, otherdomain);
|
||||
if (!p || !strchr(p, '.')) remember(domain, otherdomain);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -167,7 +167,7 @@ char *domainlen;
|
||||
* have a domain expansion, give it the expansion "domain".
|
||||
*/
|
||||
p = lookup(otherdomain);
|
||||
if (!p || !index(p, '.')) remember(otherdomain, domain);
|
||||
if (!p || !strchr(p, '.')) remember(otherdomain, domain);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -33,15 +33,18 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)makemap.c 8.6.1.1 (Berkeley) 3/6/95";
|
||||
static char sccsid[] = "@(#)makemap.c 8.14 (Berkeley) 11/5/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sysexits.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/file.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <sys/errno.h>
|
||||
#ifndef ISC_UNIX
|
||||
# include <sys/file.h>
|
||||
#endif
|
||||
#include "useful.h"
|
||||
#include "conf.h"
|
||||
|
||||
@ -80,6 +83,7 @@ main(argc, argv)
|
||||
bool inclnull = FALSE;
|
||||
bool notrunc = FALSE;
|
||||
bool allowreplace = FALSE;
|
||||
bool allowdups = FALSE;
|
||||
bool verbose = FALSE;
|
||||
bool foldcase = TRUE;
|
||||
int exitstat;
|
||||
@ -87,10 +91,12 @@ main(argc, argv)
|
||||
char *typename;
|
||||
char *mapname;
|
||||
char *ext;
|
||||
char *lext;
|
||||
int lineno;
|
||||
int st;
|
||||
int mode;
|
||||
enum type type;
|
||||
int fd;
|
||||
union
|
||||
{
|
||||
#ifdef NDBM
|
||||
@ -102,14 +108,19 @@ main(argc, argv)
|
||||
void *dbx;
|
||||
} dbp;
|
||||
union dbent key, val;
|
||||
#ifdef NEWDB
|
||||
BTREEINFO bti;
|
||||
#endif
|
||||
char ibuf[BUFSIZE];
|
||||
char fbuf[MAXNAME];
|
||||
char lbuf[MAXNAME];
|
||||
extern char *optarg;
|
||||
extern int optind;
|
||||
extern bool lockfile();
|
||||
|
||||
progname = argv[0];
|
||||
|
||||
while ((opt = getopt(argc, argv, "Nforv")) != EOF)
|
||||
while ((opt = getopt(argc, argv, "Ndforv")) != EOF)
|
||||
{
|
||||
switch (opt)
|
||||
{
|
||||
@ -117,6 +128,10 @@ main(argc, argv)
|
||||
inclnull = TRUE;
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
allowdups = TRUE;
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
foldcase = FALSE;
|
||||
break;
|
||||
@ -148,10 +163,12 @@ main(argc, argv)
|
||||
typename = argv[0];
|
||||
mapname = argv[1];
|
||||
ext = NULL;
|
||||
lext = NULL;
|
||||
|
||||
if (strcmp(typename, "dbm") == 0)
|
||||
{
|
||||
type = T_DBM;
|
||||
lext = ".dir";
|
||||
}
|
||||
else if (strcmp(typename, "btree") == 0)
|
||||
{
|
||||
@ -170,7 +187,7 @@ main(argc, argv)
|
||||
switch (type)
|
||||
{
|
||||
case T_ERR:
|
||||
fprintf(stderr, "Usage: %s [-N] [-o] [-v] type mapname\n", progname);
|
||||
fprintf(stderr, "Usage: %s [-N] [-d] [-f] [-o] [-r] [-v] type mapname\n", progname);
|
||||
exit(EX_USAGE);
|
||||
|
||||
case T_UNKNOWN:
|
||||
@ -188,6 +205,26 @@ main(argc, argv)
|
||||
fprintf(stderr, "%s: Type %s not supported in this version\n",
|
||||
progname, typename);
|
||||
exit(EX_UNAVAILABLE);
|
||||
|
||||
#ifdef NEWDB
|
||||
case T_BTREE:
|
||||
bzero(&bti, sizeof bti);
|
||||
if (allowdups)
|
||||
bti.flags |= R_DUP;
|
||||
break;
|
||||
|
||||
case T_HASH:
|
||||
#endif
|
||||
#ifdef NDBM
|
||||
case T_DBM:
|
||||
#endif
|
||||
if (allowdups)
|
||||
{
|
||||
fprintf(stderr, "%s: Type %s does not support -d (allow dups)\n",
|
||||
progname, typename);
|
||||
exit(EX_UNAVAILABLE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -208,6 +245,10 @@ main(argc, argv)
|
||||
}
|
||||
}
|
||||
|
||||
strcpy(lbuf, mapname);
|
||||
if (lext != NULL)
|
||||
strcat(lbuf, lext);
|
||||
|
||||
/*
|
||||
** Create the database.
|
||||
*/
|
||||
@ -215,6 +256,19 @@ main(argc, argv)
|
||||
mode = O_RDWR;
|
||||
if (!notrunc)
|
||||
mode |= O_CREAT|O_TRUNC;
|
||||
#ifdef O_EXLOCK
|
||||
mode |= O_EXLOCK;
|
||||
#else
|
||||
/* pre-lock the database */
|
||||
fd = open(lbuf, mode & ~O_TRUNC, 0644);
|
||||
if (fd < 0)
|
||||
{
|
||||
fprintf(stderr, "%s: cannot create type %s map %s\n",
|
||||
progname, typename, mapname);
|
||||
exit(EX_CANTCREAT);
|
||||
}
|
||||
(void) lockfile(fd);
|
||||
#endif
|
||||
switch (type)
|
||||
{
|
||||
#ifdef NDBM
|
||||
@ -227,13 +281,25 @@ main(argc, argv)
|
||||
case T_HASH:
|
||||
dbp.db = dbopen(mapname, mode, 0644, DB_HASH, NULL);
|
||||
if (dbp.db != NULL)
|
||||
{
|
||||
# if OLD_NEWDB
|
||||
(void) (*dbp.db->sync)(dbp.db);
|
||||
# else
|
||||
(void) (*dbp.db->sync)(dbp.db, 0);
|
||||
# endif
|
||||
}
|
||||
break;
|
||||
|
||||
case T_BTREE:
|
||||
dbp.db = dbopen(mapname, mode, 0644, DB_BTREE, NULL);
|
||||
dbp.db = dbopen(mapname, mode, 0644, DB_BTREE, &bti);
|
||||
if (dbp.db != NULL)
|
||||
{
|
||||
# if OLD_NEWDB
|
||||
(void) (*dbp.db->sync)(dbp.db);
|
||||
# else
|
||||
(void) (*dbp.db->sync)(dbp.db, 0);
|
||||
# endif
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
@ -244,7 +310,7 @@ main(argc, argv)
|
||||
|
||||
if (dbp.dbx == NULL)
|
||||
{
|
||||
fprintf(stderr, "%s: cannot create type %s map %s\n",
|
||||
fprintf(stderr, "%s: cannot open type %s map %s\n",
|
||||
progname, typename, mapname);
|
||||
exit(EX_CANTCREAT);
|
||||
}
|
||||
@ -373,5 +439,58 @@ main(argc, argv)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef O_EXLOCK
|
||||
/* release locks */
|
||||
close(fd);
|
||||
#endif
|
||||
|
||||
exit (exitstat);
|
||||
}
|
||||
/*
|
||||
** LOCKFILE -- lock a file using flock or (shudder) fcntl locking
|
||||
**
|
||||
** Parameters:
|
||||
** fd -- the file descriptor of the file.
|
||||
**
|
||||
** Returns:
|
||||
** TRUE if the lock was acquired.
|
||||
** FALSE otherwise.
|
||||
*/
|
||||
|
||||
bool
|
||||
lockfile(fd)
|
||||
int fd;
|
||||
{
|
||||
# if !HASFLOCK
|
||||
int action;
|
||||
struct flock lfd;
|
||||
extern int errno;
|
||||
|
||||
bzero(&lfd, sizeof lfd);
|
||||
lfd.l_type = F_WRLCK;
|
||||
action = F_SETLKW;
|
||||
|
||||
if (fcntl(fd, action, &lfd) >= 0)
|
||||
return TRUE;
|
||||
|
||||
/*
|
||||
** 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)
|
||||
return TRUE;
|
||||
|
||||
# else /* HASFLOCK */
|
||||
|
||||
if (flock(fd, LOCK_EX) >= 0)
|
||||
return TRUE;
|
||||
|
||||
# endif
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -1,4 +1,9 @@
|
||||
# @(#)Makefile 8.4 (Berkeley) 2/3/94
|
||||
# @(#)Makefile 8.7 (Berkeley) 10/31/95
|
||||
|
||||
#########################################################################
|
||||
# This Makefile is for 4.4BSD only!!! For all other systems, use #
|
||||
# the "makesendmail" script. #
|
||||
#########################################################################
|
||||
|
||||
PROG= sendmail
|
||||
|
||||
@ -10,14 +15,14 @@ PROG= sendmail
|
||||
# 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
|
||||
DBMDEF= -DNEWDB
|
||||
|
||||
CFLAGS+=-I${.CURDIR} ${DBMDEF} -DNETISO
|
||||
|
||||
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 \
|
||||
mci.c mime.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=
|
||||
LDADD=
|
||||
|
@ -1,42 +0,0 @@
|
||||
# @(#)Makefile.386BSD 8.1 (Berkeley) 2/26/94
|
||||
|
||||
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
|
||||
|
||||
CFLAGS+=-I${.CURDIR} ${DBMDEF} -DMIME
|
||||
|
||||
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=
|
||||
LDADD= $(LIBUTIL)
|
||||
MAN1= newaliases.0 mailq.0
|
||||
MAN5= aliases.0
|
||||
MAN8= sendmail.0
|
||||
LINKS= /usr/sbin/sendmail /usr/bin/newaliases \
|
||||
/usr/sbin/sendmail /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 644 /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>
|
@ -1,113 +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 AIX 3.1.5 and 3.2.3e.
|
||||
#
|
||||
# @(#)Makefile.AIX 8.3 (Berkeley) 4/11/94
|
||||
#
|
||||
|
||||
# use O=-O (usual) or O=-g (debugging)
|
||||
# you can use -O3 on AIX 3.2.4 or greater ONLY!
|
||||
O= -g
|
||||
|
||||
# define the database mechanism used for alias lookups:
|
||||
# -DNDBM -- use new DBM
|
||||
# -DNEWDB -- use new Berkeley DB
|
||||
# -DNIS -- include 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 -DNIS
|
||||
#
|
||||
# If you did not install the NEWDB on your AIX platform, use:
|
||||
#DBMDEF=-DNDBM
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
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
|
||||
#
|
||||
# If you did not install the NEWDB on your AIX platform, use:
|
||||
#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}/etc
|
||||
|
||||
# location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
|
||||
HFDIR= ${DESTDIR}/usr/lib
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
INSTALL=/usr/ucb/install
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/sbin/newaliases ${DESTDIR}/usr/sbin/mailq
|
||||
BINOWN= root
|
||||
BINGRP= system
|
||||
BINMODE=6555
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
|
||||
${STDIR}/sendmail.st
|
||||
${INSTALL} -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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,105 +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).
|
||||
#
|
||||
# @(#)Makefile.AUX 8.3 (Berkeley) 4/11/94
|
||||
#
|
||||
|
||||
# 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
|
||||
# -DNIS -- include 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
|
||||
|
||||
# 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
|
||||
|
||||
# libraries required on your system
|
||||
LIBS= -ldbm -lposix
|
||||
|
||||
# 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
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
|
||||
BINOWN= root
|
||||
BINGRP= kmem
|
||||
BINMODE=6555
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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 644 /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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,123 +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 is based on work from Jim Oldroyd -- I believe he was
|
||||
# using a fairly old Mt Xinu port.
|
||||
#
|
||||
# It should also work on UMIPS-BSD from MIPS, if you still have
|
||||
# any lying around.
|
||||
#
|
||||
# @(#)Makefile.BSD43 8.3 (Berkeley) 4/11/94
|
||||
#
|
||||
|
||||
# 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
|
||||
# -DNIS -- include 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
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
ENVDEF= -DoldBSD43
|
||||
|
||||
# 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 -lresolv -ll
|
||||
|
||||
# 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
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
# additional pseudo-sources needed
|
||||
BEFORE= unistd.h stddef.h stdlib.h dirent.h sys/time.h
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
|
||||
BINOWN= root
|
||||
BINGRP= kmem
|
||||
BINMODE=6555
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
unistd.h stddef.h stdlib.h sys/time.h:
|
||||
cp /dev/null $@
|
||||
|
||||
sys/time.h: sys
|
||||
|
||||
sys:
|
||||
mkdir sys
|
||||
|
||||
dirent.h:
|
||||
echo "#include <sys/dir.h>" > dirent.h
|
||||
echo "#define dirent direct" >> dirent.h
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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 644 /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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,32 +0,0 @@
|
||||
# @(#)Makefile.BSDI 8.1 (Berkeley) 2/26/94
|
||||
|
||||
PROG= sendmail
|
||||
DBMDEF= -DNEWDB
|
||||
CFLAGS+=-I${.CURDIR} ${DBMDEF} -DNETISO
|
||||
|
||||
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= ${LIBUTIL} ${LIBKVM}
|
||||
LDADD= -lutil -lkvm
|
||||
MAN1= mailq.0 newaliases.0
|
||||
MAN5= aliases.0
|
||||
MAN8= sendmail.0
|
||||
LINKS= /usr/sbin/sendmail /usr/bin/newaliases \
|
||||
/usr/sbin/sendmail /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 644 /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>
|
@ -1,115 +0,0 @@
|
||||
#
|
||||
# This makefile is for clipper-based Intergraph systems running CLIX.
|
||||
# It and the defines supporting it in the source tree should be considered
|
||||
# alpha-quality and used at own risk.
|
||||
#
|
||||
# Porting done for CICNet, Inc., on behalf the Michigan State Department
|
||||
# of Natural Resources.
|
||||
#
|
||||
# --Paul Southworth <pauls@cic.net>
|
||||
#
|
||||
# @(#)Makefile.CLIX 8.1 (Berkeley) 4/12/94
|
||||
#
|
||||
|
||||
# make sure the shell constructs below use the right shell
|
||||
SHELL= /bin/sh
|
||||
|
||||
# use O=-O (usual) or O=-g (debugging)
|
||||
O= -O
|
||||
|
||||
CC= gcc
|
||||
|
||||
# define the database mechanism used for alias lookups:
|
||||
# -DNDBM -- use new DBM
|
||||
# -DNEWDB -- use new Berkeley DB
|
||||
# -DNIS -- include 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
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
ENVDEF= -DCLIX
|
||||
|
||||
# see also conf.h for additional compilation flags
|
||||
|
||||
# include directories
|
||||
INCDIRS= -I/usr/include
|
||||
|
||||
# library directories
|
||||
LIBDIRS=
|
||||
|
||||
# libraries required on your system
|
||||
LIBS= -lnsl -lbsd
|
||||
|
||||
# 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
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD= getusershell.o
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq
|
||||
BINOWN= root
|
||||
BINGRP= mail
|
||||
BINMODE=6555
|
||||
INSTALL=cp
|
||||
|
||||
ALL= sendmail # aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -mandoc sendmail.8 > sendmail.0
|
||||
|
||||
install: install-sendmail #install-docs
|
||||
|
||||
install-sendmail: sendmail
|
||||
#${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
|
||||
${INSTALL} sendmail ${BINDIR}
|
||||
chmod ${BINMODE} ${BINDIR}/sendmail
|
||||
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} /dev/null ${STDIR}/sendmail.st
|
||||
#${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
|
||||
${INSTALL} sendmail.hf ${HFDIR}
|
||||
|
||||
# doesn't actually install them -- you may want to install pre-nroff versions
|
||||
install-docs: aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail #aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,105 +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 CxOS 11.0 beta 1 and 10.x.
|
||||
#
|
||||
# @(#)Makefile.ConvexOS 8.3 (Berkeley) 4/11/94
|
||||
#
|
||||
|
||||
|
||||
# use O=-O (usual) or O=-g (debugging)
|
||||
O= -g -tm c1 -D__STDC__ -d non_int_bit_field
|
||||
|
||||
# define the database mechanisms available for map & alias lookups:
|
||||
# -DNDBM -- use new DBM
|
||||
# -DNEWDB -- use new Berkeley DB
|
||||
# -DNIS -- include 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 -DYPCOMPAT -DNIS
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
ENVDEF=
|
||||
|
||||
# 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=
|
||||
|
||||
# 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
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
|
||||
BINOWN= root
|
||||
BINGRP= kmem
|
||||
BINMODE=6555
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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 644 /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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,101 +0,0 @@
|
||||
#
|
||||
# Tested on DG/UX 5.4.2 by A. Bryan Curnutt <bryan@Stoner.COM>.
|
||||
#
|
||||
# @(#)Makefile.DGUX 8.3 (Berkeley) 4/11/94
|
||||
#
|
||||
|
||||
# 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
|
||||
# -DNIS -- include 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 -DNIS
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
ENVDEF=-DDGUX
|
||||
|
||||
# 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
|
||||
|
||||
# libraries required on your system
|
||||
LIBS= -ldbm
|
||||
|
||||
# location of sendmail binary (usually /usr/sbin or /usr/lib)
|
||||
BINDIR= ${DESTDIR}/usr/bin
|
||||
|
||||
# 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}/etc
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
|
||||
BINOWN= root
|
||||
BINGRP= bin
|
||||
BINMODE=6555
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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 644 /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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,113 +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).
|
||||
#
|
||||
# Based on a Makefile for Dell SVR4 Issue 2.2 from Kimmo Suominen
|
||||
# <kim@grendel.lut.fi> -- I haven't tested this myself. It may
|
||||
# work on other SVR4 ports.
|
||||
#
|
||||
# @(#)Makefile.Dell 8.3 (Berkeley) 4/11/94
|
||||
#
|
||||
|
||||
# make sure the shell constructs below use the right shell
|
||||
SHELL= /bin/sh
|
||||
|
||||
# use O=-O (usual) or O=-g (debugging)
|
||||
O= -O2
|
||||
|
||||
CC= gcc
|
||||
#DESTDIR=/usr/local/sendmail
|
||||
|
||||
# define the database mechanism used for alias lookups:
|
||||
# -DNDBM -- use new DBM
|
||||
# -DNEWDB -- use new Berkeley DB
|
||||
# -DNIS -- include NIS support
|
||||
# The really old (V7) DBM library is no longer supported.
|
||||
# See READ_ME for a description of how these flags interact.
|
||||
#
|
||||
DBMDEF= -DNEWDB -DNDBM
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
ENVDEF= -D__svr4__
|
||||
|
||||
# see also conf.h for additional compilation flags
|
||||
|
||||
# include directories
|
||||
INCDIRS=
|
||||
|
||||
# library directories
|
||||
LIBDIRS=
|
||||
|
||||
# libraries required on your system
|
||||
LIBS= -ldb -ldbm -lresolv -lsocket -lnsl -lelf
|
||||
|
||||
# location of sendmail binary (usually /usr/sbin or /usr/lib)
|
||||
BINDIR= ${DESTDIR}/usr/ucblib
|
||||
|
||||
# location of sendmail.st file (usually /var/log or /usr/lib)
|
||||
STDIR= ${DESTDIR}/usr/ucblib
|
||||
|
||||
# location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
|
||||
HFDIR= ${DESTDIR}/usr/ucblib
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
|
||||
BINOWN= root
|
||||
BINGRP= mail
|
||||
BINMODE=6555
|
||||
INSTALL=/usr/ucb/install
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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 644 /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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,123 +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 DomainOS 10.3.5
|
||||
#
|
||||
# @(#)Makefile.DomainOS 8.5 (Berkeley) 4/12/94
|
||||
#
|
||||
#
|
||||
|
||||
# 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.
|
||||
# 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
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
ENVDEF=
|
||||
|
||||
# see also conf.h for additional compilation flags
|
||||
|
||||
# include directories
|
||||
INCDIRS=
|
||||
|
||||
# loader options
|
||||
LDOPTS=
|
||||
|
||||
# library directories
|
||||
LIBDIRS=
|
||||
|
||||
# libraries required on your system
|
||||
# You might want to use the BIND 4.9 resolver library here
|
||||
#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}/usr/lib
|
||||
|
||||
# location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
|
||||
HFDIR= ${DESTDIR}/usr/lib
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
# additional pseudo-sources needed
|
||||
BEFORE= unistd.h dirent.h
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
CFLAGS= -I. -A nansi $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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
|
||||
BINOWN= root
|
||||
BINGRP= kmem
|
||||
BINMODE=6555
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
unistd.h:
|
||||
cp /dev/null unistd.h
|
||||
|
||||
dirent.h:
|
||||
echo "#include <sys/dir.h>" > dirent.h
|
||||
echo "#define dirent direct" >> dirent.h
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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 644 /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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,113 +0,0 @@
|
||||
#
|
||||
# Tested on Dynix 3.2.0.
|
||||
#
|
||||
# From Jim Davis <jdavis@cs.arizona.edu>.
|
||||
#
|
||||
# ``There is no strtol in libc (well there is in the 'att universe'
|
||||
# libc, but I couldn't figure out how to link that in), so I
|
||||
# got the Chris Torek strtol.c from bsd-sources on uunet and
|
||||
# compiled that. There is no native ndbm either; I couldn't
|
||||
# get db 1.72 to pass it's regression test, so I used gdbm-1.7
|
||||
# instead. I compiled it with gcc 1.40a. The -lseq is to pick
|
||||
# up getopt.''
|
||||
#
|
||||
# @(#)Makefile.Dynix 8.3 (Berkeley) 4/11/94
|
||||
#
|
||||
|
||||
CC= gcc
|
||||
|
||||
# use O=-O (usual) or O=-g (debugging)
|
||||
O= -O -g
|
||||
|
||||
# define the database mechanisms available for map & alias lookups:
|
||||
# -DNDBM -- use new DBM
|
||||
# -DNEWDB -- use new Berkeley DB
|
||||
# -DNIS -- include 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
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
ENVDEF=
|
||||
|
||||
# see also conf.h for additional compilation flags
|
||||
|
||||
# include directories
|
||||
INCDIRS=
|
||||
|
||||
# loader options
|
||||
LDOPTS=
|
||||
|
||||
# library directories
|
||||
LIBDIRS=
|
||||
|
||||
# libraries required on your system
|
||||
LIBS= -lseq -lgdbm
|
||||
|
||||
# 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
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=strtol.o
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
|
||||
BINOWN= root
|
||||
BINGRP= staff # no kmem group,
|
||||
BINMODE=4555 # so not setgid
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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 644 /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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,50 +0,0 @@
|
||||
#
|
||||
# Makefile for FreeBSD
|
||||
#
|
||||
# @(#)Makefile.FreeBSD 8.1 (Berkeley) 2/26/94
|
||||
|
||||
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
|
||||
|
||||
# FreeBSD 1.0 RELEASE has uname(2) now. Use -DUSEUNAME in order to use it.
|
||||
CFLAGS+=-I${.CURDIR} ${DBMDEF} -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=
|
||||
LDADD= $(LIBUTIL)
|
||||
#
|
||||
# FreeBSD 1.0 RELEASE has GNU man and doesn't need preformatted man pages anymore
|
||||
# (assuming you consider a slower "man" command a feature)
|
||||
#
|
||||
MAN1= mailq.1 newaliases.1
|
||||
MAN5= aliases.5
|
||||
MAN8= sendmail.8
|
||||
LINKS= /usr/sbin/sendmail /usr/bin/newaliases \
|
||||
/usr/sbin/sendmail /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 644 /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>
|
@ -1,105 +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 HP-UX 8.07 on 7xx series.
|
||||
#
|
||||
# @(#)Makefile.HP-UX 8.3 (Berkeley) 4/11/94
|
||||
#
|
||||
|
||||
# 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
|
||||
# -DNIS -- include 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 -DNIS
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
ENVDEF=
|
||||
|
||||
# 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}/usr/lib
|
||||
|
||||
# location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
|
||||
HFDIR= ${DESTDIR}/usr/lib
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq
|
||||
BINOWN= root
|
||||
BINGRP= mail
|
||||
BINMODE=6555
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -mandoc sendmail.8 > sendmail.0
|
||||
|
||||
install: install-sendmail install-docs
|
||||
|
||||
install-sendmail: sendmail
|
||||
cpset sendmail ${BINDIR} ${BINMODE} ${BINOWN} ${BINGRP}
|
||||
for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
|
||||
cpset /dev/null ${STDIR}/sendmail.st 644 ${BINOWN} ${BINGRP}
|
||||
cpset sendmail.hf ${HFDIR} 444 ${BINOWN} ${BINGRP}
|
||||
|
||||
# doesn't actually install them -- you may want to install pre-nroff versions
|
||||
install-docs: aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,109 +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 4.0.4.
|
||||
#
|
||||
# @(#)Makefile.IRIX 8.4 (Berkeley) 4/11/94
|
||||
#
|
||||
SHELL= /bin/sh
|
||||
|
||||
# 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 (requires -ldb)
|
||||
# -DNIS -- include NIS support (requires -lsun)
|
||||
# The really old (V7) DBM library is no longer supported.
|
||||
# See READ_ME for a description of how these flags interact.
|
||||
#
|
||||
DBMDEF= -DNDBM
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
ENVDEF= -DIRIX
|
||||
|
||||
# see also conf.h for additional compilation flags
|
||||
|
||||
# include directories
|
||||
INCDIRS=
|
||||
|
||||
# library directories
|
||||
LIBDIRS=
|
||||
|
||||
# libraries required on your system
|
||||
LIBS= -lmld
|
||||
#LIBS= -lsun -ldb -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
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/bsd/newaliases ${DESTDIR}/usr/bsd/mailq
|
||||
BINOWN= root
|
||||
BINGRP= sys
|
||||
BINMODE=6555
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -mandoc sendmail.8 > sendmail.0
|
||||
|
||||
install: install-sendmail install-docs
|
||||
|
||||
install-sendmail: sendmail
|
||||
install -u ${BINOWN} -g ${BINGRP} -m ${BINMODE} -f ${BINDIR} sendmail
|
||||
for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
|
||||
cp /dev/null ${STDIR}/sendmail.st
|
||||
chmod 644 ${STDIR}/sendmail.st
|
||||
chown ${BINOWN} ${STDIR}/sendmail.st
|
||||
chgrp ${BINGRP} ${STDIR}/sendmail.st
|
||||
install -u ${BINOWN} -g ${BINGRP} -m 444 -f ${HFDIR} sendmail.hf
|
||||
|
||||
# doesn't actually install them -- you may want to install pre-nroff versions
|
||||
install-docs: aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,120 +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 Linux 0.99p10.
|
||||
#
|
||||
# Linux doesn't really have standard places to install things, so this
|
||||
# Makefile is likely to require a lot of customization. Read it over
|
||||
# carefully before proceeding.
|
||||
#
|
||||
# @(#)Makefile.Linux 8.7 (Berkeley) 4/11/94
|
||||
#
|
||||
|
||||
# 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
|
||||
# -DNIS -- include 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
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
ENVDEF=
|
||||
|
||||
# see also conf.h for additional compilation flags
|
||||
|
||||
# include directories
|
||||
INCDIRS=-I/usr/local/include
|
||||
|
||||
# library directories
|
||||
LIBDIRS=-L/usr/local/lib
|
||||
|
||||
# libraries required on your system
|
||||
LIBS= -lndbm
|
||||
|
||||
# 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}/etc
|
||||
|
||||
# location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
|
||||
HFDIR= ${DESTDIR}/usr/lib
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
# additional pseudo-sources needed
|
||||
BEFORE=
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq
|
||||
BINOWN= root
|
||||
BINGRP= kmem
|
||||
BINMODE=6555
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
unistd.h:
|
||||
cp /dev/null unistd.h
|
||||
|
||||
dirent.h:
|
||||
echo "#include <sys/dir.h>" > dirent.h
|
||||
echo "#define dirent direct" >> dirent.h
|
||||
|
||||
NROFF= nroff
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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
|
||||
cp /dev/null ${STDIR}/sendmail.st
|
||||
chmod 644 ${STDIR}/sendmail.st
|
||||
chown ${BINOWN} ${STDIR}/sendmail.st
|
||||
chgrp ${BINGRP} ${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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -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).
|
||||
#
|
||||
# @(#)Makefile.Mach386 8.3 (Berkeley) 4/11/94
|
||||
#
|
||||
|
||||
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
|
||||
# -DNIS -- include 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
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
ENVDEF=
|
||||
|
||||
# see also conf.h for additional compilation flags
|
||||
|
||||
# include directories
|
||||
INCDIRS=
|
||||
|
||||
# loader options
|
||||
LDOPTS=
|
||||
|
||||
# library directories
|
||||
LIBDIRS=
|
||||
|
||||
# libraries required on your system
|
||||
LIBS= -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}/usr/lib
|
||||
|
||||
# location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
|
||||
HFDIR= ${DESTDIR}/usr/lib
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
|
||||
BINOWN= root
|
||||
BINGRP= kmem
|
||||
BINMODE=6555
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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 644 /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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,109 +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).
|
||||
#
|
||||
# NCR 3000 support from Kevin Darcy <kevin@tech.mis.cfc.com>.
|
||||
#
|
||||
# @(#)Makefile.NCR3000 8.2 (Berkeley) 4/16/94
|
||||
#
|
||||
|
||||
# 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
|
||||
# -DNIS -- include 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
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
ENVDEF= -DNCR3000
|
||||
|
||||
# see also conf.h for additional compilation flags
|
||||
|
||||
# include directories
|
||||
INCDIRS=-I/usr/ucbinclude
|
||||
|
||||
# loader options
|
||||
LDOPTS=
|
||||
|
||||
# library directories
|
||||
LIBDIRS=-L/usr/ucblib
|
||||
|
||||
# libraries required on your system
|
||||
LIBS= -lsocket -lc -lelf -lucb -ldbm -lnet -lnsl
|
||||
|
||||
# location of sendmail binary (usually /usr/sbin or /usr/lib)
|
||||
BINDIR= ${DESTDIR}/usr/ucblib
|
||||
|
||||
# location of sendmail.st file (usually /var/log or /usr/lib)
|
||||
STDIR= ${DESTDIR}/var/ucblib
|
||||
|
||||
# location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
|
||||
HFDIR= ${DESTDIR}/usr/ucblib
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
|
||||
BINOWN= root
|
||||
BINGRP= kmem
|
||||
BINMODE=6555
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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 644 /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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,114 +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 NeXT 2.1.
|
||||
#
|
||||
# @(#)Makefile.NeXT 8.3 (Berkeley) 4/11/94
|
||||
#
|
||||
|
||||
# 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
|
||||
# -DNIS -- include 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
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
ENVDEF= -DNeXT -DNETINFO
|
||||
|
||||
# see also conf.h for additional compilation flags
|
||||
|
||||
# include directories
|
||||
INCDIRS=
|
||||
|
||||
# library directories
|
||||
LIBDIRS=-L/usr/local/lib
|
||||
|
||||
# libraries required on your system
|
||||
LIBS= -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}/etc/sendmail
|
||||
|
||||
# location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
|
||||
HFDIR= ${DESTDIR}/usr/lib
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
# additional pseudo-sources needed
|
||||
BEFORE= unistd.h dirent.h
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
|
||||
BINOWN= root
|
||||
BINGRP= kmem
|
||||
BINMODE=6555
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
unistd.h:
|
||||
cp /dev/null unistd.h
|
||||
|
||||
dirent.h:
|
||||
echo "#include <sys/dir.h>" > dirent.h
|
||||
echo "#define dirent direct" >> dirent.h
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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 644 /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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,46 +0,0 @@
|
||||
#
|
||||
# NetBSD Makefile
|
||||
#
|
||||
# @(#)Makefile.NetBSD 8.1 (Berkeley) 2/26/94
|
||||
# @Id: Makefile.NetBSD,v 1.3 1994/02/01 05:33:44 glass Exp $
|
||||
#
|
||||
|
||||
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 -DNIS
|
||||
|
||||
#nasty warning about gcc 2.4.x caused bugs
|
||||
CFLAGS=-I${.CURDIR} ${DBMDEF} -DNETISO
|
||||
#CFLAGS+=-I${.CURDIR} ${DBMDEF} -DNETISO
|
||||
|
||||
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
|
||||
MAN1= mailq.0 newaliases.0
|
||||
MAN5= aliases.0
|
||||
MAN8= sendmail.0
|
||||
LINKS= /usr/sbin/sendmail /usr/bin/newaliases \
|
||||
/usr/sbin/sendmail /usr/bin/mailq
|
||||
BINDIR= /usr/sbin
|
||||
BINOWN= root
|
||||
BINMODE=4555
|
||||
|
||||
beforeinstall:
|
||||
# install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
|
||||
# ${DESTDIR}/etc/sendmail.fc
|
||||
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
|
||||
|
||||
.include <bsd.prog.mk>
|
@ -1,109 +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 OSF/1 1.3
|
||||
#
|
||||
# @(#)Makefile.OSF1 8.3 (Berkeley) 4/11/94
|
||||
#
|
||||
|
||||
# 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
|
||||
# -DNIS -- include 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
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
ENVDEF= -Olimit 1000
|
||||
|
||||
# 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/shlib -L/usr/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/adm/sendmail
|
||||
|
||||
# location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
|
||||
HFDIR= ${DESTDIR}/usr/share/lib
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
# additional link flags
|
||||
#LDADD= -non_shared
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${BINDIR}/newaliases ${BINDIR}/mailq
|
||||
BINOWN= root
|
||||
BINGRP= kmem
|
||||
BINMODE=6555
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${LDADD} ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -mandoc sendmail.8 > sendmail.0
|
||||
|
||||
install: install-sendmail install-docs
|
||||
|
||||
install-sendmail: sendmail
|
||||
installbsd -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
|
||||
for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
|
||||
cp /dev/null ${STDIR}/sendmail.st
|
||||
chmod 644 ${STDIR}/sendmail.st
|
||||
chown ${BINOWN}.${BINGRP} ${STDIR}/sendmail.st
|
||||
installbsd -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
|
||||
rm -f /usr/sbin/smtpd
|
||||
|
||||
# doesn't actually install them -- you may want to install pre-nroff versions
|
||||
install-docs: aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,114 +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).
|
||||
#
|
||||
# For Sequent DYNIX/ptx.
|
||||
#
|
||||
# From Tim "Pinball Wizard" Wright <timw@sequent.com>.
|
||||
#
|
||||
# @(#)Makefile.PTX 8.3 (Berkeley) 4/11/94
|
||||
#
|
||||
|
||||
# use O=-O (usual) or O=-g (debugging)
|
||||
O= -g
|
||||
|
||||
# define the database mechanisms available for map & alias lookups:
|
||||
# -DNDBM -- use new DBM
|
||||
# -DNEWDB -- use new Berkeley DB
|
||||
# -DNIS -- include 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
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
ENVDEF=
|
||||
|
||||
# see also conf.h for additional compilation flags
|
||||
|
||||
# include directories
|
||||
#INCDIRS=-I/usr/sww/include/db
|
||||
INCDIRS=
|
||||
|
||||
# loader options
|
||||
LDOPTS=
|
||||
|
||||
# library directories
|
||||
#LIBDIRS=-L/usr/sww/lib
|
||||
LIBDIRS=
|
||||
|
||||
# libraries required on your system
|
||||
#LIBS= -ldb -ldbm
|
||||
LIBS= -lsocket -linet -lnsl -lseq
|
||||
|
||||
# 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
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq
|
||||
BINOWN= root
|
||||
BINGRP= sys
|
||||
BINMODE=6555
|
||||
|
||||
ALL= sendmail aliases.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: $& ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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 644 /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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,117 +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).
|
||||
#
|
||||
# For Mips RISC/os 4.52.
|
||||
#
|
||||
# @(#)Makefile.RISCos 8.3 (Berkeley) 4/11/94
|
||||
#
|
||||
|
||||
# use O=-O (usual) or O=-g (debugging)
|
||||
O= -O
|
||||
|
||||
# be sure we are compiling in BSD mode
|
||||
CC= cc -systype bsd43
|
||||
|
||||
# define the database mechanism used for alias lookups:
|
||||
# -DNDBM -- use new DBM
|
||||
# -DNEWDB -- use new Berkeley DB
|
||||
# -DNIS -- include 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
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
ENVDEF= -DRISCOS -Olimit 800
|
||||
|
||||
# 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= -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}/etc
|
||||
|
||||
# location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
|
||||
HFDIR= ${DESTDIR}/usr/lib
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
# additional pseudo-sources needed
|
||||
BEFORE= stdlib.h dirent.h
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
|
||||
BINOWN= root
|
||||
BINGRP= kmem
|
||||
BINMODE=6555
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
stdlib.h:
|
||||
cp /dev/null $@
|
||||
|
||||
dirent.h:
|
||||
echo "#include <sys/dir.h>" > dirent.h
|
||||
echo "#define dirent direct" >> dirent.h
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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 644 /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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,104 +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 SCO.
|
||||
#
|
||||
# @(#)Makefile.SCO 8.4 (Berkeley) 4/12/94
|
||||
#
|
||||
|
||||
# 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
|
||||
# -DNIS -- include NIS support
|
||||
# The really old (V7) DBM library is no longer supported.
|
||||
# See READ_ME for a description of how these flags interact.
|
||||
#
|
||||
DBMDEF=
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
ENVDEF= -D_SCO_unix_
|
||||
|
||||
# see also conf.h for additional compilation flags
|
||||
|
||||
# include directories
|
||||
INCDIRS=
|
||||
|
||||
# library directories
|
||||
LIBDIRS=
|
||||
|
||||
# libraries required on your system
|
||||
LIBS= -lsocket
|
||||
|
||||
# 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
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
|
||||
BINOWN= root
|
||||
BINGRP= kmem
|
||||
BINMODE=6555
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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 644 /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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,113 +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).
|
||||
#
|
||||
# Based on a Makefile for Dell SVR4 Issue 2.2 from Kimmo Suominen
|
||||
# <kim@grendel.lut.fi> -- I haven't tested this myself. It may
|
||||
# work on other SVR4 ports.
|
||||
#
|
||||
# @(#)Makefile.SVR4 8.3 (Berkeley) 4/11/94
|
||||
#
|
||||
|
||||
# make sure the shell constructs below use the right shell
|
||||
SHELL= /bin/sh
|
||||
|
||||
# use O=-O (usual) or O=-g (debugging)
|
||||
O= -O
|
||||
|
||||
CC= gcc
|
||||
#DESTDIR=/usr/local/sendmail
|
||||
|
||||
# define the database mechanism used for alias lookups:
|
||||
# -DNDBM -- use new DBM
|
||||
# -DNEWDB -- use new Berkeley DB
|
||||
# -DNIS -- include NIS support
|
||||
# The really old (V7) DBM library is no longer supported.
|
||||
# See READ_ME for a description of how these flags interact.
|
||||
#
|
||||
DBMDEF= -DNEWDB -DNDBM
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
ENVDEF= -D__svr4__
|
||||
|
||||
# see also conf.h for additional compilation flags
|
||||
|
||||
# include directories
|
||||
INCDIRS=
|
||||
|
||||
# library directories
|
||||
LIBDIRS=
|
||||
|
||||
# libraries required on your system
|
||||
LIBS= -ldb -ldbm -lresolv -lsocket -lnsl -lelf
|
||||
|
||||
# location of sendmail binary (usually /usr/sbin or /usr/lib)
|
||||
BINDIR= ${DESTDIR}/usr/ucblib
|
||||
|
||||
# location of sendmail.st file (usually /var/log or /usr/lib)
|
||||
STDIR= ${DESTDIR}/usr/ucblib
|
||||
|
||||
# location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
|
||||
HFDIR= ${DESTDIR}/usr/ucblib
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
|
||||
BINOWN= root
|
||||
BINGRP= mail
|
||||
BINMODE=6555
|
||||
INSTALL=/usr/ucb/install
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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 644 /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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,115 +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 Solaris 2.1 and 2.2.
|
||||
#
|
||||
# @(#)Makefile.Solaris 8.5 (Berkeley) 4/12/94
|
||||
#
|
||||
|
||||
# use O=-O (usual) or O=-g (debugging)
|
||||
# warning: do not use -O with gcc
|
||||
O=
|
||||
|
||||
CC= gcc
|
||||
|
||||
# define the database mechanism used for alias lookups:
|
||||
# -DNDBM -- use new DBM
|
||||
# -DNEWDB -- use new Berkeley DB
|
||||
# -DNIS -- include 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 -DNIS
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
# include -DSOLARIS_2_3 for version 2.3 and higher
|
||||
ENVDEF= -DSOLARIS
|
||||
|
||||
# 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= -lresolv -lsocket -lnsl -lelf
|
||||
|
||||
# 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}/etc/mail
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
# things to be made before compilation begins
|
||||
BEFORE= sysexits.h
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
|
||||
BINOWN= root
|
||||
BINGRP= sys
|
||||
BINMODE=6555
|
||||
INSTALL=/usr/ucb/install
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
sysexits.h: /usr/ucbinclude/sysexits.h
|
||||
ln -s /usr/ucbinclude/sysexits.h
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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 644 /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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,111 +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 SunOS 4.1.[12].
|
||||
# For SunOS 4.0.3, add -DSUNOS403 to the ENVDEF macro, and
|
||||
# create empty files stdlib.h and stddef.h in your
|
||||
# compile directory.
|
||||
#
|
||||
# @(#)Makefile.SunOS 8.3 (Berkeley) 4/11/94
|
||||
#
|
||||
|
||||
# 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
|
||||
# -DNIS -- include 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 -DNIS
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
# need to add -DSUNOS403 if you are on a SunOS 4.0.3 system
|
||||
ENVDEF=
|
||||
|
||||
# see also conf.h for additional compilation flags
|
||||
|
||||
# include directories
|
||||
INCDIRS=-I/usr/sww/include/db
|
||||
|
||||
# loader options
|
||||
LDOPTS= -Bstatic
|
||||
|
||||
# library directories
|
||||
LIBDIRS=-L/usr/sww/lib
|
||||
|
||||
# libraries required on your system
|
||||
LIBS= -ldb -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
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
|
||||
BINOWN= root
|
||||
BINGRP= kmem
|
||||
BINMODE=6555
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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 644 /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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,113 +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).
|
||||
#
|
||||
# You may find you need to find versions of some routines
|
||||
# such as strcasecmp in order to link this on SunOS 4.0.3.
|
||||
#
|
||||
# @(#)Makefile.SunOS.4.0.3 8.3 (Berkeley) 4/11/94
|
||||
#
|
||||
|
||||
# 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
|
||||
# -DNIS -- include 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 -DNIS
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
ENVDEF= -DSUNOS403
|
||||
|
||||
# see also conf.h for additional compilation flags
|
||||
|
||||
# include directories
|
||||
INCDIRS=-I/usr/sww/include/db
|
||||
|
||||
# loader options
|
||||
LDOPTS= -Bstatic
|
||||
|
||||
# library directories
|
||||
LIBDIRS=-L/usr/sww/lib
|
||||
|
||||
# libraries required on your system
|
||||
LIBS= -ldb -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
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
BEFORE= stdlib.h stddef.h
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
|
||||
BINOWN= root
|
||||
BINGRP= kmem
|
||||
BINMODE=6555
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
stddef.h stdlib.h:
|
||||
cp /dev/null $@
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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 644 /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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,115 +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 Solaris 2.1 and 2.2.
|
||||
#
|
||||
# @(#)Makefile.Solaris 8.5 (Berkeley) 4/12/94
|
||||
#
|
||||
|
||||
# use O=-O (usual) or O=-g (debugging)
|
||||
# warning: do not use -O with gcc
|
||||
O=
|
||||
|
||||
CC= gcc
|
||||
|
||||
# define the database mechanism used for alias lookups:
|
||||
# -DNDBM -- use new DBM
|
||||
# -DNEWDB -- use new Berkeley DB
|
||||
# -DNIS -- include 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 -DNIS
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
# include -DSOLARIS_2_3 for version 2.3 and higher
|
||||
ENVDEF= -DSOLARIS
|
||||
|
||||
# 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= -lresolv -lsocket -lnsl -lelf
|
||||
|
||||
# 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}/etc/mail
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
# things to be made before compilation begins
|
||||
BEFORE= sysexits.h
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
|
||||
BINOWN= root
|
||||
BINGRP= sys
|
||||
BINMODE=6555
|
||||
INSTALL=/usr/ucb/install
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
sysexits.h: /usr/ucbinclude/sysexits.h
|
||||
ln -s /usr/ucbinclude/sysexits.h
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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 644 /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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,115 +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 Solaris 2.1 and 2.2.
|
||||
#
|
||||
# @(#)Makefile.Solaris 8.5 (Berkeley) 4/12/94
|
||||
#
|
||||
|
||||
# use O=-O (usual) or O=-g (debugging)
|
||||
# warning: do not use -O with gcc
|
||||
O=
|
||||
|
||||
CC= gcc
|
||||
|
||||
# define the database mechanism used for alias lookups:
|
||||
# -DNDBM -- use new DBM
|
||||
# -DNEWDB -- use new Berkeley DB
|
||||
# -DNIS -- include 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 -DNIS
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
# include -DSOLARIS_2_3 for version 2.3 and higher
|
||||
ENVDEF= -DSOLARIS
|
||||
|
||||
# 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= -lresolv -lsocket -lnsl -lelf
|
||||
|
||||
# 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}/etc/mail
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
# things to be made before compilation begins
|
||||
BEFORE= sysexits.h
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
|
||||
BINOWN= root
|
||||
BINGRP= sys
|
||||
BINMODE=6555
|
||||
INSTALL=/usr/ucb/install
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
sysexits.h: /usr/ucbinclude/sysexits.h
|
||||
ln -s /usr/ucbinclude/sysexits.h
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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 644 /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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,115 +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 Solaris 2.3.
|
||||
#
|
||||
# @(#)Makefile.SunOS.5.x 8.5 (Berkeley) 4/12/94
|
||||
#
|
||||
|
||||
# use O=-O (usual) or O=-g (debugging)
|
||||
# warning: do not use -O with gcc
|
||||
O=
|
||||
|
||||
CC= gcc
|
||||
|
||||
# define the database mechanism used for alias lookups:
|
||||
# -DNDBM -- use new DBM
|
||||
# -DNEWDB -- use new Berkeley DB
|
||||
# -DNIS -- include 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 -DNIS
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
# include -DSOLARIS_2_3 for version 2.3 and higher
|
||||
ENVDEF= -DSOLARIS_2_3
|
||||
|
||||
# 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= -lresolv -lsocket -lnsl -lelf
|
||||
|
||||
# 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}/etc/mail
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
# things to be made before compilation begins
|
||||
BEFORE= sysexits.h
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
|
||||
BINOWN= root
|
||||
BINGRP= sys
|
||||
BINMODE=6555
|
||||
INSTALL=/usr/ucb/install
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
sysexits.h: /usr/ucbinclude/sysexits.h
|
||||
ln -s /usr/ucbinclude/sysexits.h
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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 644 /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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,114 +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).
|
||||
#
|
||||
# @(#)Makefile.Titan 8.3 (Berkeley) 4/11/94
|
||||
#
|
||||
|
||||
# put the compiler in BSD mode
|
||||
CC= cc -43
|
||||
|
||||
# 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
|
||||
# -DNIS -- include 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
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
ENVDEF=
|
||||
|
||||
# see also conf.h for additional compilation flags
|
||||
|
||||
# include directories
|
||||
INCDIRS=
|
||||
|
||||
# loader options
|
||||
LDOPTS=
|
||||
|
||||
# library directories
|
||||
LIBDIRS=
|
||||
|
||||
# libraries required on your system
|
||||
LIBS= -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/share/misc
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
# additional pseudo-sources needed
|
||||
BEFORE= stddef.h stdlib.h
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
|
||||
BINOWN= root
|
||||
BINGRP= kmem
|
||||
BINMODE=6555
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
stddef.h stdlib.h:
|
||||
cp /dev/null $@
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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 644 /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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -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 4.2A and 4.3A.
|
||||
#
|
||||
# @(#)Makefile.ULTRIX 8.3 (Berkeley) 4/11/94
|
||||
#
|
||||
|
||||
# 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
|
||||
# -DNIS -- include 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 -DNIS
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
ENVDEF= -Olimit 800
|
||||
|
||||
# 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
|
||||
|
||||
# libraries required on your system
|
||||
LIBS= -ldb
|
||||
|
||||
# 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
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
|
||||
BINOWN= root
|
||||
BINGRP= kmem
|
||||
BINMODE=6555
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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 644 /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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,114 +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 Encore UMAX V
|
||||
#
|
||||
# @(#)Makefile.UMAX 8.3 (Berkeley) 4/11/94
|
||||
#
|
||||
|
||||
# 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
|
||||
# -DNIS -- include NIS support
|
||||
# The really old (V7) DBM library is no longer supported.
|
||||
# See READ_ME for a description of how these flags interact.
|
||||
#
|
||||
DBMDEF= -DNIS
|
||||
|
||||
# environment definitions (e.g., -D_AIX3)
|
||||
ENVDEF= -DUMAXV
|
||||
|
||||
# see also conf.h for additional compilation flags
|
||||
|
||||
# include directories
|
||||
INCDIRS=
|
||||
|
||||
# loader options
|
||||
LDOPTS=
|
||||
|
||||
# library directories
|
||||
LIBDIRS=
|
||||
|
||||
# libraries required on your system
|
||||
LIBS= -lyp -lrpc
|
||||
|
||||
# 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
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
# things to do before compilation
|
||||
BEFORE= stddef.h
|
||||
|
||||
stddef.h:
|
||||
echo "#define _STDDEF_H" > stddef.h
|
||||
chmod 444 stddef.h
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
|
||||
BINOWN= root
|
||||
BINGRP= kmem
|
||||
BINMODE=6555
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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 644 /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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,40 +0,0 @@
|
||||
# @(#)Makefile.Utah 8.1 (Berkeley) 2/26/94
|
||||
|
||||
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= mailq.0 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}/var/log/sendmail.st
|
||||
install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/sendmail.hf \
|
||||
${DESTDIR}/usr/share/misc
|
||||
|
||||
.include <bsd.prog.mk>
|
@ -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).
|
||||
#
|
||||
# @(#)Makefile.dist 8.12 (Berkeley) 4/11/94
|
||||
#
|
||||
|
||||
# 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
|
||||
# -DNIS -- include 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
|
||||
|
||||
# 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
|
||||
|
||||
# libraries required on your system
|
||||
LIBS= -ldb -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
|
||||
|
||||
# additional .o files needed
|
||||
OBJADD=
|
||||
|
||||
################### end of user configuration flags ######################
|
||||
|
||||
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 ${OBJADD}
|
||||
|
||||
LINKS= ${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
|
||||
BINOWN= root
|
||||
BINGRP= kmem
|
||||
BINMODE=6555
|
||||
|
||||
ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
all: ${ALL}
|
||||
|
||||
sendmail: ${BEFORE} ${OBJS}
|
||||
${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
|
||||
|
||||
NROFF= nroff -h
|
||||
|
||||
aliases.0: aliases.5
|
||||
${NROFF} -mandoc aliases.5 > aliases.0
|
||||
|
||||
mailq.0: mailq.1
|
||||
${NROFF} -mandoc mailq.1 > mailq.0
|
||||
|
||||
newaliases.0: newaliases.1
|
||||
${NROFF} -mandoc newaliases.1 > newaliases.0
|
||||
|
||||
sendmail.0: sendmail.8
|
||||
${NROFF} -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 644 /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 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
|
||||
|
||||
# dependencies
|
||||
# gross overkill, and yet still not quite enough....
|
||||
${OBJS}: sendmail.h conf.h
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1983 Eric P. Allman
|
||||
* Copyright (c) 1983, 1995 Eric P. Allman
|
||||
* Copyright (c) 1988, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
@ -33,7 +33,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)collect.c 8.14 (Berkeley) 4/18/94";
|
||||
static char sccsid[] = "@(#)collect.c 8.49 (Berkeley) 10/29/95";
|
||||
#endif /* not lint */
|
||||
|
||||
# include <errno.h>
|
||||
@ -47,12 +47,14 @@ static char sccsid[] = "@(#)collect.c 8.14 (Berkeley) 4/18/94";
|
||||
** stripped off (after important information is extracted).
|
||||
**
|
||||
** Parameters:
|
||||
** fp -- file to read.
|
||||
** smtpmode -- if set, we are running SMTP: give an RFC821
|
||||
** style message to say we are ready to collect
|
||||
** input, and never ignore a single dot to mean
|
||||
** end of message.
|
||||
** requeueflag -- this message will be requeued later, so
|
||||
** don't do final processing on it.
|
||||
** hdrp -- the location to stash the header.
|
||||
** e -- the current envelope.
|
||||
**
|
||||
** Returns:
|
||||
@ -63,37 +65,77 @@ static char sccsid[] = "@(#)collect.c 8.14 (Berkeley) 4/18/94";
|
||||
** The from person may be set.
|
||||
*/
|
||||
|
||||
char *CollectErrorMessage;
|
||||
bool CollectErrno;
|
||||
static jmp_buf CtxCollectTimeout;
|
||||
static void collecttimeout();
|
||||
static bool CollectProgress;
|
||||
static EVENT *CollectTimeout;
|
||||
|
||||
collect(smtpmode, requeueflag, e)
|
||||
/* values for input state machine */
|
||||
#define IS_NORM 0 /* middle of line */
|
||||
#define IS_BOL 1 /* beginning of line */
|
||||
#define IS_DOT 2 /* read a dot at beginning of line */
|
||||
#define IS_DOTCR 3 /* read ".\r" at beginning of line */
|
||||
#define IS_CR 4 /* read a carriage return */
|
||||
|
||||
/* values for message state machine */
|
||||
#define MS_UFROM 0 /* reading Unix from line */
|
||||
#define MS_HEADER 1 /* reading message header */
|
||||
#define MS_BODY 2 /* reading message body */
|
||||
|
||||
void
|
||||
collect(fp, smtpmode, requeueflag, hdrp, e)
|
||||
FILE *fp;
|
||||
bool smtpmode;
|
||||
bool requeueflag;
|
||||
HDR **hdrp;
|
||||
register ENVELOPE *e;
|
||||
{
|
||||
register FILE *tf;
|
||||
bool ignrdot = smtpmode ? FALSE : IgnrDot;
|
||||
time_t dbto = smtpmode ? TimeOuts.to_datablock : 0;
|
||||
char buf[MAXLINE], buf2[MAXLINE];
|
||||
register char *workbuf, *freebuf;
|
||||
register char *bp;
|
||||
int c = '\0';
|
||||
bool inputerr = FALSE;
|
||||
extern char *hvalue();
|
||||
extern bool isheader(), flusheol();
|
||||
bool headeronly;
|
||||
char *buf;
|
||||
int buflen;
|
||||
int istate;
|
||||
int mstate;
|
||||
char *pbp;
|
||||
char peekbuf[8];
|
||||
char dfname[20];
|
||||
char bufbuf[MAXLINE];
|
||||
extern bool isheader();
|
||||
extern void eatheader();
|
||||
extern void tferror();
|
||||
|
||||
CollectErrorMessage = NULL;
|
||||
CollectErrno = 0;
|
||||
headeronly = hdrp != NULL;
|
||||
|
||||
/*
|
||||
** Create the temp file name and create the file.
|
||||
*/
|
||||
|
||||
e->e_df = queuename(e, 'd');
|
||||
e->e_df = newstr(e->e_df);
|
||||
if ((tf = dfopen(e->e_df, O_WRONLY|O_CREAT|O_TRUNC, FileMode)) == NULL)
|
||||
if (!headeronly)
|
||||
{
|
||||
syserr("Cannot create %s", e->e_df);
|
||||
NoReturn = TRUE;
|
||||
finis();
|
||||
struct stat stbuf;
|
||||
|
||||
strcpy(dfname, queuename(e, 'd'));
|
||||
if ((tf = dfopen(dfname, O_WRONLY|O_CREAT|O_TRUNC, FileMode)) == NULL)
|
||||
{
|
||||
syserr("Cannot create %s", dfname);
|
||||
e->e_flags |= EF_NO_BODY_RETN;
|
||||
finis();
|
||||
}
|
||||
if (fstat(fileno(tf), &stbuf) < 0)
|
||||
e->e_dfino = -1;
|
||||
else
|
||||
{
|
||||
e->e_dfdev = stbuf.st_dev;
|
||||
e->e_dfino = stbuf.st_ino;
|
||||
}
|
||||
HasEightBits = FALSE;
|
||||
e->e_msgsize = 0;
|
||||
e->e_flags |= EF_HAS_DF;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -103,223 +145,296 @@ collect(smtpmode, requeueflag, e)
|
||||
if (smtpmode)
|
||||
message("354 Enter mail, end with \".\" on a line by itself");
|
||||
|
||||
/* set global timer to monitor progress */
|
||||
sfgetset(dbto);
|
||||
if (tTd(30, 2))
|
||||
printf("collect\n");
|
||||
|
||||
/*
|
||||
** Try to read a UNIX-style From line
|
||||
** Read the message.
|
||||
**
|
||||
** This is done using two interleaved state machines.
|
||||
** The input state machine is looking for things like
|
||||
** hidden dots; the message state machine is handling
|
||||
** the larger picture (e.g., header versus body).
|
||||
*/
|
||||
|
||||
if (sfgets(buf, MAXLINE, InChannel, dbto,
|
||||
"initial message read") == NULL)
|
||||
goto readerr;
|
||||
fixcrlf(buf, FALSE);
|
||||
# ifndef NOTUNIX
|
||||
if (!SaveFrom && strncmp(buf, "From ", 5) == 0)
|
||||
buf = bp = bufbuf;
|
||||
buflen = sizeof bufbuf;
|
||||
pbp = peekbuf;
|
||||
istate = IS_BOL;
|
||||
mstate = SaveFrom ? MS_HEADER : MS_UFROM;
|
||||
CollectProgress = FALSE;
|
||||
|
||||
if (dbto != 0)
|
||||
{
|
||||
if (!flusheol(buf, InChannel))
|
||||
/* handle possible input timeout */
|
||||
if (setjmp(CtxCollectTimeout) != 0)
|
||||
{
|
||||
#ifdef LOG
|
||||
syslog(LOG_NOTICE,
|
||||
"timeout waiting for input from %s during message collect",
|
||||
CurHostName ? CurHostName : "<local machine>");
|
||||
#endif
|
||||
errno = 0;
|
||||
usrerr("451 timeout waiting for input during message collect");
|
||||
goto readerr;
|
||||
eatfrom(buf, e);
|
||||
if (sfgets(buf, MAXLINE, InChannel, dbto,
|
||||
"message header read") == NULL)
|
||||
goto readerr;
|
||||
fixcrlf(buf, FALSE);
|
||||
}
|
||||
CollectTimeout = setevent(dbto, collecttimeout, dbto);
|
||||
}
|
||||
# endif /* NOTUNIX */
|
||||
|
||||
/*
|
||||
** Copy InChannel to temp file & do message editing.
|
||||
** To keep certain mailers from getting confused,
|
||||
** and to keep the output clean, lines that look
|
||||
** like UNIX "From" lines are deleted in the header.
|
||||
*/
|
||||
|
||||
workbuf = buf; /* `workbuf' contains a header field */
|
||||
freebuf = buf2; /* `freebuf' can be used for read-ahead */
|
||||
for (;;)
|
||||
{
|
||||
char *curbuf;
|
||||
int curbuffree;
|
||||
register int curbuflen;
|
||||
char *p;
|
||||
|
||||
/* first, see if the header is over */
|
||||
if (!isheader(workbuf))
|
||||
{
|
||||
fixcrlf(workbuf, TRUE);
|
||||
break;
|
||||
}
|
||||
|
||||
/* if the line is too long, throw the rest away */
|
||||
if (!flusheol(workbuf, InChannel))
|
||||
goto readerr;
|
||||
|
||||
/* it's okay to toss '\n' now (flusheol() needed it) */
|
||||
fixcrlf(workbuf, TRUE);
|
||||
|
||||
curbuf = workbuf;
|
||||
curbuflen = strlen(curbuf);
|
||||
curbuffree = MAXLINE - curbuflen;
|
||||
p = curbuf + curbuflen;
|
||||
|
||||
/* get the rest of this field */
|
||||
if (tTd(30, 35))
|
||||
printf("top, istate=%d, mstate=%d\n", istate, mstate);
|
||||
for (;;)
|
||||
{
|
||||
int clen;
|
||||
|
||||
if (sfgets(freebuf, MAXLINE, InChannel, dbto,
|
||||
"message header read") == NULL)
|
||||
if (pbp > peekbuf)
|
||||
c = *--pbp;
|
||||
else
|
||||
{
|
||||
freebuf[0] = '\0';
|
||||
break;
|
||||
while (!feof(fp) && !ferror(fp))
|
||||
{
|
||||
errno = 0;
|
||||
c = getc(fp);
|
||||
if (errno != EINTR)
|
||||
break;
|
||||
clearerr(fp);
|
||||
}
|
||||
CollectProgress = TRUE;
|
||||
if (TrafficLogFile != NULL && !headeronly)
|
||||
{
|
||||
if (istate == IS_BOL)
|
||||
fprintf(TrafficLogFile, "%05d <<< ",
|
||||
getpid());
|
||||
if (c == EOF)
|
||||
fprintf(TrafficLogFile, "[EOF]\n");
|
||||
else
|
||||
putc(c, TrafficLogFile);
|
||||
}
|
||||
if (c == EOF)
|
||||
goto readerr;
|
||||
if (SevenBitInput)
|
||||
c &= 0x7f;
|
||||
else
|
||||
HasEightBits |= bitset(0x80, c);
|
||||
if (!headeronly)
|
||||
e->e_msgsize++;
|
||||
}
|
||||
|
||||
/* is this a continuation line? */
|
||||
if (*freebuf != ' ' && *freebuf != '\t')
|
||||
if (tTd(30, 94))
|
||||
printf("istate=%d, c=%c (0x%x)\n",
|
||||
istate, c, c);
|
||||
switch (istate)
|
||||
{
|
||||
case IS_BOL:
|
||||
if (c == '.')
|
||||
{
|
||||
istate = IS_DOT;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
|
||||
if (!flusheol(freebuf, InChannel))
|
||||
goto readerr;
|
||||
case IS_DOT:
|
||||
if (c == '\n' && !ignrdot &&
|
||||
!bitset(EF_NL_NOT_EOL, e->e_flags))
|
||||
goto readerr;
|
||||
else if (c == '\r' &&
|
||||
!bitset(EF_CRLF_NOT_EOL, e->e_flags))
|
||||
{
|
||||
istate = IS_DOTCR;
|
||||
continue;
|
||||
}
|
||||
else if (c != '.' ||
|
||||
(OpMode != MD_SMTP &&
|
||||
OpMode != MD_DAEMON &&
|
||||
OpMode != MD_ARPAFTP))
|
||||
{
|
||||
*pbp++ = c;
|
||||
c = '.';
|
||||
}
|
||||
break;
|
||||
|
||||
fixcrlf(freebuf, TRUE);
|
||||
clen = strlen(freebuf) + 1;
|
||||
case IS_DOTCR:
|
||||
if (c == '\n')
|
||||
goto readerr;
|
||||
else
|
||||
{
|
||||
/* push back the ".\rx" */
|
||||
*pbp++ = c;
|
||||
*pbp++ = '\r';
|
||||
c = '.';
|
||||
}
|
||||
break;
|
||||
|
||||
/* if insufficient room, dynamically allocate buffer */
|
||||
if (clen >= curbuffree)
|
||||
{
|
||||
/* reallocate buffer */
|
||||
int nbuflen = ((p - curbuf) + clen) * 2;
|
||||
char *nbuf = xalloc(nbuflen);
|
||||
|
||||
p = nbuf + curbuflen;
|
||||
curbuffree = nbuflen - curbuflen;
|
||||
bcopy(curbuf, nbuf, curbuflen);
|
||||
if (curbuf != buf && curbuf != buf2)
|
||||
free(curbuf);
|
||||
curbuf = nbuf;
|
||||
case IS_CR:
|
||||
if (c == '\n')
|
||||
istate = IS_BOL;
|
||||
else
|
||||
{
|
||||
ungetc(c, fp);
|
||||
c = '\r';
|
||||
istate = IS_NORM;
|
||||
}
|
||||
goto bufferchar;
|
||||
}
|
||||
*p++ = '\n';
|
||||
bcopy(freebuf, p, clen - 1);
|
||||
p += clen - 1;
|
||||
curbuffree -= clen;
|
||||
curbuflen += clen;
|
||||
|
||||
if (c == '\r' && !bitset(EF_CRLF_NOT_EOL, e->e_flags))
|
||||
{
|
||||
istate = IS_CR;
|
||||
continue;
|
||||
}
|
||||
else if (c == '\n' && !bitset(EF_NL_NOT_EOL, e->e_flags))
|
||||
istate = IS_BOL;
|
||||
else
|
||||
istate = IS_NORM;
|
||||
|
||||
bufferchar:
|
||||
if (mstate == MS_BODY)
|
||||
{
|
||||
/* just put the character out */
|
||||
if (MaxMessageSize <= 0 ||
|
||||
e->e_msgsize <= MaxMessageSize)
|
||||
putc(c, tf);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* header -- buffer up */
|
||||
if (bp >= &buf[buflen - 2])
|
||||
{
|
||||
char *obuf;
|
||||
|
||||
if (mstate != MS_HEADER)
|
||||
break;
|
||||
|
||||
/* out of space for header */
|
||||
obuf = buf;
|
||||
if (buflen < MEMCHUNKSIZE)
|
||||
buflen *= 2;
|
||||
else
|
||||
buflen += MEMCHUNKSIZE;
|
||||
buf = xalloc(buflen);
|
||||
bcopy(obuf, buf, bp - obuf);
|
||||
bp = &buf[bp - obuf];
|
||||
if (obuf != bufbuf)
|
||||
free(obuf);
|
||||
}
|
||||
if (c != '\0')
|
||||
*bp++ = c;
|
||||
if (istate == IS_BOL)
|
||||
break;
|
||||
}
|
||||
*p++ = '\0';
|
||||
|
||||
e->e_msgsize += curbuflen;
|
||||
|
||||
/*
|
||||
** The working buffer now becomes the free buffer, since
|
||||
** the free buffer contains a new header field.
|
||||
**
|
||||
** This is premature, since we still havent called
|
||||
** chompheader() to process the field we just created
|
||||
** (so the call to chompheader() will use `freebuf').
|
||||
** This convolution is necessary so that if we break out
|
||||
** of the loop due to H_EOH, `workbuf' will always be
|
||||
** the next unprocessed buffer.
|
||||
*/
|
||||
*bp = '\0';
|
||||
|
||||
nextstate:
|
||||
if (tTd(30, 35))
|
||||
printf("nextstate, istate=%d, mstate=%d, line = \"%s\"\n",
|
||||
istate, mstate, buf);
|
||||
switch (mstate)
|
||||
{
|
||||
register char *tmp = workbuf;
|
||||
workbuf = freebuf;
|
||||
freebuf = tmp;
|
||||
extern int chompheader();
|
||||
|
||||
case MS_UFROM:
|
||||
mstate = MS_HEADER;
|
||||
#ifndef NOTUNIX
|
||||
if (strncmp(buf, "From ", 5) == 0)
|
||||
{
|
||||
extern void eatfrom();
|
||||
|
||||
bp = buf;
|
||||
eatfrom(buf, e);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
/* fall through */
|
||||
|
||||
case MS_HEADER:
|
||||
if (!isheader(buf))
|
||||
{
|
||||
mstate = MS_BODY;
|
||||
goto nextstate;
|
||||
}
|
||||
|
||||
/* check for possible continuation line */
|
||||
do
|
||||
{
|
||||
clearerr(fp);
|
||||
errno = 0;
|
||||
c = getc(fp);
|
||||
} while (errno == EINTR);
|
||||
if (c != EOF)
|
||||
ungetc(c, fp);
|
||||
if (c == ' ' || c == '\t')
|
||||
{
|
||||
/* yep -- defer this */
|
||||
continue;
|
||||
}
|
||||
|
||||
/* trim off trailing CRLF or NL */
|
||||
if (*--bp != '\n' || *--bp != '\r')
|
||||
bp++;
|
||||
*bp = '\0';
|
||||
if (bitset(H_EOH, chompheader(buf, FALSE, hdrp, e)))
|
||||
mstate = MS_BODY;
|
||||
break;
|
||||
|
||||
case MS_BODY:
|
||||
if (tTd(30, 1))
|
||||
printf("EOH\n");
|
||||
if (headeronly)
|
||||
goto readerr;
|
||||
bp = buf;
|
||||
|
||||
/* toss blank line */
|
||||
if ((!bitset(EF_CRLF_NOT_EOL, e->e_flags) &&
|
||||
bp[0] == '\r' && bp[1] == '\n') ||
|
||||
(!bitset(EF_NL_NOT_EOL, e->e_flags) &&
|
||||
bp[0] == '\n'))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
/* if not a blank separator, write it out */
|
||||
if (MaxMessageSize <= 0 ||
|
||||
e->e_msgsize <= MaxMessageSize)
|
||||
{
|
||||
while (*bp != '\0')
|
||||
putc(*bp++, tf);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
** Snarf header away.
|
||||
*/
|
||||
|
||||
if (bitset(H_EOH, chompheader(curbuf, FALSE, e)))
|
||||
break;
|
||||
|
||||
/*
|
||||
** If the buffer was dynamically allocated, free it.
|
||||
*/
|
||||
|
||||
if (curbuf != buf && curbuf != buf2)
|
||||
free(curbuf);
|
||||
bp = buf;
|
||||
}
|
||||
|
||||
if (tTd(30, 1))
|
||||
printf("EOH\n");
|
||||
|
||||
if (*workbuf == '\0')
|
||||
{
|
||||
/* throw away a blank line */
|
||||
if (sfgets(buf, MAXLINE, InChannel, dbto,
|
||||
"message separator read") == NULL)
|
||||
goto readerr;
|
||||
}
|
||||
else if (workbuf == buf2) /* guarantee `buf' contains data */
|
||||
(void) strcpy(buf, buf2);
|
||||
|
||||
/*
|
||||
** Collect the body of the message.
|
||||
*/
|
||||
|
||||
for (;;)
|
||||
{
|
||||
register char *bp = buf;
|
||||
|
||||
fixcrlf(buf, TRUE);
|
||||
|
||||
/* check for end-of-message */
|
||||
if (!ignrdot && buf[0] == '.' && (buf[1] == '\n' || buf[1] == '\0'))
|
||||
break;
|
||||
|
||||
/* check for transparent dot */
|
||||
if ((OpMode == MD_SMTP || OpMode == MD_DAEMON) &&
|
||||
bp[0] == '.' && bp[1] == '.')
|
||||
bp++;
|
||||
|
||||
/*
|
||||
** Figure message length, output the line to the temp
|
||||
** file, and insert a newline if missing.
|
||||
*/
|
||||
|
||||
e->e_msgsize += strlen(bp) + 1;
|
||||
fputs(bp, tf);
|
||||
fputs("\n", tf);
|
||||
if (ferror(tf))
|
||||
tferror(tf, e);
|
||||
if (sfgets(buf, MAXLINE, InChannel, dbto,
|
||||
"message body read") == NULL)
|
||||
goto readerr;
|
||||
}
|
||||
|
||||
if (feof(InChannel) || ferror(InChannel))
|
||||
{
|
||||
readerr:
|
||||
if ((feof(fp) && smtpmode) || ferror(fp))
|
||||
{
|
||||
const char *errmsg = errstring(errno);
|
||||
|
||||
if (tTd(30, 1))
|
||||
printf("collect: read error\n");
|
||||
printf("collect: premature EOM: %s\n", errmsg);
|
||||
#ifdef LOG
|
||||
if (LogLevel >= 2)
|
||||
syslog(LOG_WARNING, "collect: premature EOM: %s", errmsg);
|
||||
#endif
|
||||
inputerr = TRUE;
|
||||
}
|
||||
|
||||
/* reset global timer */
|
||||
sfgetset((time_t) 0);
|
||||
clrevent(CollectTimeout);
|
||||
|
||||
if (fflush(tf) != 0)
|
||||
tferror(tf, e);
|
||||
if (fsync(fileno(tf)) < 0 || fclose(tf) < 0)
|
||||
if (headeronly)
|
||||
return;
|
||||
|
||||
if (tf != NULL &&
|
||||
(fflush(tf) != 0 || ferror(tf) || fsync(fileno(tf)) < 0 ||
|
||||
fclose(tf) < 0))
|
||||
{
|
||||
tferror(tf, e);
|
||||
flush_errors(TRUE);
|
||||
finis();
|
||||
}
|
||||
|
||||
if (CollectErrorMessage != NULL && Errors <= 0)
|
||||
/* An EOF when running SMTP is an error */
|
||||
if (inputerr && (OpMode == MD_SMTP || OpMode == MD_DAEMON))
|
||||
{
|
||||
if (CollectErrno != 0)
|
||||
{
|
||||
errno = CollectErrno;
|
||||
syserr(CollectErrorMessage, e->e_df);
|
||||
finis();
|
||||
}
|
||||
usrerr(CollectErrorMessage);
|
||||
}
|
||||
else if (inputerr && (OpMode == MD_SMTP || OpMode == MD_DAEMON))
|
||||
{
|
||||
/* An EOF when running SMTP is an error */
|
||||
char *host;
|
||||
char *problem;
|
||||
|
||||
@ -327,24 +442,28 @@ collect(smtpmode, requeueflag, e)
|
||||
if (host == NULL)
|
||||
host = "localhost";
|
||||
|
||||
if (feof(InChannel))
|
||||
if (feof(fp))
|
||||
problem = "unexpected close";
|
||||
else if (ferror(InChannel))
|
||||
else if (ferror(fp))
|
||||
problem = "I/O error";
|
||||
else
|
||||
problem = "read timeout";
|
||||
# ifdef LOG
|
||||
if (LogLevel > 0 && feof(InChannel))
|
||||
if (LogLevel > 0 && feof(fp))
|
||||
syslog(LOG_NOTICE,
|
||||
"collect: %s on connection from %s, sender=%s: %s\n",
|
||||
problem, host, e->e_from.q_paddr, errstring(errno));
|
||||
"collect: %s on connection from %.100s, sender=%s: %s",
|
||||
problem, host,
|
||||
shortenstring(e->e_from.q_paddr, 203),
|
||||
errstring(errno));
|
||||
# endif
|
||||
if (feof(InChannel))
|
||||
if (feof(fp))
|
||||
usrerr("451 collect: %s on connection from %s, from=%s",
|
||||
problem, host, e->e_from.q_paddr);
|
||||
problem, host,
|
||||
shortenstring(e->e_from.q_paddr, 203));
|
||||
else
|
||||
syserr("451 collect: %s on connection from %s, from=%s",
|
||||
problem, host, e->e_from.q_paddr);
|
||||
problem, host,
|
||||
shortenstring(e->e_from.q_paddr, 203));
|
||||
|
||||
/* don't return an error indication */
|
||||
e->e_to = NULL;
|
||||
@ -364,84 +483,128 @@ collect(smtpmode, requeueflag, e)
|
||||
|
||||
eatheader(e, !requeueflag);
|
||||
|
||||
if (GrabTo && e->e_sendqueue == NULL)
|
||||
usrerr("No recipient addresses found in header");
|
||||
|
||||
/* collect statistics */
|
||||
if (OpMode != MD_VERIFY)
|
||||
{
|
||||
extern void markstats();
|
||||
|
||||
markstats(e, (ADDRESS *) NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
** Add an Apparently-To: line if we have no recipient lines.
|
||||
*/
|
||||
|
||||
if (hvalue("to", e) == NULL && hvalue("cc", e) == NULL &&
|
||||
hvalue("bcc", e) == NULL && hvalue("apparently-to", e) == NULL)
|
||||
if (hvalue("to", e->e_header) != NULL ||
|
||||
hvalue("cc", e->e_header) != NULL ||
|
||||
hvalue("apparently-to", e->e_header) != NULL)
|
||||
{
|
||||
/* have a valid recipient header -- delete Bcc: headers */
|
||||
e->e_flags |= EF_DELETE_BCC;
|
||||
}
|
||||
else if (hvalue("bcc", e->e_header) == NULL)
|
||||
{
|
||||
/* no valid recipient headers */
|
||||
register ADDRESS *q;
|
||||
char *hdr = NULL;
|
||||
extern void addheader();
|
||||
|
||||
/* create an Apparently-To: field */
|
||||
/* that or reject the message.... */
|
||||
for (q = e->e_sendqueue; q != NULL; q = q->q_next)
|
||||
switch (NoRecipientAction)
|
||||
{
|
||||
if (q->q_alias != NULL)
|
||||
continue;
|
||||
if (tTd(30, 3))
|
||||
printf("Adding Apparently-To: %s\n", q->q_paddr);
|
||||
addheader("Apparently-To", q->q_paddr, e);
|
||||
case NRA_ADD_APPARENTLY_TO:
|
||||
hdr = "Apparently-To";
|
||||
break;
|
||||
|
||||
case NRA_ADD_TO:
|
||||
hdr = "To";
|
||||
break;
|
||||
|
||||
case NRA_ADD_BCC:
|
||||
addheader("Bcc", "", &e->e_header);
|
||||
break;
|
||||
|
||||
case NRA_ADD_TO_UNDISCLOSED:
|
||||
addheader("To", "undisclosed-recipients:;", &e->e_header);
|
||||
break;
|
||||
}
|
||||
|
||||
if (hdr != NULL)
|
||||
{
|
||||
for (q = e->e_sendqueue; q != NULL; q = q->q_next)
|
||||
{
|
||||
if (q->q_alias != NULL)
|
||||
continue;
|
||||
if (tTd(30, 3))
|
||||
printf("Adding %s: %s\n",
|
||||
hdr, q->q_paddr);
|
||||
addheader(hdr, q->q_paddr, &e->e_header);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* check for message too large */
|
||||
if (MaxMessageSize > 0 && e->e_msgsize > MaxMessageSize)
|
||||
{
|
||||
e->e_status = "5.2.3";
|
||||
usrerr("552 Message exceeds maximum fixed size (%ld)",
|
||||
MaxMessageSize);
|
||||
# ifdef LOG
|
||||
if (LogLevel > 6)
|
||||
syslog(LOG_NOTICE, "%s: message size (%ld) exceeds maximum (%ld)",
|
||||
e->e_id, e->e_msgsize, MaxMessageSize);
|
||||
# endif
|
||||
}
|
||||
|
||||
if ((e->e_dfp = fopen(e->e_df, "r")) == NULL)
|
||||
/* check for illegal 8-bit data */
|
||||
if (HasEightBits)
|
||||
{
|
||||
e->e_flags |= EF_HAS8BIT;
|
||||
if (!bitset(MM_PASS8BIT|MM_MIME8BIT, MimeMode))
|
||||
{
|
||||
e->e_status = "5.6.1";
|
||||
usrerr("554 Eight bit data not allowed");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* if it claimed to be 8 bits, well, it lied.... */
|
||||
if (e->e_bodytype != NULL &&
|
||||
strcasecmp(e->e_bodytype, "8BITMIME") == 0)
|
||||
e->e_bodytype = "7BIT";
|
||||
}
|
||||
|
||||
if ((e->e_dfp = fopen(dfname, "r")) == NULL)
|
||||
{
|
||||
/* we haven't acked receipt yet, so just chuck this */
|
||||
syserr("Cannot reopen %s", e->e_df);
|
||||
syserr("Cannot reopen %s", dfname);
|
||||
finis();
|
||||
}
|
||||
}
|
||||
/*
|
||||
** FLUSHEOL -- if not at EOL, throw away rest of input line.
|
||||
**
|
||||
** Parameters:
|
||||
** buf -- last line read in (checked for '\n'),
|
||||
** fp -- file to be read from.
|
||||
**
|
||||
** Returns:
|
||||
** FALSE on error from sfgets(), TRUE otherwise.
|
||||
**
|
||||
** Side Effects:
|
||||
** none.
|
||||
*/
|
||||
|
||||
bool
|
||||
flusheol(buf, fp)
|
||||
char *buf;
|
||||
FILE *fp;
|
||||
|
||||
static void
|
||||
collecttimeout(timeout)
|
||||
time_t timeout;
|
||||
{
|
||||
register char *p = buf;
|
||||
char junkbuf[MAXLINE];
|
||||
/* if no progress was made, die now */
|
||||
if (!CollectProgress)
|
||||
longjmp(CtxCollectTimeout, 1);
|
||||
|
||||
while (strchr(p, '\n') == NULL)
|
||||
{
|
||||
CollectErrorMessage = "553 header line too long";
|
||||
CollectErrno = 0;
|
||||
if (sfgets(junkbuf, MAXLINE, fp, TimeOuts.to_datablock,
|
||||
"long line flush") == NULL)
|
||||
return (FALSE);
|
||||
p = junkbuf;
|
||||
}
|
||||
|
||||
return (TRUE);
|
||||
/* otherwise reset the timeout */
|
||||
CollectTimeout = setevent(timeout, collecttimeout, timeout);
|
||||
CollectProgress = FALSE;
|
||||
}
|
||||
/*
|
||||
** TFERROR -- signal error on writing the temporary file.
|
||||
**
|
||||
** Parameters:
|
||||
** tf -- the file pointer for the temporary file.
|
||||
** e -- the current envelope.
|
||||
**
|
||||
** Returns:
|
||||
** none.
|
||||
@ -451,21 +614,22 @@ flusheol(buf, fp)
|
||||
** Arranges for following output to go elsewhere.
|
||||
*/
|
||||
|
||||
void
|
||||
tferror(tf, e)
|
||||
FILE *tf;
|
||||
register ENVELOPE *e;
|
||||
{
|
||||
CollectErrno = errno;
|
||||
setstat(EX_IOERR);
|
||||
if (errno == ENOSPC)
|
||||
{
|
||||
struct stat st;
|
||||
long avail;
|
||||
long bsize;
|
||||
|
||||
NoReturn = TRUE;
|
||||
e->e_flags |= EF_NO_BODY_RETN;
|
||||
if (fstat(fileno(tf), &st) < 0)
|
||||
st.st_size = 0;
|
||||
(void) freopen(e->e_df, "w", tf);
|
||||
(void) freopen(queuename(e, 'd'), "w", tf);
|
||||
if (st.st_size <= 0)
|
||||
fprintf(tf, "\n*** Mail could not be accepted");
|
||||
else if (sizeof st.st_size > sizeof (long))
|
||||
@ -476,7 +640,7 @@ tferror(tf, e)
|
||||
st.st_size);
|
||||
fprintf(tf, "*** at %s due to lack of disk space for temp file.\n",
|
||||
MyHostName);
|
||||
avail = freespace(QueueDir, &bsize);
|
||||
avail = freediskspace(QueueDir, &bsize);
|
||||
if (avail > 0)
|
||||
{
|
||||
if (bsize > 1024)
|
||||
@ -486,12 +650,11 @@ tferror(tf, e)
|
||||
fprintf(tf, "*** Currently, %ld kilobytes are available for mail temp files.\n",
|
||||
avail);
|
||||
}
|
||||
CollectErrorMessage = "452 Out of disk space for temp file";
|
||||
e->e_status = "4.3.1";
|
||||
usrerr("452 Out of disk space for temp file");
|
||||
}
|
||||
else
|
||||
{
|
||||
CollectErrorMessage = "cannot write message body to disk (%s)";
|
||||
}
|
||||
syserr("collect: Cannot write tf%s", e->e_id);
|
||||
(void) freopen("/dev/null", "w", tf);
|
||||
}
|
||||
/*
|
||||
@ -525,6 +688,7 @@ char *MonthList[] =
|
||||
NULL
|
||||
};
|
||||
|
||||
void
|
||||
eatfrom(fm, e)
|
||||
char *fm;
|
||||
register ENVELOPE *e;
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1986 Eric P. Allman
|
||||
* Copyright (c) 1986, 1995 Eric P. Allman
|
||||
* Copyright (c) 1988, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
@ -36,23 +36,21 @@
|
||||
|
||||
#ifndef lint
|
||||
#if NAMED_BIND
|
||||
static char sccsid[] = "@(#)domain.c 8.19.1.1 (Berkeley) 3/6/95 (with name server)";
|
||||
static char sccsid[] = "@(#)domain.c 8.54 (Berkeley) 9/28/95 (with name server)";
|
||||
#else
|
||||
static char sccsid[] = "@(#)domain.c 8.19.1.1 (Berkeley) 3/6/95 (without name server)";
|
||||
static char sccsid[] = "@(#)domain.c 8.54 (Berkeley) 9/28/95 (without name server)";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#if NAMED_BIND
|
||||
|
||||
#include <errno.h>
|
||||
#include <arpa/nameser.h>
|
||||
#include <resolv.h>
|
||||
#include <netdb.h>
|
||||
|
||||
typedef union
|
||||
{
|
||||
HEADER qb1;
|
||||
char qb2[PACKETSZ];
|
||||
u_char qb2[PACKETSZ];
|
||||
} querybuf;
|
||||
|
||||
static char MXHostBuf[MAXMXHOSTS*PACKETSZ];
|
||||
@ -69,15 +67,17 @@ static char MXHostBuf[MAXMXHOSTS*PACKETSZ];
|
||||
# define NO_DATA NO_ADDRESS
|
||||
#endif
|
||||
|
||||
#ifndef HEADERSZ
|
||||
# define HEADERSZ sizeof(HEADER)
|
||||
#ifndef HFIXEDSZ
|
||||
# define HFIXEDSZ 12 /* 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) */
|
||||
|
||||
#define MAXCNAMEDEPTH 10 /* maximum depth of CNAME recursion */
|
||||
|
||||
#if defined(__RES) && (__RES >= 19940415)
|
||||
# define RES_UNC_T char *
|
||||
#else
|
||||
# define RES_UNC_T u_char *
|
||||
#endif
|
||||
/*
|
||||
** GETMXRR -- get MX resource records for a domain
|
||||
**
|
||||
@ -96,13 +96,13 @@ static char MXHostBuf[MAXMXHOSTS*PACKETSZ];
|
||||
** and 1 is returned.
|
||||
*/
|
||||
|
||||
int
|
||||
getmxrr(host, mxhosts, droplocalhost, rcode)
|
||||
char *host;
|
||||
char **mxhosts;
|
||||
bool droplocalhost;
|
||||
int *rcode;
|
||||
{
|
||||
extern int h_errno;
|
||||
register u_char *eom, *cp;
|
||||
register int i, j, n;
|
||||
int nmx = 0;
|
||||
@ -111,11 +111,13 @@ getmxrr(host, mxhosts, droplocalhost, rcode)
|
||||
querybuf answer;
|
||||
int ancount, qdcount, buflen;
|
||||
bool seenlocal = FALSE;
|
||||
u_short pref, localpref, type;
|
||||
u_short pref, type;
|
||||
u_short localpref = 256;
|
||||
char *fallbackMX = FallBackMX;
|
||||
static bool firsttime = TRUE;
|
||||
STAB *st;
|
||||
bool trycanon = FALSE;
|
||||
int (*resfunc)();
|
||||
extern int res_query(), res_search();
|
||||
u_short prefer[MAXMXHOSTS];
|
||||
int weight[MAXMXHOSTS];
|
||||
extern bool getcanonname();
|
||||
@ -125,15 +127,14 @@ getmxrr(host, mxhosts, droplocalhost, rcode)
|
||||
|
||||
if (fallbackMX != NULL)
|
||||
{
|
||||
if (firsttime && res_query(FallBackMX, C_IN, T_A,
|
||||
(char *) &answer, sizeof answer) < 0)
|
||||
if (firsttime &&
|
||||
res_query(FallBackMX, C_IN, T_A,
|
||||
(u_char *) &answer, sizeof answer) < 0)
|
||||
{
|
||||
/* this entry is bogus */
|
||||
fallbackMX = FallBackMX = NULL;
|
||||
}
|
||||
else if (droplocalhost &&
|
||||
(st = stab(fallbackMX, ST_CLASS, ST_FIND)) != NULL &&
|
||||
bitnset('w', st->s_class))
|
||||
else if (droplocalhost && wordinclass(fallbackMX, 'w'))
|
||||
{
|
||||
/* don't use fallback for this pass */
|
||||
fallbackMX = NULL;
|
||||
@ -141,12 +142,29 @@ getmxrr(host, mxhosts, droplocalhost, rcode)
|
||||
firsttime = FALSE;
|
||||
}
|
||||
|
||||
*rcode = EX_OK;
|
||||
|
||||
/* efficiency hack -- numeric or non-MX lookups */
|
||||
if (host[0] == '[')
|
||||
goto punt;
|
||||
|
||||
/*
|
||||
** If we don't have MX records in our host switch, don't
|
||||
** try for MX records. Note that this really isn't "right",
|
||||
** since we might be set up to try NIS first and then DNS;
|
||||
** if the host is found in NIS we really shouldn't be doing
|
||||
** MX lookups. However, that should be a degenerate case.
|
||||
*/
|
||||
|
||||
if (!UseNameServer)
|
||||
goto punt;
|
||||
if (HasWildcardMX && ConfigLevel >= 6)
|
||||
resfunc = res_query;
|
||||
else
|
||||
resfunc = res_search;
|
||||
|
||||
errno = 0;
|
||||
n = res_search(host, C_IN, T_MX, (char *)&answer, sizeof(answer));
|
||||
n = (*resfunc)(host, C_IN, T_MX, (u_char *) &answer, sizeof(answer));
|
||||
if (n < 0)
|
||||
{
|
||||
if (tTd(8, 1))
|
||||
@ -163,25 +181,22 @@ getmxrr(host, mxhosts, droplocalhost, rcode)
|
||||
goto punt;
|
||||
|
||||
case HOST_NOT_FOUND:
|
||||
#ifdef BROKEN_RES_SEARCH
|
||||
/* Ultrix resolver returns failure w/ h_errno=0 */
|
||||
case 0:
|
||||
#if BROKEN_RES_SEARCH
|
||||
case 0: /* Ultrix resolver retns failure w/ h_errno=0 */
|
||||
#endif
|
||||
/* the host just doesn't exist */
|
||||
/* host doesn't exist in DNS; might be in /etc/hosts */
|
||||
trycanon = TRUE;
|
||||
*rcode = EX_NOHOST;
|
||||
|
||||
if (!UseNameServer)
|
||||
{
|
||||
/* might exist in /etc/hosts */
|
||||
goto punt;
|
||||
}
|
||||
break;
|
||||
goto punt;
|
||||
|
||||
case TRY_AGAIN:
|
||||
/* couldn't connect to the name server */
|
||||
if (!UseNameServer && errno == ECONNREFUSED)
|
||||
goto punt;
|
||||
|
||||
if (fallbackMX != NULL)
|
||||
{
|
||||
/* name server is hosed -- push to fallback */
|
||||
mxhosts[nmx++] = fallbackMX;
|
||||
return nmx;
|
||||
}
|
||||
/* it might come up later; better queue it up */
|
||||
*rcode = EX_TEMPFAIL;
|
||||
break;
|
||||
@ -199,7 +214,7 @@ getmxrr(host, mxhosts, droplocalhost, rcode)
|
||||
|
||||
/* find first satisfactory answer */
|
||||
hp = (HEADER *)&answer;
|
||||
cp = (u_char *)&answer + HEADERSZ;
|
||||
cp = (u_char *)&answer + HFIXEDSZ;
|
||||
eom = (u_char *)&answer + n;
|
||||
for (qdcount = ntohs(hp->qdcount); qdcount--; cp += n + QFIXEDSZ)
|
||||
if ((n = dn_skipname(cp, eom)) < 0)
|
||||
@ -210,11 +225,11 @@ getmxrr(host, mxhosts, droplocalhost, rcode)
|
||||
while (--ancount >= 0 && cp < eom && nmx < MAXMXHOSTS - 1)
|
||||
{
|
||||
if ((n = dn_expand((u_char *)&answer,
|
||||
eom, cp, (u_char *)bp, buflen)) < 0)
|
||||
eom, cp, (RES_UNC_T) bp, buflen)) < 0)
|
||||
break;
|
||||
cp += n;
|
||||
GETSHORT(type, cp);
|
||||
cp += SHORTSIZE + LONGSIZE;
|
||||
cp += INT16SZ + INT32SZ;
|
||||
GETSHORT(n, cp);
|
||||
if (type != T_MX)
|
||||
{
|
||||
@ -226,22 +241,25 @@ getmxrr(host, mxhosts, droplocalhost, rcode)
|
||||
}
|
||||
GETSHORT(pref, cp);
|
||||
if ((n = dn_expand((u_char *)&answer, eom, cp,
|
||||
(u_char *)bp, buflen)) < 0)
|
||||
(RES_UNC_T) bp, buflen)) < 0)
|
||||
break;
|
||||
cp += n;
|
||||
if (droplocalhost &&
|
||||
(st = stab(bp, ST_CLASS, ST_FIND)) != NULL &&
|
||||
bitnset('w', st->s_class))
|
||||
if (wordinclass(bp, 'w'))
|
||||
{
|
||||
if (tTd(8, 3))
|
||||
printf("found localhost (%s) in MX list, pref=%d\n",
|
||||
bp, pref);
|
||||
if (!seenlocal || pref < localpref)
|
||||
localpref = pref;
|
||||
seenlocal = TRUE;
|
||||
continue;
|
||||
if (droplocalhost)
|
||||
{
|
||||
if (!seenlocal || pref < localpref)
|
||||
localpref = pref;
|
||||
seenlocal = TRUE;
|
||||
continue;
|
||||
}
|
||||
weight[nmx] = 0;
|
||||
}
|
||||
weight[nmx] = mxrand(bp);
|
||||
else
|
||||
weight[nmx] = mxrand(bp);
|
||||
prefer[nmx] = pref;
|
||||
mxhosts[nmx++] = bp;
|
||||
n = strlen(bp);
|
||||
@ -284,11 +302,25 @@ getmxrr(host, mxhosts, droplocalhost, rcode)
|
||||
}
|
||||
}
|
||||
|
||||
/* delete duplicates from list (yes, some bozos have duplicates) */
|
||||
for (i = 0; i < nmx - 1; )
|
||||
{
|
||||
if (strcasecmp(mxhosts[i], mxhosts[i + 1]) != 0)
|
||||
i++;
|
||||
else
|
||||
{
|
||||
/* compress out duplicate */
|
||||
for (j = i + 1; j < nmx; j++)
|
||||
mxhosts[j] = mxhosts[j + 1];
|
||||
nmx--;
|
||||
}
|
||||
}
|
||||
|
||||
if (nmx == 0)
|
||||
{
|
||||
punt:
|
||||
if (seenlocal &&
|
||||
(!TryNullMXList || gethostbyname(host) == NULL))
|
||||
(!TryNullMXList || sm_gethostbyname(host) == NULL))
|
||||
{
|
||||
/*
|
||||
** If we have deleted all MX entries, this is
|
||||
@ -336,8 +368,8 @@ getmxrr(host, mxhosts, droplocalhost, rcode)
|
||||
*bp++ = '.';
|
||||
*bp = '\0';
|
||||
}
|
||||
nmx = 1;
|
||||
}
|
||||
nmx = 1;
|
||||
}
|
||||
|
||||
/* if we have a default lowest preference, include that */
|
||||
@ -364,6 +396,7 @@ getmxrr(host, mxhosts, droplocalhost, rcode)
|
||||
** none.
|
||||
*/
|
||||
|
||||
int
|
||||
mxrand(host)
|
||||
register char *host;
|
||||
{
|
||||
@ -391,13 +424,43 @@ mxrand(host)
|
||||
}
|
||||
|
||||
hfunc &= 0xff;
|
||||
hfunc++;
|
||||
|
||||
if (tTd(17, 9))
|
||||
printf(" = %d\n", hfunc);
|
||||
return hfunc;
|
||||
}
|
||||
/*
|
||||
** GETCANONNAME -- get the canonical name for named host
|
||||
** BESTMX -- find the best MX for a name
|
||||
**
|
||||
** This is really a hack, but I don't see any obvious way
|
||||
** to generalize it at the moment.
|
||||
*/
|
||||
|
||||
char *
|
||||
bestmx_map_lookup(map, name, av, statp)
|
||||
MAP *map;
|
||||
char *name;
|
||||
char **av;
|
||||
int *statp;
|
||||
{
|
||||
int nmx;
|
||||
auto int rcode;
|
||||
int saveopts = _res.options;
|
||||
char *mxhosts[MAXMXHOSTS + 1];
|
||||
|
||||
_res.options &= ~(RES_DNSRCH|RES_DEFNAMES);
|
||||
nmx = getmxrr(name, mxhosts, FALSE, &rcode);
|
||||
_res.options = saveopts;
|
||||
if (nmx <= 0)
|
||||
return NULL;
|
||||
if (bitset(MF_MATCHONLY, map->map_mflags))
|
||||
return map_rewrite(map, name, strlen(name), NULL);
|
||||
else
|
||||
return map_rewrite(map, mxhosts[0], strlen(mxhosts[0]), av);
|
||||
}
|
||||
/*
|
||||
** DNS_GETCANONNAME -- get the canonical name for named host using DNS
|
||||
**
|
||||
** This algorithm tries to be smart about wildcard MX records.
|
||||
** This is hard to do because DNS doesn't tell is if we matched
|
||||
@ -419,6 +482,7 @@ mxrand(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.
|
||||
** statp -- pointer to place to store status.
|
||||
**
|
||||
** Returns:
|
||||
** TRUE -- if the host matched.
|
||||
@ -426,12 +490,12 @@ mxrand(host)
|
||||
*/
|
||||
|
||||
bool
|
||||
getcanonname(host, hbsize, trymx)
|
||||
dns_getcanonname(host, hbsize, trymx, statp)
|
||||
char *host;
|
||||
int hbsize;
|
||||
bool trymx;
|
||||
int *statp;
|
||||
{
|
||||
extern int h_errno;
|
||||
register u_char *eom, *ap;
|
||||
register char *cp;
|
||||
register int n;
|
||||
@ -444,7 +508,7 @@ getcanonname(host, hbsize, trymx)
|
||||
char **dp;
|
||||
char *mxmatch;
|
||||
bool amatch;
|
||||
bool gotmx;
|
||||
bool gotmx = FALSE;
|
||||
int qtype;
|
||||
int loopcnt;
|
||||
char *xp;
|
||||
@ -453,10 +517,13 @@ getcanonname(host, hbsize, trymx)
|
||||
extern char *gethostalias();
|
||||
|
||||
if (tTd(8, 2))
|
||||
printf("getcanonname(%s)\n", host);
|
||||
printf("dns_getcanonname(%s, trymx=%d)\n", host, trymx);
|
||||
|
||||
if ((_res.options & RES_INIT) == 0 && res_init() == -1)
|
||||
return (FALSE);
|
||||
{
|
||||
*statp = EX_UNAVAILABLE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
** Initialize domain search list. If there is at least one
|
||||
@ -470,10 +537,15 @@ getcanonname(host, hbsize, trymx)
|
||||
|
||||
loopcnt = 0;
|
||||
cnameloop:
|
||||
for (cp = host, n = 0; *cp; cp++)
|
||||
/* Check for dots in the name */
|
||||
for (cp = host, n = 0; *cp != '\0'; cp++)
|
||||
if (*cp == '.')
|
||||
n++;
|
||||
|
||||
/*
|
||||
** If this is a simple name, determine whether it matches an
|
||||
** alias in the file defined by the environment variable HOSTALIASES.
|
||||
*/
|
||||
if (n == 0 && (xp = gethostalias(host)) != NULL)
|
||||
{
|
||||
if (loopcnt++ > MAXCNAMEDEPTH)
|
||||
@ -488,6 +560,17 @@ getcanonname(host, hbsize, trymx)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Build the search list.
|
||||
** If there is at least one dot in name, start with a null
|
||||
** domain to search the unmodified name first.
|
||||
** If name does not end with a dot and search up local domain
|
||||
** tree desired, append each local domain component to the
|
||||
** search list; if name contains no dots and default domain
|
||||
** name is desired, append default domain name to search list;
|
||||
** else if name ends in a dot, remove that dot.
|
||||
*/
|
||||
|
||||
dp = searchlist;
|
||||
if (n > 0)
|
||||
*dp++ = "";
|
||||
@ -507,7 +590,8 @@ getcanonname(host, hbsize, trymx)
|
||||
*dp = NULL;
|
||||
|
||||
/*
|
||||
** Now run through the search list for the name in question.
|
||||
** Now loop through the search list, appending each domain in turn
|
||||
** name and searching for a match.
|
||||
*/
|
||||
|
||||
mxmatch = NULL;
|
||||
@ -518,11 +602,12 @@ getcanonname(host, hbsize, trymx)
|
||||
if (qtype == T_ANY)
|
||||
gotmx = FALSE;
|
||||
if (tTd(8, 5))
|
||||
printf("getcanonname: trying %s.%s (%s)\n", host, *dp,
|
||||
printf("dns_getcanonname: trying %s.%s (%s)\n",
|
||||
host, *dp,
|
||||
qtype == T_ANY ? "ANY" : qtype == T_A ? "A" :
|
||||
qtype == T_MX ? "MX" : "???");
|
||||
ret = res_querydomain(host, *dp, C_IN, qtype,
|
||||
(u_char *) &answer, sizeof(answer));
|
||||
answer.qb2, sizeof(answer.qb2));
|
||||
if (ret <= 0)
|
||||
{
|
||||
if (tTd(8, 7))
|
||||
@ -533,6 +618,7 @@ getcanonname(host, hbsize, trymx)
|
||||
{
|
||||
/* the name server seems to be down */
|
||||
h_errno = TRY_AGAIN;
|
||||
*statp = EX_TEMPFAIL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -551,13 +637,7 @@ getcanonname(host, hbsize, trymx)
|
||||
}
|
||||
}
|
||||
|
||||
if (mxmatch != NULL)
|
||||
{
|
||||
/* we matched before -- use that one */
|
||||
break;
|
||||
}
|
||||
|
||||
/* otherwise, try the next name */
|
||||
/* definite no -- try the next domain */
|
||||
dp++;
|
||||
qtype = T_ANY;
|
||||
continue;
|
||||
@ -566,13 +646,13 @@ getcanonname(host, hbsize, trymx)
|
||||
printf("\tYES\n");
|
||||
|
||||
/*
|
||||
** This might be a bogus match. Search for A or
|
||||
** CNAME records. If we don't have a matching
|
||||
** Appear to have a match. Confirm it by searching for A or
|
||||
** CNAME records. If we don't have a local domain
|
||||
** wild card MX record, we will accept MX as well.
|
||||
*/
|
||||
|
||||
hp = (HEADER *) &answer;
|
||||
ap = (u_char *) &answer + HEADERSZ;
|
||||
ap = (u_char *) &answer + HFIXEDSZ;
|
||||
eom = (u_char *) &answer + ret;
|
||||
|
||||
/* skip question part of response -- we know what we asked */
|
||||
@ -583,44 +663,66 @@ getcanonname(host, hbsize, trymx)
|
||||
if (tTd(8, 20))
|
||||
printf("qdcount failure (%d)\n",
|
||||
ntohs(hp->qdcount));
|
||||
*statp = EX_SOFTWARE;
|
||||
return FALSE; /* ???XXX??? */
|
||||
}
|
||||
}
|
||||
|
||||
amatch = FALSE;
|
||||
for (ancount = ntohs(hp->ancount); --ancount >= 0 && ap < eom; ap += n)
|
||||
for (ancount = ntohs(hp->ancount); --ancount >= 0 && ap < eom;
|
||||
ap += n)
|
||||
{
|
||||
n = dn_expand((u_char *) &answer, eom, ap,
|
||||
(u_char *) nbuf, sizeof nbuf);
|
||||
(RES_UNC_T) nbuf, sizeof nbuf);
|
||||
if (n < 0)
|
||||
break;
|
||||
ap += n;
|
||||
GETSHORT(type, ap);
|
||||
ap += SHORTSIZE + LONGSIZE;
|
||||
ap += INT16SZ + INT32SZ;
|
||||
GETSHORT(n, ap);
|
||||
switch (type)
|
||||
{
|
||||
case T_MX:
|
||||
gotmx = TRUE;
|
||||
if (**dp != '\0')
|
||||
if (**dp != '\0' && HasWildcardMX)
|
||||
{
|
||||
/* got a match -- save that info */
|
||||
/*
|
||||
** If we are using MX matches and have
|
||||
** not yet gotten one, save this one
|
||||
** but keep searching for an A or
|
||||
** CNAME match.
|
||||
*/
|
||||
|
||||
if (trymx && mxmatch == NULL)
|
||||
mxmatch = *dp;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* exact MX matches are as good as an A match */
|
||||
/* fall through */
|
||||
/*
|
||||
** If we did not append a domain name, this
|
||||
** must have been a canonical name to start
|
||||
** with. Even if we did append a domain name,
|
||||
** in the absence of a wildcard MX this must
|
||||
** still be a real MX match.
|
||||
** Such MX matches are as good as an A match,
|
||||
** fall through.
|
||||
*/
|
||||
|
||||
case T_A:
|
||||
/* good show */
|
||||
/* Flag that a good match was found */
|
||||
amatch = TRUE;
|
||||
|
||||
/* continue in case a CNAME also exists */
|
||||
continue;
|
||||
|
||||
case T_CNAME:
|
||||
if (DontExpandCnames)
|
||||
{
|
||||
/* got CNAME -- guaranteed canonical */
|
||||
amatch = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (loopcnt++ > MAXCNAMEDEPTH)
|
||||
{
|
||||
/*XXX should notify postmaster XXX*/
|
||||
@ -630,17 +732,18 @@ getcanonname(host, hbsize, trymx)
|
||||
{
|
||||
char ebuf[MAXLINE];
|
||||
|
||||
sprintf(ebuf, "Deferred: DNS failure: CNAME loop for %s",
|
||||
sprintf(ebuf, "Deferred: DNS failure: CNAME loop for %.100s",
|
||||
host);
|
||||
CurEnv->e_message = newstr(ebuf);
|
||||
}
|
||||
h_errno = NO_RECOVERY;
|
||||
*statp = EX_CONFIG;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* value points at name */
|
||||
if ((ret = dn_expand((u_char *)&answer,
|
||||
eom, ap, (u_char *)nbuf, sizeof(nbuf))) < 0)
|
||||
eom, ap, (RES_UNC_T) nbuf, sizeof(nbuf))) < 0)
|
||||
break;
|
||||
(void)strncpy(host, nbuf, hbsize); /* XXX */
|
||||
host[hbsize - 1] = '\0';
|
||||
@ -661,14 +764,24 @@ getcanonname(host, hbsize, trymx)
|
||||
|
||||
if (amatch)
|
||||
{
|
||||
/* got an A record and no CNAME */
|
||||
/*
|
||||
** Got a good match -- either an A, CNAME, or an
|
||||
** exact MX record. Save it and get out of here.
|
||||
*/
|
||||
|
||||
mxmatch = *dp;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
** If this was a T_ANY query, we may have the info but
|
||||
** need an explicit query. Try T_A, then T_MX.
|
||||
** Nothing definitive yet.
|
||||
** If this was a T_ANY query, we don't really know what
|
||||
** was returned -- it might have been a T_NS,
|
||||
** for example. Try T_A to be more specific
|
||||
** during the next pass.
|
||||
** If this was a T_A query and we haven't yet found a MX
|
||||
** match, try T_MX if allowed to do so.
|
||||
** Otherwise, try the next domain.
|
||||
*/
|
||||
|
||||
if (qtype == T_ANY)
|
||||
@ -677,39 +790,51 @@ getcanonname(host, hbsize, trymx)
|
||||
qtype = T_MX;
|
||||
else
|
||||
{
|
||||
/* really nothing in this domain; try the next */
|
||||
qtype = T_ANY;
|
||||
dp++;
|
||||
}
|
||||
}
|
||||
|
||||
/* if nothing was found, we are done */
|
||||
if (mxmatch == NULL)
|
||||
{
|
||||
*statp = EX_NOHOST;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
** Create canonical name and return.
|
||||
** If saved domain name is null, name was already canonical.
|
||||
** Otherwise append the saved domain name.
|
||||
*/
|
||||
|
||||
/* create matching name and return */
|
||||
(void) sprintf(nbuf, "%.*s%s%.*s", MAXDNAME, host,
|
||||
*mxmatch == '\0' ? "" : ".",
|
||||
MAXDNAME, mxmatch);
|
||||
strncpy(host, nbuf, hbsize);
|
||||
host[hbsize - 1] = '\0';
|
||||
if (tTd(8, 5))
|
||||
printf("dns_getcanonname: %s\n", host);
|
||||
*statp = EX_OK;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
char *
|
||||
gethostalias(host)
|
||||
char *host;
|
||||
{
|
||||
char *fname;
|
||||
FILE *fp;
|
||||
register char *p;
|
||||
register char *p = NULL;
|
||||
char buf[MAXLINE];
|
||||
static char hbuf[MAXDNAME];
|
||||
|
||||
fname = getenv("HOSTALIASES");
|
||||
if (fname == NULL || (fp = fopen(fname, "r")) == NULL)
|
||||
if (fname == NULL ||
|
||||
(fp = safefopen(fname, O_RDONLY, 0, SFF_REGONLY)) == NULL)
|
||||
return NULL;
|
||||
setbuf(fp, NULL);
|
||||
while (fgets(buf, sizeof buf, fp) != NULL)
|
||||
{
|
||||
for (p = buf; p != '\0' && !(isascii(*p) && isspace(*p)); p++)
|
||||
@ -743,28 +868,4 @@ gethostalias(host)
|
||||
return hbuf;
|
||||
}
|
||||
|
||||
|
||||
#else /* not NAMED_BIND */
|
||||
|
||||
#include <netdb.h>
|
||||
|
||||
bool
|
||||
getcanonname(host, hbsize, trymx)
|
||||
char *host;
|
||||
int hbsize;
|
||||
bool trymx;
|
||||
{
|
||||
struct hostent *hp;
|
||||
|
||||
hp = gethostbyname(host);
|
||||
if (hp == NULL)
|
||||
return (FALSE);
|
||||
|
||||
if (strlen(hp->h_name) >= hbsize)
|
||||
return (FALSE);
|
||||
|
||||
(void) strcpy(host, hp->h_name);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
#endif /* not NAMED_BIND */
|
||||
#endif /* NAMED_BIND */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1983 Eric P. Allman
|
||||
* Copyright (c) 1983, 1995 Eric P. Allman
|
||||
* Copyright (c) 1988, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
@ -33,7 +33,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)headers.c 8.32 (Berkeley) 4/14/94";
|
||||
static char sccsid[] = "@(#)headers.c 8.82 (Berkeley) 10/28/95";
|
||||
#endif /* not lint */
|
||||
|
||||
# include <errno.h>
|
||||
@ -47,6 +47,7 @@ static char sccsid[] = "@(#)headers.c 8.32 (Berkeley) 4/14/94";
|
||||
** Parameters:
|
||||
** line -- header as a text line.
|
||||
** def -- if set, this is a default value.
|
||||
** hdrp -- a pointer to the place to save the header.
|
||||
** e -- the envelope including this header.
|
||||
**
|
||||
** Returns:
|
||||
@ -57,9 +58,11 @@ static char sccsid[] = "@(#)headers.c 8.32 (Berkeley) 4/14/94";
|
||||
** Contents of 'line' are destroyed.
|
||||
*/
|
||||
|
||||
chompheader(line, def, e)
|
||||
int
|
||||
chompheader(line, def, hdrp, e)
|
||||
char *line;
|
||||
bool def;
|
||||
HDR **hdrp;
|
||||
register ENVELOPE *e;
|
||||
{
|
||||
register char *p;
|
||||
@ -69,11 +72,20 @@ chompheader(line, def, e)
|
||||
char *fvalue;
|
||||
struct hdrinfo *hi;
|
||||
bool cond = FALSE;
|
||||
bool headeronly;
|
||||
BITMAP mopts;
|
||||
char buf[MAXNAME];
|
||||
char buf[MAXNAME + 1];
|
||||
|
||||
if (tTd(31, 6))
|
||||
printf("chompheader: %s\n", line);
|
||||
{
|
||||
printf("chompheader: ");
|
||||
xputs(line);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
headeronly = hdrp != NULL;
|
||||
if (!headeronly)
|
||||
hdrp = &e->e_header;
|
||||
|
||||
/* strip off options */
|
||||
clrbitmap(mopts);
|
||||
@ -91,7 +103,7 @@ chompheader(line, def, e)
|
||||
p = q;
|
||||
}
|
||||
else
|
||||
usrerr("553 header syntax error, line \"%s\"", line);
|
||||
syserr("553 header syntax error, line \"%s\"", line);
|
||||
cond = TRUE;
|
||||
}
|
||||
|
||||
@ -114,6 +126,10 @@ chompheader(line, def, e)
|
||||
if (*fvalue == ' ')
|
||||
fvalue++;
|
||||
|
||||
/* security scan: long field names are end-of-header */
|
||||
if (strlen(fname) > 100)
|
||||
return H_EOH;
|
||||
|
||||
/* see if it is a known type */
|
||||
for (hi = HdrInfo; hi->hi_field != NULL; hi++)
|
||||
{
|
||||
@ -126,17 +142,38 @@ chompheader(line, def, e)
|
||||
if (hi->hi_field == NULL)
|
||||
printf("no header match\n");
|
||||
else
|
||||
printf("header match, hi_flags=%o\n", hi->hi_flags);
|
||||
printf("header match, hi_flags=%x\n", hi->hi_flags);
|
||||
}
|
||||
|
||||
/* see if this is a resent message */
|
||||
if (!def && bitset(H_RESENT, hi->hi_flags))
|
||||
if (!def && !headeronly && bitset(H_RESENT, hi->hi_flags))
|
||||
e->e_flags |= EF_RESENT;
|
||||
|
||||
/* if this is an Errors-To: header keep track of it now */
|
||||
if (UseErrorsTo && !def && !headeronly &&
|
||||
bitset(H_ERRORSTO, hi->hi_flags))
|
||||
(void) sendtolist(fvalue, NULLADDR, &e->e_errorqueue, 0, e);
|
||||
|
||||
/* if this means "end of header" quit now */
|
||||
if (bitset(H_EOH, hi->hi_flags))
|
||||
return (hi->hi_flags);
|
||||
|
||||
#ifdef LOTUS_NOTES_HACK
|
||||
/*
|
||||
** Horrible hack to work around problem with Lotus Notes SMTP
|
||||
** mail gateway, which generates From: headers with newlines in
|
||||
** them and the <address> on the second line. Although this is
|
||||
** legal RFC 822, many MUAs don't handle this properly and thus
|
||||
** never find the actual address.
|
||||
*/
|
||||
|
||||
if (bitset(H_FROM, hi->hi_flags) && SingleLineFromHeader)
|
||||
{
|
||||
while ((p = strchr(fvalue, '\n')) != NULL)
|
||||
*p = ' ';
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Drop explicit From: if same as what we would generate.
|
||||
** This is to make MH (which doesn't always give a full name)
|
||||
@ -146,7 +183,8 @@ chompheader(line, def, e)
|
||||
p = "resent-from";
|
||||
if (!bitset(EF_RESENT, e->e_flags))
|
||||
p += 7;
|
||||
if (!def && !bitset(EF_QUEUERUN, e->e_flags) && strcasecmp(fname, p) == 0)
|
||||
if (!def && !headeronly && !bitset(EF_QUEUERUN, e->e_flags) &&
|
||||
strcasecmp(fname, p) == 0)
|
||||
{
|
||||
if (tTd(31, 2))
|
||||
{
|
||||
@ -158,7 +196,7 @@ chompheader(line, def, e)
|
||||
strcmp(fvalue, e->e_from.q_user) == 0))
|
||||
return (hi->hi_flags);
|
||||
#ifdef MAYBENEXTRELEASE /* XXX UNTESTED XXX UNTESTED XXX UNTESTED XXX */
|
||||
#ifdef USERDB
|
||||
#if USERDB
|
||||
else
|
||||
{
|
||||
auto ADDRESS a;
|
||||
@ -183,13 +221,13 @@ chompheader(line, def, e)
|
||||
SuprErrs = TRUE;
|
||||
fancy = crackaddr(fvalue);
|
||||
if (parseaddr(fvalue, &a, RF_COPYNONE, '\0', NULL, e) != NULL &&
|
||||
a.q_mailer == LocalMailer &&
|
||||
bitnset(M_CHECKUDB, a.q_mailer->m_flags) &&
|
||||
(p = udbsender(a.q_user)) != NULL)
|
||||
{
|
||||
char *oldg = macvalue('g', e);
|
||||
|
||||
define('g', p, e);
|
||||
expand(fancy, buf, &buf[sizeof buf], e);
|
||||
expand(fancy, buf, sizeof buf, e);
|
||||
define('g', oldg, e);
|
||||
fvalue = buf;
|
||||
}
|
||||
@ -200,12 +238,20 @@ chompheader(line, def, e)
|
||||
}
|
||||
|
||||
/* delete default value for this header */
|
||||
for (hp = &e->e_header; (h = *hp) != NULL; hp = &h->h_link)
|
||||
for (hp = hdrp; (h = *hp) != NULL; hp = &h->h_link)
|
||||
{
|
||||
if (strcasecmp(fname, h->h_field) == 0 &&
|
||||
bitset(H_DEFAULT, h->h_flags) &&
|
||||
!bitset(H_FORCE, h->h_flags))
|
||||
{
|
||||
h->h_value = NULL;
|
||||
if (!cond)
|
||||
{
|
||||
/* copy conditions from default case */
|
||||
bcopy((char *)h->h_mflags, (char *)mopts,
|
||||
sizeof mopts);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* create a new node */
|
||||
@ -222,7 +268,7 @@ chompheader(line, def, e)
|
||||
h->h_flags |= H_CHECK;
|
||||
|
||||
/* hack to see if this is a new format message */
|
||||
if (!def && bitset(H_RCPT|H_FROM, h->h_flags) &&
|
||||
if (!def && !headeronly && bitset(H_RCPT|H_FROM, h->h_flags) &&
|
||||
(strchr(fvalue, ',') != NULL || strchr(fvalue, '(') != NULL ||
|
||||
strchr(fvalue, '<') != NULL || strchr(fvalue, ';') != NULL))
|
||||
{
|
||||
@ -239,7 +285,7 @@ chompheader(line, def, e)
|
||||
** Parameters:
|
||||
** field -- the name of the header field.
|
||||
** value -- the value of the field.
|
||||
** e -- the envelope to add them to.
|
||||
** hp -- an indirect pointer to the header structure list.
|
||||
**
|
||||
** Returns:
|
||||
** none.
|
||||
@ -248,10 +294,11 @@ chompheader(line, def, e)
|
||||
** adds the field on the list of headers for this envelope.
|
||||
*/
|
||||
|
||||
addheader(field, value, e)
|
||||
void
|
||||
addheader(field, value, hdrlist)
|
||||
char *field;
|
||||
char *value;
|
||||
ENVELOPE *e;
|
||||
HDR **hdrlist;
|
||||
{
|
||||
register HDR *h;
|
||||
register struct hdrinfo *hi;
|
||||
@ -265,7 +312,7 @@ addheader(field, value, e)
|
||||
}
|
||||
|
||||
/* find current place in list -- keep back pointer? */
|
||||
for (hp = &e->e_header; (h = *hp) != NULL; hp = &h->h_link)
|
||||
for (hp = hdrlist; (h = *hp) != NULL; hp = &h->h_link)
|
||||
{
|
||||
if (strcasecmp(field, h->h_field) == 0)
|
||||
break;
|
||||
@ -288,7 +335,7 @@ addheader(field, value, e)
|
||||
**
|
||||
** Parameters:
|
||||
** field -- the field name.
|
||||
** e -- the envelope containing the header.
|
||||
** header -- the header list.
|
||||
**
|
||||
** Returns:
|
||||
** pointer to the value part.
|
||||
@ -299,13 +346,13 @@ addheader(field, value, e)
|
||||
*/
|
||||
|
||||
char *
|
||||
hvalue(field, e)
|
||||
hvalue(field, header)
|
||||
char *field;
|
||||
register ENVELOPE *e;
|
||||
HDR *header;
|
||||
{
|
||||
register HDR *h;
|
||||
|
||||
for (h = e->e_header; h != NULL; h = h->h_link)
|
||||
for (h = header; h != NULL; h = h->h_link)
|
||||
{
|
||||
if (!bitset(H_DEFAULT, h->h_flags) &&
|
||||
strcasecmp(h->h_field, field) == 0)
|
||||
@ -319,11 +366,17 @@ hvalue(field, e)
|
||||
** A line is a header if it has a single word followed by
|
||||
** optional white space followed by a colon.
|
||||
**
|
||||
** Header fields beginning with two dashes, although technically
|
||||
** permitted by RFC822, are automatically rejected in order
|
||||
** to make MIME work out. Without this we could have a technically
|
||||
** legal header such as ``--"foo:bar"'' that would also be a legal
|
||||
** MIME separator.
|
||||
**
|
||||
** Parameters:
|
||||
** s -- string to check for possible headerness.
|
||||
** h -- string to check for possible headerness.
|
||||
**
|
||||
** Returns:
|
||||
** TRUE if s is a header.
|
||||
** TRUE if h is a header.
|
||||
** FALSE otherwise.
|
||||
**
|
||||
** Side Effects:
|
||||
@ -331,12 +384,20 @@ hvalue(field, e)
|
||||
*/
|
||||
|
||||
bool
|
||||
isheader(s)
|
||||
register char *s;
|
||||
isheader(h)
|
||||
char *h;
|
||||
{
|
||||
register char *s = h;
|
||||
|
||||
if (s[0] == '-' && s[1] == '-')
|
||||
return FALSE;
|
||||
|
||||
while (*s > ' ' && *s != ':' && *s != '\0')
|
||||
s++;
|
||||
|
||||
if (h == s)
|
||||
return FALSE;
|
||||
|
||||
/* following technically violates RFC822 */
|
||||
while (isascii(*s) && isspace(*s))
|
||||
s++;
|
||||
@ -349,7 +410,9 @@ isheader(s)
|
||||
** Parameters:
|
||||
** e -- the envelope to process.
|
||||
** full -- if set, do full processing (e.g., compute
|
||||
** message priority).
|
||||
** message priority). This should not be set
|
||||
** when reading a queue file because some info
|
||||
** needed to compute the priority is wrong.
|
||||
**
|
||||
** Returns:
|
||||
** none.
|
||||
@ -360,6 +423,7 @@ isheader(s)
|
||||
** Aborts the message if the hop count is exceeded.
|
||||
*/
|
||||
|
||||
void
|
||||
eatheader(e, full)
|
||||
register ENVELOPE *e;
|
||||
bool full;
|
||||
@ -382,28 +446,42 @@ eatheader(e, full)
|
||||
define('u', NULL, e);
|
||||
|
||||
/* full name of from person */
|
||||
p = hvalue("full-name", e);
|
||||
p = hvalue("full-name", e->e_header);
|
||||
if (p != NULL)
|
||||
define('x', p, e);
|
||||
|
||||
if (tTd(32, 1))
|
||||
printf("----- collected header -----\n");
|
||||
msgid = "<none>";
|
||||
msgid = NULL;
|
||||
for (h = e->e_header; h != NULL; h = h->h_link)
|
||||
{
|
||||
if (tTd(32, 1))
|
||||
printf("%s: ", h->h_field);
|
||||
if (h->h_value == NULL)
|
||||
{
|
||||
if (tTd(32, 1))
|
||||
printf("%s: <NULL>\n", h->h_field);
|
||||
printf("<NULL>\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
/* do early binding */
|
||||
if (bitset(H_DEFAULT, h->h_flags))
|
||||
{
|
||||
expand(h->h_value, buf, &buf[sizeof buf], e);
|
||||
if (tTd(32, 1))
|
||||
{
|
||||
printf("(");
|
||||
xputs(h->h_value);
|
||||
printf(") ");
|
||||
}
|
||||
expand(h->h_value, buf, sizeof buf, e);
|
||||
if (buf[0] != '\0')
|
||||
{
|
||||
if (bitset(H_FROM, h->h_flags))
|
||||
{
|
||||
extern char *crackaddr();
|
||||
|
||||
expand(crackaddr(buf), buf, sizeof buf, e);
|
||||
}
|
||||
h->h_value = newstr(buf);
|
||||
h->h_flags &= ~H_DEFAULT;
|
||||
}
|
||||
@ -411,7 +489,6 @@ eatheader(e, full)
|
||||
|
||||
if (tTd(32, 1))
|
||||
{
|
||||
printf("%s: ", h->h_field);
|
||||
xputs(h->h_value);
|
||||
printf("\n");
|
||||
}
|
||||
@ -428,7 +505,7 @@ eatheader(e, full)
|
||||
int saveflags = e->e_flags;
|
||||
|
||||
(void) sendtolist(h->h_value, NULLADDR,
|
||||
&e->e_sendqueue, e);
|
||||
&e->e_sendqueue, 0, e);
|
||||
|
||||
/* delete fatal errors generated by this address */
|
||||
if (!GrabTo && !bitset(EF_FATALERRS, saveflags))
|
||||
@ -436,7 +513,10 @@ eatheader(e, full)
|
||||
}
|
||||
|
||||
/* save the message-id for logging */
|
||||
if (full && strcasecmp(h->h_field, "message-id") == 0)
|
||||
p = "resent-message-id";
|
||||
if (!bitset(EF_RESENT, e->e_flags))
|
||||
p += 7;
|
||||
if (strcasecmp(h->h_field, p) == 0)
|
||||
{
|
||||
msgid = h->h_value;
|
||||
while (isascii(*msgid) && isspace(*msgid))
|
||||
@ -446,11 +526,6 @@ eatheader(e, full)
|
||||
/* see if this is a return-receipt header */
|
||||
if (bitset(H_RECEIPTTO, h->h_flags))
|
||||
e->e_receiptto = h->h_value;
|
||||
|
||||
/* see if this is an errors-to header */
|
||||
if (UseErrorsTo && bitset(H_ERRORSTO, h->h_flags))
|
||||
(void) sendtolist(h->h_value, NULLADDR,
|
||||
&e->e_errorqueue, e);
|
||||
}
|
||||
if (tTd(32, 1))
|
||||
printf("----------------------------\n");
|
||||
@ -464,21 +539,60 @@ eatheader(e, full)
|
||||
e->e_hopcount = hopcnt;
|
||||
|
||||
/* message priority */
|
||||
p = hvalue("precedence", e);
|
||||
p = hvalue("precedence", e->e_header);
|
||||
if (p != NULL)
|
||||
e->e_class = priencode(p);
|
||||
if (e->e_class < 0)
|
||||
e->e_timeoutclass = TOC_NONURGENT;
|
||||
else if (e->e_class > 0)
|
||||
e->e_timeoutclass = TOC_URGENT;
|
||||
if (full)
|
||||
{
|
||||
e->e_msgpriority = e->e_msgsize
|
||||
- e->e_class * WkClassFact
|
||||
+ e->e_nrcpts * WkRecipFact;
|
||||
}
|
||||
|
||||
/* message timeout priority */
|
||||
p = hvalue("priority", e->e_header);
|
||||
if (p != NULL)
|
||||
{
|
||||
/* (this should be in the configuration file) */
|
||||
if (strcasecmp(p, "urgent"))
|
||||
e->e_timeoutclass = TOC_URGENT;
|
||||
else if (strcasecmp(p, "normal"))
|
||||
e->e_timeoutclass = TOC_NORMAL;
|
||||
else if (strcasecmp(p, "non-urgent"))
|
||||
e->e_timeoutclass = TOC_NONURGENT;
|
||||
}
|
||||
|
||||
/* date message originated */
|
||||
p = hvalue("posted-date", e);
|
||||
p = hvalue("posted-date", e->e_header);
|
||||
if (p == NULL)
|
||||
p = hvalue("date", e);
|
||||
p = hvalue("date", e->e_header);
|
||||
if (p != NULL)
|
||||
define('a', p, e);
|
||||
|
||||
/* check to see if this is a MIME message */
|
||||
if ((e->e_bodytype != NULL &&
|
||||
strcasecmp(e->e_bodytype, "8BITMIME") == 0) ||
|
||||
hvalue("MIME-Version", e->e_header) != NULL)
|
||||
{
|
||||
e->e_flags |= EF_IS_MIME;
|
||||
if (HasEightBits)
|
||||
e->e_bodytype = "8BITMIME";
|
||||
}
|
||||
else if ((p = hvalue("Content-Type", e->e_header)) != NULL)
|
||||
{
|
||||
/* this may be an RFC 1049 message */
|
||||
p = strpbrk(p, ";/");
|
||||
if (p == NULL || *p == ';')
|
||||
{
|
||||
/* yep, it is */
|
||||
e->e_flags |= EF_DONT_MIME;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** From person in antiquated ARPANET mode
|
||||
** required by UK Grey Book e-mail gateways (sigh)
|
||||
@ -493,7 +607,7 @@ eatheader(e, full)
|
||||
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)
|
||||
(p = hvalue(hi->hi_field, e->e_header)) != NULL)
|
||||
break;
|
||||
}
|
||||
if (hi->hi_field != NULL)
|
||||
@ -510,7 +624,7 @@ eatheader(e, full)
|
||||
*/
|
||||
|
||||
# ifdef LOG
|
||||
if (full && LogLevel > 4)
|
||||
if (bitset(EF_LOGSENDER, e->e_flags) && LogLevel > 4)
|
||||
logsender(e, msgid);
|
||||
# endif /* LOG */
|
||||
e->e_flags &= ~EF_LOGSENDER;
|
||||
@ -526,6 +640,7 @@ eatheader(e, full)
|
||||
** none
|
||||
*/
|
||||
|
||||
void
|
||||
logsender(e, msgid)
|
||||
register ENVELOPE *e;
|
||||
char *msgid;
|
||||
@ -534,8 +649,23 @@ logsender(e, msgid)
|
||||
char *name;
|
||||
register char *sbp;
|
||||
register char *p;
|
||||
char hbuf[MAXNAME];
|
||||
char sbuf[MAXLINE];
|
||||
int l;
|
||||
char hbuf[MAXNAME + 1];
|
||||
char sbuf[MAXLINE + 1];
|
||||
char mbuf[MAXNAME + 1];
|
||||
|
||||
/* don't allow newlines in the message-id */
|
||||
if (msgid != NULL)
|
||||
{
|
||||
l = strlen(msgid);
|
||||
if (l > sizeof mbuf - 1)
|
||||
l = sizeof mbuf - 1;
|
||||
bcopy(msgid, mbuf, l);
|
||||
mbuf[l] = '\0';
|
||||
p = mbuf;
|
||||
while ((p = strchr(p, '\n')) != NULL)
|
||||
*p++ = ' ';
|
||||
}
|
||||
|
||||
if (bitset(EF_RESPONSE, e->e_flags))
|
||||
name = "[RESPONSE]";
|
||||
@ -552,7 +682,7 @@ logsender(e, msgid)
|
||||
if (RealHostAddr.sa.sa_family != 0)
|
||||
{
|
||||
p = &hbuf[strlen(hbuf)];
|
||||
(void) sprintf(p, " (%s)",
|
||||
(void) sprintf(p, " (%.100s)",
|
||||
anynet_ntoa(&RealHostAddr));
|
||||
}
|
||||
}
|
||||
@ -561,12 +691,12 @@ logsender(e, msgid)
|
||||
# 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);
|
||||
e->e_from.q_paddr == NULL ? "<NONE>" : 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);
|
||||
sprintf(sbp, ", msgid=%.100s", mbuf);
|
||||
sbp += strlen(sbp);
|
||||
}
|
||||
if (e->e_bodytype != NULL)
|
||||
@ -577,33 +707,35 @@ logsender(e, msgid)
|
||||
p = macvalue('r', e);
|
||||
if (p != NULL)
|
||||
(void) sprintf(sbp, ", proto=%.20s", p);
|
||||
syslog(LOG_INFO, "%s: %s, relay=%s",
|
||||
syslog(LOG_INFO, "%s: %.850s, relay=%.100s",
|
||||
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));
|
||||
e->e_id, e->e_from.q_paddr == NULL ? "<NONE>" :
|
||||
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);
|
||||
syslog(LOG_INFO, "%s: msgid=%s",
|
||||
e->e_id, shortenstring(mbuf, 83));
|
||||
sbp = sbuf;
|
||||
sprintf(sbp, "%s:", e->e_id);
|
||||
sbp += strlen(sbp);
|
||||
if (e->e_bodytype != NULL)
|
||||
{
|
||||
sprintf(sbp, " bodytype=%s,", e->e_bodytype);
|
||||
sprintf(sbp, " bodytype=%.20s,", e->e_bodytype);
|
||||
sbp += strlen(sbp);
|
||||
}
|
||||
p = macvalue('r', e);
|
||||
if (p != NULL)
|
||||
{
|
||||
sprintf(sbp, " proto=%s,", p);
|
||||
sprintf(sbp, " proto=%.20s,", p);
|
||||
sbp += strlen(sbp);
|
||||
}
|
||||
syslog(LOG_INFO, "%s relay=%s", sbuf, name);
|
||||
syslog(LOG_INFO, "%.400s relay=%.100s", sbuf, name);
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
@ -620,6 +752,7 @@ logsender(e, msgid)
|
||||
** none.
|
||||
*/
|
||||
|
||||
int
|
||||
priencode(p)
|
||||
char *p;
|
||||
{
|
||||
@ -678,9 +811,12 @@ crackaddr(addr)
|
||||
bool putgmac = FALSE;
|
||||
bool quoteit = FALSE;
|
||||
bool gotangle = FALSE;
|
||||
bool gotcolon = FALSE;
|
||||
register char *bp;
|
||||
char *buflim;
|
||||
static char buf[MAXNAME];
|
||||
char *bufhead;
|
||||
char *addrhead;
|
||||
static char buf[MAXNAME + 1];
|
||||
|
||||
if (tTd(33, 1))
|
||||
printf("crackaddr(%s)\n", addr);
|
||||
@ -694,9 +830,9 @@ crackaddr(addr)
|
||||
** adjusted later if we find them.
|
||||
*/
|
||||
|
||||
bp = buf;
|
||||
bp = bufhead = buf;
|
||||
buflim = &buf[sizeof buf - 5];
|
||||
p = addr;
|
||||
p = addrhead = addr;
|
||||
copylev = anglelev = realanglelev = cmtlev = realcmtlev = 0;
|
||||
qmode = realqmode = FALSE;
|
||||
|
||||
@ -780,8 +916,80 @@ crackaddr(addr)
|
||||
bp--;
|
||||
}
|
||||
|
||||
/* check for group: list; syntax */
|
||||
if (c == ':' && anglelev <= 0 && !gotcolon && !ColonOkInAddr)
|
||||
{
|
||||
register char *q;
|
||||
|
||||
if (*p == ':')
|
||||
{
|
||||
/* special case -- :: syntax */
|
||||
if (cmtlev <= 0 && !qmode)
|
||||
quoteit = TRUE;
|
||||
if (copylev > 0 && !skipping)
|
||||
{
|
||||
*bp++ = c;
|
||||
*bp++ = c;
|
||||
}
|
||||
p++;
|
||||
goto putg;
|
||||
}
|
||||
|
||||
gotcolon = TRUE;
|
||||
|
||||
bp = bufhead;
|
||||
if (quoteit)
|
||||
{
|
||||
*bp++ = '"';
|
||||
|
||||
/* back up over the ':' and any spaces */
|
||||
--p;
|
||||
while (isascii(*--p) && isspace(*p))
|
||||
continue;
|
||||
p++;
|
||||
}
|
||||
for (q = addrhead; q < p; )
|
||||
{
|
||||
c = *q++;
|
||||
if (bp < buflim)
|
||||
{
|
||||
if (quoteit && c == '"')
|
||||
*bp++ = '\\';
|
||||
*bp++ = c;
|
||||
}
|
||||
}
|
||||
if (quoteit)
|
||||
{
|
||||
if (bp == &bufhead[1])
|
||||
bp--;
|
||||
else
|
||||
*bp++ = '"';
|
||||
while ((c = *p++) != ':')
|
||||
{
|
||||
if (bp < buflim)
|
||||
*bp++ = c;
|
||||
}
|
||||
*bp++ = c;
|
||||
}
|
||||
|
||||
/* any trailing white space is part of group: */
|
||||
while (isascii(*p) && isspace(*p) && bp < buflim)
|
||||
*bp++ = *p++;
|
||||
copylev = 0;
|
||||
putgmac = quoteit = FALSE;
|
||||
bufhead = bp;
|
||||
addrhead = p;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (c == ';' && copylev <= 0 && !ColonOkInAddr)
|
||||
{
|
||||
if (bp < buflim)
|
||||
*bp++ = c;
|
||||
}
|
||||
|
||||
/* check for characters that may have to be quoted */
|
||||
if (strchr(".'@,;:\\()[]", c) != NULL)
|
||||
if (strchr(MustQuoteChars, c) != NULL)
|
||||
{
|
||||
/*
|
||||
** If these occur as the phrase part of a <>
|
||||
@ -809,7 +1017,7 @@ crackaddr(addr)
|
||||
if (!skipping)
|
||||
realanglelev = 1;
|
||||
|
||||
bp = buf;
|
||||
bp = bufhead;
|
||||
if (quoteit)
|
||||
{
|
||||
*bp++ = '"';
|
||||
@ -820,7 +1028,7 @@ crackaddr(addr)
|
||||
continue;
|
||||
p++;
|
||||
}
|
||||
for (q = addr; q < p; )
|
||||
for (q = addrhead; q < p; )
|
||||
{
|
||||
c = *q++;
|
||||
if (bp < buflim)
|
||||
@ -901,6 +1109,7 @@ crackaddr(addr)
|
||||
**
|
||||
** Parameters:
|
||||
** mci -- the connection information.
|
||||
** h -- the header to put.
|
||||
** e -- envelope to use.
|
||||
**
|
||||
** Returns:
|
||||
@ -917,27 +1126,45 @@ crackaddr(addr)
|
||||
# define MAX(a,b) (((a)>(b))?(a):(b))
|
||||
#endif
|
||||
|
||||
putheader(mci, e)
|
||||
void
|
||||
putheader(mci, h, e)
|
||||
register MCI *mci;
|
||||
register HDR *h;
|
||||
register ENVELOPE *e;
|
||||
{
|
||||
char buf[MAX(MAXLINE,BUFSIZ)];
|
||||
register HDR *h;
|
||||
char obuf[MAXLINE];
|
||||
|
||||
if (tTd(34, 1))
|
||||
printf("--- putheader, mailer = %s ---\n",
|
||||
mci->mci_mailer->m_name);
|
||||
|
||||
for (h = e->e_header; h != NULL; h = h->h_link)
|
||||
mci->mci_flags |= MCIF_INHEADER;
|
||||
for (; h != NULL; h = h->h_link)
|
||||
{
|
||||
register char *p;
|
||||
register char *p = h->h_value;
|
||||
extern bool bitintersect();
|
||||
|
||||
if (tTd(34, 11))
|
||||
{
|
||||
printf(" %s: ", h->h_field);
|
||||
xputs(h->h_value);
|
||||
xputs(p);
|
||||
}
|
||||
|
||||
/* suppress Content-Transfer-Encoding: if we are MIMEing */
|
||||
if (bitset(H_CTE, h->h_flags) &&
|
||||
bitset(MCIF_CVT8TO7|MCIF_INMIME, mci->mci_flags))
|
||||
{
|
||||
if (tTd(34, 11))
|
||||
printf(" (skipped (content-transfer-encoding))\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bitset(MCIF_INMIME, mci->mci_flags))
|
||||
{
|
||||
if (tTd(34, 11))
|
||||
printf("\n");
|
||||
goto vanilla;
|
||||
}
|
||||
|
||||
if (bitset(H_CHECK|H_ACHECK, h->h_flags) &&
|
||||
@ -966,10 +1193,9 @@ putheader(mci, e)
|
||||
}
|
||||
|
||||
/* macro expand value if generated internally */
|
||||
p = h->h_value;
|
||||
if (bitset(H_DEFAULT, h->h_flags))
|
||||
{
|
||||
expand(p, buf, &buf[sizeof buf], e);
|
||||
expand(p, buf, sizeof buf, e);
|
||||
p = buf;
|
||||
if (p == NULL || *p == '\0')
|
||||
{
|
||||
@ -979,6 +1205,23 @@ putheader(mci, e)
|
||||
}
|
||||
}
|
||||
|
||||
if (bitset(H_BCC, h->h_flags))
|
||||
{
|
||||
/* Bcc: field -- either truncate or delete */
|
||||
if (bitset(EF_DELETE_BCC, e->e_flags))
|
||||
{
|
||||
if (tTd(34, 11))
|
||||
printf(" (skipped -- bcc)\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
/* no other recipient headers: truncate value */
|
||||
(void) sprintf(obuf, "%s:", h->h_field);
|
||||
putline(obuf, mci);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tTd(34, 11))
|
||||
printf("\n");
|
||||
|
||||
@ -995,21 +1238,51 @@ putheader(mci, e)
|
||||
{
|
||||
/* vanilla header line */
|
||||
register char *nlp;
|
||||
register char *obp;
|
||||
|
||||
(void) sprintf(obuf, "%s: ", h->h_field);
|
||||
vanilla:
|
||||
(void) sprintf(obuf, "%.200s: ", h->h_field);
|
||||
obp = obuf + strlen(obuf);
|
||||
while ((nlp = strchr(p, '\n')) != NULL)
|
||||
{
|
||||
|
||||
*nlp = '\0';
|
||||
(void) strcat(obuf, p);
|
||||
sprintf(obp, "%.*s",
|
||||
sizeof obuf - (obp - obuf) - 1, p);
|
||||
*nlp = '\n';
|
||||
putline(obuf, mci);
|
||||
p = ++nlp;
|
||||
obuf[0] = '\0';
|
||||
obp = obuf;
|
||||
}
|
||||
(void) strcat(obuf, p);
|
||||
sprintf(obp, "%.*s", sizeof obuf - (obp - obuf) - 1, p);
|
||||
putline(obuf, mci);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** If we are converting this to a MIME message, add the
|
||||
** MIME headers.
|
||||
*/
|
||||
|
||||
#if MIME8TO7
|
||||
if (bitset(MM_MIME8BIT, MimeMode) &&
|
||||
bitset(EF_HAS8BIT, e->e_flags) &&
|
||||
!bitset(EF_DONT_MIME, e->e_flags) &&
|
||||
!bitnset(M_8BITS, mci->mci_mailer->m_flags) &&
|
||||
!bitset(MCIF_CVT8TO7, mci->mci_flags))
|
||||
{
|
||||
if (hvalue("MIME-Version", e->e_header) == NULL)
|
||||
putline("MIME-Version: 1.0", mci);
|
||||
if (hvalue("Content-Type", e->e_header) == NULL)
|
||||
{
|
||||
sprintf(obuf, "Content-Type: text/plain; charset=%s",
|
||||
defcharset(e));
|
||||
putline(obuf, mci);
|
||||
}
|
||||
if (hvalue("Content-Transfer-Encoding", e->e_header) == NULL)
|
||||
putline("Content-Transfer-Encoding: 8bit", mci);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
/*
|
||||
** COMMAIZE -- output a header field, making a comma-translated list.
|
||||
@ -1051,7 +1324,7 @@ commaize(h, p, oldstyle, mci, e)
|
||||
printf("commaize(%s: %s)\n", h->h_field, p);
|
||||
|
||||
obp = obuf;
|
||||
(void) sprintf(obp, "%s: ", h->h_field);
|
||||
(void) sprintf(obp, "%.200s: ", h->h_field);
|
||||
opos = strlen(h->h_field) + 2;
|
||||
obp += opos;
|
||||
omax = mci->mci_mailer->m_linelimit - 2;
|
||||
@ -1088,7 +1361,7 @@ commaize(h, p, oldstyle, mci, e)
|
||||
char pvpbuf[PSBUFSIZE];
|
||||
|
||||
(void) prescan(p, oldstyle ? ' ' : ',', pvpbuf,
|
||||
sizeof pvpbuf, &oldp);
|
||||
sizeof pvpbuf, &oldp, NULL);
|
||||
p = oldp;
|
||||
|
||||
/* look to see if we have an at sign */
|
||||
@ -1119,6 +1392,18 @@ commaize(h, p, oldstyle, mci, e)
|
||||
flags = RF_HEADERADDR|RF_ADDDOMAIN;
|
||||
if (bitset(H_FROM, h->h_flags))
|
||||
flags |= RF_SENDERADDR;
|
||||
#if USERDB
|
||||
else if (e->e_from.q_mailer != NULL &&
|
||||
bitnset(M_UDBRECIPIENT, e->e_from.q_mailer->m_flags))
|
||||
{
|
||||
extern char *udbsender();
|
||||
char *q;
|
||||
|
||||
q = udbsender(name);
|
||||
if (q != NULL)
|
||||
name = q;
|
||||
}
|
||||
#endif
|
||||
stat = EX_OK;
|
||||
name = remotename(name, mci->mci_mailer, flags, &stat, e);
|
||||
if (*name == '\0')
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1983 Eric P. Allman
|
||||
* Copyright (c) 1983, 1995 Eric P. Allman
|
||||
* Copyright (c) 1988, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
@ -33,7 +33,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)parseaddr.c 8.31 (Berkeley) 4/15/94";
|
||||
static char sccsid[] = "@(#)parseaddr.c 8.86 (Berkeley) 9/28/95";
|
||||
#endif /* not lint */
|
||||
|
||||
# include "sendmail.h"
|
||||
@ -91,6 +91,7 @@ parseaddr(addr, a, flags, delim, delimptr, e)
|
||||
char pvpbuf[PSBUFSIZE];
|
||||
extern ADDRESS *buildaddr();
|
||||
extern bool invalidaddr();
|
||||
extern void allocaddr __P((ADDRESS *, int, char *));
|
||||
|
||||
/*
|
||||
** Initialize and prescan address.
|
||||
@ -103,7 +104,7 @@ parseaddr(addr, a, flags, delim, delimptr, e)
|
||||
if (delimptr == NULL)
|
||||
delimptr = &delimptrbuf;
|
||||
|
||||
pvp = prescan(addr, delim, pvpbuf, sizeof pvpbuf, delimptr);
|
||||
pvp = prescan(addr, delim, pvpbuf, sizeof pvpbuf, delimptr, NULL);
|
||||
if (pvp == NULL)
|
||||
{
|
||||
if (tTd(20, 1))
|
||||
@ -172,12 +173,15 @@ parseaddr(addr, a, flags, delim, delimptr, e)
|
||||
{
|
||||
char *msg = "Transient parse error -- message queued for future delivery";
|
||||
|
||||
if (e->e_sendmode == SM_DEFER)
|
||||
msg = "Deferring message until queue run";
|
||||
if (tTd(20, 1))
|
||||
printf("parseaddr: queuing message\n");
|
||||
message(msg);
|
||||
if (e->e_message == NULL)
|
||||
if (e->e_message == NULL && e->e_sendmode != SM_DEFER)
|
||||
e->e_message = newstr(msg);
|
||||
a->q_flags |= QQUEUEUP;
|
||||
a->q_status = "4.4.3";
|
||||
}
|
||||
|
||||
/*
|
||||
@ -208,7 +212,7 @@ invalidaddr(addr, delimptr)
|
||||
register char *addr;
|
||||
char *delimptr;
|
||||
{
|
||||
char savedelim;
|
||||
char savedelim = '\0';
|
||||
|
||||
if (delimptr != NULL)
|
||||
{
|
||||
@ -231,14 +235,14 @@ invalidaddr(addr, delimptr)
|
||||
}
|
||||
if (*addr == '\0')
|
||||
{
|
||||
if (savedelim != '\0' && delimptr != NULL)
|
||||
if (delimptr != NULL && savedelim != '\0')
|
||||
*delimptr = savedelim;
|
||||
return FALSE;
|
||||
}
|
||||
setstat(EX_USAGE);
|
||||
usrerr("553 Address contained invalid control characters");
|
||||
addrfailure:
|
||||
if (savedelim != '\0' && delimptr != NULL)
|
||||
if (delimptr != NULL && savedelim != '\0')
|
||||
*delimptr = savedelim;
|
||||
return TRUE;
|
||||
}
|
||||
@ -260,13 +264,14 @@ invalidaddr(addr, delimptr)
|
||||
** Copies portions of a into local buffers as requested.
|
||||
*/
|
||||
|
||||
void
|
||||
allocaddr(a, flags, paddr)
|
||||
register ADDRESS *a;
|
||||
int flags;
|
||||
char *paddr;
|
||||
{
|
||||
if (tTd(24, 4))
|
||||
printf("allocaddr(flags=%o, paddr=%s)\n", flags, paddr);
|
||||
printf("allocaddr(flags=%x, paddr=%s)\n", flags, paddr);
|
||||
|
||||
a->q_paddr = paddr;
|
||||
|
||||
@ -311,6 +316,8 @@ allocaddr(a, flags, paddr)
|
||||
** pvpbsize -- size of pvpbuf.
|
||||
** delimptr -- if non-NULL, set to the location of the
|
||||
** terminating delimiter.
|
||||
** toktab -- if set, a token table to use for parsing.
|
||||
** If NULL, use the default table.
|
||||
**
|
||||
** Returns:
|
||||
** A pointer to a vector of tokens.
|
||||
@ -323,8 +330,9 @@ allocaddr(a, flags, paddr)
|
||||
# define QST 2 /* in quoted string */
|
||||
# define SPC 3 /* chewing up spaces */
|
||||
# define ONE 4 /* pick up one character */
|
||||
# define ILL 5 /* illegal character */
|
||||
|
||||
# define NSTATES 5 /* number of states */
|
||||
# define NSTATES 6 /* number of states */
|
||||
# define TYPE 017 /* mask to select state type */
|
||||
|
||||
/* meta bits for table */
|
||||
@ -334,46 +342,102 @@ allocaddr(a, flags, paddr)
|
||||
|
||||
static short StateTab[NSTATES][NSTATES] =
|
||||
{
|
||||
/* oldst chtype> OPR ATM QST SPC ONE */
|
||||
/*OPR*/ OPR|B, ATM|B, QST|B, SPC|MB, ONE|B,
|
||||
/*ATM*/ OPR|B, ATM, QST|B, SPC|MB, ONE|B,
|
||||
/*QST*/ QST, QST, OPR, QST, QST,
|
||||
/*SPC*/ OPR, ATM, QST, SPC|M, ONE,
|
||||
/*ONE*/ OPR, OPR, OPR, OPR, OPR,
|
||||
/* oldst chtype> OPR ATM QST SPC ONE ILL */
|
||||
/*OPR*/ OPR|B, ATM|B, QST|B, SPC|MB, ONE|B, ILL|MB,
|
||||
/*ATM*/ OPR|B, ATM, QST|B, SPC|MB, ONE|B, ILL|MB,
|
||||
/*QST*/ QST, QST, OPR, QST, QST, QST,
|
||||
/*SPC*/ OPR, ATM, QST, SPC|M, ONE, ILL|MB,
|
||||
/*ONE*/ OPR, OPR, OPR, OPR, OPR, ILL|MB,
|
||||
/*ILL*/ OPR|B, ATM|B, QST|B, SPC|MB, ONE|B, ILL|M,
|
||||
};
|
||||
|
||||
/* token type table -- it gets modified with $o characters */
|
||||
static TokTypeTab[256] =
|
||||
static u_char 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,
|
||||
/* nul soh stx etx eot enq ack bel bs ht nl vt np cr so si */
|
||||
ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM, ATM,SPC,SPC,SPC,SPC,SPC,ATM,ATM,
|
||||
/* dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us */
|
||||
ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM, ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
|
||||
/* sp ! " # $ % & ' ( ) * + , - . / */
|
||||
SPC,ATM,QST,ATM,ATM,ATM,ATM,ATM, ATM,SPC,ATM,ATM,ATM,ATM,ATM,ATM,
|
||||
/* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */
|
||||
ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM, ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
|
||||
/* @ A B C D E F G H I J K L M N O */
|
||||
ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM, ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
|
||||
/* P Q R S T U V W X Y Z [ \ ] ^ _ */
|
||||
ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM, ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
|
||||
/* ` a b c d e f g h i j k l m n o */
|
||||
ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM, ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
|
||||
/* p q r s t u v w x y z { | } ~ del */
|
||||
ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM, ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
|
||||
|
||||
/* nul soh stx etx eot enq ack bel bs ht nl vt np cr so si */
|
||||
OPR,OPR,ONE,OPR,OPR,OPR,OPR,OPR, OPR,OPR,OPR,OPR,OPR,OPR,OPR,OPR,
|
||||
/* dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us */
|
||||
OPR,OPR,OPR,ONE,ONE,ONE,OPR,OPR, OPR,OPR,OPR,OPR,OPR,OPR,OPR,OPR,
|
||||
/* sp ! " # $ % & ' ( ) * + , - . / */
|
||||
ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM, ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
|
||||
/* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */
|
||||
ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM, ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
|
||||
/* @ A B C D E F G H I J K L M N O */
|
||||
ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM, ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
|
||||
/* P Q R S T U V W X Y Z [ \ ] ^ _ */
|
||||
ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM, ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
|
||||
/* ` a b c d e f g h i j k l m n o */
|
||||
ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM, ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
|
||||
/* p q r s t u v w x y z { | } ~ del */
|
||||
ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM, ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
|
||||
};
|
||||
|
||||
#define toktype(c) ((int) TokTypeTab[(c) & 0xff])
|
||||
/* token type table for MIME parsing */
|
||||
u_char MimeTokenTab[256] =
|
||||
{
|
||||
/* nul soh stx etx eot enq ack bel bs ht nl vt np cr so si */
|
||||
ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL, ILL,SPC,SPC,SPC,SPC,SPC,ILL,ILL,
|
||||
/* dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us */
|
||||
ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL, ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,
|
||||
/* sp ! " # $ % & ' ( ) * + , - . / */
|
||||
SPC,ATM,QST,ATM,ATM,ATM,ATM,ATM, ATM,SPC,ATM,ATM,OPR,ATM,ATM,OPR,
|
||||
/* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */
|
||||
ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM, ATM,ATM,OPR,OPR,OPR,OPR,OPR,OPR,
|
||||
/* @ A B C D E F G H I J K L M N O */
|
||||
OPR,ATM,ATM,ATM,ATM,ATM,ATM,ATM, ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
|
||||
/* P Q R S T U V W X Y Z [ \ ] ^ _ */
|
||||
ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM, ATM,ATM,ATM,OPR,OPR,OPR,ATM,ATM,
|
||||
/* ` a b c d e f g h i j k l m n o */
|
||||
ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM, ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
|
||||
/* p q r s t u v w x y z { | } ~ del */
|
||||
ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM, ATM,ATM,ATM,ATM,ATM,ATM,ATM,ATM,
|
||||
|
||||
/* nul soh stx etx eot enq ack bel bs ht nl vt np cr so si */
|
||||
ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL, ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,
|
||||
/* dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us */
|
||||
ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL, ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,
|
||||
/* sp ! " # $ % & ' ( ) * + , - . / */
|
||||
ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL, ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,
|
||||
/* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */
|
||||
ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL, ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,
|
||||
/* @ A B C D E F G H I J K L M N O */
|
||||
ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL, ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,
|
||||
/* P Q R S T U V W X Y Z [ \ ] ^ _ */
|
||||
ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL, ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,
|
||||
/* ` a b c d e f g h i j k l m n o */
|
||||
ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL, ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,
|
||||
/* p q r s t u v w x y z { | } ~ del */
|
||||
ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL, ILL,ILL,ILL,ILL,ILL,ILL,ILL,ILL,
|
||||
};
|
||||
|
||||
|
||||
# define NOCHAR -1 /* signal nothing in lookahead token */
|
||||
|
||||
char **
|
||||
prescan(addr, delim, pvpbuf, pvpbsize, delimptr)
|
||||
prescan(addr, delim, pvpbuf, pvpbsize, delimptr, toktab)
|
||||
char *addr;
|
||||
char delim;
|
||||
int delim;
|
||||
char pvpbuf[];
|
||||
int pvpbsize;
|
||||
char **delimptr;
|
||||
u_char *toktab;
|
||||
{
|
||||
register char *p;
|
||||
register char *q;
|
||||
@ -396,7 +460,14 @@ prescan(addr, delim, pvpbuf, pvpbsize, delimptr)
|
||||
char obuf[50];
|
||||
|
||||
firsttime = FALSE;
|
||||
expand("\201o", obuf, &obuf[sizeof obuf - sizeof DELIMCHARS], CurEnv);
|
||||
if (OperatorChars == NULL)
|
||||
{
|
||||
if (ConfigLevel < 7)
|
||||
OperatorChars = macvalue('o', CurEnv);
|
||||
if (OperatorChars == NULL)
|
||||
OperatorChars = ".:@[]";
|
||||
}
|
||||
expand(OperatorChars, obuf, sizeof obuf - sizeof DELIMCHARS, CurEnv);
|
||||
strcat(obuf, DELIMCHARS);
|
||||
for (p = obuf; *p != '\0'; p++)
|
||||
{
|
||||
@ -404,6 +475,8 @@ prescan(addr, delim, pvpbuf, pvpbsize, delimptr)
|
||||
TokTypeTab[*p & 0xff] = OPR;
|
||||
}
|
||||
}
|
||||
if (toktab == NULL)
|
||||
toktab = TokTypeTab;
|
||||
|
||||
/* make sure error messages don't have garbage on them */
|
||||
errno = 0;
|
||||
@ -437,6 +510,8 @@ prescan(addr, delim, pvpbuf, pvpbsize, delimptr)
|
||||
if (q >= &pvpbuf[pvpbsize - 5])
|
||||
{
|
||||
usrerr("553 Address too long");
|
||||
if (strlen(addr) > MAXNAME)
|
||||
addr[MAXNAME] = '\0';
|
||||
returnnull:
|
||||
if (delimptr != NULL)
|
||||
*delimptr = p;
|
||||
@ -546,10 +621,17 @@ prescan(addr, delim, pvpbuf, pvpbsize, delimptr)
|
||||
if (c == delim && anglecnt <= 0 && state != QST)
|
||||
break;
|
||||
|
||||
newstate = StateTab[state][toktype(c)];
|
||||
newstate = StateTab[state][toktab[c & 0xff]];
|
||||
if (tTd(22, 101))
|
||||
printf("ns=%02o\n", newstate);
|
||||
state = newstate & TYPE;
|
||||
if (state == ILL)
|
||||
{
|
||||
if (isascii(c) && isprint(c))
|
||||
usrerr("653 Illegal character %c", c);
|
||||
else
|
||||
usrerr("653 Illegal character 0x%02x", c);
|
||||
}
|
||||
if (bitset(M, newstate))
|
||||
c = NOCHAR;
|
||||
if (bitset(B, newstate))
|
||||
@ -642,10 +724,6 @@ struct match
|
||||
|
||||
# define MAXMATCH 9 /* max params per rewrite */
|
||||
|
||||
# ifndef MAXRULERECURSION
|
||||
# define MAXRULERECURSION 50 /* max recursion depth */
|
||||
# endif
|
||||
|
||||
|
||||
int
|
||||
rewrite(pvp, ruleset, reclevel, e)
|
||||
@ -666,7 +744,7 @@ rewrite(pvp, ruleset, reclevel, e)
|
||||
struct match mlist[MAXMATCH]; /* stores match on LHS */
|
||||
char *npvp[MAXATOM+1]; /* temporary space for rebuild */
|
||||
|
||||
if (OpMode == MD_TEST || tTd(21, 2))
|
||||
if (OpMode == MD_TEST || tTd(21, 1))
|
||||
{
|
||||
printf("rewrite: ruleset %2d input:", ruleset);
|
||||
printav(pvp);
|
||||
@ -676,9 +754,10 @@ rewrite(pvp, ruleset, reclevel, e)
|
||||
syserr("554 rewrite: illegal ruleset number %d", ruleset);
|
||||
return EX_CONFIG;
|
||||
}
|
||||
if (reclevel++ > MAXRULERECURSION)
|
||||
if (reclevel++ > MaxRuleRecursion)
|
||||
{
|
||||
syserr("rewrite: infinite recursion, ruleset %d", ruleset);
|
||||
syserr("rewrite: excessive recursion (max %d), ruleset %d",
|
||||
MaxRuleRecursion, ruleset);
|
||||
return EX_CONFIG;
|
||||
}
|
||||
if (pvp == NULL)
|
||||
@ -740,7 +819,6 @@ rewrite(pvp, ruleset, reclevel, e)
|
||||
|
||||
switch (*rp & 0377)
|
||||
{
|
||||
register STAB *s;
|
||||
char buf[MAXLINE];
|
||||
|
||||
case MATCHCLASS:
|
||||
@ -753,8 +831,7 @@ rewrite(pvp, ruleset, reclevel, e)
|
||||
goto backup;
|
||||
mlp->last = avp++;
|
||||
cataddr(mlp->first, mlp->last, buf, sizeof buf, '\0');
|
||||
s = stab(buf, ST_CLASS, ST_FIND);
|
||||
if (s == NULL || !bitnset(rp[1], s->s_class))
|
||||
if (!wordinclass(buf, rp[1]))
|
||||
{
|
||||
if (tTd(21, 36))
|
||||
{
|
||||
@ -773,8 +850,7 @@ rewrite(pvp, ruleset, reclevel, e)
|
||||
|
||||
case MATCHNCLASS:
|
||||
/* match any token not in a class */
|
||||
s = stab(ap, ST_CLASS, ST_FIND);
|
||||
if (s != NULL && bitnset(rp[1], s->s_class))
|
||||
if (wordinclass(ap, rp[1]))
|
||||
goto backup;
|
||||
|
||||
/* fall through */
|
||||
@ -1097,10 +1173,22 @@ rewrite(pvp, ruleset, reclevel, e)
|
||||
/* look it up */
|
||||
cataddr(key_rvp, NULL, buf, sizeof buf, '\0');
|
||||
argvect[0] = buf;
|
||||
if (map != NULL && bitset(MF_OPEN, map->s_map.map_mflags))
|
||||
if (e->e_sendmode == SM_DEFER)
|
||||
{
|
||||
/* don't do any map lookups */
|
||||
if (tTd(60, 1))
|
||||
printf("map_lookup(%s, %s) => DEFERRED\n",
|
||||
mapname, buf);
|
||||
replac = NULL;
|
||||
rstat = EX_TEMPFAIL;
|
||||
}
|
||||
else if (map != NULL && bitset(MF_OPEN, map->s_map.map_mflags))
|
||||
{
|
||||
auto int stat = EX_OK;
|
||||
|
||||
if (!bitset(MF_KEEPQUOTES, map->s_map.map_mflags))
|
||||
stripquotes(buf);
|
||||
|
||||
/* XXX should try to auto-open the map here */
|
||||
|
||||
if (tTd(60, 1))
|
||||
@ -1115,7 +1203,21 @@ rewrite(pvp, ruleset, reclevel, e)
|
||||
|
||||
/* should recover if stat == EX_TEMPFAIL */
|
||||
if (stat == EX_TEMPFAIL)
|
||||
rstat = stat;
|
||||
{
|
||||
rstat = EX_TEMPFAIL;
|
||||
if (tTd(60, 1))
|
||||
printf("map_lookup(%s, %s) tempfail: errno=%d\n",
|
||||
mapname, buf, errno);
|
||||
if (e->e_message == NULL)
|
||||
{
|
||||
char mbuf[300];
|
||||
|
||||
sprintf(mbuf, "%.80s map: lookup (%s): deferred",
|
||||
mapname,
|
||||
shortenstring(buf, 203));
|
||||
e->e_message = newstr(mbuf);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
replac = NULL;
|
||||
@ -1142,7 +1244,7 @@ rewrite(pvp, ruleset, reclevel, e)
|
||||
{
|
||||
/* scan the new replacement */
|
||||
xpvp = prescan(replac, '\0', pvpbuf,
|
||||
sizeof pvpbuf, NULL);
|
||||
sizeof pvpbuf, NULL, NULL);
|
||||
if (xpvp == NULL)
|
||||
{
|
||||
/* prescan already printed error */
|
||||
@ -1182,11 +1284,15 @@ rewrite(pvp, ruleset, reclevel, e)
|
||||
}
|
||||
else
|
||||
{
|
||||
int ruleset;
|
||||
STAB *s;
|
||||
|
||||
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);
|
||||
ruleset = strtorwset(npvp[1], NULL, ST_FIND);
|
||||
stat = rewrite(pvp, ruleset, reclevel, e);
|
||||
if (rstat == EX_OK || stat == EX_TEMPFAIL)
|
||||
rstat = stat;
|
||||
if (*pvp != NULL && (**pvp & 0377) == CANONNET)
|
||||
@ -1205,7 +1311,7 @@ rewrite(pvp, ruleset, reclevel, e)
|
||||
}
|
||||
}
|
||||
|
||||
if (OpMode == MD_TEST || tTd(21, 2))
|
||||
if (OpMode == MD_TEST || tTd(21, 1))
|
||||
{
|
||||
printf("rewrite: ruleset %2d returns:", ruleset);
|
||||
printav(pvp);
|
||||
@ -1260,15 +1366,17 @@ buildaddr(tv, a, flags, e)
|
||||
{
|
||||
struct mailer **mp;
|
||||
register struct mailer *m;
|
||||
char *bp;
|
||||
int spaceleft;
|
||||
register char *p;
|
||||
char *mname;
|
||||
char **hostp;
|
||||
char hbuf[MAXNAME + 1];
|
||||
static MAILER errormailer;
|
||||
static char *errorargv[] = { "ERROR", NULL };
|
||||
static char buf[MAXNAME];
|
||||
static char ubuf[MAXNAME + 1];
|
||||
|
||||
if (tTd(24, 5))
|
||||
{
|
||||
printf("buildaddr, flags=%o, tv=", flags);
|
||||
printf("buildaddr, flags=%x, tv=", flags);
|
||||
printav(tv);
|
||||
}
|
||||
|
||||
@ -1276,10 +1384,13 @@ buildaddr(tv, a, flags, e)
|
||||
a = (ADDRESS *) xalloc(sizeof *a);
|
||||
bzero((char *) a, sizeof *a);
|
||||
|
||||
/* set up default error return flags */
|
||||
a->q_flags |= QPINGONFAILURE|QPINGONDELAY;
|
||||
|
||||
/* figure out what net/mailer to use */
|
||||
if (*tv == NULL || (**tv & 0377) != CANONNET)
|
||||
{
|
||||
syserr("554 buildaddr: no net");
|
||||
syserr("554 buildaddr: no mailer in parsed address");
|
||||
badaddr:
|
||||
a->q_flags |= QBADADDR;
|
||||
a->q_mailer = &errormailer;
|
||||
@ -1292,91 +1403,97 @@ buildaddr(tv, a, flags, e)
|
||||
}
|
||||
return a;
|
||||
}
|
||||
tv++;
|
||||
if (strcasecmp(*tv, "error") == 0)
|
||||
mname = *++tv;
|
||||
|
||||
/* extract host and user portions */
|
||||
if ((**++tv & 0377) == CANONHOST)
|
||||
hostp = ++tv;
|
||||
else
|
||||
hostp = NULL;
|
||||
while (*tv != NULL && (**tv & 0377) != CANONUSER)
|
||||
tv++;
|
||||
if (*tv == NULL)
|
||||
{
|
||||
if ((**++tv & 0377) == CANONHOST)
|
||||
syserr("554 buildaddr: no user");
|
||||
goto badaddr;
|
||||
}
|
||||
if (tv == hostp)
|
||||
hostp = NULL;
|
||||
else if (hostp != NULL)
|
||||
cataddr(hostp, tv - 1, hbuf, sizeof hbuf, '\0');
|
||||
cataddr(++tv, NULL, ubuf, sizeof ubuf, ' ');
|
||||
|
||||
/* save away the host name */
|
||||
if (strcasecmp(mname, "error") == 0)
|
||||
{
|
||||
if (hostp != NULL)
|
||||
{
|
||||
register struct errcodes *ep;
|
||||
|
||||
if (isascii(**++tv) && isdigit(**tv))
|
||||
if (strchr(hbuf, '.') != NULL)
|
||||
{
|
||||
setstat(atoi(*tv));
|
||||
a->q_status = newstr(hbuf);
|
||||
setstat(dsntoexitstat(hbuf));
|
||||
}
|
||||
else if (isascii(hbuf[0]) && isdigit(hbuf[0]))
|
||||
{
|
||||
setstat(atoi(hbuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
for (ep = ErrorCodes; ep->ec_name != NULL; ep++)
|
||||
if (strcasecmp(ep->ec_name, *tv) == 0)
|
||||
if (strcasecmp(ep->ec_name, hbuf) == 0)
|
||||
break;
|
||||
setstat(ep->ec_code);
|
||||
}
|
||||
tv++;
|
||||
}
|
||||
else
|
||||
setstat(EX_UNAVAILABLE);
|
||||
if ((**tv & 0377) != CANONUSER)
|
||||
syserr("554 buildaddr: error: no user");
|
||||
cataddr(++tv, NULL, buf, sizeof buf, ' ');
|
||||
stripquotes(buf);
|
||||
if (isascii(buf[0]) && isdigit(buf[0]) &&
|
||||
isascii(buf[1]) && isdigit(buf[1]) &&
|
||||
isascii(buf[2]) && isdigit(buf[2]) &&
|
||||
buf[3] == ' ')
|
||||
stripquotes(ubuf);
|
||||
if (isascii(ubuf[0]) && isdigit(ubuf[0]) &&
|
||||
isascii(ubuf[1]) && isdigit(ubuf[1]) &&
|
||||
isascii(ubuf[2]) && isdigit(ubuf[2]) &&
|
||||
ubuf[3] == ' ')
|
||||
{
|
||||
char fmt[10];
|
||||
|
||||
strncpy(fmt, buf, 3);
|
||||
strncpy(fmt, ubuf, 3);
|
||||
strcpy(&fmt[3], " %s");
|
||||
usrerr(fmt, buf + 4);
|
||||
usrerr(fmt, ubuf + 4);
|
||||
|
||||
/*
|
||||
** If this is a 4xx code and we aren't running
|
||||
** SMTP on our input, bounce this message;
|
||||
** otherwise it disappears without a trace.
|
||||
*/
|
||||
|
||||
if (fmt[0] == '4' && OpMode != MD_SMTP &&
|
||||
OpMode != MD_DAEMON)
|
||||
{
|
||||
e->e_flags |= EF_FATALERRS;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
usrerr("553 %s", buf);
|
||||
usrerr("553 %s", ubuf);
|
||||
}
|
||||
goto badaddr;
|
||||
}
|
||||
|
||||
for (mp = Mailer; (m = *mp++) != NULL; )
|
||||
{
|
||||
if (strcasecmp(m->m_name, *tv) == 0)
|
||||
if (strcasecmp(m->m_name, mname) == 0)
|
||||
break;
|
||||
}
|
||||
if (m == NULL)
|
||||
{
|
||||
syserr("554 buildaddr: unknown mailer %s", *tv);
|
||||
syserr("554 buildaddr: unknown mailer %s", mname);
|
||||
goto badaddr;
|
||||
}
|
||||
a->q_mailer = m;
|
||||
|
||||
/* figure out what host (if any) */
|
||||
tv++;
|
||||
if ((**tv & 0377) == CANONHOST)
|
||||
{
|
||||
bp = buf;
|
||||
spaceleft = sizeof buf - 1;
|
||||
while (*++tv != NULL && (**tv & 0377) != CANONUSER)
|
||||
{
|
||||
int i = strlen(*tv);
|
||||
|
||||
if (i > spaceleft)
|
||||
{
|
||||
/* out of space for this address */
|
||||
if (spaceleft >= 0)
|
||||
syserr("554 buildaddr: host too long (%.40s...)",
|
||||
buf);
|
||||
i = spaceleft;
|
||||
spaceleft = 0;
|
||||
}
|
||||
if (i <= 0)
|
||||
continue;
|
||||
bcopy(*tv, bp, i);
|
||||
bp += i;
|
||||
spaceleft -= i;
|
||||
}
|
||||
*bp = '\0';
|
||||
a->q_host = newstr(buf);
|
||||
}
|
||||
else
|
||||
if (hostp == NULL)
|
||||
{
|
||||
if (!bitnset(M_LOCALMAILER, m->m_flags))
|
||||
{
|
||||
@ -1385,47 +1502,38 @@ buildaddr(tv, a, flags, e)
|
||||
}
|
||||
a->q_host = NULL;
|
||||
}
|
||||
else
|
||||
a->q_host = newstr(hbuf);
|
||||
|
||||
/* figure out the user */
|
||||
if (*tv == NULL || (**tv & 0377) != CANONUSER)
|
||||
{
|
||||
syserr("554 buildaddr: no user");
|
||||
goto badaddr;
|
||||
}
|
||||
tv++;
|
||||
|
||||
/* do special mapping for local mailer */
|
||||
if (m == LocalMailer && *tv != NULL)
|
||||
{
|
||||
register char *p = *tv;
|
||||
|
||||
if (*p == '"')
|
||||
p++;
|
||||
if (*p == '|')
|
||||
a->q_mailer = m = ProgMailer;
|
||||
else if (*p == '/')
|
||||
a->q_mailer = m = FileMailer;
|
||||
else if (*p == ':')
|
||||
{
|
||||
/* may be :include: */
|
||||
cataddr(tv, NULL, buf, sizeof buf, '\0');
|
||||
stripquotes(buf);
|
||||
if (strncasecmp(buf, ":include:", 9) == 0)
|
||||
{
|
||||
/* if :include:, don't need further rewriting */
|
||||
a->q_mailer = m = InclMailer;
|
||||
a->q_user = &buf[9];
|
||||
return (a);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m == LocalMailer && *tv != NULL && strcmp(*tv, "@") == 0)
|
||||
p = ubuf;
|
||||
if (bitnset(M_CHECKUDB, m->m_flags) && *p == '@')
|
||||
{
|
||||
p++;
|
||||
tv++;
|
||||
a->q_flags |= QNOTREMOTE;
|
||||
}
|
||||
|
||||
/* do special mapping for local mailer */
|
||||
if (*p == '"')
|
||||
p++;
|
||||
if (*p == '|' && bitnset(M_CHECKPROG, m->m_flags))
|
||||
a->q_mailer = m = ProgMailer;
|
||||
else if (*p == '/' && bitnset(M_CHECKFILE, m->m_flags))
|
||||
a->q_mailer = m = FileMailer;
|
||||
else if (*p == ':' && bitnset(M_CHECKINCLUDE, m->m_flags))
|
||||
{
|
||||
/* may be :include: */
|
||||
stripquotes(ubuf);
|
||||
if (strncasecmp(ubuf, ":include:", 9) == 0)
|
||||
{
|
||||
/* if :include:, don't need further rewriting */
|
||||
a->q_mailer = m = InclMailer;
|
||||
a->q_user = newstr(&ubuf[9]);
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
/* rewrite according recipient mailer rewriting rules */
|
||||
define('h', a->q_host, e);
|
||||
if (!bitset(RF_SENDERADDR|RF_HEADERADDR, flags))
|
||||
@ -1438,8 +1546,8 @@ buildaddr(tv, a, flags, e)
|
||||
(void) rewrite(tv, 4, 0, e);
|
||||
|
||||
/* save the result for the command line/RCPT argument */
|
||||
cataddr(tv, NULL, buf, sizeof buf, '\0');
|
||||
a->q_user = buf;
|
||||
cataddr(tv, NULL, ubuf, sizeof ubuf, '\0');
|
||||
a->q_user = ubuf;
|
||||
|
||||
/*
|
||||
** Do mapping to lower case as requested by mailer
|
||||
@ -1450,7 +1558,12 @@ buildaddr(tv, a, flags, e)
|
||||
if (!bitnset(M_USR_UPPER, m->m_flags))
|
||||
makelower(a->q_user);
|
||||
|
||||
return (a);
|
||||
if (tTd(24, 6))
|
||||
{
|
||||
printf("buildaddr => ");
|
||||
printaddr(a, FALSE);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
/*
|
||||
** CATADDR -- concatenate pieces of addresses (putting in <LWSP> subs)
|
||||
@ -1471,12 +1584,13 @@ buildaddr(tv, a, flags, e)
|
||||
** Destroys buf.
|
||||
*/
|
||||
|
||||
void
|
||||
cataddr(pvp, evp, buf, sz, spacesub)
|
||||
char **pvp;
|
||||
char **evp;
|
||||
char *buf;
|
||||
register int sz;
|
||||
char spacesub;
|
||||
int spacesub;
|
||||
{
|
||||
bool oatomtok = FALSE;
|
||||
bool natomtok = FALSE;
|
||||
@ -1495,7 +1609,7 @@ cataddr(pvp, evp, buf, sz, spacesub)
|
||||
sz -= 2;
|
||||
while (*pvp != NULL && (i = strlen(*pvp)) < sz)
|
||||
{
|
||||
natomtok = (toktype(**pvp) == ATM);
|
||||
natomtok = (TokTypeTab[**pvp & 0xff] == ATM);
|
||||
if (oatomtok && natomtok)
|
||||
*p++ = spacesub;
|
||||
(void) strcpy(p, *pvp);
|
||||
@ -1580,17 +1694,55 @@ sameaddr(a, b)
|
||||
** none.
|
||||
*/
|
||||
|
||||
struct qflags
|
||||
{
|
||||
char *qf_name;
|
||||
u_long qf_bit;
|
||||
};
|
||||
|
||||
struct qflags AddressFlags[] =
|
||||
{
|
||||
"QDONTSEND", QDONTSEND,
|
||||
"QBADADDR", QBADADDR,
|
||||
"QGOODUID", QGOODUID,
|
||||
"QPRIMARY", QPRIMARY,
|
||||
"QQUEUEUP", QQUEUEUP,
|
||||
"QSENT", QSENT,
|
||||
"QNOTREMOTE", QNOTREMOTE,
|
||||
"QSELFREF", QSELFREF,
|
||||
"QVERIFIED", QVERIFIED,
|
||||
"QBOGUSSHELL", QBOGUSSHELL,
|
||||
"QUNSAFEADDR", QUNSAFEADDR,
|
||||
"QPINGONSUCCESS", QPINGONSUCCESS,
|
||||
"QPINGONFAILURE", QPINGONFAILURE,
|
||||
"QPINGONDELAY", QPINGONDELAY,
|
||||
"QHASNOTIFY", QHASNOTIFY,
|
||||
"QRELAYED", QRELAYED,
|
||||
"QEXPANDED", QEXPANDED,
|
||||
"QDELIVERED", QDELIVERED,
|
||||
"QDELAYED", QDELAYED,
|
||||
"QTHISPASS", QTHISPASS,
|
||||
NULL
|
||||
};
|
||||
|
||||
void
|
||||
printaddr(a, follow)
|
||||
register ADDRESS *a;
|
||||
bool follow;
|
||||
{
|
||||
bool first = TRUE;
|
||||
register MAILER *m;
|
||||
MAILER pseudomailer;
|
||||
register struct qflags *qfp;
|
||||
bool firstone;
|
||||
|
||||
if (a == NULL)
|
||||
{
|
||||
printf("[NULL]\n");
|
||||
return;
|
||||
}
|
||||
|
||||
while (a != NULL)
|
||||
{
|
||||
first = FALSE;
|
||||
printf("%x=", a);
|
||||
(void) fflush(stdout);
|
||||
|
||||
@ -1603,25 +1755,60 @@ printaddr(a, follow)
|
||||
m->m_name = "NULL";
|
||||
}
|
||||
|
||||
printf("%s:\n\tmailer %d (%s), host `%s', user `%s', ruser `%s'\n",
|
||||
a->q_paddr, m->m_mno, m->m_name,
|
||||
a->q_host, a->q_user,
|
||||
a->q_ruser ? a->q_ruser : "<null>");
|
||||
printf("\tnext=%x, flags=%o, alias %x, uid %d, gid %d\n",
|
||||
a->q_next, a->q_flags, a->q_alias, a->q_uid, a->q_gid);
|
||||
printf("%s:\n\tmailer %d (%s), host `%s'\n",
|
||||
a->q_paddr == NULL ? "<null>" : a->q_paddr,
|
||||
m->m_mno, m->m_name,
|
||||
a->q_host == NULL ? "<null>" : a->q_host);
|
||||
printf("\tuser `%s', ruser `%s'\n",
|
||||
a->q_user,
|
||||
a->q_ruser == NULL ? "<null>" : a->q_ruser);
|
||||
printf("\tnext=%x, alias %x, uid %d, gid %d\n",
|
||||
a->q_next, a->q_alias, a->q_uid, a->q_gid);
|
||||
printf("\tflags=%lx<", a->q_flags);
|
||||
firstone = TRUE;
|
||||
for (qfp = AddressFlags; qfp->qf_name != NULL; qfp++)
|
||||
{
|
||||
if (!bitset(qfp->qf_bit, a->q_flags))
|
||||
continue;
|
||||
if (!firstone)
|
||||
printf(",");
|
||||
firstone = FALSE;
|
||||
printf("%s", qfp->qf_name);
|
||||
}
|
||||
printf(">\n");
|
||||
printf("\towner=%s, home=\"%s\", fullname=\"%s\"\n",
|
||||
a->q_owner == NULL ? "(none)" : a->q_owner,
|
||||
a->q_home == NULL ? "(none)" : a->q_home,
|
||||
a->q_fullname == NULL ? "(none)" : a->q_fullname);
|
||||
printf("\torcpt=\"%s\", statmta=%s, rstatus=%s\n",
|
||||
a->q_orcpt == NULL ? "(none)" : a->q_orcpt,
|
||||
a->q_statmta == NULL ? "(none)" : a->q_statmta,
|
||||
a->q_rstatus == NULL ? "(none)" : a->q_rstatus);
|
||||
|
||||
if (!follow)
|
||||
return;
|
||||
a = a->q_next;
|
||||
}
|
||||
if (first)
|
||||
printf("[NULL]\n");
|
||||
}
|
||||
/*
|
||||
** EMPTYADDR -- return TRUE if this address is empty (``<>'')
|
||||
**
|
||||
** Parameters:
|
||||
** a -- pointer to the address
|
||||
**
|
||||
** Returns:
|
||||
** TRUE -- if this address is "empty" (i.e., no one should
|
||||
** ever generate replies to it.
|
||||
** FALSE -- if it is a "regular" (read: replyable) address.
|
||||
*/
|
||||
|
||||
bool
|
||||
emptyaddr(a)
|
||||
register ADDRESS *a;
|
||||
{
|
||||
return a->q_paddr == NULL || strcmp(a->q_paddr, "<>") == 0 ||
|
||||
a->q_user == NULL || strcmp(a->q_user, "<>") == 0;
|
||||
}
|
||||
/*
|
||||
** REMOTENAME -- return the name relative to the current mailer
|
||||
**
|
||||
@ -1657,8 +1844,8 @@ remotename(name, m, flags, pstat, e)
|
||||
char *fancy;
|
||||
char *oldg = macvalue('g', e);
|
||||
int rwset;
|
||||
static char buf[MAXNAME];
|
||||
char lbuf[MAXNAME];
|
||||
static char buf[MAXNAME + 1];
|
||||
char lbuf[MAXNAME + 1];
|
||||
char pvpbuf[PSBUFSIZE];
|
||||
extern char *crackaddr();
|
||||
|
||||
@ -1693,7 +1880,7 @@ remotename(name, m, flags, pstat, e)
|
||||
** domain will be appended.
|
||||
*/
|
||||
|
||||
pvp = prescan(name, '\0', pvpbuf, sizeof pvpbuf, NULL);
|
||||
pvp = prescan(name, '\0', pvpbuf, sizeof pvpbuf, NULL, NULL);
|
||||
if (pvp == NULL)
|
||||
return (name);
|
||||
if (rewrite(pvp, 3, 0, e) == EX_TEMPFAIL)
|
||||
@ -1760,9 +1947,9 @@ remotename(name, m, flags, pstat, 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);
|
||||
expand("<\201g>", buf, sizeof buf, e);
|
||||
else
|
||||
expand(fancy, buf, &buf[sizeof buf - 1], e);
|
||||
expand(fancy, buf, sizeof buf, e);
|
||||
|
||||
define('g', oldg, e);
|
||||
|
||||
@ -1777,14 +1964,18 @@ remotename(name, m, flags, pstat, e)
|
||||
** a -- the address to map (but just the user name part).
|
||||
** sendq -- the sendq in which to install any replacement
|
||||
** addresses.
|
||||
** aliaslevel -- the alias nesting depth.
|
||||
** e -- the envelope.
|
||||
**
|
||||
** Returns:
|
||||
** none.
|
||||
*/
|
||||
|
||||
maplocaluser(a, sendq, e)
|
||||
void
|
||||
maplocaluser(a, sendq, aliaslevel, e)
|
||||
register ADDRESS *a;
|
||||
ADDRESS **sendq;
|
||||
int aliaslevel;
|
||||
ENVELOPE *e;
|
||||
{
|
||||
register char **pvp;
|
||||
@ -1797,7 +1988,7 @@ maplocaluser(a, sendq, e)
|
||||
printf("maplocaluser: ");
|
||||
printaddr(a, FALSE);
|
||||
}
|
||||
pvp = prescan(a->q_user, '\0', pvpbuf, sizeof pvpbuf, &delimptr);
|
||||
pvp = prescan(a->q_user, '\0', pvpbuf, sizeof pvpbuf, &delimptr, NULL);
|
||||
if (pvp == NULL)
|
||||
return;
|
||||
|
||||
@ -1818,8 +2009,8 @@ maplocaluser(a, sendq, e)
|
||||
printaddr(a, FALSE);
|
||||
}
|
||||
a1->q_alias = a;
|
||||
allocaddr(a1, RF_COPYALL, NULL);
|
||||
(void) recipient(a1, sendq, e);
|
||||
allocaddr(a1, RF_COPYALL, a->q_paddr);
|
||||
(void) recipient(a1, sendq, aliaslevel, e);
|
||||
}
|
||||
/*
|
||||
** DEQUOTE_INIT -- initialize dequote map
|
||||
@ -1841,6 +2032,7 @@ dequote_init(map, args)
|
||||
{
|
||||
register char *p = args;
|
||||
|
||||
map->map_mflags |= MF_KEEPQUOTES;
|
||||
for (;;)
|
||||
{
|
||||
while (isascii(*p) && isspace(*p))
|
||||
@ -1852,6 +2044,10 @@ dequote_init(map, args)
|
||||
case 'a':
|
||||
map->map_app = ++p;
|
||||
break;
|
||||
|
||||
case 's':
|
||||
map->map_coldelim = *++p;
|
||||
break;
|
||||
}
|
||||
while (*p != '\0' && !(isascii(*p) && isspace(*p)))
|
||||
p++;
|
||||
@ -1888,19 +2084,13 @@ dequote_map(map, name, av, statp)
|
||||
register char *p;
|
||||
register char *q;
|
||||
register char c;
|
||||
int anglecnt;
|
||||
int cmntcnt;
|
||||
int quotecnt;
|
||||
int spacecnt;
|
||||
bool quotemode;
|
||||
bool bslashmode;
|
||||
|
||||
anglecnt = 0;
|
||||
cmntcnt = 0;
|
||||
quotecnt = 0;
|
||||
spacecnt = 0;
|
||||
quotemode = FALSE;
|
||||
bslashmode = FALSE;
|
||||
int anglecnt = 0;
|
||||
int cmntcnt = 0;
|
||||
int quotecnt = 0;
|
||||
int spacecnt = 0;
|
||||
bool quotemode = FALSE;
|
||||
bool bslashmode = FALSE;
|
||||
char spacesub = map->map_coldelim;
|
||||
|
||||
for (p = q = name; (c = *p++) != '\0'; )
|
||||
{
|
||||
@ -1911,6 +2101,9 @@ dequote_map(map, name, av, statp)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (c == ' ' && spacesub != '\0')
|
||||
c = spacesub;
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '\\':
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -29,9 +29,9 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)sendmail.8 8.4 (Berkeley) 12/11/93
|
||||
.\" @(#)sendmail.8 8.6 (Berkeley) 5/27/95
|
||||
.\"
|
||||
.Dd December 11, 1993
|
||||
.Dd May 27, 1995
|
||||
.Dt SENDMAIL 8
|
||||
.Os BSD 4
|
||||
.Sh NAME
|
||||
@ -209,6 +209,18 @@ is specified,
|
||||
will run in background.
|
||||
This option can be used safely with
|
||||
.Fl bd .
|
||||
.It Fl qI Ns Ar substr
|
||||
Limit processed jobs to those containing
|
||||
.Ar substr
|
||||
as a substring of the queue id.
|
||||
.It Fl qR Ns Ar substr
|
||||
Limit processed jobs to those containing
|
||||
.Ar substr
|
||||
as a substring of one of the recipients.
|
||||
.It Fl qS Ns Ar substr
|
||||
Limit processed jobs to those containing
|
||||
.Ar substr
|
||||
as a substring of the sender.
|
||||
.It Fl r Ns Ar name
|
||||
An alternate and obsolete form of the
|
||||
.Fl f
|
||||
@ -259,6 +271,7 @@ successful deliveries (default 10).
|
||||
This avoids excessive duplicate deliveries
|
||||
when sending to long mailing lists
|
||||
interrupted by system crashes.
|
||||
.ne 1i
|
||||
.It Li d Ns Ar x
|
||||
Set the delivery mode to
|
||||
.Ar x .
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1983 Eric P. Allman
|
||||
* Copyright (c) 1983, 1995 Eric P. Allman
|
||||
* Copyright (c) 1988, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
@ -31,7 +31,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)sendmail.h 8.43.1.3 (Berkeley) 3/5/95
|
||||
* @(#)sendmail.h 8.159 (Berkeley) 11/18/95
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -41,7 +41,7 @@
|
||||
# ifdef _DEFINE
|
||||
# define EXTERN
|
||||
# ifndef lint
|
||||
static char SmailSccsId[] = "@(#)sendmail.h 8.43.1.3 3/5/95";
|
||||
static char SmailSccsId[] = "@(#)sendmail.h 8.159 11/18/95";
|
||||
# endif
|
||||
# else /* _DEFINE */
|
||||
# define EXTERN extern
|
||||
@ -53,10 +53,13 @@ static char SmailSccsId[] = "@(#)sendmail.h 8.43.1.3 3/5/95";
|
||||
# include <stdio.h>
|
||||
# include <ctype.h>
|
||||
# include <setjmp.h>
|
||||
# include <sysexits.h>
|
||||
# include <string.h>
|
||||
# include <time.h>
|
||||
# include <errno.h>
|
||||
# ifdef EX_OK
|
||||
# undef EX_OK /* for SVr4.2 SMP */
|
||||
# endif
|
||||
# include <sysexits.h>
|
||||
|
||||
# include "conf.h"
|
||||
# include "useful.h"
|
||||
@ -68,38 +71,42 @@ static char SmailSccsId[] = "@(#)sendmail.h 8.43.1.3 3/5/95";
|
||||
# ifdef DAEMON
|
||||
# include <sys/socket.h>
|
||||
# endif
|
||||
# ifdef NETUNIX
|
||||
# if NETUNIX
|
||||
# include <sys/un.h>
|
||||
# endif
|
||||
# ifdef NETINET
|
||||
# if NETINET
|
||||
# include <netinet/in.h>
|
||||
# endif
|
||||
# ifdef NETISO
|
||||
# if NETISO
|
||||
# include <netiso/iso.h>
|
||||
# endif
|
||||
# ifdef NETNS
|
||||
# if NETNS
|
||||
# include <netns/ns.h>
|
||||
# endif
|
||||
# ifdef NETX25
|
||||
# if NETX25
|
||||
# include <netccitt/x25.h>
|
||||
# endif
|
||||
|
||||
|
||||
|
||||
/* forward references for prototypes */
|
||||
typedef struct envelope ENVELOPE;
|
||||
typedef struct mailer MAILER;
|
||||
|
||||
|
||||
/*
|
||||
** Data structure for bit maps.
|
||||
**
|
||||
** Each bit in this map can be referenced by an ascii character.
|
||||
** This is 128 possible bits, or 12 8-bit bytes.
|
||||
** This is 256 possible bits, or 32 8-bit bytes.
|
||||
*/
|
||||
|
||||
#define BITMAPBYTES 16 /* number of bytes in a bit map */
|
||||
#define BITMAPBYTES 32 /* number of bytes in a bit map */
|
||||
#define BYTEBITS 8 /* number of bits in a byte */
|
||||
|
||||
/* internal macros */
|
||||
#define _BITWORD(bit) (bit / (BYTEBITS * sizeof (int)))
|
||||
#define _BITBIT(bit) (1 << (bit % (BYTEBITS * sizeof (int))))
|
||||
#define _BITWORD(bit) ((bit) / (BYTEBITS * sizeof (int)))
|
||||
#define _BITBIT(bit) (1 << ((bit) % (BYTEBITS * sizeof (int))))
|
||||
|
||||
typedef int BITMAP[BITMAPBYTES / sizeof (int)];
|
||||
|
||||
@ -126,7 +133,7 @@ struct address
|
||||
char *q_ruser; /* real user name, or NULL if q_user */
|
||||
char *q_host; /* host name */
|
||||
struct mailer *q_mailer; /* mailer to use */
|
||||
u_short q_flags; /* status flags, see below */
|
||||
u_long q_flags; /* status flags, see below */
|
||||
uid_t q_uid; /* user-id of receiver (if known) */
|
||||
gid_t q_gid; /* group-id of receiver (if known) */
|
||||
char *q_home; /* home dir (local mailer only) */
|
||||
@ -135,25 +142,51 @@ struct address
|
||||
struct address *q_alias; /* address this results from */
|
||||
char *q_owner; /* owner of q_alias */
|
||||
struct address *q_tchain; /* temporary use chain */
|
||||
time_t q_timeout; /* timeout for this address */
|
||||
char *q_orcpt; /* ORCPT parameter from RCPT TO: line */
|
||||
char *q_status; /* status code for DSNs */
|
||||
char *q_rstatus; /* remote status message for DSNs */
|
||||
time_t q_statdate; /* date of status messages */
|
||||
char *q_statmta; /* MTA generating q_rstatus */
|
||||
short q_specificity; /* how "specific" this address is */
|
||||
};
|
||||
|
||||
typedef struct address ADDRESS;
|
||||
|
||||
# define QDONTSEND 000001 /* don't send to this address */
|
||||
# define QBADADDR 000002 /* this address is verified bad */
|
||||
# define QGOODUID 000004 /* the q_uid q_gid fields are good */
|
||||
# define QPRIMARY 000010 /* set from argv */
|
||||
# define QQUEUEUP 000020 /* queue for later transmission */
|
||||
# define QSENT 000040 /* has been successfully delivered */
|
||||
# define QNOTREMOTE 000100 /* not an address for remote forwarding */
|
||||
# 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 QDONTSEND 0x00000001 /* don't send to this address */
|
||||
# define QBADADDR 0x00000002 /* this address is verified bad */
|
||||
# define QGOODUID 0x00000004 /* the q_uid q_gid fields are good */
|
||||
# define QPRIMARY 0x00000008 /* set from RCPT or argv */
|
||||
# define QQUEUEUP 0x00000010 /* queue for later transmission */
|
||||
# define QSENT 0x00000020 /* has been successfully delivered */
|
||||
# define QNOTREMOTE 0x00000040 /* address not for remote forwarding */
|
||||
# define QSELFREF 0x00000080 /* this address references itself */
|
||||
# define QVERIFIED 0x00000100 /* verified, but not expanded */
|
||||
# define QBOGUSSHELL 0x00000400 /* user has no valid shell listed */
|
||||
# define QUNSAFEADDR 0x00000800 /* address aquired via unsafe path */
|
||||
# define QPINGONSUCCESS 0x00001000 /* give return on successful delivery */
|
||||
# define QPINGONFAILURE 0x00002000 /* give return on failure */
|
||||
# define QPINGONDELAY 0x00004000 /* give return on message delay */
|
||||
# define QHASNOTIFY 0x00008000 /* propogate notify parameter */
|
||||
# define QRELAYED 0x00010000 /* DSN: relayed to non-DSN aware sys */
|
||||
# define QEXPANDED 0x00020000 /* DSN: undergone list expansion */
|
||||
# define QDELIVERED 0x00040000 /* DSN: successful final delivery */
|
||||
# define QDELAYED 0x00080000 /* DSN: message delayed */
|
||||
# define QTHISPASS 0x80000000 /* temp: address set this pass */
|
||||
|
||||
# define NULLADDR ((ADDRESS *) NULL)
|
||||
|
||||
/* functions */
|
||||
extern ADDRESS *parseaddr __P((char *, ADDRESS *, int, int, char **, ENVELOPE *));
|
||||
extern ADDRESS *recipient __P((ADDRESS *, ADDRESS **, int, ENVELOPE *));
|
||||
extern char **prescan __P((char *, int, char[], int, char **, u_char *));
|
||||
extern int rewrite __P((char **, int, int, ENVELOPE *));
|
||||
extern char *remotename __P((char *, MAILER *, int, int *, ENVELOPE *));
|
||||
extern ADDRESS *getctladdr __P((ADDRESS *));
|
||||
extern bool sameaddr __P((ADDRESS *, ADDRESS *));
|
||||
extern bool emptyaddr __P((ADDRESS *));
|
||||
extern void printaddr __P((ADDRESS *, bool));
|
||||
extern void cataddr __P((char **, char **, char *, int, int));
|
||||
extern int sendtolist __P((char *, ADDRESS *, ADDRESS **, int, ENVELOPE *));
|
||||
/*
|
||||
** Mailer definition structure.
|
||||
** Every mailer known to the system is declared in this
|
||||
@ -170,8 +203,12 @@ struct mailer
|
||||
{
|
||||
char *m_name; /* symbolic name of this mailer */
|
||||
char *m_mailer; /* pathname of the mailer to use */
|
||||
char *m_mtatype; /* type of this MTA */
|
||||
char *m_addrtype; /* type for addresses */
|
||||
char *m_diagtype; /* type for diagnostics */
|
||||
BITMAP m_flags; /* status flags, see below */
|
||||
short m_mno; /* mailer number internally */
|
||||
short m_nice; /* niceness to run at (mostly for prog) */
|
||||
char **m_argv; /* template argument vector */
|
||||
short m_sh_rwset; /* rewrite set: sender header addresses */
|
||||
short m_se_rwset; /* rewrite set: sender envelope addresses */
|
||||
@ -181,15 +218,18 @@ struct mailer
|
||||
long m_maxsize; /* size limit on message to this mailer */
|
||||
int m_linelimit; /* max # characters per line */
|
||||
char *m_execdir; /* directory to chdir to before execv */
|
||||
uid_t m_uid; /* UID to run as */
|
||||
gid_t m_gid; /* GID to run as */
|
||||
char *m_defcharset; /* default character set */
|
||||
};
|
||||
|
||||
typedef struct mailer MAILER;
|
||||
|
||||
/* bits for m_flags */
|
||||
# define M_ESMTP 'a' /* run Extended SMTP protocol */
|
||||
# define M_ALIASABLE 'A' /* user can be LHS of an alias */
|
||||
# define M_BLANKEND 'b' /* ensure blank line at end of message */
|
||||
# define M_NOCOMMENT 'c' /* don't include comment part of address */
|
||||
# define M_CANONICAL 'C' /* make addresses canonical "u@dom" */
|
||||
# define M_NOBRACKET 'd' /* never angle bracket envelope route-addrs */
|
||||
/* 'D' CF: include Date: */
|
||||
# define M_EXPENSIVE 'e' /* it costs to use this mailer.... */
|
||||
# define M_ESCFROM 'E' /* escape From lines to >From */
|
||||
@ -198,25 +238,39 @@ typedef struct mailer MAILER;
|
||||
# define M_NO_NULL_FROM 'g' /* sender of errors should be $g */
|
||||
# define M_HST_UPPER 'h' /* preserve host case distinction */
|
||||
# define M_PREHEAD 'H' /* MAIL11V3: preview headers */
|
||||
# define M_UDBENVELOPE 'i' /* do udbsender rewriting on envelope */
|
||||
# define M_INTERNAL 'I' /* SMTP to another sendmail site */
|
||||
# define M_UDBRECIPIENT 'j' /* do udbsender rewriting on recipient lines */
|
||||
# define M_NOLOOPCHECK 'k' /* don't check for loops in HELO command */
|
||||
# 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 */
|
||||
# define M_MANYSTATUS 'N' /* MAIL11V3: DATA returns multi-status */
|
||||
# define M_RUNASRCPT 'o' /* always run mailer as recipient */
|
||||
# define M_FROMPATH 'p' /* use reverse-path in MAIL FROM: */
|
||||
/* 'P' CF: include Return-Path: */
|
||||
# define M_ROPT 'r' /* mailer takes picky -r flag */
|
||||
# define M_SECURE_PORT 'R' /* try to send on a reserved TCP port */
|
||||
# define M_STRIPQ 's' /* strip quote chars from user/host */
|
||||
# define M_RESTR 'S' /* must be daemon to execute */
|
||||
# define M_SPECIFIC_UID 'S' /* run as specific uid/gid */
|
||||
# define M_USR_UPPER 'u' /* preserve user case distinction */
|
||||
# define M_UGLYUUCP 'U' /* this wants an ugly UUCP from line */
|
||||
# define M_CONTENT_LEN 'v' /* add Content-Length: header (SVr4) */
|
||||
/* 'V' UIUC: !-relativize all addresses */
|
||||
# define M_HASPWENT 'w' /* check for /etc/passwd entry */
|
||||
/* 'x' CF: include Full-Name: */
|
||||
# define M_XDOT 'X' /* use hidden-dot algorithm */
|
||||
# define M_EBCDIC '3' /* extend Q-P encoding for EBCDIC */
|
||||
# define M_TRYRULESET5 '5' /* use ruleset 5 after local aliasing */
|
||||
# define M_7BITS '7' /* use 7-bit path */
|
||||
# define M_8BITS '8' /* force "just send 8" behaviour */
|
||||
# define M_MAKE8BIT '9' /* convert 7 -> 8 bit if appropriate */
|
||||
# define M_CHECKINCLUDE ':' /* check for :include: files */
|
||||
# define M_CHECKPROG '|' /* check for |program addresses */
|
||||
# define M_CHECKFILE '/' /* check for /file addresses */
|
||||
# define M_CHECKUDB '@' /* user can be user database key */
|
||||
|
||||
EXTERN MAILER *Mailer[MAXMAILERS+1];
|
||||
|
||||
@ -255,18 +309,21 @@ struct hdrinfo
|
||||
extern struct hdrinfo HdrInfo[];
|
||||
|
||||
/* bits for h_flags and hi_flags */
|
||||
# define H_EOH 00001 /* this field terminates header */
|
||||
# define H_RCPT 00002 /* contains recipient addresses */
|
||||
# define H_DEFAULT 00004 /* if another value is found, drop this */
|
||||
# define H_RESENT 00010 /* this address is a "Resent-..." address */
|
||||
# define H_CHECK 00020 /* check h_mflags against m_flags */
|
||||
# define H_ACHECK 00040 /* ditto, but always (not just default) */
|
||||
# define H_FORCE 00100 /* force this field, even if default */
|
||||
# define H_TRACE 00200 /* this field contains trace information */
|
||||
# define H_FROM 00400 /* this is a from-type field */
|
||||
# define H_VALID 01000 /* this field has a validated value */
|
||||
# define H_RECEIPTTO 02000 /* this field has return receipt info */
|
||||
# define H_ERRORSTO 04000 /* this field has error address info */
|
||||
# define H_EOH 0x0001 /* this field terminates header */
|
||||
# define H_RCPT 0x0002 /* contains recipient addresses */
|
||||
# define H_DEFAULT 0x0004 /* if another value is found, drop this */
|
||||
# define H_RESENT 0x0008 /* this address is a "Resent-..." address */
|
||||
# define H_CHECK 0x0010 /* check h_mflags against m_flags */
|
||||
# define H_ACHECK 0x0020 /* ditto, but always (not just default) */
|
||||
# define H_FORCE 0x0040 /* force this field, even if default */
|
||||
# define H_TRACE 0x0080 /* this field contains trace information */
|
||||
# define H_FROM 0x0100 /* this is a from-type field */
|
||||
# define H_VALID 0x0200 /* this field has a validated value */
|
||||
# define H_RECEIPTTO 0x0400 /* this field has return receipt info */
|
||||
# define H_ERRORSTO 0x0800 /* this field has error address info */
|
||||
# define H_CTE 0x1000 /* this field is a content-transfer-encoding */
|
||||
# define H_CTYPE 0x2000 /* this is a content-type field */
|
||||
# define H_BCC 0x4000 /* Bcc: header: strip value or delete */
|
||||
/*
|
||||
** Information about currently open connections to mailers, or to
|
||||
** hosts that we have looked up recently.
|
||||
@ -288,20 +345,27 @@ MCI
|
||||
char *mci_phase; /* SMTP phase string */
|
||||
struct mailer *mci_mailer; /* ptr to the mailer for this conn */
|
||||
char *mci_host; /* host name */
|
||||
char *mci_status; /* DSN status to be copied to addrs */
|
||||
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 */
|
||||
#define MCIF_VALID 0x0001 /* this entry is valid */
|
||||
#define MCIF_TEMP 0x0002 /* don't cache this connection */
|
||||
#define MCIF_CACHED 0x0004 /* currently in open cache */
|
||||
#define MCIF_ESMTP 0x0008 /* this host speaks ESMTP */
|
||||
#define MCIF_EXPN 0x0010 /* EXPN command supported */
|
||||
#define MCIF_SIZE 0x0020 /* SIZE option supported */
|
||||
#define MCIF_8BITMIME 0x0040 /* BODY=8BITMIME supported */
|
||||
#define MCIF_7BIT 0x0080 /* strip this message to 7 bits */
|
||||
#define MCIF_MULTSTAT 0x0100 /* MAIL11V3: handles MULT status */
|
||||
#define MCIF_INHEADER 0x0200 /* currently outputing header */
|
||||
#define MCIF_CVT8TO7 0x0400 /* convert from 8 to 7 bits */
|
||||
#define MCIF_DSN 0x0800 /* DSN extension supported */
|
||||
#define MCIF_8BITOK 0x1000 /* OK to send 8 bit characters */
|
||||
#define MCIF_CVT7TO8 0x2000 /* convert from 7 to 8 bits */
|
||||
#define MCIF_INMIME 0x4000 /* currently reading MIME header */
|
||||
|
||||
/* states */
|
||||
#define MCIS_CLOSED 0 /* no traffic on this connection */
|
||||
@ -311,6 +375,11 @@ MCI
|
||||
#define MCIS_QUITING 4 /* running quit protocol */
|
||||
#define MCIS_SSD 5 /* service shutting down */
|
||||
#define MCIS_ERROR 6 /* I/O error on connection */
|
||||
|
||||
/* functions */
|
||||
extern MCI *mci_get __P((char *, MAILER *));
|
||||
extern void mci_cache __P((MCI *));
|
||||
extern void mci_flush __P((bool, MCI *));
|
||||
/*
|
||||
** Envelope structure.
|
||||
** This structure defines the message itself. There is usually
|
||||
@ -320,9 +389,7 @@ MCI
|
||||
** will have their own envelope.
|
||||
*/
|
||||
|
||||
# define ENVELOPE struct envelope
|
||||
|
||||
ENVELOPE
|
||||
struct envelope
|
||||
{
|
||||
HDR *e_header; /* head of header list */
|
||||
long e_msgpriority; /* adjusted priority of this message */
|
||||
@ -342,14 +409,14 @@ ENVELOPE
|
||||
short e_nsent; /* number of sends since checkpoint */
|
||||
short e_sendmode; /* message send mode */
|
||||
short e_errormode; /* error return mode */
|
||||
int (*e_puthdr)__P((MCI *, ENVELOPE *));
|
||||
short e_timeoutclass; /* message timeout class */
|
||||
void (*e_puthdr)__P((MCI *, HDR *, ENVELOPE *));
|
||||
/* function to put header of message */
|
||||
int (*e_putbody)__P((MCI *, ENVELOPE *, char *));
|
||||
void (*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 */
|
||||
char *e_bodytype; /* type of message body */
|
||||
char *e_df; /* location of temp file */
|
||||
FILE *e_dfp; /* temporary file */
|
||||
char *e_id; /* code for this entry in queue */
|
||||
FILE *e_xfp; /* transcript file */
|
||||
@ -358,16 +425,23 @@ ENVELOPE
|
||||
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 */
|
||||
char *e_envid; /* envelope id from MAIL FROM: line */
|
||||
char *e_status; /* DSN status for this message */
|
||||
time_t e_dtime; /* time of last delivery attempt */
|
||||
int e_ntries; /* number of delivery attempts */
|
||||
dev_t e_dfdev; /* df file's device, for crash recov */
|
||||
ino_t e_dfino; /* df file's ino, for crash recovery */
|
||||
char *e_macro[256]; /* macro definitions */
|
||||
};
|
||||
|
||||
/* values for e_flags */
|
||||
#define EF_OLDSTYLE 0x0000001 /* use spaces (not commas) in hdrs */
|
||||
#define EF_INQUEUE 0x0000002 /* this message is fully queued */
|
||||
#define EF_NO_BODY_RETN 0x0000004 /* omit message body on error */
|
||||
#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_DELETE_BCC 0x0000040 /* delete Bcc: headers entirely */
|
||||
#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) */
|
||||
@ -378,8 +452,23 @@ ENVELOPE
|
||||
#define EF_METOO 0x0004000 /* send to me too */
|
||||
#define EF_LOGSENDER 0x0008000 /* need to log the sender */
|
||||
#define EF_NORECEIPT 0x0010000 /* suppress all return-receipts */
|
||||
#define EF_HAS8BIT 0x0020000 /* at least one 8-bit char in body */
|
||||
#define EF_NL_NOT_EOL 0x0040000 /* don't accept raw NL as EOLine */
|
||||
#define EF_CRLF_NOT_EOL 0x0080000 /* don't accept CR-LF as EOLine */
|
||||
#define EF_RET_PARAM 0x0100000 /* RCPT command had RET argument */
|
||||
#define EF_HAS_DF 0x0200000 /* set when df file is instantiated */
|
||||
#define EF_IS_MIME 0x0400000 /* really is a MIME message */
|
||||
#define EF_DONT_MIME 0x0800000 /* never MIME this message */
|
||||
|
||||
EXTERN ENVELOPE *CurEnv; /* envelope currently being processed */
|
||||
|
||||
/* functions */
|
||||
extern ENVELOPE *newenvelope __P((ENVELOPE *, ENVELOPE *));
|
||||
extern void dropenvelope __P((ENVELOPE *));
|
||||
extern void clearenvelope __P((ENVELOPE *, bool));
|
||||
|
||||
extern void putheader __P((MCI *, HDR *, ENVELOPE *));
|
||||
extern void putbody __P((MCI *, ENVELOPE *, char *));
|
||||
/*
|
||||
** Message priority classes.
|
||||
**
|
||||
@ -434,35 +523,35 @@ EXTERN struct rewrite *RewriteRules[MAXRWSETS];
|
||||
*/
|
||||
|
||||
/* left hand side items */
|
||||
# define MATCHZANY 0220 /* match zero or more tokens */
|
||||
# define MATCHANY 0221 /* match one or more tokens */
|
||||
# define MATCHONE 0222 /* match exactly one token */
|
||||
# define MATCHCLASS 0223 /* match one token in a class */
|
||||
# define MATCHNCLASS 0224 /* match anything not in class */
|
||||
# define MATCHREPL 0225 /* replacement on RHS for above */
|
||||
# define MATCHZANY ((u_char)0220) /* match zero or more tokens */
|
||||
# define MATCHANY ((u_char)0221) /* match one or more tokens */
|
||||
# define MATCHONE ((u_char)0222) /* match exactly one token */
|
||||
# define MATCHCLASS ((u_char)0223) /* match one token in a class */
|
||||
# define MATCHNCLASS ((u_char)0224) /* match anything not in class */
|
||||
# define MATCHREPL ((u_char)0225) /* replacement on RHS for above */
|
||||
|
||||
/* right hand side items */
|
||||
# define CANONNET 0226 /* canonical net, next token */
|
||||
# define CANONHOST 0227 /* canonical host, next token */
|
||||
# define CANONUSER 0230 /* canonical user, next N tokens */
|
||||
# define CALLSUBR 0231 /* call another rewriting set */
|
||||
# define CANONNET ((u_char)0226) /* canonical net, next token */
|
||||
# define CANONHOST ((u_char)0227) /* canonical host, next token */
|
||||
# define CANONUSER ((u_char)0230) /* canonical user, next N tokens */
|
||||
# define CALLSUBR ((u_char)0231) /* call another rewriting set */
|
||||
|
||||
/* conditionals in macros */
|
||||
# define CONDIF 0232 /* conditional if-then */
|
||||
# define CONDELSE 0233 /* conditional else */
|
||||
# define CONDFI 0234 /* conditional fi */
|
||||
# define CONDIF ((u_char)0232) /* conditional if-then */
|
||||
# define CONDELSE ((u_char)0233) /* conditional else */
|
||||
# define CONDFI ((u_char)0234) /* conditional fi */
|
||||
|
||||
/* bracket characters for host name lookup */
|
||||
# define HOSTBEGIN 0235 /* hostname lookup begin */
|
||||
# define HOSTEND 0236 /* hostname lookup end */
|
||||
# define HOSTBEGIN ((u_char)0235) /* hostname lookup begin */
|
||||
# define HOSTEND ((u_char)0236) /* hostname lookup end */
|
||||
|
||||
/* bracket characters for generalized lookup */
|
||||
# define LOOKUPBEGIN 0205 /* generalized lookup begin */
|
||||
# define LOOKUPEND 0206 /* generalized lookup end */
|
||||
# define LOOKUPBEGIN ((u_char)0205) /* generalized lookup begin */
|
||||
# define LOOKUPEND ((u_char)0206) /* generalized lookup end */
|
||||
|
||||
/* macro substitution character */
|
||||
# define MACROEXPAND 0201 /* macro expansion */
|
||||
# define MACRODEXPAND 0202 /* deferred macro expansion */
|
||||
# define MACROEXPAND ((u_char)0201) /* macro expansion */
|
||||
# define MACRODEXPAND ((u_char)0202) /* deferred macro expansion */
|
||||
|
||||
/* to make the code clearer */
|
||||
# define MATCHZERO CANONHOST
|
||||
@ -473,6 +562,16 @@ struct metamac
|
||||
char metaname; /* external code (after $) */
|
||||
u_char metaval; /* internal code (as above) */
|
||||
};
|
||||
|
||||
/* values for macros with external names only */
|
||||
# define MID_OPMODE 0202 /* operation mode */
|
||||
|
||||
/* functions */
|
||||
extern void expand __P((char *, char *, size_t, ENVELOPE *));
|
||||
extern void define __P((int, char *, ENVELOPE *));
|
||||
extern char *macvalue __P((int, ENVELOPE *));
|
||||
extern char *macname __P((int));
|
||||
extern int macid __P((char *, char **));
|
||||
/*
|
||||
** Name canonification short circuit.
|
||||
**
|
||||
@ -505,6 +604,7 @@ NAMECANON
|
||||
|
||||
# define MAPCLASS struct _mapclass
|
||||
# define MAP struct _map
|
||||
# define MAXMAPACTIONS 3 /* size of map_actions array */
|
||||
|
||||
|
||||
/*
|
||||
@ -515,32 +615,47 @@ MAP
|
||||
{
|
||||
MAPCLASS *map_class; /* the class of this map */
|
||||
char *map_mname; /* name of this map */
|
||||
int map_mflags; /* flags, see below */
|
||||
long map_mflags; /* flags, see below */
|
||||
char *map_file; /* the (nominal) filename */
|
||||
ARBPTR_T map_db1; /* the open database ptr */
|
||||
ARBPTR_T map_db2; /* an "extra" database pointer */
|
||||
char *map_keycolnm; /* key column name */
|
||||
char *map_valcolnm; /* value column name */
|
||||
u_char map_keycolno; /* key column number */
|
||||
u_char map_valcolno; /* value column number */
|
||||
char map_coldelim; /* column delimiter */
|
||||
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 */
|
||||
short map_specificity; /* specificity of alaases */
|
||||
MAP *map_stack[MAXMAPSTACK]; /* list for stacked maps */
|
||||
short map_return[MAXMAPACTIONS]; /* return bitmaps for stacked maps */
|
||||
};
|
||||
|
||||
/* bit values for map_flags */
|
||||
# define MF_VALID 0x0001 /* this entry is valid */
|
||||
# define MF_INCLNULL 0x0002 /* include null byte in key */
|
||||
# define MF_OPTIONAL 0x0004 /* don't complain if map not found */
|
||||
# define MF_NOFOLDCASE 0x0008 /* don't fold case in keys */
|
||||
# define MF_MATCHONLY 0x0010 /* don't use the map value */
|
||||
# define MF_OPEN 0x0020 /* this entry is open */
|
||||
# define MF_WRITABLE 0x0040 /* open for writing */
|
||||
# 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 */
|
||||
/* bit values for map_mflags */
|
||||
# define MF_VALID 0x00000001 /* this entry is valid */
|
||||
# define MF_INCLNULL 0x00000002 /* include null byte in key */
|
||||
# define MF_OPTIONAL 0x00000004 /* don't complain if map not found */
|
||||
# define MF_NOFOLDCASE 0x00000008 /* don't fold case in keys */
|
||||
# define MF_MATCHONLY 0x00000010 /* don't use the map value */
|
||||
# define MF_OPEN 0x00000020 /* this entry is open */
|
||||
# define MF_WRITABLE 0x00000040 /* open for writing */
|
||||
# define MF_ALIAS 0x00000080 /* this is an alias file */
|
||||
# define MF_TRY0NULL 0x00000100 /* try with no null byte */
|
||||
# define MF_TRY1NULL 0x00000200 /* try with the null byte */
|
||||
# define MF_LOCKED 0x00000400 /* this map is currently locked */
|
||||
# define MF_ALIASWAIT 0x00000800 /* alias map in aliaswait state */
|
||||
# define MF_IMPL_HASH 0x00001000 /* implicit: underlying hash database */
|
||||
# define MF_IMPL_NDBM 0x00002000 /* implicit: underlying NDBM database */
|
||||
# define MF_UNSAFEDB 0x00004000 /* this map is world writable */
|
||||
# define MF_APPEND 0x00008000 /* append new entry on rebuiled */
|
||||
# define MF_KEEPQUOTES 0x00010000 /* don't dequote key before lookup */
|
||||
|
||||
/* indices for map_actions */
|
||||
# define MA_NOTFOUND 0 /* member map returned "not found" */
|
||||
# define MA_UNAVAIL 1 /* member map is not available */
|
||||
# define MA_TRYAGAIN 2 /* member map returns temp failure */
|
||||
|
||||
/*
|
||||
** The class of a map -- essentially the functions to call
|
||||
@ -567,6 +682,11 @@ MAPCLASS
|
||||
#define MCF_ALIASOK 0x0001 /* can be used for aliases */
|
||||
#define MCF_ALIASONLY 0x0002 /* usable only for aliases */
|
||||
#define MCF_REBUILDABLE 0x0004 /* can rebuild alias files */
|
||||
#define MCF_OPTFILE 0x0008 /* file name is optional */
|
||||
|
||||
/* functions */
|
||||
extern char *map_rewrite __P((MAP *, char *, int, char **));
|
||||
extern MAP *makemapentry __P((char *));
|
||||
/*
|
||||
** Symbol table definitions
|
||||
*/
|
||||
@ -587,6 +707,8 @@ struct symtab
|
||||
char *sv_hostsig; /* host signature */
|
||||
MCI sv_mci; /* mailer connection info */
|
||||
NAMECANON sv_namecanon; /* canonical name cache */
|
||||
int sv_macro; /* macro name => id mapping */
|
||||
int sv_ruleset; /* ruleset index */
|
||||
} s_value;
|
||||
};
|
||||
|
||||
@ -602,6 +724,8 @@ typedef struct symtab STAB;
|
||||
# define ST_MAP 6 /* mapping function */
|
||||
# define ST_HOSTSIG 7 /* host signature */
|
||||
# define ST_NAMECANON 8 /* cached canonical name */
|
||||
# define ST_MACRO 9 /* macro name to id mapping */
|
||||
# define ST_RULESET 10 /* ruleset index */
|
||||
# define ST_MCI 16 /* mailer connection info (offset) */
|
||||
|
||||
# define s_class s_value.sv_class
|
||||
@ -613,6 +737,8 @@ typedef struct symtab STAB;
|
||||
# define s_hostsig s_value.sv_hostsig
|
||||
# define s_map s_value.sv_map
|
||||
# define s_namecanon s_value.sv_namecanon
|
||||
# define s_macro s_value.sv_macro
|
||||
# define s_ruleset s_value.sv_ruleset
|
||||
|
||||
extern STAB *stab __P((char *, int, int));
|
||||
extern void stabapply __P((void (*)(STAB *, int), int));
|
||||
@ -632,7 +758,7 @@ extern void stabapply __P((void (*)(STAB *, int), int));
|
||||
struct event
|
||||
{
|
||||
time_t ev_time; /* time of the function call */
|
||||
int (*ev_func)__P((int));
|
||||
void (*ev_func)__P((int));
|
||||
/* function to call */
|
||||
int ev_arg; /* argument to ev_func */
|
||||
int ev_pid; /* pid that set this event */
|
||||
@ -642,8 +768,12 @@ struct event
|
||||
typedef struct event EVENT;
|
||||
|
||||
EXTERN EVENT *EventQueue; /* head of event queue */
|
||||
|
||||
/* functions */
|
||||
extern EVENT *setevent __P((time_t, void(*)(), int));
|
||||
extern void clrevent __P((EVENT *));
|
||||
/*
|
||||
** Operation, send, and error modes
|
||||
** Operation, send, error, and MIME modes
|
||||
**
|
||||
** The operation mode describes the basic operation of sendmail.
|
||||
** This can be set from the command line, and is "send mail" by
|
||||
@ -673,9 +803,9 @@ EXTERN char OpMode; /* operation mode, see below */
|
||||
|
||||
/* values for e_sendmode -- send modes */
|
||||
#define SM_DELIVER 'i' /* interactive delivery */
|
||||
#define SM_QUICKD 'j' /* deliver w/o queueing */
|
||||
#define SM_FORK 'b' /* deliver in background */
|
||||
#define SM_QUEUE 'q' /* queue, don't deliver */
|
||||
#define SM_DEFER 'd' /* defer map lookups as well as queue */
|
||||
#define SM_VERIFY 'v' /* verify only (used internally) */
|
||||
|
||||
/* used only as a parameter to sendall */
|
||||
@ -688,6 +818,37 @@ EXTERN char OpMode; /* operation mode, see below */
|
||||
#define EM_WRITE 'w' /* write back errors */
|
||||
#define EM_BERKNET 'e' /* special berknet processing */
|
||||
#define EM_QUIET 'q' /* don't print messages (stat only) */
|
||||
|
||||
|
||||
/* MIME processing mode */
|
||||
EXTERN int MimeMode;
|
||||
|
||||
/* bit values for MimeMode */
|
||||
#define MM_CVTMIME 0x0001 /* convert 8 to 7 bit MIME */
|
||||
#define MM_PASS8BIT 0x0002 /* just send 8 bit data blind */
|
||||
#define MM_MIME8BIT 0x0004 /* convert 8-bit data to MIME */
|
||||
|
||||
/* queue sorting order algorithm */
|
||||
EXTERN int QueueSortOrder;
|
||||
|
||||
#define QS_BYPRIORITY 0 /* sort by message priority */
|
||||
#define QS_BYHOST 1 /* sort by first host name */
|
||||
|
||||
|
||||
/* how to handle messages without any recipient addresses */
|
||||
EXTERN int NoRecipientAction;
|
||||
|
||||
#define NRA_NO_ACTION 0 /* just leave it as is */
|
||||
#define NRA_ADD_TO 1 /* add To: header */
|
||||
#define NRA_ADD_APPARENTLY_TO 2 /* add Apparently-To: header */
|
||||
#define NRA_ADD_BCC 3 /* add empty Bcc: header */
|
||||
#define NRA_ADD_TO_UNDISCLOSED 4 /* add To: undisclosed:; header */
|
||||
|
||||
|
||||
/* flags to putxline */
|
||||
#define PXLF_NOTHINGSPECIAL 0 /* no special mapping */
|
||||
#define PXLF_MAPFROM 0x0001 /* map From_ to >From_ */
|
||||
#define PXLF_STRIP8BIT 0x0002 /* strip 8th bit *e
|
||||
/*
|
||||
** Additional definitions
|
||||
*/
|
||||
@ -699,16 +860,16 @@ EXTERN char OpMode; /* operation mode, see below */
|
||||
*/
|
||||
|
||||
#define PRIV_PUBLIC 0 /* what have I got to hide? */
|
||||
#define PRIV_NEEDMAILHELO 00001 /* insist on HELO for MAIL, at least */
|
||||
#define PRIV_NEEDEXPNHELO 00002 /* insist on HELO for EXPN */
|
||||
#define PRIV_NEEDVRFYHELO 00004 /* insist on HELO for VRFY */
|
||||
#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_NORECEIPTS 00100 /* disallow return receipts */
|
||||
#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 */
|
||||
#define PRIV_NEEDMAILHELO 0x0001 /* insist on HELO for MAIL, at least */
|
||||
#define PRIV_NEEDEXPNHELO 0x0002 /* insist on HELO for EXPN */
|
||||
#define PRIV_NEEDVRFYHELO 0x0004 /* insist on HELO for VRFY */
|
||||
#define PRIV_NOEXPN 0x0008 /* disallow EXPN command entirely */
|
||||
#define PRIV_NOVRFY 0x0010 /* disallow VRFY command entirely */
|
||||
#define PRIV_AUTHWARNINGS 0x0020 /* flag possible authorization probs */
|
||||
#define PRIV_NORECEIPTS 0x0040 /* disallow return receipts */
|
||||
#define PRIV_RESTRICTMAILQ 0x1000 /* restrict mailq command */
|
||||
#define PRIV_RESTRICTQRUN 0x2000 /* restrict queue run */
|
||||
#define PRIV_GOAWAY 0x0fff /* don't give no info, anyway, anyhow */
|
||||
|
||||
/* struct defining such things */
|
||||
struct prival
|
||||
@ -722,12 +883,12 @@ struct prival
|
||||
** 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_SENDERADDR 0x001 /* this is a sender address */
|
||||
#define RF_HEADERADDR 0x002 /* this is a header address */
|
||||
#define RF_CANONICAL 0x004 /* strip comment information */
|
||||
#define RF_ADDDOMAIN 0x008 /* OK to do domain extension */
|
||||
#define RF_COPYPARSE 0x010 /* copy parsed user & host */
|
||||
#define RF_COPYPADDR 0x020 /* copy print address */
|
||||
#define RF_COPYALL (RF_COPYPARSE|RF_COPYPADDR)
|
||||
#define RF_COPYNONE 0
|
||||
|
||||
@ -740,6 +901,23 @@ struct prival
|
||||
#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 */
|
||||
#define SFF_RUNASREALUID 0x0008 /* if no ctladdr, run as real uid */
|
||||
#define SFF_NOPATHCHECK 0x0010 /* don't bother checking dir path */
|
||||
#define SFF_SETUIDOK 0x0020 /* setuid files are ok */
|
||||
#define SFF_CREAT 0x0040 /* ok to create file if necessary */
|
||||
#define SFF_REGONLY 0x0080 /* regular files only */
|
||||
|
||||
/* flags that are actually specific to safefopen */
|
||||
#define SFF_OPENASROOT 0x1000 /* open as root instead of real user */
|
||||
|
||||
|
||||
/*
|
||||
** Flags passed to mime8to7.
|
||||
*/
|
||||
|
||||
#define M87F_OUTER 0 /* outer context */
|
||||
#define M87F_NO8BIT 0x0001 /* can't have 8-bit in this section */
|
||||
#define M87F_DIGEST 0x0002 /* processing multipart/digest */
|
||||
|
||||
|
||||
/*
|
||||
@ -747,27 +925,56 @@ struct prival
|
||||
** we are forced to declare a supertype here.
|
||||
*/
|
||||
|
||||
#ifdef DAEMON
|
||||
union bigsockaddr
|
||||
{
|
||||
struct sockaddr sa; /* general version */
|
||||
#ifdef NETUNIX
|
||||
#if NETUNIX
|
||||
struct sockaddr_un sunix; /* UNIX family */
|
||||
#endif
|
||||
#ifdef NETINET
|
||||
#if NETINET
|
||||
struct sockaddr_in sin; /* INET family */
|
||||
#endif
|
||||
#ifdef NETISO
|
||||
#if NETISO
|
||||
struct sockaddr_iso siso; /* ISO family */
|
||||
#endif
|
||||
#ifdef NETNS
|
||||
#if NETNS
|
||||
struct sockaddr_ns sns; /* XNS family */
|
||||
#endif
|
||||
#ifdef NETX25
|
||||
#if NETX25
|
||||
struct sockaddr_x25 sx25; /* X.25 family */
|
||||
#endif
|
||||
};
|
||||
|
||||
#define SOCKADDR union bigsockaddr
|
||||
|
||||
EXTERN SOCKADDR RealHostAddr; /* address of host we are talking to */
|
||||
extern char *anynet_ntoa __P((SOCKADDR *));
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
** Vendor codes
|
||||
**
|
||||
** Vendors can customize sendmail to add special behaviour,
|
||||
** generally for back compatibility. Ideally, this should
|
||||
** be set up in the .cf file using the "V" command. However,
|
||||
** it's quite reasonable for some vendors to want the default
|
||||
** be their old version; this can be set using
|
||||
** -DVENDOR_DEFAULT=VENDOR_xxx
|
||||
** in the Makefile.
|
||||
**
|
||||
** Vendors should apply to sendmail@CS.Berkeley.EDU for
|
||||
** unique vendor codes.
|
||||
*/
|
||||
|
||||
#define VENDOR_BERKELEY 1 /* Berkeley-native configuration file */
|
||||
#define VENDOR_SUN 2 /* Sun-native configuration file */
|
||||
#define VENDOR_HP 3 /* Hewlett-Packard specific config syntax */
|
||||
#define VENDOR_IBM 4 /* IBM specific config syntax */
|
||||
|
||||
EXTERN int VendorCode; /* vendor-specific operation enhancements */
|
||||
/*
|
||||
** Global variables.
|
||||
*/
|
||||
@ -778,7 +985,6 @@ EXTERN bool IgnrDot; /* don't let dot end messages */
|
||||
EXTERN bool SaveFrom; /* save leading "From" lines */
|
||||
EXTERN bool Verbose; /* set if blow-by-blow desired */
|
||||
EXTERN bool GrabTo; /* if set, get recipients from msg */
|
||||
EXTERN bool NoReturn; /* don't return letter to sender */
|
||||
EXTERN bool SuprErrs; /* set if we are suppressing errors */
|
||||
EXTERN bool HoldErrs; /* only output errors to transcript */
|
||||
EXTERN bool NoConnect; /* don't connect to non-local mailers */
|
||||
@ -787,20 +993,22 @@ EXTERN bool ForkQueueRuns; /* fork for each job when running the queue */
|
||||
EXTERN bool AutoRebuild; /* auto-rebuild the alias database as needed */
|
||||
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 bool UseNameServer; /* using DNS -- interpret h_errno & MX RRs */
|
||||
EXTERN bool UseHesiod; /* using Hesiod -- interpret Hesiod errors */
|
||||
EXTERN bool SevenBitInput; /* force 7-bit data on input */
|
||||
EXTERN bool HasEightBits; /* has at least one eight bit input byte */
|
||||
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 */
|
||||
EXTERN gid_t RealGid; /* when Daemon, real gid of caller */
|
||||
EXTERN char *RealUserName; /* real user name of caller */
|
||||
EXTERN uid_t RealUid; /* real uid of caller */
|
||||
EXTERN gid_t RealGid; /* real gid of caller */
|
||||
EXTERN uid_t DefUid; /* default uid to run as */
|
||||
EXTERN gid_t DefGid; /* default gid to run as */
|
||||
EXTERN char *DefUser; /* default user to run as (from DefUid) */
|
||||
EXTERN int OldUmask; /* umask when sendmail starts up */
|
||||
EXTERN int Errors; /* set if errors (local to single pass) */
|
||||
EXTERN int ExitStat; /* exit status code */
|
||||
EXTERN int AliasLevel; /* depth of aliasing */
|
||||
EXTERN int LineNumber; /* line number in current input */
|
||||
EXTERN int LogLevel; /* level of logging to perform */
|
||||
EXTERN int FileMode; /* mode on files */
|
||||
@ -817,7 +1025,6 @@ EXTERN char *FileName; /* name to print on error messages */
|
||||
EXTERN char *SmtpPhase; /* current phase in SMTP processing */
|
||||
EXTERN char *MyHostName; /* name of this host for SMTP messages */
|
||||
EXTERN char *RealHostName; /* name of host we are talking to */
|
||||
EXTERN SOCKADDR RealHostAddr; /* address of host we are talking to */
|
||||
EXTERN char *CurHostName; /* current host we are dealing with */
|
||||
EXTERN jmp_buf TopFrame; /* branch-to-top-of-loop-on-error frame */
|
||||
EXTERN bool QuickAbort; /* .... but only if we want a quick abort */
|
||||
@ -826,9 +1033,10 @@ 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 bool ColonOkInAddr; /* single colon legal in address */
|
||||
EXTERN bool HasWildcardMX; /* don't use MX records when canonifying */
|
||||
EXTERN char SpaceSub; /* substitution for <lwsp> */
|
||||
EXTERN int PrivacyFlags; /* privacy flags */
|
||||
EXTERN char *ConfFile; /* location of configuration file [conf.c] */
|
||||
@ -845,16 +1053,38 @@ EXTERN char *ForwardPath; /* path to search for .forward files */
|
||||
EXTERN long MinBlocksFree; /* min # of blocks free on queue fs */
|
||||
EXTERN char *FallBackMX; /* fall back MX host */
|
||||
EXTERN long MaxMessageSize; /* advertised max size we will accept */
|
||||
EXTERN time_t MaxHostStatAge; /* max age of cached host status info */
|
||||
EXTERN time_t MinQueueAge; /* min delivery interval */
|
||||
EXTERN time_t DialDelay; /* delay between dial-on-demand tries */
|
||||
EXTERN char *SafeFileEnv; /* chroot location for file delivery */
|
||||
EXTERN char *HostsFile; /* path to /etc/hosts file */
|
||||
EXTERN int MaxQueueRun; /* maximum number of jobs in one queue run */
|
||||
EXTERN int MaxChildren; /* maximum number of daemonic children */
|
||||
EXTERN int CurChildren; /* current number of daemonic children */
|
||||
EXTERN char *SmtpGreeting; /* SMTP greeting message (old $e macro) */
|
||||
EXTERN char *UnixFromLine; /* UNIX From_ line (old $l macro) */
|
||||
EXTERN char *OperatorChars; /* operators (old $o macro) */
|
||||
EXTERN bool DontInitGroups; /* avoid initgroups() because of NIS cost */
|
||||
EXTERN bool SingleLineFromHeader; /* force From: header to be one line */
|
||||
EXTERN int MaxAliasRecursion; /* maximum depth of alias recursion */
|
||||
EXTERN int MaxRuleRecursion; /* maximum depth of ruleset recursion */
|
||||
EXTERN char *MustQuoteChars; /* quote these characters in phrases */
|
||||
EXTERN char *ServiceSwitchFile; /* backup service switch */
|
||||
EXTERN char *DefaultCharSet; /* default character set for MIME */
|
||||
EXTERN int DeliveryNiceness; /* how nice to be during delivery */
|
||||
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 bool DontExpandCnames; /* do not $[...$] expand CNAMEs */
|
||||
EXTERN int MaxMciCache; /* maximum entries in MCI cache */
|
||||
EXTERN time_t MciCacheTimeout; /* maximum idle time on connections */
|
||||
EXTERN time_t MciInfoTimeout; /* how long 'til we retry down hosts */
|
||||
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 char *UserEnviron[MAXUSERENVIRON + 1];
|
||||
/* saved user environment */
|
||||
extern int errno;
|
||||
|
||||
|
||||
@ -875,16 +1105,23 @@ EXTERN struct
|
||||
time_t to_datafinal; /* DATA completion [10m] */
|
||||
time_t to_nextcommand; /* next command [5m] */
|
||||
/* following timeouts are not mentioned in RFC 1123 */
|
||||
time_t to_connect; /* initial connection timeout */
|
||||
time_t to_rset; /* RSET command */
|
||||
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 */
|
||||
time_t to_fileopen; /* opening :include: and .forward files */
|
||||
/* following are per message */
|
||||
time_t to_q_return; /* queue return timeout */
|
||||
time_t to_q_warning; /* queue warning timeout */
|
||||
time_t to_q_return[MAXTOCLASS]; /* queue return timeouts */
|
||||
time_t to_q_warning[MAXTOCLASS]; /* queue warning timeouts */
|
||||
} TimeOuts;
|
||||
|
||||
/* timeout classes for return and warning timeouts */
|
||||
# define TOC_NORMAL 0 /* normal delivery */
|
||||
# define TOC_URGENT 1 /* urgent delivery */
|
||||
# define TOC_NONURGENT 2 /* non-urgent delivery */
|
||||
|
||||
|
||||
/*
|
||||
** Trace information
|
||||
@ -920,43 +1157,59 @@ EXTERN u_char tTdvect[100];
|
||||
** Declarations of useful functions
|
||||
*/
|
||||
|
||||
extern ADDRESS *parseaddr __P((char *, ADDRESS *, int, int, char **, ENVELOPE *));
|
||||
extern char *xalloc __P((int));
|
||||
extern bool sameaddr __P((ADDRESS *, ADDRESS *));
|
||||
extern FILE *dfopen __P((char *, int, int));
|
||||
extern EVENT *setevent __P((time_t, int(*)(), int));
|
||||
extern char *sfgets __P((char *, int, FILE *, time_t, char *));
|
||||
extern char *queuename __P((ENVELOPE *, int));
|
||||
extern time_t curtime __P(());
|
||||
extern bool transienterror __P((int));
|
||||
extern char *xalloc __P((int));
|
||||
extern FILE *dfopen __P((char *, int, int));
|
||||
extern char *sfgets __P((char *, int, FILE *, time_t, char *));
|
||||
extern char *queuename __P((ENVELOPE *, int));
|
||||
extern time_t curtime __P(());
|
||||
extern bool transienterror __P((int));
|
||||
extern char *fgetfolded __P((char *, int, FILE *));
|
||||
extern char *username __P(());
|
||||
extern char *pintvl __P((time_t, bool));
|
||||
extern bool shouldqueue __P((long, time_t));
|
||||
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 char *shortenstring __P((const char *, int));
|
||||
extern bool usershellok __P((char *, char *));
|
||||
extern void commaize __P((HDR *, char *, bool, MCI *, ENVELOPE *));
|
||||
extern char *hvalue __P((char *, HDR *));
|
||||
extern char *defcharset __P((ENVELOPE *));
|
||||
extern bool wordinclass __P((char *, int));
|
||||
extern char *denlstring __P((char *, bool, bool));
|
||||
extern void makelower __P((char *));
|
||||
extern void rebuildaliases __P((MAP *, bool));
|
||||
extern void readaliases __P((MAP *, FILE *, bool, bool));
|
||||
extern void finis __P(());
|
||||
extern void setsender __P((char *, ENVELOPE *, char **, bool));
|
||||
extern FILE *safefopen __P((char *, int, int, int));
|
||||
extern void xputs __P((const char *));
|
||||
extern void logsender __P((ENVELOPE *, char *));
|
||||
extern void smtprset __P((MAILER *, MCI *, ENVELOPE *));
|
||||
extern void smtpquit __P((MAILER *, MCI *, ENVELOPE *));
|
||||
extern void setuserenv __P((const char *, const char *));
|
||||
extern void disconnect __P((int, ENVELOPE *));
|
||||
extern void putxline __P((char *, MCI *, int));
|
||||
extern void dumpfd __P((int, bool, bool));
|
||||
extern void makemailer __P((char *));
|
||||
extern void putfromline __P((MCI *, ENVELOPE *));
|
||||
extern void setoption __P((int, char *, bool, bool, ENVELOPE *));
|
||||
extern void setclass __P((int, char *));
|
||||
extern void inittimeouts __P((char *));
|
||||
extern void logdelivery __P((MAILER *, MCI *, const char *, ADDRESS *, time_t, ENVELOPE *));
|
||||
extern void giveresponse __P((int, MAILER *, MCI *, ADDRESS *, time_t, ENVELOPE *));
|
||||
|
||||
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[], 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 *));
|
||||
extern void dropenvelope __P((ENVELOPE *));
|
||||
extern void clearenvelope __P((ENVELOPE *, int));
|
||||
extern char *username __P(());
|
||||
extern MCI *mci_get __P((char *, MAILER *));
|
||||
extern char *pintvl __P((time_t, int));
|
||||
extern char *map_rewrite __P((MAP *, char *, int, char **));
|
||||
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 *, 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 *));
|
||||
extern char *denlstring __P((char *, int, int));
|
||||
extern struct hostent *sm_gethostbyname __P((char *));
|
||||
extern struct hostent *sm_gethostbyaddr __P((char *, int, int));
|
||||
extern struct passwd *sm_getpwnam __P((char *));
|
||||
extern struct passwd *sm_getpwuid __P((UID_T));
|
||||
|
||||
#ifdef XDEBUG
|
||||
extern void checkfd012 __P((char *));
|
||||
#endif
|
||||
|
||||
/* ellipsis is a different case though */
|
||||
#ifdef __STDC__
|
||||
@ -972,3 +1225,13 @@ extern void usrerr();
|
||||
extern void message();
|
||||
extern void nmessage();
|
||||
#endif
|
||||
|
||||
#if !HASSNPRINTF
|
||||
# ifdef __STDC__
|
||||
extern void snprintf(char *, size_t, const char *, ...);
|
||||
extern void vsnprintf(char *, size_t, const char *, va_list);
|
||||
# else
|
||||
extern void snprintf();
|
||||
extern void vsnprintf();
|
||||
# endif
|
||||
#endif
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1983 Eric P. Allman
|
||||
* Copyright (c) 1983, 1995 Eric P. Allman
|
||||
* Copyright (c) 1988, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
@ -36,9 +36,9 @@
|
||||
|
||||
#ifndef lint
|
||||
#ifdef SMTP
|
||||
static char sccsid[] = "@(#)srvrsmtp.c 8.37 (Berkeley) 4/13/94 (with SMTP)";
|
||||
static char sccsid[] = "@(#)srvrsmtp.c 8.97 (Berkeley) 11/18/95 (with SMTP)";
|
||||
#else
|
||||
static char sccsid[] = "@(#)srvrsmtp.c 8.37 (Berkeley) 4/13/94 (without SMTP)";
|
||||
static char sccsid[] = "@(#)srvrsmtp.c 8.97 (Berkeley) 11/18/95 (without SMTP)";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -117,35 +117,34 @@ bool OneXact = FALSE; /* one xaction only this run */
|
||||
char *CurSmtpClient; /* who's at the other end of channel */
|
||||
|
||||
static char *skipword();
|
||||
extern char RealUserName[];
|
||||
|
||||
|
||||
#define MAXBADCOMMANDS 25 /* maximum number of bad commands */
|
||||
|
||||
void
|
||||
smtp(e)
|
||||
register ENVELOPE *e;
|
||||
register ENVELOPE *volatile e;
|
||||
{
|
||||
register char *p;
|
||||
register struct cmd *c;
|
||||
char *cmd;
|
||||
auto ADDRESS *vrfyqueue;
|
||||
ADDRESS *a;
|
||||
bool gotmail; /* mail command received */
|
||||
bool gothello; /* helo command received */
|
||||
volatile bool gotmail; /* mail command received */
|
||||
volatile bool gothello; /* helo command received */
|
||||
bool vrfy; /* set if this is a vrfy command */
|
||||
char *protocol; /* sending protocol */
|
||||
char *sendinghost; /* sending hostname */
|
||||
unsigned long msize; /* approximate maximum message size */
|
||||
char *peerhostname; /* name of SMTP peer or "localhost" */
|
||||
char *volatile protocol; /* sending protocol */
|
||||
char *volatile sendinghost; /* sending hostname */
|
||||
char *volatile peerhostname; /* name of SMTP peer or "localhost" */
|
||||
auto char *delimptr;
|
||||
char *id;
|
||||
int nrcpts; /* number of RCPT commands */
|
||||
volatile int nrcpts = 0; /* number of RCPT commands */
|
||||
bool doublequeue;
|
||||
int badcommands = 0; /* count of bad commands */
|
||||
volatile int badcommands = 0; /* count of bad commands */
|
||||
char inp[MAXLINE];
|
||||
char cmdbuf[MAXLINE];
|
||||
extern char Version[];
|
||||
extern ENVELOPE BlankEnvelope;
|
||||
extern void help __P((char *));
|
||||
|
||||
if (fileno(OutChannel) != fileno(stdout))
|
||||
{
|
||||
@ -162,28 +161,41 @@ smtp(e)
|
||||
CurSmtpClient = CurHostName;
|
||||
|
||||
setproctitle("server %s startup", CurSmtpClient);
|
||||
expand("\201e", inp, &inp[sizeof inp], e);
|
||||
if (BrokenSmtpPeers)
|
||||
#ifdef LOG
|
||||
if (LogLevel > 11)
|
||||
{
|
||||
p = strchr(inp, '\n');
|
||||
if (p != NULL)
|
||||
*p = '\0';
|
||||
message("220 %s", inp);
|
||||
/* log connection information */
|
||||
syslog(LOG_INFO, "SMTP connect from %.100s (%.100s)",
|
||||
CurSmtpClient, anynet_ntoa(&RealHostAddr));
|
||||
}
|
||||
else
|
||||
{
|
||||
char *q = inp;
|
||||
#endif
|
||||
|
||||
while (q != NULL)
|
||||
{
|
||||
p = strchr(q, '\n');
|
||||
if (p != NULL)
|
||||
*p++ = '\0';
|
||||
message("220-%s", q);
|
||||
q = p;
|
||||
}
|
||||
message("220 ESMTP spoken here");
|
||||
/* output the first line, inserting "ESMTP" as second word */
|
||||
expand(SmtpGreeting, inp, sizeof inp, e);
|
||||
p = strchr(inp, '\n');
|
||||
if (p != NULL)
|
||||
*p++ = '\0';
|
||||
id = strchr(inp, ' ');
|
||||
if (id == NULL)
|
||||
id = &inp[strlen(inp)];
|
||||
cmd = p == NULL ? "220 %.*s ESMTP%s" : "220-%.*s ESMTP%s";
|
||||
message(cmd, id - inp, inp, id);
|
||||
|
||||
/* output remaining lines */
|
||||
while ((id = p) != NULL && (p = strchr(id, '\n')) != NULL)
|
||||
{
|
||||
*p++ = '\0';
|
||||
if (isascii(*id) && isspace(*id))
|
||||
id++;
|
||||
message("220-%s", id);
|
||||
}
|
||||
if (id != NULL)
|
||||
{
|
||||
if (isascii(*id) && isspace(*id))
|
||||
id++;
|
||||
message("220 %s", id);
|
||||
}
|
||||
|
||||
protocol = NULL;
|
||||
sendinghost = macvalue('s', e);
|
||||
gothello = FALSE;
|
||||
@ -213,7 +225,7 @@ smtp(e)
|
||||
|
||||
/* read the input line */
|
||||
SmtpPhase = "server cmd read";
|
||||
setproctitle("server %s cmd read", CurHostName);
|
||||
setproctitle("server %s cmd read", CurSmtpClient);
|
||||
p = sfgets(inp, sizeof inp, InChannel, TimeOuts.to_nextcommand,
|
||||
SmtpPhase);
|
||||
|
||||
@ -226,7 +238,7 @@ smtp(e)
|
||||
MyHostName, CurSmtpClient);
|
||||
#ifdef LOG
|
||||
if (LogLevel > (gotmail ? 1 : 19))
|
||||
syslog(LOG_NOTICE, "lost input channel from %s",
|
||||
syslog(LOG_NOTICE, "lost input channel from %.100s",
|
||||
CurSmtpClient);
|
||||
#endif
|
||||
if (InChild)
|
||||
@ -285,6 +297,39 @@ smtp(e)
|
||||
protocol = "SMTP";
|
||||
SmtpPhase = "server HELO";
|
||||
}
|
||||
|
||||
/* check for valid domain name (re 1123 5.2.5) */
|
||||
if (*p == '\0')
|
||||
{
|
||||
message("501 %s requires domain address",
|
||||
cmdbuf);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
register char *q;
|
||||
|
||||
for (q = p; *q != '\0'; q++)
|
||||
{
|
||||
if (!isascii(*q))
|
||||
break;
|
||||
if (isalnum(*q))
|
||||
continue;
|
||||
if (isspace(*q))
|
||||
{
|
||||
*q = '\0';
|
||||
break;
|
||||
}
|
||||
if (strchr("[].-_#", *q) == NULL)
|
||||
break;
|
||||
}
|
||||
if (*q != '\0')
|
||||
{
|
||||
message("501 Invalid domain name");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
sendinghost = newstr(p);
|
||||
gothello = TRUE;
|
||||
if (c->cmdcode != CMDEHLO)
|
||||
@ -300,10 +345,19 @@ smtp(e)
|
||||
MyHostName, CurSmtpClient);
|
||||
if (!bitset(PRIV_NOEXPN, PrivacyFlags))
|
||||
message("250-EXPN");
|
||||
#if MIME8TO7
|
||||
message("250-8BITMIME");
|
||||
#endif
|
||||
if (MaxMessageSize > 0)
|
||||
message("250-SIZE %ld", MaxMessageSize);
|
||||
else
|
||||
message("250-SIZE");
|
||||
#if DSN
|
||||
if (SendMIMEErrors)
|
||||
message("250-DSN");
|
||||
#endif
|
||||
message("250-VERB");
|
||||
message("250-ONEX");
|
||||
message("250 HELP");
|
||||
break;
|
||||
|
||||
@ -344,7 +398,7 @@ smtp(e)
|
||||
{
|
||||
auth_warning(e,
|
||||
"Host %s didn't use HELO protocol",
|
||||
peerhostname);
|
||||
CurSmtpClient);
|
||||
}
|
||||
#ifdef PICKY_HELO_CHECK
|
||||
if (strcasecmp(sendinghost, peerhostname) != 0 &&
|
||||
@ -352,7 +406,7 @@ smtp(e)
|
||||
strcasecmp(sendinghost, MyHostName) != 0))
|
||||
{
|
||||
auth_warning(e, "Host %s claimed to be %s",
|
||||
peerhostname, sendinghost);
|
||||
CurSmtpClient, sendinghost);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -362,7 +416,7 @@ smtp(e)
|
||||
define('s', sendinghost, e);
|
||||
initsys(e);
|
||||
nrcpts = 0;
|
||||
e->e_flags |= EF_LOGSENDER;
|
||||
e->e_flags |= EF_LOGSENDER|EF_CLRQUEUE;
|
||||
setproctitle("%s %s: %.80s", e->e_id, CurSmtpClient, inp);
|
||||
|
||||
/* child -- go do the processing */
|
||||
@ -392,19 +446,21 @@ smtp(e)
|
||||
|
||||
/* check for possible spoofing */
|
||||
if (RealUid != 0 && OpMode == MD_SMTP &&
|
||||
(e->e_from.q_mailer != LocalMailer &&
|
||||
strcmp(e->e_from.q_user, RealUserName) != 0))
|
||||
!wordinclass(RealUserName, 't') &&
|
||||
!bitnset(M_LOCALMAILER, e->e_from.q_mailer->m_flags) &&
|
||||
strcmp(e->e_from.q_user, RealUserName) != 0)
|
||||
{
|
||||
auth_warning(e, "%s owned process doing -bs",
|
||||
RealUserName);
|
||||
}
|
||||
|
||||
/* now parse ESMTP arguments */
|
||||
msize = 0;
|
||||
e->e_msgsize = 0;
|
||||
while (p != NULL && *p != '\0')
|
||||
{
|
||||
char *kp;
|
||||
char *vp = NULL;
|
||||
extern void mail_esmtp_args __P((char *, char *, ENVELOPE *));
|
||||
|
||||
/* locate the beginning of the keyword */
|
||||
while (isascii(*p) && isspace(*p))
|
||||
@ -435,59 +491,17 @@ smtp(e)
|
||||
printf("MAIL: got arg %s=\"%s\"\n", kp,
|
||||
vp == NULL ? "<null>" : vp);
|
||||
|
||||
if (strcasecmp(kp, "size") == 0)
|
||||
{
|
||||
if (vp == NULL)
|
||||
{
|
||||
usrerr("501 SIZE requires a value");
|
||||
/* NOTREACHED */
|
||||
}
|
||||
# ifdef __STDC__
|
||||
msize = strtoul(vp, (char **) NULL, 10);
|
||||
# else
|
||||
msize = strtol(vp, (char **) NULL, 10);
|
||||
# endif
|
||||
}
|
||||
else if (strcasecmp(kp, "body") == 0)
|
||||
{
|
||||
if (vp == NULL)
|
||||
{
|
||||
usrerr("501 BODY requires a value");
|
||||
/* NOTREACHED */
|
||||
}
|
||||
# ifdef MIME
|
||||
if (strcasecmp(vp, "8bitmime") == 0)
|
||||
{
|
||||
e->e_bodytype = "8BITMIME";
|
||||
SevenBit = FALSE;
|
||||
}
|
||||
else if (strcasecmp(vp, "7bit") == 0)
|
||||
{
|
||||
e->e_bodytype = "7BIT";
|
||||
SevenBit = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
usrerr("501 Unknown BODY type %s",
|
||||
vp);
|
||||
}
|
||||
# endif
|
||||
}
|
||||
else
|
||||
{
|
||||
usrerr("501 %s parameter unrecognized", kp);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
mail_esmtp_args(kp, vp, e);
|
||||
}
|
||||
|
||||
if (MaxMessageSize > 0 && msize > MaxMessageSize)
|
||||
if (MaxMessageSize > 0 && e->e_msgsize > MaxMessageSize)
|
||||
{
|
||||
usrerr("552 Message size exceeds fixed maximum message size (%ld)",
|
||||
MaxMessageSize);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
if (!enoughspace(msize))
|
||||
|
||||
if (!enoughdiskspace(e->e_msgsize))
|
||||
{
|
||||
message("452 Insufficient disk space; try again later");
|
||||
break;
|
||||
@ -517,11 +531,53 @@ smtp(e)
|
||||
p = skipword(p, "to");
|
||||
if (p == NULL)
|
||||
break;
|
||||
a = parseaddr(p, NULLADDR, RF_COPYALL, ' ', NULL, e);
|
||||
a = parseaddr(p, NULLADDR, RF_COPYALL, ' ', &delimptr, e);
|
||||
if (a == NULL)
|
||||
break;
|
||||
a->q_flags |= QPRIMARY;
|
||||
a = recipient(a, &e->e_sendqueue, e);
|
||||
p = delimptr;
|
||||
|
||||
/* now parse ESMTP arguments */
|
||||
while (p != NULL && *p != '\0')
|
||||
{
|
||||
char *kp;
|
||||
char *vp = NULL;
|
||||
extern void rcpt_esmtp_args __P((ADDRESS *, char *, char *, ENVELOPE *));
|
||||
|
||||
/* locate the beginning of the keyword */
|
||||
while (isascii(*p) && isspace(*p))
|
||||
p++;
|
||||
if (*p == '\0')
|
||||
break;
|
||||
kp = p;
|
||||
|
||||
/* skip to the value portion */
|
||||
while (isascii(*p) && isalnum(*p) || *p == '-')
|
||||
p++;
|
||||
if (*p == '=')
|
||||
{
|
||||
*p++ = '\0';
|
||||
vp = p;
|
||||
|
||||
/* skip to the end of the value */
|
||||
while (*p != '\0' && *p != ' ' &&
|
||||
!(isascii(*p) && iscntrl(*p)) &&
|
||||
*p != '=')
|
||||
p++;
|
||||
}
|
||||
|
||||
if (*p != '\0')
|
||||
*p++ = '\0';
|
||||
|
||||
if (tTd(19, 1))
|
||||
printf("RCPT: got arg %s=\"%s\"\n", kp,
|
||||
vp == NULL ? "<null>" : vp);
|
||||
|
||||
rcpt_esmtp_args(a, kp, vp, e);
|
||||
}
|
||||
|
||||
/* save in recipient list after ESMTP mods */
|
||||
a = recipient(a, &e->e_sendqueue, 0, e);
|
||||
|
||||
if (Errors != 0)
|
||||
break;
|
||||
|
||||
@ -575,10 +631,18 @@ smtp(e)
|
||||
|
||||
/* collect the text of the message */
|
||||
SmtpPhase = "collect";
|
||||
collect(TRUE, doublequeue, e);
|
||||
buffer_errors();
|
||||
collect(InChannel, TRUE, doublequeue, NULL, e);
|
||||
flush_errors(TRUE);
|
||||
if (Errors != 0)
|
||||
goto abortmessage;
|
||||
HoldErrs = TRUE;
|
||||
|
||||
/* make sure we actually do delivery */
|
||||
e->e_flags &= ~EF_CLRQUEUE;
|
||||
|
||||
/* from now on, we have to operate silently */
|
||||
buffer_errors();
|
||||
e->e_errormode = EM_MAIL;
|
||||
|
||||
/*
|
||||
** Arrange to send to everyone.
|
||||
@ -599,42 +663,32 @@ smtp(e)
|
||||
*/
|
||||
|
||||
SmtpPhase = "delivery";
|
||||
if (nrcpts != 1 && !doublequeue)
|
||||
{
|
||||
HoldErrs = TRUE;
|
||||
e->e_errormode = EM_MAIL;
|
||||
}
|
||||
e->e_xfp = freopen(queuename(e, 'x'), "w", e->e_xfp);
|
||||
id = e->e_id;
|
||||
|
||||
/* send to all recipients */
|
||||
sendall(e, doublequeue ? SM_QUEUE : SM_DEFAULT);
|
||||
e->e_to = NULL;
|
||||
|
||||
/* issue success if appropriate and reset */
|
||||
if (Errors == 0 || HoldErrs)
|
||||
message("250 %s Message accepted for delivery", id);
|
||||
|
||||
if (bitset(EF_FATALERRS, e->e_flags) && !HoldErrs)
|
||||
if (doublequeue)
|
||||
{
|
||||
/* avoid sending back an extra message */
|
||||
e->e_flags &= ~EF_FATALERRS;
|
||||
e->e_flags |= EF_CLRQUEUE;
|
||||
/* make sure it is in the queue */
|
||||
queueup(e, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* from now on, we have to operate silently */
|
||||
HoldErrs = TRUE;
|
||||
e->e_errormode = EM_MAIL;
|
||||
/* send to all recipients */
|
||||
sendall(e, SM_DEFAULT);
|
||||
}
|
||||
e->e_to = NULL;
|
||||
|
||||
/* if we just queued, poke it */
|
||||
if (doublequeue && e->e_sendmode != SM_QUEUE)
|
||||
{
|
||||
extern pid_t dowork();
|
||||
/* issue success message */
|
||||
message("250 %s Message accepted for delivery", id);
|
||||
|
||||
unlockqueue(e);
|
||||
(void) dowork(id, TRUE, TRUE, e);
|
||||
}
|
||||
/* if we just queued, poke it */
|
||||
if (doublequeue && e->e_sendmode != SM_QUEUE &&
|
||||
e->e_sendmode != SM_DEFER)
|
||||
{
|
||||
extern pid_t dowork();
|
||||
|
||||
unlockqueue(e);
|
||||
(void) dowork(id, TRUE, TRUE, e);
|
||||
}
|
||||
|
||||
abortmessage:
|
||||
@ -651,6 +705,9 @@ smtp(e)
|
||||
|
||||
case CMDRSET: /* rset -- reset state */
|
||||
message("250 Reset state");
|
||||
|
||||
/* arrange to ignore any current send list */
|
||||
e->e_sendqueue = NULL;
|
||||
e->e_flags |= EF_CLRQUEUE;
|
||||
if (InChild)
|
||||
finis();
|
||||
@ -668,13 +725,14 @@ smtp(e)
|
||||
PrivacyFlags))
|
||||
{
|
||||
if (vrfy)
|
||||
message("252 Who's to say?");
|
||||
message("252 Cannot VRFY user; try RCPT to attempt delivery (or try finger)");
|
||||
else
|
||||
message("502 Sorry, we do not allow this operation");
|
||||
#ifdef LOG
|
||||
if (LogLevel > 5)
|
||||
syslog(LOG_INFO, "%s: %s [rejected]",
|
||||
CurSmtpClient, inp);
|
||||
syslog(LOG_INFO, "%.100s: %s [rejected]",
|
||||
CurSmtpClient,
|
||||
shortenstring(inp, 203));
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@ -689,14 +747,16 @@ smtp(e)
|
||||
break;
|
||||
#ifdef LOG
|
||||
if (LogLevel > 5)
|
||||
syslog(LOG_INFO, "%s: %s", CurSmtpClient, inp);
|
||||
syslog(LOG_INFO, "%.100s: %s",
|
||||
CurSmtpClient,
|
||||
shortenstring(inp, 203));
|
||||
#endif
|
||||
vrfyqueue = NULL;
|
||||
QuickAbort = TRUE;
|
||||
if (vrfy)
|
||||
e->e_flags |= EF_VRFYONLY;
|
||||
while (*p != '\0' && isascii(*p) && isspace(*p))
|
||||
*p++;
|
||||
p++;
|
||||
if (*p == '\0')
|
||||
{
|
||||
message("501 Argument required");
|
||||
@ -704,7 +764,7 @@ smtp(e)
|
||||
}
|
||||
else
|
||||
{
|
||||
(void) sendtolist(p, NULLADDR, &vrfyqueue, e);
|
||||
(void) sendtolist(p, NULLADDR, &vrfyqueue, 0, e);
|
||||
}
|
||||
if (Errors != 0)
|
||||
{
|
||||
@ -718,6 +778,8 @@ smtp(e)
|
||||
}
|
||||
while (vrfyqueue != NULL)
|
||||
{
|
||||
extern void printvrfyaddr __P((ADDRESS *, bool));
|
||||
|
||||
a = vrfyqueue;
|
||||
while ((a = a->q_next) != NULL &&
|
||||
bitset(QDONTSEND|QBADADDR, a->q_flags))
|
||||
@ -742,6 +804,9 @@ smtp(e)
|
||||
message("221 %s closing connection", MyHostName);
|
||||
|
||||
doquit:
|
||||
/* arrange to ignore any current send list */
|
||||
e->e_sendqueue = NULL;
|
||||
|
||||
/* avoid future 050 messages */
|
||||
disconnect(1, e);
|
||||
|
||||
@ -786,8 +851,8 @@ smtp(e)
|
||||
# ifdef LOG
|
||||
if (LogLevel > 0)
|
||||
syslog(LOG_CRIT,
|
||||
"\"%s\" command from %s (%s)",
|
||||
c->cmdname, peerhostname,
|
||||
"\"%s\" command from %.100s (%.100s)",
|
||||
c->cmdname, CurSmtpClient,
|
||||
anynet_ntoa(&RealHostAddr));
|
||||
# endif
|
||||
/* FALL THROUGH */
|
||||
@ -847,7 +912,7 @@ skipword(p, w)
|
||||
{
|
||||
syntax:
|
||||
message("501 Syntax error in parameters scanning \"%s\"",
|
||||
firstp);
|
||||
shortenstring(firstp, 203));
|
||||
Errors++;
|
||||
return (NULL);
|
||||
}
|
||||
@ -865,6 +930,183 @@ skipword(p, w)
|
||||
return (p);
|
||||
}
|
||||
/*
|
||||
** MAIL_ESMTP_ARGS -- process ESMTP arguments from MAIL line
|
||||
**
|
||||
** Parameters:
|
||||
** kp -- the parameter key.
|
||||
** vp -- the value of that parameter.
|
||||
** e -- the envelope.
|
||||
**
|
||||
** Returns:
|
||||
** none.
|
||||
*/
|
||||
|
||||
void
|
||||
mail_esmtp_args(kp, vp, e)
|
||||
char *kp;
|
||||
char *vp;
|
||||
ENVELOPE *e;
|
||||
{
|
||||
if (strcasecmp(kp, "size") == 0)
|
||||
{
|
||||
if (vp == NULL)
|
||||
{
|
||||
usrerr("501 SIZE requires a value");
|
||||
/* NOTREACHED */
|
||||
}
|
||||
# if defined(__STDC__) && !defined(BROKEN_ANSI_LIBRARY)
|
||||
e->e_msgsize = strtoul(vp, (char **) NULL, 10);
|
||||
# else
|
||||
e->e_msgsize = strtol(vp, (char **) NULL, 10);
|
||||
# endif
|
||||
}
|
||||
else if (strcasecmp(kp, "body") == 0)
|
||||
{
|
||||
if (vp == NULL)
|
||||
{
|
||||
usrerr("501 BODY requires a value");
|
||||
/* NOTREACHED */
|
||||
}
|
||||
else if (strcasecmp(vp, "8bitmime") == 0)
|
||||
{
|
||||
SevenBitInput = FALSE;
|
||||
}
|
||||
else if (strcasecmp(vp, "7bit") == 0)
|
||||
{
|
||||
SevenBitInput = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
usrerr("501 Unknown BODY type %s",
|
||||
vp);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
e->e_bodytype = newstr(vp);
|
||||
}
|
||||
else if (strcasecmp(kp, "envid") == 0)
|
||||
{
|
||||
if (vp == NULL)
|
||||
{
|
||||
usrerr("501 ENVID requires a value");
|
||||
/* NOTREACHED */
|
||||
}
|
||||
if (!xtextok(vp))
|
||||
{
|
||||
usrerr("501 Syntax error in ENVID parameter value");
|
||||
/* NOTREACHED */
|
||||
}
|
||||
if (e->e_envid != NULL)
|
||||
{
|
||||
usrerr("501 Duplicate ENVID parameter");
|
||||
/* NOTREACHED */
|
||||
}
|
||||
e->e_envid = newstr(vp);
|
||||
}
|
||||
else if (strcasecmp(kp, "ret") == 0)
|
||||
{
|
||||
if (vp == NULL)
|
||||
{
|
||||
usrerr("501 RET requires a value");
|
||||
/* NOTREACHED */
|
||||
}
|
||||
if (bitset(EF_RET_PARAM, e->e_flags))
|
||||
{
|
||||
usrerr("501 Duplicate RET parameter");
|
||||
/* NOTREACHED */
|
||||
}
|
||||
e->e_flags |= EF_RET_PARAM;
|
||||
if (strcasecmp(vp, "hdrs") == 0)
|
||||
e->e_flags |= EF_NO_BODY_RETN;
|
||||
else if (strcasecmp(vp, "full") != 0)
|
||||
{
|
||||
usrerr("501 Bad argument \"%s\" to RET", vp);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
usrerr("501 %s parameter unrecognized", kp);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
}
|
||||
/*
|
||||
** RCPT_ESMTP_ARGS -- process ESMTP arguments from RCPT line
|
||||
**
|
||||
** Parameters:
|
||||
** a -- the address corresponding to the To: parameter.
|
||||
** kp -- the parameter key.
|
||||
** vp -- the value of that parameter.
|
||||
** e -- the envelope.
|
||||
**
|
||||
** Returns:
|
||||
** none.
|
||||
*/
|
||||
|
||||
void
|
||||
rcpt_esmtp_args(a, kp, vp, e)
|
||||
ADDRESS *a;
|
||||
char *kp;
|
||||
char *vp;
|
||||
ENVELOPE *e;
|
||||
{
|
||||
if (strcasecmp(kp, "notify") == 0)
|
||||
{
|
||||
char *p;
|
||||
|
||||
if (vp == NULL)
|
||||
{
|
||||
usrerr("501 NOTIFY requires a value");
|
||||
/* NOTREACHED */
|
||||
}
|
||||
a->q_flags &= ~(QPINGONSUCCESS|QPINGONFAILURE|QPINGONDELAY);
|
||||
a->q_flags |= QHASNOTIFY;
|
||||
if (strcasecmp(vp, "never") == 0)
|
||||
return;
|
||||
for (p = vp; p != NULL; vp = p)
|
||||
{
|
||||
p = strchr(p, ',');
|
||||
if (p != NULL)
|
||||
*p++ = '\0';
|
||||
if (strcasecmp(vp, "success") == 0)
|
||||
a->q_flags |= QPINGONSUCCESS;
|
||||
else if (strcasecmp(vp, "failure") == 0)
|
||||
a->q_flags |= QPINGONFAILURE;
|
||||
else if (strcasecmp(vp, "delay") == 0)
|
||||
a->q_flags |= QPINGONDELAY;
|
||||
else
|
||||
{
|
||||
usrerr("501 Bad argument \"%s\" to NOTIFY",
|
||||
vp);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (strcasecmp(kp, "orcpt") == 0)
|
||||
{
|
||||
if (vp == NULL)
|
||||
{
|
||||
usrerr("501 ORCPT requires a value");
|
||||
/* NOTREACHED */
|
||||
}
|
||||
if (strchr(vp, ';') == NULL || !xtextok(vp))
|
||||
{
|
||||
usrerr("501 Syntax error in ORCPT parameter value");
|
||||
/* NOTREACHED */
|
||||
}
|
||||
if (a->q_orcpt != NULL)
|
||||
{
|
||||
usrerr("501 Duplicate ORCPT parameter");
|
||||
/* NOTREACHED */
|
||||
}
|
||||
a->q_orcpt = newstr(vp);
|
||||
}
|
||||
else
|
||||
{
|
||||
usrerr("501 %s parameter unrecognized", kp);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
}
|
||||
/*
|
||||
** PRINTVRFYADDR -- print an entry in the verify queue
|
||||
**
|
||||
** Parameters:
|
||||
@ -878,6 +1120,7 @@ skipword(p, w)
|
||||
** Prints the appropriate 250 codes.
|
||||
*/
|
||||
|
||||
void
|
||||
printvrfyaddr(a, last)
|
||||
register ADDRESS *a;
|
||||
bool last;
|
||||
@ -905,66 +1148,6 @@ printvrfyaddr(a, last)
|
||||
}
|
||||
}
|
||||
/*
|
||||
** HELP -- implement the HELP command.
|
||||
**
|
||||
** Parameters:
|
||||
** topic -- the topic we want help for.
|
||||
**
|
||||
** Returns:
|
||||
** none.
|
||||
**
|
||||
** Side Effects:
|
||||
** outputs the help file to message output.
|
||||
*/
|
||||
|
||||
help(topic)
|
||||
char *topic;
|
||||
{
|
||||
register FILE *hf;
|
||||
int len;
|
||||
char buf[MAXLINE];
|
||||
bool noinfo;
|
||||
|
||||
if (HelpFile == NULL || (hf = fopen(HelpFile, "r")) == NULL)
|
||||
{
|
||||
/* no help */
|
||||
errno = 0;
|
||||
message("502 HELP not implemented");
|
||||
return;
|
||||
}
|
||||
|
||||
if (topic == NULL || *topic == '\0')
|
||||
topic = "smtp";
|
||||
else
|
||||
makelower(topic);
|
||||
|
||||
len = strlen(topic);
|
||||
noinfo = TRUE;
|
||||
|
||||
while (fgets(buf, sizeof buf, hf) != NULL)
|
||||
{
|
||||
if (strncmp(buf, topic, len) == 0)
|
||||
{
|
||||
register char *p;
|
||||
|
||||
p = strchr(buf, '\t');
|
||||
if (p == NULL)
|
||||
p = buf;
|
||||
else
|
||||
p++;
|
||||
fixcrlf(p, TRUE);
|
||||
message("214-%s", p);
|
||||
noinfo = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (noinfo)
|
||||
message("504 HELP topic unknown");
|
||||
else
|
||||
message("214 End of HELP info");
|
||||
(void) fclose(hf);
|
||||
}
|
||||
/*
|
||||
** RUNINCHILD -- return twice -- once in the child, then in the parent again
|
||||
**
|
||||
** Parameters:
|
||||
@ -978,6 +1161,7 @@ help(topic)
|
||||
** none.
|
||||
*/
|
||||
|
||||
int
|
||||
runinchild(label, e)
|
||||
char *label;
|
||||
register ENVELOPE *e;
|
||||
@ -989,7 +1173,7 @@ runinchild(label, e)
|
||||
childpid = dofork();
|
||||
if (childpid < 0)
|
||||
{
|
||||
syserr("%s: cannot fork", label);
|
||||
syserr("451 %s: cannot fork", label);
|
||||
return (1);
|
||||
}
|
||||
if (childpid > 0)
|
||||
@ -997,12 +1181,12 @@ runinchild(label, e)
|
||||
auto int st;
|
||||
|
||||
/* parent -- wait for child to complete */
|
||||
setproctitle("server %s child wait", CurHostName);
|
||||
setproctitle("server %s child wait", CurSmtpClient);
|
||||
st = waitfor(childpid);
|
||||
if (st == -1)
|
||||
syserr("%s: lost child", label);
|
||||
syserr("451 %s: lost child", label);
|
||||
else if (!WIFEXITED(st))
|
||||
syserr("%s: died on signal %d",
|
||||
syserr("451 %s: died on signal %d",
|
||||
label, st & 0177);
|
||||
|
||||
/* if we exited on a QUIT command, complete the process */
|
||||
@ -1030,3 +1214,72 @@ runinchild(label, e)
|
||||
}
|
||||
|
||||
# endif /* SMTP */
|
||||
/*
|
||||
** HELP -- implement the HELP command.
|
||||
**
|
||||
** Parameters:
|
||||
** topic -- the topic we want help for.
|
||||
**
|
||||
** Returns:
|
||||
** none.
|
||||
**
|
||||
** Side Effects:
|
||||
** outputs the help file to message output.
|
||||
*/
|
||||
|
||||
void
|
||||
help(topic)
|
||||
char *topic;
|
||||
{
|
||||
register FILE *hf;
|
||||
int len;
|
||||
bool noinfo;
|
||||
char buf[MAXLINE];
|
||||
extern char Version[];
|
||||
|
||||
|
||||
if (HelpFile == NULL || (hf = fopen(HelpFile, "r")) == NULL)
|
||||
{
|
||||
/* no help */
|
||||
errno = 0;
|
||||
message("502 Sendmail %s -- HELP not implemented", Version);
|
||||
return;
|
||||
}
|
||||
|
||||
if (topic == NULL || *topic == '\0')
|
||||
{
|
||||
topic = "smtp";
|
||||
message("214-This is Sendmail version %s", Version);
|
||||
noinfo = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
makelower(topic);
|
||||
noinfo = TRUE;
|
||||
}
|
||||
|
||||
len = strlen(topic);
|
||||
|
||||
while (fgets(buf, sizeof buf, hf) != NULL)
|
||||
{
|
||||
if (strncmp(buf, topic, len) == 0)
|
||||
{
|
||||
register char *p;
|
||||
|
||||
p = strchr(buf, '\t');
|
||||
if (p == NULL)
|
||||
p = buf;
|
||||
else
|
||||
p++;
|
||||
fixcrlf(p, TRUE);
|
||||
message("214-%s", p);
|
||||
noinfo = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (noinfo)
|
||||
message("504 HELP topic \"%.10s\" unknown", topic);
|
||||
else
|
||||
message("214 End of HELP info");
|
||||
(void) fclose(hf);
|
||||
}
|
||||
|
@ -1,118 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1987, 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.
|
||||
*
|
||||
* @(#)sysexits.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _SYSEXITS_H_
|
||||
#define _SYSEXITS_H_
|
||||
|
||||
/*
|
||||
* SYSEXITS.H -- Exit status codes for system programs.
|
||||
*
|
||||
* This include file attempts to categorize possible error
|
||||
* exit statuses for system programs, notably delivermail
|
||||
* and the Berkeley network.
|
||||
*
|
||||
* Error numbers begin at EX__BASE to reduce the possibility of
|
||||
* clashing with other exit statuses that random programs may
|
||||
* already return. The meaning of the codes is approximately
|
||||
* as follows:
|
||||
*
|
||||
* EX_USAGE -- The command was used incorrectly, e.g., with
|
||||
* the wrong number of arguments, a bad flag, a bad
|
||||
* syntax in a parameter, or whatever.
|
||||
* EX_DATAERR -- The input data was incorrect in some way.
|
||||
* This should only be used for user's data & not
|
||||
* system files.
|
||||
* EX_NOINPUT -- An input file (not a system file) did not
|
||||
* exist or was not readable. This could also include
|
||||
* errors like "No message" to a mailer (if it cared
|
||||
* to catch it).
|
||||
* EX_NOUSER -- The user specified did not exist. This might
|
||||
* be used for mail addresses or remote logins.
|
||||
* EX_NOHOST -- The host specified did not exist. This is used
|
||||
* in mail addresses or network requests.
|
||||
* EX_UNAVAILABLE -- A service is unavailable. This can occur
|
||||
* if a support program or file does not exist. This
|
||||
* can also be used as a catchall message when something
|
||||
* you wanted to do doesn't work, but you don't know
|
||||
* why.
|
||||
* EX_SOFTWARE -- An internal software error has been detected.
|
||||
* This should be limited to non-operating system related
|
||||
* errors as possible.
|
||||
* EX_OSERR -- An operating system error has been detected.
|
||||
* This is intended to be used for such things as "cannot
|
||||
* fork", "cannot create pipe", or the like. It includes
|
||||
* things like getuid returning a user that does not
|
||||
* exist in the passwd file.
|
||||
* EX_OSFILE -- Some system file (e.g., /etc/passwd, /etc/utmp,
|
||||
* etc.) does not exist, cannot be opened, or has some
|
||||
* sort of error (e.g., syntax error).
|
||||
* EX_CANTCREAT -- A (user specified) output file cannot be
|
||||
* created.
|
||||
* EX_IOERR -- An error occurred while doing I/O on some file.
|
||||
* EX_TEMPFAIL -- temporary failure, indicating something that
|
||||
* is not really an error. In sendmail, this means
|
||||
* that a mailer (e.g.) could not create a connection,
|
||||
* and the request should be reattempted later.
|
||||
* EX_PROTOCOL -- the remote system returned something that
|
||||
* was "not possible" during a protocol exchange.
|
||||
* EX_NOPERM -- You did not have sufficient permission to
|
||||
* perform the operation. This is not intended for
|
||||
* file system problems, which should use NOINPUT or
|
||||
* CANTCREAT, but rather for higher level permissions.
|
||||
*/
|
||||
|
||||
#define EX_OK 0 /* successful termination */
|
||||
|
||||
#define EX__BASE 64 /* base value for error messages */
|
||||
|
||||
#define EX_USAGE 64 /* command line usage error */
|
||||
#define EX_DATAERR 65 /* data format error */
|
||||
#define EX_NOINPUT 66 /* cannot open input */
|
||||
#define EX_NOUSER 67 /* addressee unknown */
|
||||
#define EX_NOHOST 68 /* host name unknown */
|
||||
#define EX_UNAVAILABLE 69 /* service unavailable */
|
||||
#define EX_SOFTWARE 70 /* internal software error */
|
||||
#define EX_OSERR 71 /* system error (e.g., can't fork) */
|
||||
#define EX_OSFILE 72 /* critical OS file missing */
|
||||
#define EX_CANTCREAT 73 /* can't create (user) output file */
|
||||
#define EX_IOERR 74 /* input/output error */
|
||||
#define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */
|
||||
#define EX_PROTOCOL 76 /* remote error in protocol */
|
||||
#define EX_NOPERM 77 /* permission denied */
|
||||
#define EX_CONFIG 78 /* configuration error */
|
||||
|
||||
#define EX__MAX 78 /* maximum listed value */
|
||||
|
||||
#endif /* !_SYSEXITS_H_ */
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1983 Eric P. Allman
|
||||
* Copyright (c) 1983, 1995 Eric P. Allman
|
||||
* Copyright (c) 1988, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
@ -35,21 +35,30 @@
|
||||
#include "sendmail.h"
|
||||
|
||||
#ifndef lint
|
||||
#ifdef USERDB
|
||||
static char sccsid [] = "@(#)udb.c 8.8 (Berkeley) 4/14/94 (with USERDB)";
|
||||
#if USERDB
|
||||
static char sccsid [] = "@(#)udb.c 8.32 (Berkeley) 11/18/95 (with USERDB)";
|
||||
#else
|
||||
static char sccsid [] = "@(#)udb.c 8.8 (Berkeley) 4/14/94 (without USERDB)";
|
||||
static char sccsid [] = "@(#)udb.c 8.32 (Berkeley) 11/18/95 (without USERDB)";
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef USERDB
|
||||
#if USERDB
|
||||
|
||||
#include <errno.h>
|
||||
#include <netdb.h>
|
||||
#include <db.h>
|
||||
|
||||
#ifdef NEWDB
|
||||
# include <db.h>
|
||||
#else
|
||||
# define DBT struct _data_base_thang_
|
||||
DBT
|
||||
{
|
||||
void *data; /* pointer to data */
|
||||
size_t size; /* length of data */
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef HESIOD
|
||||
#include <hesiod.h>
|
||||
# include <hesiod.h>
|
||||
#endif /* HESIOD */
|
||||
|
||||
/*
|
||||
@ -82,6 +91,7 @@ struct udbent
|
||||
} udb_forward;
|
||||
#define udb_fwdhost udb_u.udb_forward._udb_fwdhost
|
||||
|
||||
#ifdef NEWDB
|
||||
/* type UE_FETCH -- lookup in local database */
|
||||
struct
|
||||
{
|
||||
@ -90,6 +100,7 @@ struct udbent
|
||||
} udb_lookup;
|
||||
#define udb_dbname udb_u.udb_lookup._udb_dbname
|
||||
#define udb_dbp udb_u.udb_lookup._udb_dbp
|
||||
#endif
|
||||
} udb_u;
|
||||
};
|
||||
|
||||
@ -114,6 +125,8 @@ struct option
|
||||
** Parameters:
|
||||
** a -- address to expand.
|
||||
** sendq -- pointer to head of sendq to put the expansions in.
|
||||
** aliaslevel -- the current alias nesting depth.
|
||||
** e -- the current envelope.
|
||||
**
|
||||
** Returns:
|
||||
** EX_TEMPFAIL -- if something "odd" happened -- probably due
|
||||
@ -132,13 +145,13 @@ int UdbSock = -1;
|
||||
bool UdbInitialized = FALSE;
|
||||
|
||||
int
|
||||
udbexpand(a, sendq, e)
|
||||
udbexpand(a, sendq, aliaslevel, e)
|
||||
register ADDRESS *a;
|
||||
ADDRESS **sendq;
|
||||
int aliaslevel;
|
||||
register ENVELOPE *e;
|
||||
{
|
||||
int i;
|
||||
register char *p;
|
||||
DBT key;
|
||||
DBT info;
|
||||
bool breakout;
|
||||
@ -201,6 +214,7 @@ udbexpand(a, sendq, e)
|
||||
|
||||
switch (up->udb_type)
|
||||
{
|
||||
#ifdef NEWDB
|
||||
case UDB_DBFETCH:
|
||||
key.data = keybuf;
|
||||
key.size = keylen;
|
||||
@ -227,7 +241,6 @@ udbexpand(a, sendq, e)
|
||||
if (bitset(EF_VRFYONLY, e->e_flags))
|
||||
{
|
||||
a->q_flags |= QVERIFIED;
|
||||
e->e_nrcpts++;
|
||||
return EX_OK;
|
||||
}
|
||||
|
||||
@ -242,12 +255,11 @@ udbexpand(a, sendq, e)
|
||||
message("expanded to %s", user);
|
||||
#ifdef LOG
|
||||
if (LogLevel >= 10)
|
||||
syslog(LOG_INFO, "%s: expand %s => %s",
|
||||
e->e_id, e->e_to, user);
|
||||
syslog(LOG_INFO, "%s: expand %.100s => %s",
|
||||
e->e_id, e->e_to,
|
||||
shortenstring(user, 203));
|
||||
#endif
|
||||
AliasLevel++;
|
||||
naddrs += sendtolist(user, a, sendq, e);
|
||||
AliasLevel--;
|
||||
naddrs += sendtolist(user, a, sendq, aliaslevel + 1, e);
|
||||
|
||||
if (user != buf)
|
||||
free(user);
|
||||
@ -299,9 +311,11 @@ udbexpand(a, sendq, e)
|
||||
fprintf(e->e_xfp,
|
||||
"Message delivered to mailing list %s\n",
|
||||
a->q_paddr);
|
||||
e->e_flags |= EF_SENDRECEIPT;
|
||||
}
|
||||
e->e_flags |= EF_SENDRECEIPT;
|
||||
a->q_flags |= QDELIVERED|QEXPANDED;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef HESIOD
|
||||
case UDB_HESIOD:
|
||||
@ -312,12 +326,45 @@ udbexpand(a, sendq, e)
|
||||
keybuf, keylen);
|
||||
/* look up the key via hesiod */
|
||||
i = hes_udb_get(&key, &info);
|
||||
if (i > 0 || info.size <= 0)
|
||||
if (i < 0)
|
||||
{
|
||||
syserr("udbexpand: hesiod-get %.*s stat %d",
|
||||
key.size, key.data, i);
|
||||
return EX_TEMPFAIL;
|
||||
}
|
||||
else if (i > 0 || info.size <= 0)
|
||||
{
|
||||
#if HES_GETMAILHOST
|
||||
struct hes_postoffice *hp;
|
||||
#endif
|
||||
|
||||
if (tTd(28, 2))
|
||||
printf("udbexpand: no match on %s (%d)\n",
|
||||
keybuf, keylen);
|
||||
printf("udbexpand: no match on %s (%d)\n",
|
||||
keybuf, keylen);
|
||||
#if HES_GETMAILHOST
|
||||
if (tTd(28, 8))
|
||||
printf(" ... trying hes_getmailhost(%s)\n",
|
||||
a->q_user);
|
||||
hp = hes_getmailhost(a->q_user);
|
||||
if (hp == NULL)
|
||||
{
|
||||
if (hes_error() == HES_ER_NET)
|
||||
{
|
||||
syserr("udbexpand: hesiod-getmail %s stat %d",
|
||||
a->q_user, hes_error());
|
||||
return EX_TEMPFAIL;
|
||||
}
|
||||
if (tTd(28, 2))
|
||||
printf("hes_getmailhost(%s): %d\n",
|
||||
a->q_user, hes_error();
|
||||
continue;
|
||||
}
|
||||
sprintf(info.data, "%s@%s",
|
||||
hp->po_name, hp->po_host);
|
||||
info.size = strlen(info.data);
|
||||
#else
|
||||
continue;
|
||||
#endif
|
||||
}
|
||||
if (tTd(28, 80))
|
||||
printf("udbexpand: match %.*s: %.*s\n",
|
||||
@ -327,8 +374,6 @@ udbexpand(a, sendq, e)
|
||||
if (bitset(EF_VRFYONLY, e->e_flags))
|
||||
{
|
||||
a->q_flags |= QVERIFIED;
|
||||
e->e_nrcpts++;
|
||||
free(info.data);
|
||||
return EX_OK;
|
||||
}
|
||||
|
||||
@ -339,17 +384,15 @@ udbexpand(a, sendq, e)
|
||||
user = xalloc(info.size + 1);
|
||||
bcopy(info.data, user, info.size);
|
||||
user[info.size] = '\0';
|
||||
free(info.data);
|
||||
|
||||
message("hesioded to %s", user);
|
||||
#ifdef LOG
|
||||
if (LogLevel >= 10)
|
||||
syslog(LOG_INFO, "%s: hesiod %s => %s",
|
||||
e->e_id, e->e_to, user);
|
||||
syslog(LOG_INFO, "%s: hesiod %.100s => %s",
|
||||
e->e_id, e->e_to,
|
||||
shortenstring(user, 203));
|
||||
#endif
|
||||
AliasLevel++;
|
||||
naddrs = sendtolist(user, a, sendq, e);
|
||||
AliasLevel--;
|
||||
naddrs = sendtolist(user, a, sendq, aliaslevel + 1, e);
|
||||
|
||||
if (user != buf)
|
||||
free(user);
|
||||
@ -363,12 +406,6 @@ udbexpand(a, sendq, e)
|
||||
}
|
||||
a->q_flags |= QDONTSEND;
|
||||
}
|
||||
if (i < 0)
|
||||
{
|
||||
syserr("udbexpand: hesiod-get %.*s stat %d",
|
||||
key.size, key.data, i);
|
||||
return EX_TEMPFAIL;
|
||||
}
|
||||
|
||||
/*
|
||||
** If this address has a -request address, reflect
|
||||
@ -386,7 +423,6 @@ udbexpand(a, sendq, e)
|
||||
a->q_owner = xalloc(info.size + 1);
|
||||
bcopy(info.data, a->q_owner, info.size);
|
||||
a->q_owner[info.size] = '\0';
|
||||
free(info.data);
|
||||
break;
|
||||
#endif /* HESIOD */
|
||||
|
||||
@ -405,9 +441,7 @@ udbexpand(a, sendq, e)
|
||||
(void) sprintf(user, "%s@%s", a->q_user, up->udb_fwdhost);
|
||||
message("expanded to %s", user);
|
||||
a->q_flags &= ~QSELFREF;
|
||||
AliasLevel++;
|
||||
naddrs = sendtolist(user, a, sendq, e);
|
||||
AliasLevel--;
|
||||
naddrs = sendtolist(user, a, sendq, aliaslevel + 1, e);
|
||||
if (naddrs > 0 && !bitset(QSELFREF, a->q_flags))
|
||||
{
|
||||
if (tTd(28, 5))
|
||||
@ -509,6 +543,7 @@ udbmatch(user, field)
|
||||
|
||||
switch (up->udb_type)
|
||||
{
|
||||
#ifdef NEWDB
|
||||
case UDB_DBFETCH:
|
||||
key.data = keybuf;
|
||||
key.size = keylen;
|
||||
@ -528,6 +563,7 @@ udbmatch(user, field)
|
||||
printf("udbmatch ==> %s\n", p);
|
||||
return p;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef HESIOD
|
||||
case UDB_HESIOD:
|
||||
@ -545,11 +581,9 @@ udbmatch(user, field)
|
||||
p = xalloc(info.size + 1);
|
||||
bcopy(info.data, p, info.size);
|
||||
p[info.size] = '\0';
|
||||
free(info.data);
|
||||
if (tTd(28, 1))
|
||||
printf("udbmatch ==> %s\n", p);
|
||||
return p;
|
||||
break;
|
||||
#endif /* HESIOD */
|
||||
}
|
||||
}
|
||||
@ -572,6 +606,7 @@ udbmatch(user, field)
|
||||
{
|
||||
switch (up->udb_type)
|
||||
{
|
||||
#ifdef NEWDB
|
||||
case UDB_DBFETCH:
|
||||
/* get the default case for this database */
|
||||
if (up->udb_default == NULL)
|
||||
@ -613,6 +648,7 @@ udbmatch(user, field)
|
||||
printf("udbmatch ==> %s\n", p);
|
||||
return p;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef HESIOD
|
||||
case UDB_HESIOD:
|
||||
@ -634,7 +670,6 @@ udbmatch(user, field)
|
||||
up->udb_default = xalloc(info.size + 1);
|
||||
bcopy(info.data, up->udb_default, info.size);
|
||||
up->udb_default[info.size] = '\0';
|
||||
free(info.data);
|
||||
}
|
||||
else if (up->udb_default[0] == '\0')
|
||||
continue;
|
||||
@ -649,7 +684,6 @@ udbmatch(user, field)
|
||||
continue;
|
||||
}
|
||||
|
||||
free(info.data);
|
||||
/* they exist -- build the actual address */
|
||||
p = xalloc(strlen(user) + strlen(up->udb_default) + 2);
|
||||
(void) strcpy(p, user);
|
||||
@ -667,6 +701,57 @@ udbmatch(user, field)
|
||||
return NULL;
|
||||
}
|
||||
/*
|
||||
** UDB_MAP_LOOKUP -- look up arbitrary entry in user database map
|
||||
**
|
||||
** Parameters:
|
||||
** map -- the map being queried.
|
||||
** name -- the name to look up.
|
||||
** av -- arguments to the map lookup.
|
||||
** statp -- to get any error status.
|
||||
**
|
||||
** Returns:
|
||||
** NULL if name not found in map.
|
||||
** The rewritten name otherwise.
|
||||
*/
|
||||
|
||||
char *
|
||||
udb_map_lookup(map, name, av, statp)
|
||||
MAP *map;
|
||||
char *name;
|
||||
char **av;
|
||||
int *statp;
|
||||
{
|
||||
char *val;
|
||||
char *key;
|
||||
char keybuf[MAXNAME + 1];
|
||||
|
||||
if (tTd(28, 20) || tTd(38, 20))
|
||||
printf("udb_map_lookup(%s, %s)\n", map->map_mname, name);
|
||||
|
||||
if (bitset(MF_NOFOLDCASE, map->map_mflags))
|
||||
{
|
||||
key = name;
|
||||
}
|
||||
else
|
||||
{
|
||||
int keysize = strlen(name);
|
||||
|
||||
if (keysize > sizeof keybuf - 1)
|
||||
keysize = sizeof keybuf - 1;
|
||||
bcopy(name, keybuf, keysize);
|
||||
keybuf[keysize] = '\0';
|
||||
makelower(keybuf);
|
||||
key = keybuf;
|
||||
}
|
||||
val = udbmatch(key, map->map_file);
|
||||
if (val == NULL)
|
||||
return NULL;
|
||||
if (bitset(MF_MATCHONLY, map->map_mflags))
|
||||
return map_rewrite(map, name, strlen(name), NULL);
|
||||
else
|
||||
return map_rewrite(map, val, strlen(val), av);
|
||||
}
|
||||
/*
|
||||
** _UDBX_INIT -- parse the UDB specification, opening any valid entries.
|
||||
**
|
||||
** Parameters:
|
||||
@ -688,9 +773,7 @@ int
|
||||
_udbx_init()
|
||||
{
|
||||
register char *p;
|
||||
int i;
|
||||
register struct udbent *up;
|
||||
char buf[BUFSIZ];
|
||||
|
||||
if (UdbInitialized)
|
||||
return EX_OK;
|
||||
@ -705,11 +788,14 @@ _udbx_init()
|
||||
while (p != NULL)
|
||||
{
|
||||
char *spec;
|
||||
auto int rcode;
|
||||
int nopts;
|
||||
# if 0
|
||||
auto int rcode;
|
||||
int nmx;
|
||||
int i;
|
||||
register struct hostent *h;
|
||||
char *mxhosts[MAXMXHOSTS + 1];
|
||||
# endif
|
||||
struct option opts[MAXUDBOPTS + 1];
|
||||
|
||||
while (*p == ' ' || *p == '\t' || *p == ',')
|
||||
@ -743,10 +829,13 @@ _udbx_init()
|
||||
** since it always matches the input.
|
||||
** /dbname -- search the named database on the local
|
||||
** host using the Berkeley db package.
|
||||
** Hesiod -- search the named database with BIND
|
||||
** using the MIT Hesiod package.
|
||||
*/
|
||||
|
||||
switch (*spec)
|
||||
{
|
||||
#if 0
|
||||
case '+': /* search remote database */
|
||||
case '*': /* search remote database (expand MX) */
|
||||
if (*spec == '*')
|
||||
@ -776,14 +865,14 @@ _udbx_init()
|
||||
|
||||
for (i = 0; i < nmx; i++)
|
||||
{
|
||||
h = gethostbyname(mxhosts[i]);
|
||||
h = sm_gethostbyname(mxhosts[i]);
|
||||
if (h == NULL)
|
||||
continue;
|
||||
up->udb_type = UDB_REMOTE;
|
||||
up->udb_addr.sin_family = h->h_addrtype;
|
||||
bcopy(h->h_addr_list[0],
|
||||
(char *) &up->udb_addr.sin_addr,
|
||||
sizeof up->udb_addr.sin_addr);
|
||||
INADDRSZ);
|
||||
up->udb_addr.sin_port = UdbPort;
|
||||
up->udb_timeout = UdbTimeout;
|
||||
up++;
|
||||
@ -796,6 +885,7 @@ _udbx_init()
|
||||
(void) fcntl(UdbSock, F_SETFD, 1);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
case '@': /* forward to remote host */
|
||||
up->udb_type = UDB_FORWARD;
|
||||
@ -803,22 +893,31 @@ _udbx_init()
|
||||
up++;
|
||||
break;
|
||||
|
||||
#ifdef HESIOD
|
||||
case 'h': /* use hesiod */
|
||||
case 'H':
|
||||
#ifdef HESIOD
|
||||
if (strcasecmp(spec, "hesiod") != 0)
|
||||
break;
|
||||
goto badspec;
|
||||
up->udb_type = UDB_HESIOD;
|
||||
up++;
|
||||
#endif /* HESIOD */
|
||||
break;
|
||||
#endif /* HESIOD */
|
||||
|
||||
#ifdef NEWDB
|
||||
case '/': /* look up remote name */
|
||||
up->udb_dbname = spec;
|
||||
errno = 0;
|
||||
up->udb_dbp = dbopen(spec, O_RDONLY, 0644, DB_BTREE, NULL);
|
||||
if (up->udb_dbp == NULL)
|
||||
{
|
||||
if (tTd(28, 1))
|
||||
{
|
||||
int saveerrno = errno;
|
||||
|
||||
printf("dbopen(%s): %s",
|
||||
spec, errstring(errno));
|
||||
errno = saveerrno;
|
||||
}
|
||||
if (errno != ENOENT && errno != EACCES)
|
||||
{
|
||||
#ifdef LOG
|
||||
@ -834,6 +933,12 @@ _udbx_init()
|
||||
up->udb_type = UDB_DBFETCH;
|
||||
up++;
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
badspec:
|
||||
syserr("Unknown UDB spec %s", spec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
up->udb_type = UDB_EOLIST;
|
||||
@ -844,15 +949,21 @@ _udbx_init()
|
||||
{
|
||||
switch (up->udb_type)
|
||||
{
|
||||
#ifdef DAEMON
|
||||
case UDB_REMOTE:
|
||||
printf("REMOTE: addr %s, timeo %d\n",
|
||||
anynet_ntoa((SOCKADDR *) &up->udb_addr),
|
||||
up->udb_timeout);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case UDB_DBFETCH:
|
||||
#ifdef NEWDB
|
||||
printf("FETCH: file %s\n",
|
||||
up->udb_dbname);
|
||||
#else
|
||||
printf("FETCH\n");
|
||||
#endif
|
||||
break;
|
||||
|
||||
case UDB_FORWARD:
|
||||
@ -880,6 +991,7 @@ _udbx_init()
|
||||
*/
|
||||
|
||||
tempfail:
|
||||
#ifdef NEWDB
|
||||
for (up = UdbEnts; up->udb_type != UDB_EOLIST; up++)
|
||||
{
|
||||
if (up->udb_type == UDB_DBFETCH)
|
||||
@ -887,6 +999,7 @@ _udbx_init()
|
||||
(*up->udb_dbp->close)(up->udb_dbp);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return EX_TEMPFAIL;
|
||||
}
|
||||
|
||||
@ -929,20 +1042,24 @@ hes_udb_get(key, info)
|
||||
{
|
||||
char *name, *type;
|
||||
char *p, **hp;
|
||||
char kbuf[MAXKEY + 1];
|
||||
|
||||
name = key->data;
|
||||
type = strchr(name, ':');
|
||||
strcpy(kbuf, key->data);
|
||||
name = kbuf;
|
||||
type = strrchr(name, ':');
|
||||
if (type == NULL)
|
||||
return 1;
|
||||
|
||||
*type++ = '\0';
|
||||
if (strchr(name, '@') != NULL)
|
||||
return 1;
|
||||
|
||||
if (tTd(28, 1))
|
||||
printf("hes_udb_get(%s, %s)\n", name, type);
|
||||
|
||||
/* make the hesiod query */
|
||||
hp = hes_resolve(name, type);
|
||||
if (hp == NULL)
|
||||
*--type = ':';
|
||||
if (hp == NULL || hp[0] == NULL)
|
||||
{
|
||||
/* network problem or timeout */
|
||||
if (hes_error() == HES_ER_NET)
|
||||
@ -954,19 +1071,19 @@ hes_udb_get(key, info)
|
||||
{
|
||||
/*
|
||||
** If there are multiple matches, just return the
|
||||
** first one and free the others.
|
||||
** first one.
|
||||
**
|
||||
** XXX These should really be returned; for example,
|
||||
** XXX it is legal for :maildrop to be multi-valued.
|
||||
*/
|
||||
|
||||
for (p = hp[1]; p; p++)
|
||||
free(p);
|
||||
|
||||
info->data = hp[0];
|
||||
info->size = (size_t) strlen(info->data);
|
||||
}
|
||||
|
||||
if (tTd(28, 80))
|
||||
printf("hes_udb_get => %s\n", *hp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* HESIOD */
|
||||
@ -974,9 +1091,10 @@ hes_udb_get(key, info)
|
||||
#else /* not USERDB */
|
||||
|
||||
int
|
||||
udbexpand(a, sendq, e)
|
||||
udbexpand(a, sendq, aliaslevel, e)
|
||||
ADDRESS *a;
|
||||
ADDRESS **sendq;
|
||||
int aliaslevel;
|
||||
ENVELOPE *e;
|
||||
{
|
||||
return EX_OK;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1983 Eric P. Allman
|
||||
* Copyright (c) 1983, 1995 Eric P. Allman
|
||||
* Copyright (c) 1988, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
@ -36,9 +36,9 @@
|
||||
|
||||
#ifndef lint
|
||||
#ifdef SMTP
|
||||
static char sccsid[] = "@(#)usersmtp.c 8.18 (Berkeley) 1/24/94 (with SMTP)";
|
||||
static char sccsid[] = "@(#)usersmtp.c 8.65 (Berkeley) 9/28/95 (with SMTP)";
|
||||
#else
|
||||
static char sccsid[] = "@(#)usersmtp.c 8.18 (Berkeley) 1/24/94 (without SMTP)";
|
||||
static char sccsid[] = "@(#)usersmtp.c 8.65 (Berkeley) 9/28/95 (without SMTP)";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -63,9 +63,7 @@ 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, ...);
|
||||
#endif
|
||||
extern void smtpmessage __P((char *f, MAILER *m, MCI *mci, ...));
|
||||
/*
|
||||
** SMTPINIT -- initialize SMTP.
|
||||
**
|
||||
@ -83,6 +81,7 @@ extern smtpmessage(char *f, MAILER *m, MCI *mci, ...);
|
||||
** creates connection and sends initial protocol.
|
||||
*/
|
||||
|
||||
void
|
||||
smtpinit(m, mci, e)
|
||||
struct mailer *m;
|
||||
register MCI *mci;
|
||||
@ -105,6 +104,8 @@ smtpinit(m, mci, e)
|
||||
|
||||
SmtpError[0] = '\0';
|
||||
CurHostName = mci->mci_host; /* XXX UGLY XXX */
|
||||
if (CurHostName == NULL)
|
||||
CurHostName = MyHostName;
|
||||
SmtpNeedIntro = TRUE;
|
||||
switch (mci->mci_state)
|
||||
{
|
||||
@ -186,18 +187,16 @@ smtpinit(m, mci, e)
|
||||
** 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 (CheckLoopBack && strcasecmp(&SmtpReplyBuffer[4], MyHostName) == 0)
|
||||
if (!bitnset(M_NOLOOPCHECK, m->m_flags) &&
|
||||
strcasecmp(&SmtpReplyBuffer[4], MyHostName) == 0)
|
||||
{
|
||||
syserr("553 %s config error: mail loops back to myself",
|
||||
MyHostName);
|
||||
syserr("553 %s config error: mail loops back to me (MX problem?)",
|
||||
mci->mci_host);
|
||||
mci->mci_exitstat = EX_CONFIG;
|
||||
mci->mci_errno = 0;
|
||||
smtpquit(m, mci, e);
|
||||
@ -244,9 +243,9 @@ smtpinit(m, mci, e)
|
||||
/*
|
||||
** ESMTP_CHECK -- check to see if this implementation likes ESMTP protocol
|
||||
**
|
||||
**
|
||||
** Parameters:
|
||||
** line -- the response line.
|
||||
** firstline -- set if this is the first line of the reply.
|
||||
** m -- the mailer.
|
||||
** mci -- the mailer connection info.
|
||||
** e -- the envelope.
|
||||
@ -256,23 +255,24 @@ smtpinit(m, mci, e)
|
||||
*/
|
||||
|
||||
void
|
||||
esmtp_check(line, m, mci, e)
|
||||
esmtp_check(line, firstline, m, mci, e)
|
||||
char *line;
|
||||
bool firstline;
|
||||
MAILER *m;
|
||||
register MCI *mci;
|
||||
ENVELOPE *e;
|
||||
{
|
||||
if (strlen(line) < 5)
|
||||
return;
|
||||
line += 4;
|
||||
if (strncmp(line, "ESMTP ", 6) == 0)
|
||||
if (strstr(line, "ESMTP") != NULL)
|
||||
mci->mci_flags |= MCIF_ESMTP;
|
||||
if (strstr(line, "8BIT-OK") != NULL)
|
||||
mci->mci_flags |= MCIF_8BITOK;
|
||||
}
|
||||
/*
|
||||
** HELO_OPTIONS -- process the options on a HELO line.
|
||||
**
|
||||
** Parameters:
|
||||
** line -- the response line.
|
||||
** firstline -- set if this is the first line of the reply.
|
||||
** m -- the mailer.
|
||||
** mci -- the mailer connection info.
|
||||
** e -- the envelope.
|
||||
@ -282,15 +282,19 @@ esmtp_check(line, m, mci, e)
|
||||
*/
|
||||
|
||||
void
|
||||
helo_options(line, m, mci, e)
|
||||
helo_options(line, firstline, m, mci, e)
|
||||
char *line;
|
||||
bool firstline;
|
||||
MAILER *m;
|
||||
register MCI *mci;
|
||||
ENVELOPE *e;
|
||||
{
|
||||
register char *p;
|
||||
|
||||
if (strlen(line) < 5)
|
||||
if (firstline)
|
||||
return;
|
||||
|
||||
if (strlen(line) < (SIZE_T) 5)
|
||||
return;
|
||||
line += 4;
|
||||
p = strchr(line, ' ');
|
||||
@ -309,6 +313,8 @@ helo_options(line, m, mci, e)
|
||||
}
|
||||
else if (strcasecmp(line, "expn") == 0)
|
||||
mci->mci_flags |= MCIF_EXPN;
|
||||
else if (strcasecmp(line, "dsn") == 0)
|
||||
mci->mci_flags |= MCIF_DSN;
|
||||
}
|
||||
/*
|
||||
** SMTPMAILFROM -- send MAIL command
|
||||
@ -319,6 +325,7 @@ helo_options(line, m, mci, e)
|
||||
** e -- the envelope (including the sender to specify).
|
||||
*/
|
||||
|
||||
int
|
||||
smtpmailfrom(m, mci, e)
|
||||
struct mailer *m;
|
||||
MCI *mci;
|
||||
@ -326,7 +333,8 @@ smtpmailfrom(m, mci, e)
|
||||
{
|
||||
int r;
|
||||
char *bufp;
|
||||
char buf[MAXNAME];
|
||||
char *bodytype;
|
||||
char buf[MAXNAME + 1];
|
||||
char optbuf[MAXLINE];
|
||||
|
||||
if (tTd(18, 2))
|
||||
@ -338,6 +346,64 @@ smtpmailfrom(m, mci, e)
|
||||
else
|
||||
strcpy(optbuf, "");
|
||||
|
||||
bodytype = e->e_bodytype;
|
||||
if (bitset(MCIF_8BITMIME, mci->mci_flags))
|
||||
{
|
||||
if (bodytype == NULL &&
|
||||
bitset(MM_MIME8BIT, MimeMode) &&
|
||||
bitset(EF_HAS8BIT, e->e_flags) &&
|
||||
!bitset(EF_DONT_MIME, e->e_flags) &&
|
||||
!bitnset(M_8BITS, m->m_flags))
|
||||
bodytype = "8BITMIME";
|
||||
if (bodytype != NULL)
|
||||
{
|
||||
strcat(optbuf, " BODY=");
|
||||
strcat(optbuf, bodytype);
|
||||
}
|
||||
}
|
||||
else if (bitnset(M_8BITS, m->m_flags) ||
|
||||
!bitset(EF_HAS8BIT, e->e_flags) ||
|
||||
bitset(MCIF_8BITOK, mci->mci_flags))
|
||||
{
|
||||
/* just pass it through */
|
||||
}
|
||||
#if MIME8TO7
|
||||
else if (bitset(MM_CVTMIME, MimeMode) &&
|
||||
!bitset(EF_DONT_MIME, e->e_flags) &&
|
||||
(!bitset(MM_PASS8BIT, MimeMode) ||
|
||||
bitset(EF_IS_MIME, e->e_flags)))
|
||||
{
|
||||
/* must convert from 8bit MIME format to 7bit encoded */
|
||||
mci->mci_flags |= MCIF_CVT8TO7;
|
||||
}
|
||||
#endif
|
||||
else if (!bitset(MM_PASS8BIT, MimeMode))
|
||||
{
|
||||
/* cannot just send a 8-bit version */
|
||||
usrerr("%s does not support 8BITMIME", mci->mci_host);
|
||||
mci->mci_status = "5.6.3";
|
||||
return EX_DATAERR;
|
||||
}
|
||||
|
||||
if (bitset(MCIF_DSN, mci->mci_flags))
|
||||
{
|
||||
if (e->e_envid != NULL)
|
||||
{
|
||||
strcat(optbuf, " ENVID=");
|
||||
strcat(optbuf, e->e_envid);
|
||||
}
|
||||
|
||||
/* RET= parameter */
|
||||
if (bitset(EF_RET_PARAM, e->e_flags))
|
||||
{
|
||||
strcat(optbuf, " RET=");
|
||||
if (bitset(EF_NO_BODY_RETN, e->e_flags))
|
||||
strcat(optbuf, "HDRS");
|
||||
else
|
||||
strcat(optbuf, "FULL");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Send the MAIL command.
|
||||
** Designates the sender.
|
||||
@ -349,7 +415,7 @@ smtpmailfrom(m, mci, e)
|
||||
!bitnset(M_NO_NULL_FROM, m->m_flags))
|
||||
(void) strcpy(buf, "");
|
||||
else
|
||||
expand("\201g", buf, &buf[sizeof buf - 1], e);
|
||||
expand("\201g", buf, sizeof buf, e);
|
||||
if (buf[0] == '<')
|
||||
{
|
||||
/* strip off <angle brackets> (put back on below) */
|
||||
@ -360,7 +426,7 @@ smtpmailfrom(m, mci, e)
|
||||
}
|
||||
else
|
||||
bufp = buf;
|
||||
if (e->e_from.q_mailer == LocalMailer ||
|
||||
if (bitnset(M_LOCALMAILER, e->e_from.q_mailer->m_flags) ||
|
||||
!bitnset(M_FROMPATH, m->m_flags))
|
||||
{
|
||||
smtpmessage("MAIL From:<%s>%s", m, mci, bufp, optbuf);
|
||||
@ -373,37 +439,57 @@ smtpmailfrom(m, mci, e)
|
||||
SmtpPhase = mci->mci_phase = "client MAIL";
|
||||
setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
|
||||
r = reply(m, mci, e, TimeOuts.to_mail, NULL);
|
||||
if (r < 0 || REPLYTYPE(r) == 4)
|
||||
if (r < 0 || r == 421)
|
||||
{
|
||||
/* communications failure/service shutting down */
|
||||
mci->mci_exitstat = EX_TEMPFAIL;
|
||||
mci->mci_errno = errno;
|
||||
smtpquit(m, mci, e);
|
||||
return EX_TEMPFAIL;
|
||||
}
|
||||
else if (r == 250)
|
||||
else if (REPLYTYPE(r) == 4)
|
||||
{
|
||||
return EX_TEMPFAIL;
|
||||
}
|
||||
else if (REPLYTYPE(r) == 2)
|
||||
{
|
||||
mci->mci_exitstat = EX_OK;
|
||||
return EX_OK;
|
||||
}
|
||||
else if (r == 501)
|
||||
{
|
||||
/* syntax error in arguments */
|
||||
mci->mci_status = "5.5.2";
|
||||
return EX_DATAERR;
|
||||
}
|
||||
else if (r == 553)
|
||||
{
|
||||
/* mailbox name not allowed */
|
||||
mci->mci_status = "5.1.3";
|
||||
return EX_DATAERR;
|
||||
}
|
||||
else if (r == 552)
|
||||
{
|
||||
/* signal service unavailable */
|
||||
mci->mci_exitstat = EX_UNAVAILABLE;
|
||||
smtpquit(m, mci, e);
|
||||
/* exceeded storage allocation */
|
||||
mci->mci_status = "5.2.2";
|
||||
return EX_UNAVAILABLE;
|
||||
}
|
||||
else if (REPLYTYPE(r) == 5)
|
||||
{
|
||||
/* unknown error */
|
||||
return EX_UNAVAILABLE;
|
||||
}
|
||||
|
||||
#ifdef LOG
|
||||
if (LogLevel > 1)
|
||||
{
|
||||
syslog(LOG_CRIT, "%s: SMTP MAIL protocol error: %s",
|
||||
e->e_id, SmtpReplyBuffer);
|
||||
syslog(LOG_CRIT, "%s: %.100s: SMTP MAIL protocol error: %s",
|
||||
e->e_id, mci->mci_host,
|
||||
shortenstring(SmtpReplyBuffer, 403));
|
||||
}
|
||||
#endif
|
||||
|
||||
/* protocol error -- close up */
|
||||
smtpquit(m, mci, e);
|
||||
mci->mci_exitstat = EX_PROTOCOL;
|
||||
return EX_PROTOCOL;
|
||||
}
|
||||
/*
|
||||
@ -422,6 +508,7 @@ smtpmailfrom(m, mci, e)
|
||||
** Sends the mail via SMTP.
|
||||
*/
|
||||
|
||||
int
|
||||
smtprcpt(to, m, mci, e)
|
||||
ADDRESS *to;
|
||||
register MAILER *m;
|
||||
@ -429,30 +516,77 @@ smtprcpt(to, m, mci, e)
|
||||
ENVELOPE *e;
|
||||
{
|
||||
register int r;
|
||||
char optbuf[MAXLINE];
|
||||
extern char *smtptodsn();
|
||||
|
||||
smtpmessage("RCPT To:<%s>", m, mci, to->q_user);
|
||||
strcpy(optbuf, "");
|
||||
if (bitset(MCIF_DSN, mci->mci_flags))
|
||||
{
|
||||
/* NOTIFY= parameter */
|
||||
if (bitset(QHASNOTIFY, to->q_flags) &&
|
||||
bitset(QPRIMARY, to->q_flags))
|
||||
{
|
||||
bool firstone = TRUE;
|
||||
|
||||
strcat(optbuf, " NOTIFY=");
|
||||
if (bitset(QPINGONSUCCESS, to->q_flags))
|
||||
{
|
||||
strcat(optbuf, "SUCCESS");
|
||||
firstone = FALSE;
|
||||
}
|
||||
if (bitset(QPINGONFAILURE, to->q_flags))
|
||||
{
|
||||
if (!firstone)
|
||||
strcat(optbuf, ",");
|
||||
strcat(optbuf, "FAILURE");
|
||||
firstone = FALSE;
|
||||
}
|
||||
if (bitset(QPINGONDELAY, to->q_flags))
|
||||
{
|
||||
if (!firstone)
|
||||
strcat(optbuf, ",");
|
||||
strcat(optbuf, "DELAY");
|
||||
firstone = FALSE;
|
||||
}
|
||||
if (firstone)
|
||||
strcat(optbuf, "NEVER");
|
||||
}
|
||||
|
||||
/* ORCPT= parameter */
|
||||
if (to->q_orcpt != NULL)
|
||||
{
|
||||
strcat(optbuf, " ORCPT=");
|
||||
strcat(optbuf, to->q_orcpt);
|
||||
}
|
||||
}
|
||||
|
||||
smtpmessage("RCPT To:<%s>%s", m, mci, to->q_user, optbuf);
|
||||
|
||||
SmtpPhase = mci->mci_phase = "client RCPT";
|
||||
setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
|
||||
r = reply(m, mci, e, TimeOuts.to_rcpt, NULL);
|
||||
to->q_rstatus = newstr(SmtpReplyBuffer);
|
||||
to->q_status = smtptodsn(r);
|
||||
to->q_statmta = mci->mci_host;
|
||||
if (r < 0 || REPLYTYPE(r) == 4)
|
||||
return (EX_TEMPFAIL);
|
||||
return EX_TEMPFAIL;
|
||||
else if (REPLYTYPE(r) == 2)
|
||||
return (EX_OK);
|
||||
return EX_OK;
|
||||
else if (r == 550 || r == 551 || r == 553)
|
||||
return (EX_NOUSER);
|
||||
else if (r == 552 || r == 554)
|
||||
return (EX_UNAVAILABLE);
|
||||
return EX_NOUSER;
|
||||
else if (REPLYTYPE(r) == 5)
|
||||
return EX_UNAVAILABLE;
|
||||
|
||||
#ifdef LOG
|
||||
if (LogLevel > 1)
|
||||
{
|
||||
syslog(LOG_CRIT, "%s: SMTP RCPT protocol error: %s",
|
||||
e->e_id, SmtpReplyBuffer);
|
||||
syslog(LOG_CRIT, "%s: %.100s: SMTP RCPT protocol error: %s",
|
||||
e->e_id, mci->mci_host,
|
||||
shortenstring(SmtpReplyBuffer, 403));
|
||||
}
|
||||
#endif
|
||||
|
||||
return (EX_PROTOCOL);
|
||||
return EX_PROTOCOL;
|
||||
}
|
||||
/*
|
||||
** SMTPDATA -- send the data and clean up the transaction.
|
||||
@ -469,8 +603,9 @@ smtprcpt(to, m, mci, e)
|
||||
*/
|
||||
|
||||
static jmp_buf CtxDataTimeout;
|
||||
static int datatimeout();
|
||||
static void datatimeout();
|
||||
|
||||
int
|
||||
smtpdata(m, mci, e)
|
||||
struct mailer *m;
|
||||
register MCI *mci;
|
||||
@ -496,20 +631,21 @@ smtpdata(m, mci, e)
|
||||
if (r < 0 || REPLYTYPE(r) == 4)
|
||||
{
|
||||
smtpquit(m, mci, e);
|
||||
return (EX_TEMPFAIL);
|
||||
return EX_TEMPFAIL;
|
||||
}
|
||||
else if (r == 554)
|
||||
else if (REPLYTYPE(r) == 5)
|
||||
{
|
||||
smtprset(m, mci, e);
|
||||
return (EX_UNAVAILABLE);
|
||||
return EX_UNAVAILABLE;
|
||||
}
|
||||
else if (r != 354)
|
||||
{
|
||||
#ifdef LOG
|
||||
if (LogLevel > 1)
|
||||
{
|
||||
syslog(LOG_CRIT, "%s: SMTP DATA-1 protocol error: %s",
|
||||
e->e_id, SmtpReplyBuffer);
|
||||
syslog(LOG_CRIT, "%s: %.100s: SMTP DATA-1 protocol error: %s",
|
||||
e->e_id, mci->mci_host,
|
||||
shortenstring(SmtpReplyBuffer, 403));
|
||||
}
|
||||
#endif
|
||||
smtprset(m, mci, e);
|
||||
@ -533,16 +669,22 @@ smtpdata(m, mci, e)
|
||||
}
|
||||
|
||||
timeout = e->e_msgsize / 16;
|
||||
if (timeout < (time_t) 60)
|
||||
timeout = (time_t) 60;
|
||||
timeout += e->e_nrcpts * 90;
|
||||
if (timeout < (time_t) 600)
|
||||
timeout = (time_t) 600;
|
||||
timeout += e->e_nrcpts * 300;
|
||||
ev = setevent(timeout, datatimeout, 0);
|
||||
|
||||
/* now output the actual message */
|
||||
(*e->e_puthdr)(mci, e);
|
||||
putline("\n", mci);
|
||||
/*
|
||||
** Output the actual message.
|
||||
*/
|
||||
|
||||
(*e->e_puthdr)(mci, e->e_header, e);
|
||||
(*e->e_putbody)(mci, e, NULL);
|
||||
|
||||
/*
|
||||
** Cleanup after sending message.
|
||||
*/
|
||||
|
||||
clrevent(ev);
|
||||
|
||||
if (ferror(mci->mci_out))
|
||||
@ -569,28 +711,31 @@ smtpdata(m, mci, e)
|
||||
if (r < 0)
|
||||
{
|
||||
smtpquit(m, mci, e);
|
||||
return (EX_TEMPFAIL);
|
||||
return EX_TEMPFAIL;
|
||||
}
|
||||
mci->mci_state = MCIS_OPEN;
|
||||
e->e_statmsg = newstr(&SmtpReplyBuffer[4]);
|
||||
if (REPLYTYPE(r) == 4)
|
||||
return (EX_TEMPFAIL);
|
||||
else if (r == 250)
|
||||
return (EX_OK);
|
||||
else if (r == 552 || r == 554)
|
||||
return (EX_UNAVAILABLE);
|
||||
return EX_TEMPFAIL;
|
||||
else if (REPLYCLASS(r) != 5)
|
||||
/* fall through */ ;
|
||||
else if (REPLYTYPE(r) == 2)
|
||||
return EX_OK;
|
||||
else if (REPLYTYPE(r) == 5)
|
||||
return EX_UNAVAILABLE;
|
||||
#ifdef LOG
|
||||
if (LogLevel > 1)
|
||||
{
|
||||
syslog(LOG_CRIT, "%s: SMTP DATA-2 protocol error: %s",
|
||||
e->e_id, SmtpReplyBuffer);
|
||||
syslog(LOG_CRIT, "%s: %.100s: SMTP DATA-2 protocol error: %s",
|
||||
e->e_id, mci->mci_host,
|
||||
shortenstring(SmtpReplyBuffer, 403));
|
||||
}
|
||||
#endif
|
||||
return (EX_PROTOCOL);
|
||||
return EX_PROTOCOL;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
static void
|
||||
datatimeout()
|
||||
{
|
||||
longjmp(CtxDataTimeout, 1);
|
||||
@ -608,6 +753,7 @@ datatimeout()
|
||||
** sends the final protocol and closes the connection.
|
||||
*/
|
||||
|
||||
void
|
||||
smtpquit(m, mci, e)
|
||||
register MAILER *m;
|
||||
register MCI *mci;
|
||||
@ -647,6 +793,7 @@ smtpquit(m, mci, e)
|
||||
** SMTPRSET -- send a RSET (reset) command
|
||||
*/
|
||||
|
||||
void
|
||||
smtprset(m, mci, e)
|
||||
register MAILER *m;
|
||||
register MCI *mci;
|
||||
@ -670,6 +817,7 @@ smtprset(m, mci, e)
|
||||
** SMTPPROBE -- check the connection state
|
||||
*/
|
||||
|
||||
int
|
||||
smtpprobe(mci)
|
||||
register MCI *mci;
|
||||
{
|
||||
@ -693,9 +841,8 @@ smtpprobe(mci)
|
||||
** mci -- the mailer connection info structure.
|
||||
** e -- the current envelope.
|
||||
** timeout -- the timeout for reads.
|
||||
** pfunc -- processing function for second and subsequent
|
||||
** lines of response -- if null, no special
|
||||
** processing is done.
|
||||
** pfunc -- processing function called on each line of response.
|
||||
** If null, no special processing is done.
|
||||
**
|
||||
** Returns:
|
||||
** reply code it reads.
|
||||
@ -704,6 +851,7 @@ smtpprobe(mci)
|
||||
** flushes the mail file.
|
||||
*/
|
||||
|
||||
int
|
||||
reply(m, mci, e, timeout, pfunc)
|
||||
MAILER *m;
|
||||
MCI *mci;
|
||||
@ -749,7 +897,6 @@ reply(m, mci, e, timeout, pfunc)
|
||||
if (p == NULL)
|
||||
{
|
||||
bool oldholderrs;
|
||||
extern char MsgBuf[]; /* err.c */
|
||||
|
||||
/* if the remote end closed early, fake an error */
|
||||
if (errno == 0)
|
||||
@ -770,16 +917,18 @@ reply(m, mci, e, timeout, pfunc)
|
||||
pause();
|
||||
mci->mci_state = MCIS_ERROR;
|
||||
smtpquit(m, mci, e);
|
||||
#ifdef XDEBUG
|
||||
#if XDEBUG
|
||||
{
|
||||
char wbuf[MAXLINE];
|
||||
char *p = wbuf;
|
||||
|
||||
if (e->e_to != NULL)
|
||||
{
|
||||
sprintf(p, "%s... ", e->e_to);
|
||||
sprintf(p, "%s... ",
|
||||
shortenstring(e->e_to, 203));
|
||||
p += strlen(p);
|
||||
}
|
||||
sprintf(p, "reply(%s) during %s",
|
||||
sprintf(p, "reply(%.100s) during %s",
|
||||
mci->mci_host, SmtpPhase);
|
||||
checkfd012(wbuf);
|
||||
}
|
||||
@ -815,8 +964,8 @@ reply(m, mci, e, timeout, pfunc)
|
||||
nmessage("050 %s", bufp);
|
||||
|
||||
/* process the line */
|
||||
if (pfunc != NULL && !firstline)
|
||||
(*pfunc)(bufp, m, mci, e);
|
||||
if (pfunc != NULL)
|
||||
(*pfunc)(bufp, firstline, m, mci, e);
|
||||
|
||||
firstline = FALSE;
|
||||
|
||||
@ -871,6 +1020,7 @@ reply(m, mci, e, timeout, pfunc)
|
||||
*/
|
||||
|
||||
/*VARARGS1*/
|
||||
void
|
||||
#ifdef __STDC__
|
||||
smtpmessage(char *f, MAILER *m, MCI *mci, ...)
|
||||
#else
|
||||
@ -884,7 +1034,7 @@ smtpmessage(f, m, mci, va_alist)
|
||||
VA_LOCAL_DECL
|
||||
|
||||
VA_START(mci);
|
||||
(void) vsprintf(SmtpMsgBuffer, f, ap);
|
||||
(void) vsnprintf(SmtpMsgBuffer, sizeof SmtpMsgBuffer, f, ap);
|
||||
VA_END;
|
||||
|
||||
if (tTd(18, 1) || Verbose)
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user