home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
reviewed
/
volume01
/
deliver
/
patch09
< prev
next >
Wrap
Internet Message Format
|
1992-02-05
|
29KB
From: Chip Salzenberg <chip@tct.com>
Subject: v01i049: deliver - (Ver. 2.1) flexible E-Mail delivery, Patch09
Newsgroups: comp.sources.reviewed
Approved: csr@calvin.dgbt.doc.ca
Submitted-by: Chip Salzenberg <chip@tct.com>
Posting-number: Volume 1, Issue 49
Archive-name: deliver/patch09
Patch-To: deliver: Volume 1, Issue 09-14
NOTE: This patch contains changes for files in subdirectories.
When you apply it, be sure to use the "-p" option of patch.
Changes in patch #9 to Deliver 2.1:
1. There are new supported configurations: HP-UX 8.x and SCO Xenix.
2. There is a new documentation file: "Using Deliver With MMDF."
3. New configuration items:
TEMPDIR
The directory in which Deliver puts temporary files. The
default is "/tmp". Note that if the filesystem containing
this directory ever fills up, Deliver will go to pieces.
UUX_DASH_A
If defined, Deliver uses the "-asender" option of the uux
program, thus sending failure notices to the original sender.
This option is defined by default.
4. Preprocessors that can't do "#if defined(x) + defined(y)" are now
supported (but cursed).
5. There was a problem with logging of errors in spawning children.
The symptom was a scrambled error log, in which several processes
would overwrite each others' log entries. Thanks to David G.
McLane <davidg@aegis.or.jp> for reporting this bug.
6. Lockfile creation now does the sleep/retry dance only on an error
of EEXIST (file already exists). Other errors, such as ENOENT (no
such file or directory), are considered permanent, and therefore
are not retried.
7. A few bits of lint have been removed.
8. The `make install' actions now work even on systems where the
shell is so badly broken that the "if" statement can't be used.
9. The README file now enumerates supported systems in a table, which
should be easy to read and/or pass on to your friends. ;-)
Patch and enjoy.
NOTE: This patch contains changes for files in subdirectories.
When you apply it, be sure to use the "-p" option of patch.
This patch contains changes to the following files:
patchlevel.h
INSTALL
MMDF
Makefile
README
config.h
copymsg.c
deliver.8
deliver.h
lock.c
log.c
main.c
subs.c
sysdep.c
unctime.y
uucp.c
conf/finish-os.h
conf/os-hpux8.h
conf/os-scoxnx.h
Index: patchlevel.h
Prereq: 8
***************
*** 1 ****
! #define PATCHLEVEL 8
--- 1 ----
! #define PATCHLEVEL 9
Index: INSTALL
Prereq: 1.4
***************
*** 1,3 ****
! $Id: INSTALL,v 1.4 1991/08/05 19:06:23 chip Exp $
--- 1,3 ----
! $Id: INSTALL,v 1.5 1991/11/25 21:29:01 chip Exp $
***************
*** 9,19 ****
Before running "make install", be logged in as root or else su'd to
! root. Also, check that the Makefile definitions for BINDIR and GROUP
! are acceptable. BINDIR specifies the target directory for program
! installation. GROUP specifies the group that should own the installed
! programs.
Running "make install" copies the "deliver" and "header" binaries to
! the directory specified by BINDIR. It also changes the group of the
installed Deliver binary to the group specified by GROUP. Finally, it
changes the permissions on the installed Deliver binary to be setuid
--- 9,19 ----
Before running "make install", be logged in as root or else su'd to
! root. Also, check that the Makefile definitions for BIN and GROUP are
! acceptable. BIN specifies the target directory for the installed
! program binaries. GROUP specifies the group that should own the
! installed program binaries.
Running "make install" copies the "deliver" and "header" binaries to
! the directory specified by BIN. It also changes the group of the
installed Deliver binary to the group specified by GROUP. Finally, it
changes the permissions on the installed Deliver binary to be setuid
Index: MMDF
***************
*** 0 ****
--- 1,44 ----
+ $Id: MMDF,v 1.3 1992/01/20 20:37:06 chip Exp $
+
+
+ USING DELIVER WITH MMDF
+
+
+ MMDF can be configured to use Deliver in two distinct ways. The MMDF
+ administrator can set up an alias for each user. Or, each user can
+ create a maildelivery file for herself.
+
+
+ To use the administrator alias approach, log in as `mmdf' and edit the
+ file `table/alias.list'. For each user, add a line like
+
+ user "user|/usr/bin/deliver user"
+
+ where `user' is the name of the user to whom mail will be delivered.
+ Next, while still logged in as `mmdf', run `table/dbmbuild'. Please
+ note that Deliver will execute in the user's context. See the MMDF
+ administrators guide for more details.
+
+
+ The second possibility is for each user to decide for herself whether
+ to use Deliver. Any user may create an MMDF maildelivery file in her
+ home directory. This file is named $HOME/.maildelivery.
+
+ Each line of a user's maildelivery file describes how to handle some
+ or all messages addressed to that user. To use Deliver for personal
+ mail delivery, a user's maildeliveryfile must include a line like:
+
+ * - | A /usr/bin/deliver user
+
+ The fields are white-space separated. They tell MMDF to pass all
+ messages (*) without exception (-) via pipe (|) to the given program,
+ and to accept delivery (A). Here again, Deliver will execute in the
+ user's context.
+
+
+ Note that in both cases, the MMDF modifies the From_ header line to
+ reflect the name of the user who effected delivery.
+
+
+ [ Jan-Piet Mens <jpm@Logix.DE> originally wrote this document,
+ but it has been heavily edited by Chip Salzenberg <chip@tct.com>. ]
Index: Makefile
Prereq: 1.10
***************
*** 1,3 ****
! # $Id: Makefile,v 1.10 1991/08/21 22:09:15 chip Exp $
#
# Makefile for deliver
--- 1,3 ----
! # $Id: Makefile,v 1.12 1991/12/25 22:03:19 chip Exp $
#
# Makefile for deliver
***************
*** 101,105 ****
#
! DOCS = README INSTALL SENDMAIL deliver.8
MF = Makefile
--- 101,105 ----
#
! DOCS = README INSTALL SENDMAIL MMDF deliver.8
MF = Makefile
***************
*** 151,165 ****
install: deliver header uid
! @if test 2 -ne `./uid -uU | fgrep '(root)' | wc -l`; \
! then \
! echo "Sorry! You must be root to install deliver."; \
! exit 1; \
! else \
! true; \
! fi
! @if test -n "$(DELHOME)"; \
! then \
! h="$(DELHOME)" ; \
! for d in $$h $$h/bin $$h/lib $$h/log; \
do \
test -d $$d && continue; \
--- 151,162 ----
install: deliver header uid
! @set -- `./uid -uU | fgrep '(root)' | wc -l`; \
! case "$$1" in \
! 2) ;; \
! *) echo "Sorry! You must be root to install deliver."; exit 1 ;; \
! esac
! @h="$(DELHOME)"; \
! case "$$h" in \
! ?*) for d in $$h $$h/bin $$h/lib $$h/log; \
do \
test -d $$d && continue; \
***************
*** 168,175 ****
chgrp $(GROUP) $$d; \
chmod 755 $$d ) || exit 1; \
! done; \
! else \
! true; \
! fi
$(COPY) deliver $(BIN)/deliver
chgrp $(GROUP) $(BIN)/deliver
--- 165,170 ----
chgrp $(GROUP) $$d; \
chmod 755 $$d ) || exit 1; \
! done ;; \
! esac
$(COPY) deliver $(BIN)/deliver
chgrp $(GROUP) $(BIN)/deliver
Index: README
Prereq: 1.9
***************
*** 1,4 ****
! $Id: README,v 1.9 1991/10/30 21:55:52 chip Exp $
! This is the README file for Deliver 2.1.08.
--- 1,4 ----
! $Id: README,v 1.10 1991/11/21 15:34:13 chip Exp $
! This is the README file for Deliver 2.1.09.
***************
*** 31,37 ****
! Deliver runs under SCO UNIX 3.2, SCO Xenix/286 and Xenix/386 2.x and
! 3.x, AIX 3.1, SunOS 3.x and 4.x, generic UNIX System V, 4.3 BSD, V7
! (!) and Coherent (!!).
Configuration headers for various operating systems are found in
--- 31,52 ----
! Deliver runs under (in alpabetical order):
!
! Op. Sys. Vendor Comments
! ------------------ -------------- ------------------------------
! 3B1 System V AT&T
! AIX 3.1 IBM
! BSD generic
! Coherent Mark Williams
! CX/UX Harris
! HP-UX 8.x HP using cc or c89
! NeWS-OS 3.2 Sony
! NextOS 2.x NeXT
! SCO UNIX 3.2 SCO using cc, rcc or gcc
! SCO Xenix 2.x, 3.x SCO both Xenix/286 and Xenix/386
! SunOS 3.x, 4.x Sun
! System V (generic)
! System V r4 (generic)
! V7 AT&T
Configuration headers for various operating systems are found in
Index: config.h
Prereq: 1.6
***************
*** 1,3 ****
! /* $Id: config.h,v 1.6 1991/10/30 21:50:44 chip Exp $
*
* Deliver configuration.
--- 1,3 ----
! /* $Id: config.h,v 1.8 1992/01/20 20:36:05 chip Exp $
*
* Deliver configuration.
***************
*** 4,7 ****
--- 4,14 ----
*
* $Log: config.h,v $
+ * Revision 1.8 1992/01/20 20:36:05 chip
+ * Allow for UUX_OPTS to be a list.
+ * Support UUX_DASH_A, so UUCP failure messages are mailed to original sender.
+ *
+ * Revision 1.7 1991/11/26 16:50:42 chip
+ * Add TEMPDIR.
+ *
* Revision 1.6 1991/10/30 21:50:44 chip
* Add support for MMDF.
***************
*** 95,107 ****
*
* UUCP_NAMESIZE Maximum size of a UUCP system name.
- * UUX_OPTS Options for uux; "-r" means queue but don't call.
* UUX_ARGCOUNT Maximum count of arguments for uux.
* UUX_ARGSIZE Maximum total size of arguments for uux.
*/
#define UUCP_NAMESIZE 16
- #define UUX_OPTS "-r"
#define UUX_ARGCOUNT 16
#define UUX_ARGSIZE 512
/*----------------------------------------------------------------------
--- 102,117 ----
*
* UUCP_NAMESIZE Maximum size of a UUCP system name.
* UUX_ARGCOUNT Maximum count of arguments for uux.
* UUX_ARGSIZE Maximum total size of arguments for uux.
+ * UUX_OPTS A comma-separated list of options for uux.
+ * Option "-r" often means: queue, but don't call.
+ * UUX_DASH_A Define if your uux understands "-asender".
*/
#define UUCP_NAMESIZE 16
#define UUX_ARGCOUNT 16
#define UUX_ARGSIZE 512
+ #define UUX_OPTS "-r"
+ #define UUX_DASH_A
/*----------------------------------------------------------------------
***************
*** 185,188 ****
--- 195,207 ----
/*----------------------------------------------------------------------
+ * Directory for temporary files.
+ *
+ * If the filesystem containing this directory becomes full, Deliver
+ * will fail ungracefully.
+ */
+
+ #define TEMPDIR "/tmp"
+
+ /*----------------------------------------------------------------------
* Log file names.
* Errors and warnings are output to stderr and to the error log file.
***************
*** 191,194 ****
--- 210,215 ----
*
* Define LOGLOCK to be the temp file controlling access to log files.
+ * This macro does not use TEMPDIR because log files may be shared with
+ * other systems; if so, LOGLOCK must also be shared.
*/
Index: copymsg.c
Prereq: 1.5
***************
*** 1,3 ****
! /* $Id: copymsg.c,v 1.5 1991/10/23 20:02:46 chip Exp $
*
* Take the message from standard input and write it to two temp files,
--- 1,3 ----
! /* $Id: copymsg.c,v 1.6 1991/11/12 20:43:30 chip Exp $
*
* Take the message from standard input and write it to two temp files,
***************
*** 5,8 ****
--- 5,11 ----
*
* $Log: copymsg.c,v $
+ * Revision 1.6 1991/11/12 20:43:30 chip
+ * Ignore return value of fflush().
+ *
* Revision 1.5 1991/10/23 20:02:46 chip
* Use tdup().
***************
*** 336,340 ****
for (t = T_HDR; t <= T_BODY; ++t)
{
! fflush(dfp[t]);
if (ferror(dfp[t]))
{
--- 339,343 ----
for (t = T_HDR; t <= T_BODY; ++t)
{
! (void) fflush(dfp[t]);
if (ferror(dfp[t]))
{
Index: deliver.8
Prereq: 1.6
***************
*** 1,26 ****
! .\" $Id: deliver.8,v 1.6 1991/10/23 20:25:47 chip Exp $
.\"
.\" Man page for deliver.
.\"
! .\" $Log: deliver.8,v $
! .\" Revision 1.6 1991/10/23 20:25:47 chip
! .\" Patch eight.
! .\"
! .\" Revision 1.5 1991/08/27 13:43:05 chip
! .\" New patchlevel (seven).
! .\"
! .\" Revision 1.4 1991/08/06 15:03:13 chip
! .\" Mention new patchlevel (six).
! .\"
! .\" Revision 1.3 1991/08/05 19:04:11 chip
! .\" Improvements suggested by reviewers.
! .\"
! .\" Revision 1.2 1991/06/21 12:04:15 chip
! .\" Patch #5.
! .\"
! .\" Revision 1.1 1991/05/13 18:43:49 chip
! .\" Initial revision
! .\"
! .TH DELIVER 8 "Deliver 2.1.08"
.SH NAME
deliver \- deliver mail
--- 1,7 ----
! .\" $Id: deliver.8,v 1.7 1991/11/21 15:34:45 chip Exp $
.\"
.\" Man page for deliver.
.\"
! .TH DELIVER 8 "Deliver 2.1.09"
.SH NAME
deliver \- deliver mail
Index: deliver.h
Prereq: 1.7
***************
*** 1,3 ****
! /* $Id: deliver.h,v 1.7 1991/10/23 19:47:48 chip Exp $
*
* General pull-it-together include file.
--- 1,3 ----
! /* $Id: deliver.h,v 1.8 1991/11/12 20:44:42 chip Exp $
*
* General pull-it-together include file.
***************
*** 4,7 ****
--- 4,10 ----
*
* $Log: deliver.h,v $
+ * Revision 1.8 1991/11/12 20:44:42 chip
+ * Add logsize().
+ *
* Revision 1.7 1991/10/23 19:47:48 chip
* Declare errname().
***************
*** 149,152 ****
--- 152,157 ----
DCLASS addr_class();
+
+ long logsize();
time_t unctime();
Index: lock.c
Prereq: 1.5
***************
*** 1,3 ****
! /* $Id: lock.c,v 1.5 1991/08/26 18:00:32 chip Exp $
*
* Mailbox locking.
--- 1,3 ----
! /* $Id: lock.c,v 1.6 1991/12/20 18:38:20 chip Exp $
*
* Mailbox locking.
***************
*** 5,8 ****
--- 5,11 ----
*
* $Log: lock.c,v $
+ * Revision 1.6 1991/12/20 18:38:20 chip
+ * Lockfile creation only retries if errno is EEXIST.
+ *
* Revision 1.5 1991/08/26 18:00:32 chip
* Make minimum name size explicit.
***************
*** 348,351 ****
--- 351,359 ----
}
+ /* The only error that can be retried is: File exists. */
+
+ if ((errno_save = errno) != EEXIST)
+ break;
+
#else /* not SAFE_CREATE */
***************
*** 373,379 ****
}
! #endif /* not SAFE_CREATE */
! errno_save = errno;
if (verbose && (tries == 0))
--- 381,389 ----
}
! /* We can't trust errno; so, assume the most benign error. */
!
! errno_save = EEXIST;
! #endif /* not SAFE_CREATE */
if (verbose && (tries == 0))
Index: log.c
Prereq: 1.4
***************
*** 1,3 ****
! /* $Id: log.c,v 1.4 1991/08/27 15:39:45 chip Exp $
*
* Deliver logging.
--- 1,3 ----
! /* $Id: log.c,v 1.6 1991/11/25 20:49:42 chip Exp $
*
* Deliver logging.
***************
*** 4,7 ****
--- 4,15 ----
*
* $Log: log.c,v $
+ * Revision 1.6 1991/11/25 20:49:42 chip
+ * Prettify "Undel.mail" message for home directory of root.
+ *
+ * Revision 1.5 1991/11/12 20:44:47 chip
+ * Use new logsize() function. Seek to end of log before
+ * writing to it or testing its size, since a child process
+ * might have grown it.
+ *
* Revision 1.4 1991/08/27 15:39:45 chip
* Use tmzone().
***************
*** 69,74 ****
savelogs()
{
- /* If logs weren't kept, forget it. */
-
if (!log && !errlog)
return;
--- 77,80 ----
***************
*** 76,81 ****
/* If temporary logs contain anything, append them to real logs. */
! if ((log && ftell(log) > 0)
! || (errlog && ftell(errlog) > 0))
{
if (log_lock() == 0)
--- 82,86 ----
/* If temporary logs contain anything, append them to real logs. */
! if (logsize(log) || logsize(errlog))
{
if (log_lock() == 0)
***************
*** 120,124 ****
/* If the file is empty, never mind. */
! if (ftell(fp) == 0)
{
(void) fclose(fp);
--- 125,129 ----
/* If the file is empty, never mind. */
! if (logsize(fp) == 0)
{
(void) fclose(fp);
***************
*** 254,258 ****
/* If any errors have been logged, record the failed header. */
! if (ftell(errlog) > 0)
errheader();
}
--- 259,263 ----
/* If any errors have been logged, record the failed header. */
! if (logsize(errlog))
errheader();
}
***************
*** 287,293 ****
errstart();
! (void) fprintf(errlog,
! "Undelivered mail for %s put in %s/%s\n",
! d->d_name, home, MBX_UNDEL);
}
}
--- 292,298 ----
errstart();
! (void) fprintf(errlog, "Undelivered mail for %s put in %s/%s\n",
! d->d_name, (strcmp(home, "/") == 0) ? "" : home,
! MBX_UNDEL);
}
}
***************
*** 347,353 ****
errstart()
{
/* If we've already written a time stamp, don't do it again. */
! if (!errlog || ftell(errlog) > 0)
return;
--- 352,361 ----
errstart()
{
+ if (!errlog)
+ return;
+
/* If we've already written a time stamp, don't do it again. */
! if (logsize(errlog))
return;
***************
*** 367,373 ****
errdone()
{
/* If we never wrote to the error log file, do nothing. */
! if (!errlog || ftell(errlog) == 0)
return;
--- 375,384 ----
errdone()
{
+ if (!errlog)
+ return;
+
/* If we never wrote to the error log file, do nothing. */
! if (logsize(errlog) == 0)
return;
***************
*** 422,424 ****
--- 433,456 ----
if (rec_level == 0)
(void) fputs("===========================\n\n", fp);
+ }
+
+ /*----------------------------------------------------------------------
+ * Report the size of an open log file.
+ * Incidentally, seek to the end.
+ */
+
+ long
+ logsize(fp)
+ FILE *fp;
+ {
+ long pos;
+
+ if (!fp)
+ return 0L;
+
+ if (fseek(fp, 0L, 2) == -1)
+ return 0;
+
+ pos = ftell(fp);
+ return (pos == -1) ? 0 : pos;
}
Index: main.c
Prereq: 1.7
***************
*** 1,3 ****
! /* $Id: main.c,v 1.7 1991/10/28 15:45:38 chip Exp $
*
* A program to deliver local mail with some flexibility.
--- 1,3 ----
! /* $Id: main.c,v 1.8 1992/01/20 20:35:14 chip Exp $
*
* A program to deliver local mail with some flexibility.
***************
*** 4,7 ****
--- 4,10 ----
*
* $Log: main.c,v $
+ * Revision 1.8 1992/01/20 20:35:14 chip
+ * Eliminate GCC2 warnings about unparenthesized || and &&.
+ *
* Revision 1.7 1991/10/28 15:45:38 chip
* Don't throw mail away just because sender address is unsafe.
***************
*** 383,393 ****
*/
! if (!trusted_user
! && (strcmp(dfl_sys, sys_deliver) != 0
|| strcmp(dfl_post, post_deliver) != 0
|| strcmp(dfl_err, err_deliver) != 0
! || strcmp(dfl_user, user_deliver) != 0)
! || !mailer_user
! && (hostopt && strcmp(hostopt, hostname) != 0))
{
if (eff_uid != real_uid && setuid(real_uid) == -1)
--- 386,396 ----
*/
! if ((!trusted_user
! && (strcmp(dfl_sys, sys_deliver) != 0
|| strcmp(dfl_post, post_deliver) != 0
|| strcmp(dfl_err, err_deliver) != 0
! || strcmp(dfl_user, user_deliver) != 0))
! || (!mailer_user
! && (hostopt && strcmp(hostopt, hostname) != 0)))
{
if (eff_uid != real_uid && setuid(real_uid) == -1)
Index: subs.c
Prereq: 1.7
***************
*** 1,3 ****
! /* $Id: subs.c,v 1.7 1991/10/23 20:02:03 chip Exp $
*
* Miscellaneous subroutines.
--- 1,3 ----
! /* $Id: subs.c,v 1.8 1991/11/26 16:50:42 chip Exp $
*
* Miscellaneous subroutines.
***************
*** 4,7 ****
--- 4,10 ----
*
* $Log: subs.c,v $
+ * Revision 1.8 1991/11/26 16:50:42 chip
+ * Add TEMPDIR.
+ *
* Revision 1.7 1991/10/23 20:02:03 chip
* Make all temp files close-on-exec.
***************
*** 53,60 ****
tempfile()
{
! static char template[] = "/tmp/dl.XXXXXX";
char *f;
! f = copystr(template);
if (mktemp(f) == NULL)
{
--- 56,64 ----
tempfile()
{
! static char template[] = "dl.XXXXXX";
char *f;
! f = zalloc(sizeof(TEMPDIR) + sizeof(template));
! (void) sprintf(f, "%s/%s", TEMPDIR, template);
if (mktemp(f) == NULL)
{
Index: sysdep.c
Prereq: 1.7
***************
*** 1,3 ****
! /* $Id: sysdep.c,v 1.7 1991/10/23 19:48:08 chip Exp $
*
* Routines which are (or might well be) system-dependant.
--- 1,3 ----
! /* $Id: sysdep.c,v 1.8 1991/11/12 20:44:14 chip Exp $
*
* Routines which are (or might well be) system-dependant.
***************
*** 6,9 ****
--- 6,12 ----
*
* $Log: sysdep.c,v $
+ * Revision 1.8 1991/11/12 20:44:14 chip
+ * Ignore return values of fflush() and sprintf().
+ *
* Revision 1.7 1991/10/23 19:48:08 chip
* Add errname().
***************
*** 116,119 ****
--- 119,123 ----
(void) vfprintf(errlog, fmt, ap);
FMT_END;
+ (void) fflush(errlog);
}
}
***************
*** 208,212 ****
return sys_errlist[e];
! sprintf(ue, "Error %d", e);
return ue;
--- 212,216 ----
return sys_errlist[e];
! (void) sprintf(ue, "Error %d", e);
return ue;
Index: unctime.y
Prereq: 1.4
***************
*** 1,4 ****
/*
! * $Id: unctime.y,v 1.4 1991/08/26 17:41:21 chip Exp $
*
* Conversion of ctime-style date string back to a time_t.
--- 1,4 ----
/*
! * $Id: unctime.y,v 1.5 1991/11/12 20:43:10 chip Exp $
*
* Conversion of ctime-style date string back to a time_t.
***************
*** 7,10 ****
--- 7,13 ----
*
* $Log: unctime.y,v $
+ * Revision 1.5 1991/11/12 20:43:10 chip
+ * Ignore return value of ftime().
+ *
* Revision 1.4 1991/08/26 17:41:21 chip
* Prioritize methods for determining timezone.
***************
*** 454,458 ****
{
struct timeb tb;
! ftime(&tb);
return (long)tb.timezone * -60;
}
--- 457,461 ----
{
struct timeb tb;
! (void) ftime(&tb);
return (long)tb.timezone * -60;
}
Index: uucp.c
Prereq: 1.2
***************
*** 1,3 ****
! /* $Id: uucp.c,v 1.2 1991/10/23 20:09:26 chip Exp $
*
* Handle mail destined for other hosts via UUCP.
--- 1,3 ----
! /* $Id: uucp.c,v 1.3 1992/01/20 20:36:05 chip Exp $
*
* Handle mail destined for other hosts via UUCP.
***************
*** 6,9 ****
--- 6,13 ----
*
* $Log: uucp.c,v $
+ * Revision 1.3 1992/01/20 20:36:05 chip
+ * Allow for UUX_OPTS to be a list.
+ * Support UUX_DASH_A, so UUCP failure messages are mailed to original sender.
+ *
* Revision 1.2 1991/10/23 20:09:26 chip
* Use tdup() to duplicate temp file fds.
***************
*** 23,26 ****
--- 27,41 ----
static int uucp_copy();
+ /*
+ * Local data.
+ */
+
+ #ifdef UUX_OPTS
+ static char *uux_opts[] = { UUX_OPTS };
+ #define UUX_OPTCOUNT (sizeof(uux_opts) / sizeof(uux_opts[0]))
+ #else
+ #define UUX_OPTCOUNT 0
+ #endif
+
/*----------------------------------------------------------------------
* Send mail to UUCP addresses (if any).
***************
*** 32,36 ****
{
DEST *d;
! char *uav[UUX_ARGCOUNT + 8];/* arguments for execv() */
char **av; /* remote addresses in uav[] */
DEST *dv[UUX_ARGCOUNT]; /* destinations in av[] */
--- 47,51 ----
{
DEST *d;
! char *uav[UUX_ARGCOUNT + UUX_OPTCOUNT + 8];/* arguments for execv() */
char **av; /* remote addresses in uav[] */
DEST *dv[UUX_ARGCOUNT]; /* destinations in av[] */
***************
*** 43,49 ****
av = uav;
*av++ = "uux";
#ifdef UUX_OPTS
! *av++ = UUX_OPTS;
#endif
*av++ = "-";
*av++ = rmail;
--- 58,96 ----
av = uav;
*av++ = "uux";
+
#ifdef UUX_OPTS
! {
! int i;
!
! for (i = 0; i < UUX_OPTCOUNT; ++i)
! *av++ = uux_opts[i];
! }
#endif
+
+ #ifdef UUX_DASH_A
+ {
+ char *s, *p;
+
+ /* Send failure notices to original sender, not local sender. */
+ s = orig_sender;
+
+ /* Strip smail-generated "hostname!" unless address contains "@". */
+ if (strchr(s, '@') == NULL)
+ {
+ size_t hostlen;
+
+ hostlen = strlen(hostname);
+ while (strncmp(s, hostname, hostlen) == 0 && s[hostlen] == '!')
+ s += hostlen + 1;
+ }
+
+ /* Generate "-asender" option. */
+ p = zalloc(sizeof("-a") + strlen(s));
+ strcpy(p, "-a");
+ strcat(p, s);
+ *av++ = p;
+ }
+ #endif
+
*av++ = "-";
*av++ = rmail;
Index: conf/finish-os.h
Prereq: 1.9
***************
*** 1,3 ****
! /* $Id: finish-os.h,v 1.9 1991/10/23 19:20:27 chip Exp $
*
* Spell out the implications of a given OS configuration.
--- 1,3 ----
! /* $Id: finish-os.h,v 1.10 1991/11/21 15:13:29 chip Exp $
*
* Spell out the implications of a given OS configuration.
***************
*** 4,7 ****
--- 4,11 ----
*
* $Log: finish-os.h,v $
+ * Revision 1.10 1991/11/21 15:13:29 chip
+ * Simplify test for multiple locks, for HP-UX preprocessor.
+ * Define LOCK_ANY before use. (!)
+ *
* Revision 1.9 1991/10/23 19:20:27 chip
* Always include <fcntl.h>. Define FD_CLOEXEC if it's missing.
***************
*** 31,34 ****
--- 35,92 ----
*/
+ /*------------------------------------------------------------------------
+ * Validate kernel locking configuration.
+ */
+
+ #undef LOCK_ANY
+
+ /* lockf() */
+ #ifdef LOCK_LOCKF
+ # ifdef LOCK_ANY
+ # define LOCK_MULT
+ # else
+ # define LOCK_ANY
+ # endif
+ #endif
+
+ /* fcntl() */
+ #ifdef LOCK_FCNTL
+ # ifdef LOCK_ANY
+ # define LOCK_MULT
+ # else
+ # define LOCK_ANY
+ # endif
+ #endif
+
+ /* flock() */
+ #ifdef LOCK_FLOCK
+ # ifdef LOCK_ANY
+ # define LOCK_MULT
+ # else
+ # define LOCK_ANY
+ # endif
+ #endif
+
+ /* locking() */
+ #ifdef LOCK_LOCKING
+ # ifdef LOCK_ANY
+ # define LOCK_MULT
+ # else
+ # define LOCK_ANY
+ # endif
+ #endif
+
+ #ifdef LOCK_MULT
+ ACK! "Define only one of LOCK_LOCKF, LOCK_FCNTL, LOCK_FLOCK and LOCK_LOCKING.";
+ #endif
+
+ /*------------------------------------------------------------------------
+ * Validate time configuration.
+ */
+
+ #if !defined(HAS_TIMEZONE) && !defined(HAS_GETTOD) && !defined(HAS_FTIME)
+ ACK! "Define either HAS_TIMEZONE, HAS_GETTOD or HAS_FTIME.";
+ #endif
+
/*----------------------------------------------------------------------
* POSIX systems have <unistd.h> which defines lots of interesting
***************
*** 110,114 ****
#endif
! #if (LOCK_ANY > 0) && defined(SAFE_CREATE)
#define SAFE_UPDATE
#endif
--- 168,172 ----
#endif
! #if defined(LOCK_ANY) && defined(SAFE_CREATE)
#define SAFE_UPDATE
#endif
***************
*** 270,290 ****
#define MBX_DIR "/usr/spool/mail"
#define MBX_MODE 0600
- #endif
-
- /*------------------------------------------------------------------------
- * Validate kernel locking configuration.
- */
-
- #define LOCK_ANY (defined(LOCK_LOCKF) + defined(LOCK_FCNTL) + \
- defined(LOCK_FLOCK) + defined(LOCK_LOCKING))
- #if LOCK_ANY > 1
- ACK! "Define only one of LOCK_LOCKF, LOCK_FCNTL, LOCK_FLOCK and LOCK_LOCKING.";
- #endif
-
- /*------------------------------------------------------------------------
- * Validate time configuration.
- */
-
- #if !defined(HAS_TIMEZONE) && !defined(HAS_GETTOD) && !defined(HAS_FTIME)
- ACK! "Define either HAS_TIMEZONE, HAS_GETTOD or HAS_FTIME.";
#endif
--- 328,330 ----
Index: conf/os-hpux8.h
***************
*** 0 ****
--- 1,17 ----
+ /* $Id: os-hpux8.h,v 1.1 1991/11/21 15:14:04 chip Exp $
+ *
+ * Deliver configuration for HP-UX 8.x.
+ *
+ * $Log: os-hpux8.h,v $
+ * Revision 1.1 1991/11/21 15:14:04 chip
+ * Initial revision
+ *
+ */
+
+ /* Mostly it's System V (externally, anyway). */
+
+ #include <os-sysv.h>
+
+ /* Then again... */
+
+ #define HH_UNISTD /* Has <unistd.h> */
Index: conf/os-scoxnx.h
***************
*** 0 ****
--- 1,33 ----
+ /*
+ * $Id: os-scoxnx.h,v 1.1 1991/11/21 15:40:45 chip Exp $
+ *
+ * Deliver configuration for SCO Xenix System V.
+ *
+ * NOTE: If you have a very old version of Xenix, you may have to edit
+ * "local.h" to include the statement "#define SETVBUF_TYPE_BUF". If
+ * this means you, your first clue will probably be a core dump.
+ *
+ * $Log: os-scoxnx.h,v $
+ * Revision 1.1 1991/11/21 15:40:45 chip
+ * Initial revision
+ *
+ */
+
+ /* Mostly it's System V. */
+
+ #include <os-sysv.h>
+
+ /* Then again... */
+
+ #ifndef lint
+ #define HH_STDARG /* Has <stdarg.h> */
+ #undef HH_VARARGS /* Has <varargs.h> */
+ #endif
+
+ #undef SYSV_USRMAIL /* Mailboxes in /usr/mail, as per SysV */
+
+ #undef LOCK_LOCKF /* Use lockf(F_LOCK, ...) (SVID) */
+ #define LOCK_LOCKING /* Use locking(LK_LOCK, ...) (Xenix) */
+
+ #undef ML_DOTLOCK /* Create <mailbox>.lock */
+ #define ML_DOTMLK /* Create <basename>.mlk (Xenix) */
--------------------------------------------------------------------------
--
Chip Salzenberg at Teltronics/TCT <chip@tct.com>, <73717.366@compuserve.com>
exit 0 # Just in case...