diff options
author | cvs2svn <cvs2svn@FreeBSD.org> | 2001-09-02 20:14:09 +0000 |
---|---|---|
committer | cvs2svn <cvs2svn@FreeBSD.org> | 2001-09-02 20:14:09 +0000 |
commit | 43e9a1b4e1ac61532bb66f42422e3fb36615e146 (patch) | |
tree | dccdbf5f592f4075b06230fd98c91732e37892c6 | |
parent | fee4c7e3e72130c038f4580db5360a73131baff3 (diff) |
This commit was manufactured by cvs2svn to create tagvendor/amd/6.0.7
'amd-vendor-amd_6_0_7'.
Notes
Notes:
svn path=/vendor/amd/dist/; revision=82819
svn path=/vendor/amd/6.0.7/; revision=82821; tag=vendor/amd/6.0.7
-rw-r--r-- | contrib/amd/LSM.am-utils | 20 | ||||
-rw-r--r-- | contrib/amd/TODO | 177 | ||||
-rw-r--r-- | contrib/amd/conf/mount/mount_freebsd3.c | 68 | ||||
-rw-r--r-- | contrib/amd/conf/trap/trap_freebsd3.h | 3 | ||||
-rw-r--r-- | contrib/amd/libamu/clnt_sperrno.c | 147 | ||||
-rw-r--r-- | contrib/amd/scripts/Makefile.am | 49 | ||||
-rw-r--r-- | contrib/amd/scripts/Makefile.in | 381 | ||||
-rwxr-xr-x | contrib/amd/scripts/fixrmtab | 24 | ||||
-rw-r--r-- | contrib/amd/scripts/lostaltmail.conf-sample | 84 | ||||
-rwxr-xr-x | contrib/amd/scripts/lostaltmail.in | 649 |
10 files changed, 0 insertions, 1602 deletions
diff --git a/contrib/amd/LSM.am-utils b/contrib/amd/LSM.am-utils deleted file mode 100644 index f8b045b6b6df..000000000000 --- a/contrib/amd/LSM.am-utils +++ /dev/null @@ -1,20 +0,0 @@ -Begin3 -Title: am-utils -Version: 6.0.1 -Entered-date: 08SEP99 -Description: BSD Automounter Utilities - Replaces the old amd-upl102. Offers NFS V3 support, many - new features, and numerous ports. The home page for - am-utils is in http://www.cs.columbia.edu/~ezk/am-utils/ -Keywords: amd amq hlfsd fsinfo wire-test fixmount mk-amd-map automount -Author: ezk@cs.columbia.edu (Erez Zadok) -Maintained-by: ezk@cs.columbia.edu (Erez Zadok) -Primary-site: shekel.mcl.cs.columbia.edu /pub/am-utils - 1.3MB am-utils-6.0.1.tar.gz - 1.3MB am-utils.tar.gz - 1.3MB am-utils-snapshot.tar.gz -Alternate-site: http://www.cs.columbia.edu/~ezk/am-utils/mirrors.html -Original-site: ftp.cs.columbia.edu /pub/amd -Platforms: all modern Unix systems -Copying-policy: BSD -End diff --git a/contrib/amd/TODO b/contrib/amd/TODO deleted file mode 100644 index 07fb5559678c..000000000000 --- a/contrib/amd/TODO +++ /dev/null @@ -1,177 +0,0 @@ -# -*- text -*- - -Make a tasks file that people can pick jobs off of. - -take a look at am_compat.h and fix everything there... - -fix all $Id bla bla bla $ on every file. -add my own copyright 1997 etc. - -NOT NEEDED: convert DEBUG symbol to ENABLE_DEBUG -NOT NEEDED: convert DEBUG_MEM symbol to ENABLE_DEBUG_MEM - -Use these two somewhere: -AC_DEFINE(AM_UTILS_NAME_PACKAGE, "am-utils") -AC_DEFINE(AM_UTILS_VERSION, "6.0a1) - -check all "dnl XXX: in configure.in - -check for: INLINE, Const->const, P_void, VOIDP - -rename DEBUG_MTAB to DEBUG_MNTTAB -rename UPDATE_MTAB to MOUNT_TABLE_ON_FILE -rename HAS_NIS_MAPS to HAVE_MAP_NIS -rename HAS_TFS to HAVE_FS_TFS -rename SIG_HNDL_TYP to RETSIGTYPE - -remove HOST_EXEC #define from everywhere. add to am_ops.c a static flag -initialized_vops, which if not true, should set the host_ops vector field to -0 or host_umounted. This way let the feature be turned on if -h option to -amd is given. - -nuke all code that is ifdef'd SUNOS4_COMPAT - -rename NEED_MNTOPT_PARSER to HAVE_HASMNTOPT and cleanup the code. also take -the supplied code in amd/mount_fs.c and include it as the library function -libamd/hasmntopt.c - -TLI code needs to be fixed. - -a way to include a site-specific configuration file IFF it exists from -directory local/<${target}.h> - -replace #include WAIT with nothing (HAVE_SYS_WAIT_H?) - -replace SYS5_SIGNALS with HAVE_SYS_WAIT_H (which is on only if it sys/wait.h -exists and is using the newer "int" for type, not "union wait". The macro -AC_HEADER_SYS_WAIT turns on HAVE_SYS_WAIT_H iff wait*() functions are -posix.1 compliant. Make sure you don't remove SYS5_SIGNALS ifdef's that are -not related to wait*() syscalls. - -add username, hostname, and date at which time amd was compiled. - -No more need for MOUNT_HELPER_SOURCE. - -any code which is included by NEED_UMOUNT_FS, should be on iff -MOUNT_TABLE_ON_FILE is on. - -replace NFS_FH_FIELD with references fo ".fh" in calls to -NFS_FH_DREF(src, dst) macro - -For *EVERY* M4 Macro with case/esac, check that the $host_os case entries -are correct. - -I'm not using amd's regexp code. Instead, use generic system code. If the -system has posix style regexp functions, then change amd/map.c to use -correct new prototype. - -use HAVE_SVC_GETREQSET instead of RPC_4. - -replace all "jsp" in *.[hc] $Id: TODO,v 1.1.1.1 1998/11/05 02:04:19 ezk Exp $ with ezk. - -use MNTTAB_FILE_NAME instead of MOUNTED - -use MOUNT_TABLE_ON_FILE instead of READ_MTAB_FROM_FILE - -no more HAS_EMPTY_AUTOMOUNTS, which was used if a df(1) divide by zero bug -was invoked. Instead, change nfs_statfs() code to always return non-zero -values. Then nuke HAS_EMPTY_AUTOMOUNTS. - -REGEXP: use whatever regular expressionlibrary you have on the system, -including regexp.h if available, and using regcomp/regexec. Amd was written -with BSD regexps in mind, not Sys V, so if I use any of those, I have to -watch for correct usage. Otherwise, I can include the older include/re.h -and amd/re.c. Replace HAS_REGEXP with HAVE_REGEXEC. - -The regex code in amd/mapc.c has changed a lot. It probably has bugs. Must -test and debug it!!! - -# string name of filesystem in /etc/mnttab file -Use MNTTAB_TYPE_FOO instead of MTAB_TYPE_FOO. -# string name of mount option in /etc/mnttab file -Use MNTTAB_OPT_FOO instead of MNTOPT_FOO. -# string (or integer?) name of filesystem type in mount(2) syscall -Use MOUNT_TYPE_FOO instead of MNTTYPE_FOO or MOUNT_FOO. -# hex/number of FS mount option in nfs_args passed to mount(2) syscall -Use MNT2_NFS_OPT_FOO instead NFSMNT_FOO. -# hex/number of generic FS mount option directly passed to mount(2) syscall -Use MNT2_GEN_OPT_FOO instead of MS_FOO or M_FOO. - - -update AMD_COMPAT to 6.0 in include/am_utils.h - -convert all mem* functions b* functions (memset to bzero, etc.) or vice -verse. - -put my name/copyright on every src file - -change all struct mnttab/mntent to "mntent_t" - -cleanup lib/resvport.c (TLI vs. Sockets). TLI code is #defin'ed -HAVE_T_OPEN. -[ -setting MTAB_LOCK_FILE (mtab_svr4.c) should be an amd run-time configuration -option. - -change all UMOUNT_FS macros to umount_fs() fxn calls. - -remove getnetbyaddr() from lib/getnetbyaddr.c and then link w/ -lsocket - -take care of various (hlfsd et al) scripts in Makefile.am files. - -rename HOSTNAMESZ to MAXHOSTNAMELEN - -turn on all the NEW_TOPLVL_READDIR code (for "ls" to work in an amd point) - -change all NEW_DEFAULTS to ENABLE_DEFAULT_SELECTOTS (which is now on by -default) - -remove refereces to mnt_freq and mnt_passno in mntent_t since it's not in -use any more. - -remove all the (lint?) comments /*ARGSUSED */ - -change HAS_FOOFS to HAVE_AM_FS_FOO (for example HAS_NFSX -> HAVE_AM_FS_FOO), -but change HAS_UNION_FS to HAVE_AM_FS_UNION. - -some code uses #ifdef M_NEWTYPE to tell if mount(2)'s type field is "char *" -or int. Use MTYPE_TYPE declaration instead (not ifdef macro!) - -change DEBUG_MTAB to DEBUG_MNTTAB - -deal with the changes in values of $os, $arch, and $osver! - -replace SYS5_SIGNALS with REINSTATE_SIGNAL_HANDLER - -figure out how to auto-conf HAS_HESIOD_RELOAD (amd/info_hesiod.c). For now -I've used the macro HAVE_HS_ZONE_TRANSFER. - - - - -****************************************************************************** -PERL SCRIPT TO FIX OLD AMD MAPS: -- fix '=' to ':=' -- fix sos5 -> solaris2, etc. - -****************************************************************************** -USE AS IS: - -- SVC_IN_ARG_TYPE (change from SVC_IN_ARGS_TYPE, with an 'S') -- NFS_FH_TYPE -- MTYPE_TYPE -- MOUNT_TYPE_* NO!!! - -****************************************************************************** -NEW FEATURES: - -- autofs -- cachefs -- dbm/gdbm/db file maps -- add amd option -O (override) to override $os, $osver, $arch, $karch, etc. - -****************************************************************************** -DONE: - -HAS_TFS is gone and all of it's code too. -major code cleanup, removed if 0 code and if notdef diff --git a/contrib/amd/conf/mount/mount_freebsd3.c b/contrib/amd/conf/mount/mount_freebsd3.c deleted file mode 100644 index 5888ed949d30..000000000000 --- a/contrib/amd/conf/mount/mount_freebsd3.c +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 1997-1998 Erez Zadok - * Copyright (c) 1990 Jan-Simon Pendry - * Copyright (c) 1990 Imperial College of Science, Technology & Medicine - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Jan-Simon Pendry at Imperial College, London. - * - * 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. - * - * %W% (Berkeley) %G% - * - * $Id: mount_freebsd3.c,v 5.2.2.1 1992/02/09 15:10:08 jsp beta $ - * - */ - -/* - * FreeBSD 3.x (as of snapshot 3.0-980311-SNAP) Mount helper - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif /* HAVE_CONFIG_H */ -#include <am_defs.h> -#include <amu.h> - -/* - * Map from conventional mount arguments - * to FreeBSD 3.0 style arguments. - */ -int -mount_freebsd3(MTYPE_TYPE type, const char *dir, int flags, voidp data) -{ - char const *namelist[] = INITMOUNTNAMES; - - return mount(namelist[type], - dir, - flags, - data); -} diff --git a/contrib/amd/conf/trap/trap_freebsd3.h b/contrib/amd/conf/trap/trap_freebsd3.h deleted file mode 100644 index 95c664254c05..000000000000 --- a/contrib/amd/conf/trap/trap_freebsd3.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $srcdir/conf/trap/trap_freebsd3.h */ -extern int mount_freebsd3(MTYPE_TYPE type, const char *dir, int flags, voidp data); -#define MOUNT_TRAP(type, mnt, flags, mnt_data) mount_freebsd3(type, mnt->mnt_dir, flags, mnt_data) diff --git a/contrib/amd/libamu/clnt_sperrno.c b/contrib/amd/libamu/clnt_sperrno.c deleted file mode 100644 index d3b48d1cd405..000000000000 --- a/contrib/amd/libamu/clnt_sperrno.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) 1997-1998 Erez Zadok - * Copyright (c) 1990 Jan-Simon Pendry - * Copyright (c) 1990 Imperial College of Science, Technology & Medicine - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Jan-Simon Pendry at Imperial College, London. - * - * 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. - * - * %W% (Berkeley) %G% - * - * $Id: clnt_sperrno.c,v 5.2.2.1 1992/02/09 15:08:40 jsp beta $ - * - */ - -/* - * Early RPC seems to be missing these.. - * Extracted from the RPC 3.9 sources as indicated - */ - -/* @(#)clnt_perror.c 1.1 87/11/04 3.9 RPCSRC */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif /* HAVE_CONFIG_H */ -#include <am_defs.h> -#include <amu.h> - - -struct rpc_errtab { - enum clnt_stat status; - char *message; -}; - -static struct rpc_errtab rpc_errlist[] = -{ - {RPC_SUCCESS, - "RPC: Success"}, - {RPC_CANTENCODEARGS, - "RPC: Can't encode arguments"}, - {RPC_CANTDECODERES, - "RPC: Can't decode result"}, - {RPC_CANTSEND, - "RPC: Unable to send"}, - {RPC_CANTRECV, - "RPC: Unable to receive"}, - {RPC_TIMEDOUT, - "RPC: Timed out"}, - {RPC_VERSMISMATCH, - "RPC: Incompatible versions of RPC"}, - {RPC_AUTHERROR, - "RPC: Authentication error"}, - {RPC_PROGUNAVAIL, - "RPC: Program unavailable"}, - {RPC_PROGVERSMISMATCH, - "RPC: Program/version mismatch"}, - {RPC_PROCUNAVAIL, - "RPC: Procedure unavailable"}, - {RPC_CANTDECODEARGS, - "RPC: Server can't decode arguments"}, - {RPC_SYSTEMERROR, - "RPC: Remote system error"}, - {RPC_UNKNOWNHOST, - "RPC: Unknown host"}, -/* { RPC_UNKNOWNPROTO, - * "RPC: Unknown protocol" }, */ - {RPC_PMAPFAILURE, - "RPC: Port mapper failure"}, - {RPC_PROGNOTREGISTERED, - "RPC: Program not registered"}, - {RPC_FAILED, - "RPC: Failed (unspecified error)"} -}; - - -/* - * This interface for use by clntrpc - */ -char * -clnt_sperrno(enum clnt_stat stat) -{ - int i; - - for (i = 0; i < sizeof(rpc_errlist) / sizeof(struct rpc_errtab); i++) { - if (rpc_errlist[i].status == stat) { - return (rpc_errlist[i].message); - } - } - return ("RPC: (unknown error code)"); -} diff --git a/contrib/amd/scripts/Makefile.am b/contrib/amd/scripts/Makefile.am deleted file mode 100644 index c4380584ec0e..000000000000 --- a/contrib/amd/scripts/Makefile.am +++ /dev/null @@ -1,49 +0,0 @@ -## Process this file with automake to produce Makefile.in - -# Package: am-utils -# Level: Makefile for scripts/ directory -# Author: Erez Zadok - -sbin_SCRIPTS = \ - am-eject \ - amd2ldif \ - amd2sun \ - ctl-amd \ - ctl-hlfsd \ - fixrmtab \ - fix-amd-map \ - lostaltmail \ - wait4amd \ - wait4amd2die - -bin_SCRIPTS = \ - expn - -sysconf_DATA = \ - amd.conf-sample \ - lostaltmail.conf-sample - -# man pages -man_MANS = \ - amd.conf.5 \ - expn.1 - -EXTRA_DIST = \ - am-eject.in \ - amd2ldif.in \ - amd2sun.in \ - ctl-amd.in \ - ctl-hlfsd.in \ - fixrmtab.in \ - fix-amd-map.in \ - lostaltmail.in \ - wait4amd.in \ - wait4amd2die.in \ - \ - expn.in \ - \ - amd.conf-sample \ - lostaltmail.conf-sample \ - $(man_MANS) - -CLEANFILES = $(sbin_SCRIPTS) $(bin_SCRIPTS) diff --git a/contrib/amd/scripts/Makefile.in b/contrib/amd/scripts/Makefile.in deleted file mode 100644 index a20d84627136..000000000000 --- a/contrib/amd/scripts/Makefile.in +++ /dev/null @@ -1,381 +0,0 @@ -# Makefile.in generated automatically by automake 1.3.2 from Makefile.am - -# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# Package: am-utils -# Level: Makefile for scripts/ directory -# Author: Erez Zadok - - -SHELL = /bin/sh - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DISTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_alias = @host_alias@ -host_triplet = @host@ -AR = @AR@ -CC = @CC@ -CPP = @CPP@ -LEX = @LEX@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_LDFLAGS = @LIBTOOL_LDFLAGS@ -LTALLOCA = @LTALLOCA@ -LTLIBOBJS = @LTLIBOBJS@ -PACKAGE = @PACKAGE@ -PERL = @PERL@ -RANLIB = @RANLIB@ -VERSION = @VERSION@ - -sbin_SCRIPTS = \ - am-eject \ - amd2ldif \ - amd2sun \ - ctl-amd \ - ctl-hlfsd \ - fixrmtab \ - fix-amd-map \ - lostaltmail \ - wait4amd \ - wait4amd2die - -bin_SCRIPTS = \ - expn - -sysconf_DATA = \ - amd.conf-sample \ - lostaltmail.conf-sample - -# man pages -man_MANS = \ - amd.conf.5 \ - expn.1 - -EXTRA_DIST = \ - am-eject.in \ - amd2ldif.in \ - amd2sun.in \ - ctl-amd.in \ - ctl-hlfsd.in \ - fixrmtab.in \ - fix-amd-map.in \ - lostaltmail.in \ - wait4amd.in \ - wait4amd2die.in \ - \ - expn.in \ - \ - amd.conf-sample \ - lostaltmail.conf-sample \ - $(man_MANS) - -CLEANFILES = $(sbin_SCRIPTS) $(bin_SCRIPTS) -mkinstalldirs = $(SHELL) $(top_srcdir)/aux/mkinstalldirs -CONFIG_HEADER = ../config.h -CONFIG_CLEAN_FILES = am-eject amd2ldif amd2sun ctl-amd ctl-hlfsd expn \ -fixrmtab fix-amd-map lostaltmail wait4amd wait4amd2die -SCRIPTS = $(bin_SCRIPTS) $(sbin_SCRIPTS) - -man1dir = $(mandir)/man1 -man5dir = $(mandir)/man5 -MANS = $(man_MANS) - -NROFF = nroff -DATA = $(sysconf_DATA) - -DIST_COMMON = Makefile.am Makefile.in am-eject.in amd2ldif.in \ -amd2sun.in ctl-amd.in ctl-hlfsd.in expn.in fix-amd-map.in fixrmtab.in \ -lostaltmail.in wait4amd.in wait4amd2die.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = gtar -GZIP = --best -all: Makefile $(SCRIPTS) $(MANS) $(DATA) - -.SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/./aux/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --localdir=./aux --gnu --include-deps scripts/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - -am-eject: $(top_builddir)/config.status am-eject.in - cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status -amd2ldif: $(top_builddir)/config.status amd2ldif.in - cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status -amd2sun: $(top_builddir)/config.status amd2sun.in - cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status -ctl-amd: $(top_builddir)/config.status ctl-amd.in - cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status -ctl-hlfsd: $(top_builddir)/config.status ctl-hlfsd.in - cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status -expn: $(top_builddir)/config.status expn.in - cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status -fixrmtab: $(top_builddir)/config.status fixrmtab.in - cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status -fix-amd-map: $(top_builddir)/config.status fix-amd-map.in - cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status -lostaltmail: $(top_builddir)/config.status lostaltmail.in - cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status -wait4amd: $(top_builddir)/config.status wait4amd.in - cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status -wait4amd2die: $(top_builddir)/config.status wait4amd2die.in - cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status - -install-binSCRIPTS: $(bin_SCRIPTS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(bindir) - @list='$(bin_SCRIPTS)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ - $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ - else if test -f $(srcdir)/$$p; then \ - echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ - $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ - else :; fi; fi; \ - done - -uninstall-binSCRIPTS: - @$(NORMAL_UNINSTALL) - list='$(bin_SCRIPTS)'; for p in $$list; do \ - rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ - done - -install-sbinSCRIPTS: $(sbin_SCRIPTS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(sbindir) - @list='$(sbin_SCRIPTS)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`"; \ - $(INSTALL_SCRIPT) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \ - else if test -f $(srcdir)/$$p; then \ - echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`"; \ - $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \ - else :; fi; fi; \ - done - -uninstall-sbinSCRIPTS: - @$(NORMAL_UNINSTALL) - list='$(sbin_SCRIPTS)'; for p in $$list; do \ - rm -f $(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \ - done - -install-man1: - $(mkinstalldirs) $(DESTDIR)$(man1dir) - @list='$(man1_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ - else file=$$i; fi; \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ - $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ - done - -uninstall-man1: - @list='$(man1_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ - rm -f $(DESTDIR)$(man1dir)/$$inst; \ - done - -install-man5: - $(mkinstalldirs) $(DESTDIR)$(man5dir) - @list='$(man5_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ - case "$$i" in \ - *.5*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ - else file=$$i; fi; \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst"; \ - $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst; \ - done - -uninstall-man5: - @list='$(man5_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ - case "$$i" in \ - *.5*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f $(DESTDIR)$(man5dir)/$$inst"; \ - rm -f $(DESTDIR)$(man5dir)/$$inst; \ - done -install-man: $(MANS) - @$(NORMAL_INSTALL) - $(MAKE) install-man1 install-man5 -uninstall-man: - @$(NORMAL_UNINSTALL) - $(MAKE) uninstall-man1 uninstall-man5 - -install-sysconfDATA: $(sysconf_DATA) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(sysconfdir) - @list='$(sysconf_DATA)'; for p in $$list; do \ - if test -f $(srcdir)/$$p; then \ - echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(sysconfdir)/$$p"; \ - $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(sysconfdir)/$$p; \ - else if test -f $$p; then \ - echo " $(INSTALL_DATA) $$p $(DESTDIR)$(sysconfdir)/$$p"; \ - $(INSTALL_DATA) $$p $(DESTDIR)$(sysconfdir)/$$p; \ - fi; fi; \ - done - -uninstall-sysconfDATA: - @$(NORMAL_UNINSTALL) - list='$(sysconf_DATA)'; for p in $$list; do \ - rm -f $(DESTDIR)$(sysconfdir)/$$p; \ - done -tags: TAGS -TAGS: - - -distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = scripts - -distdir: $(DISTFILES) - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file; \ - done -info: -dvi: -check: all - $(MAKE) -installcheck: -install-exec: install-binSCRIPTS install-sbinSCRIPTS install-sysconfDATA - @$(NORMAL_INSTALL) - -install-data: install-man - @$(NORMAL_INSTALL) - -install: install-exec install-data all - @: - -uninstall: uninstall-binSCRIPTS uninstall-sbinSCRIPTS uninstall-man uninstall-sysconfDATA - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install -installdirs: - $(mkinstalldirs) $(DATADIR)$(bindir) $(DATADIR)$(sbindir) \ - $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 \ - $(DATADIR)$(sysconfdir) - - -mostlyclean-generic: - -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -rm -f Makefile $(DISTCLEANFILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -mostlyclean: mostlyclean-generic - -clean: clean-generic mostlyclean - -distclean: distclean-generic clean - -rm -f config.status - -rm -f libtool - -maintainer-clean: maintainer-clean-generic distclean - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - -.PHONY: uninstall-binSCRIPTS install-binSCRIPTS uninstall-sbinSCRIPTS \ -install-sbinSCRIPTS install-man1 uninstall-man1 install-man5 \ -uninstall-man5 install-man uninstall-man uninstall-sysconfDATA \ -install-sysconfDATA tags distdir info dvi installcheck install-exec \ -install-data install uninstall all installdirs mostlyclean-generic \ -distclean-generic clean-generic maintainer-clean-generic clean \ -mostlyclean distclean maintainer-clean - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/contrib/amd/scripts/fixrmtab b/contrib/amd/scripts/fixrmtab deleted file mode 100755 index 33b7bcfdb6ce..000000000000 --- a/contrib/amd/scripts/fixrmtab +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# Invalidate /etc/rmtab entries for hosts named. -# Restart mountd for changes to take effect. -# -# usage: fixrmtab host1 host2 ... -# -# Package: am-utils-6.0 -# Author: Andreas Stolcke <stolcke@icsi.berkeley.edu> - -#set -x - -RMTAB=/etc/rmtab -TMP=/tmp/rmtab.$$ - -if [ ! -f /etc/rmtab ]; then - exit 0 -fi - -for host in $* -do - sed -e '/^'$host':/s/^./#/' $RMTAB > $TMP && cp $TMP $RMTAB -done -rm -f $TMP diff --git a/contrib/amd/scripts/lostaltmail.conf-sample b/contrib/amd/scripts/lostaltmail.conf-sample deleted file mode 100644 index a20158c14f83..000000000000 --- a/contrib/amd/scripts/lostaltmail.conf-sample +++ /dev/null @@ -1,84 +0,0 @@ -# -*- perl -*- -############################################################################## -# # -# CONFIGURABLE VALUES # -# # -############################################################################## - -$MAILGRUNT="postmaster"; # To whom to send log mail if mail is prefered. - -$TMPDIR="/tmp/"; # Place lostmail can do its dirty work. - -$LOCAL_LOCK_EXT=".lock"; # Name of file local mailer uses to lock - # spool file. This the correct setting for - # /bin/mail - -$SYSTEM_FROM_ADDRESS="Mailer-Daemon"; - -$MAILDIR="/var/alt_mail"; # What directory should I run out of. -$MAILER='/usr/lib/sendmail -t'; # Which mailer should I use. - -$LOCALMAILJUNK='.*~|\#.*|core'; # Files name patterns that might appear in - # alt_mail and should be ignored. This REGEXP - # gets or'ed with $MAILJUNK below. - -$SMTPHOST='localhost'; # The name of a local host which speaks SMTP - # and knows *all* your aliases. You probably - # don't want to change this. If the machine - # running lost_alt mail doesn't run an SMTP, - # daemon then something is either wrong or you - # should be setting `noverify' to prevent - # SMTP verification. - -$HOSTNAME='localhost'; # Hostname to use for SMTP HELO - -# Subject of lost log mail message. Must define $MAILGRUNT. -# I overwrite this variable in the subroutine Clean_up. Please make sure I -# haven't noodle-headdly forgotten to remove that hack in the distribution! -# No newline here please. The script will insert it for you. -$LOG_SUBJECT="Log of lostmail resends"; - -############################################################################## -# # -# DEFAULTED CONFIGURATIONS # -# # -############################################################################## - -$LOGFILE="$TMPDIR" . "lostlog"; - - -# MAILJUNK is a pattern of ignorable alt_mail files which are either common -# to most platforms or actually produced by this script. You should customize -# this REGEXP by hacking at $LOCALMAILJUNK above. -$MAILJUNK='[a-z]\.[0-9]*|\.\.?|lost\+found'; - -$LOCKEXT=".lostlock"; # our lock file extension. Should not need to - # modify - -$MESSAGE_DELIM="^From[^:]"; # /bin/mail message delimiter. Your milage - # may differ - -$HEADER_BODY_DELIM="\n"; # RFC 822 header-body delimiter. - -$RESENT_TO="Resent-To: "; # -$RESENT_FROM="Resent-From: "; # Resent headers (RFC 822). -$RESENT_DATE="Resent-Date: "; # You probably don't want to muck with these. -$RESENT_INFO="X-Resent-Info: "; # (special one to alert folks about mail). - - -############################################################################## -# # -# LOSTMAIL DEFINITIONS (DON'T TOUCH) # -# # -############################################################################## - -$FALSE=0; -$TRUE=(! $FALSE); - -$OK=$TRUE; -$ABORT_RESEND=2; -$LOCK_RETRIES=10; # The number of seconds/retries lost mail - # should wait before requeing or aborting a - # resend. - -TRUE; # Ansures true return from include file. diff --git a/contrib/amd/scripts/lostaltmail.in b/contrib/amd/scripts/lostaltmail.in deleted file mode 100755 index 8d1e6ec09d99..000000000000 --- a/contrib/amd/scripts/lostaltmail.in +++ /dev/null @@ -1,649 +0,0 @@ -#!@PERL@ -sw -# -# Package: am-utils-6.0 -# Author: James Tanis <jtt@cs.columbia.edu> -# - -############################################################################ -# -# lostaltmail -- remail files files found alt_mail (or -a argument to hlfsd) to -# whomever should receive it. This version is for SMTP varient which -# support VRFY as a non-expanding verifier!!! (sendmail V8 is a an -# example). -# -# Usage: lostaltmail [-debug] [-nomail] [-noverify] -# -# GLOBAL VARIABLES (as if you care :-) ) -# Probably a very incomplete list. -# -# Everything in the config file for this program *and* ... -# -# $debug: set it from the command line with -debug. Does the obvious -# $nomail: set it from the command line with -nomail. *Not* implied by -# $debug -# $currentTO: The addresss we are currently checking on. Actually this is -# left over from an earlier version of lostaltmail and will hopefully -# go away. -# $noverify: set it from the address line. Avoid verification of $currentTO. -# This should be relatively safe as long as your are willing to -# endure bounces from mail that cannot be redelivered as opposed to -# just getting a warning. UNTESTED (but should work). -# -# $logopen: state variable indicating weather the log file (should there be -# one) is in fact open. -# -# @allentries: Array of all the directory entries in $MAILDIR -# @allnames: Array of all *likely* recipients. It is created from @allentries -# sans junk files (see $MAILJUNK and $LOCALMAILJUNK) -# @wanderers: Array of all the files associated with a *single* address -# which might need remailing. Should lostaltmail die unexpectedly, -# it might leave a temporary file containing messages it was -# currently trying to deliver. These will get picked and resent -# later. -# -# VRFY: Handle onto SMTP verification channel. Not to be confused with mail -# delivery; only verification occurs accross this handle. -# -############################################################################ - -############################################################################## -# # -# SMTP_SEND # -# # -############################################################################## -# -# Send a message to the smtp channel. Inserts the necessary NEWLINE if it -# does not exist; -# I stole this from myself. It shouldn nott be printing errors to STDERR, but -# this is a quick hack. -# -sub smtp_send { - local ($msg) = @_; - local ($length); - - $length=length($msg); - - if ( $msg !~ /^.*\n$/ ) { - $msg = $msg . "\n"; - $length++; - } - - - if ( ! syswrite (VRFY, $msg, $length)) { - print STDERR "Failing SMTP write: $msg"; - return 0; - } - - return 1; -} - -############################################################################## -# # -# SMTP_RECV # -# # -############################################################################## -# -# Read in lines from SMTP connection and return the final -# Really hideous -- please excuse. -# -sub smtp_recv { - local ($line,$rin, $win, $ein, $readbuf, $ret); - $readbuf = ""; - - $rin = $win = $ein = ''; # Null fd sets, - vec ($rin, fileno(VRFY), 1) = 1; # Stolen straight from the example; - $ein = $rin | $win; # This is probably useless - - -LINE_OF_INPUT: - while (1) { # Read in all the input - - if ((select ( $rin, $win, $ein, 600.0))[0] == 0 ) { - print "select returned -1" if ($debug); - return -1; # timeout - } - sysread (VRFY, $readbuf, 1024); - chop ($readbuf); - - foreach $line ( split('\n', $readbuf)) { - - # This loop is actually needed since V8 has a multi-line greet. - - ( $line =~ /^(\d\d\d).*/ && ($SMTP_retval=$1)) || - warn "Badly formed reply from SMTP peer: $line\n"; - - # Space after return code indicates EOT - - if ($line =~ /^\d\d\d /) { - $ret = $line; # Oddly $line is in a different context here; - # and thus we need to export it out of the - # while loop via $ret. - last LINE_OF_INPUT; - } - } # End of read. - } # End of input. - - return $ret; -} - - - - -############################################################################## -# # -# LOG_INFO # -# # -############################################################################## -# -# -# Opens appropriate logging file -- STDOUT (cron) or temp file (mail). -# -sub Log_info { - local($message) = @_; - - if ( !$logopened ) { - if ( $MAILGRUNT eq "" || $debug) { - open (LOGFILE, ">-") || die "Unable to open stdout"; - } - else { - # Snarf the log into a tmp file for final mailing to MAILGRUNT - $logfile = $LOGFILE . ".$$"; - open (LOGFILE, (">". "$logfile")) || die "Unable to create log file"; - } - } - - $logopened=1; # Note that the log is now open - - # Heart of the function. - print LOGFILE "$message"; - - print LOGFILE "\n" if ( index($message,"\n") == -1 ); -} - -############################################################################## -# # -# LOCK_FILE # -# # -############################################################################## - -# -# Tries to grab a lock on the supplied file name. -# Spins for a bit if it can't on the assumption that the lock will be released -# quickly. If it times out and it's allowed to requeue, it will defer -# until later, other wise write a message to loginfo. - -# If a recurring error or really unexpected situation arrises, return -# ABORT_RESEND -# -# PARAMETERS -# mailfile: path to the file to resend. -# should_requeue: BOOLEAN - TRUE if the mailfile should be put on the -# queue for a later retry if we can not finish -# now. - -sub Lock_file { - - local($mailfile,$should_requeue,$i,$new_lost_file) = @_; - -# We need to rename the current mailbox so that mail can loop back into it if -# the resent mail just gets looped right back to us. - $new_lost_file = $mailfile . ".$$"; - -# make a tmpfile name based on mailfile; - $lostlockfile = "$mailfile" . "$LOCKEXT"; - - if ( ! open(LOCKFILE, (">" . $lostlockfile)) ) { - printf(STDERR "Could not create lostlockfile for %s: %s\n", $mailfile,$!); - return $ABORT_RESEND; - } - close(LOCKFILE); - - $maillockfile = "$mailfile" . "$LOCAL_LOCK_EXT"; - - for ($i=0; $i < $LOCK_RETRIES && ! link ($lostlockfile, $maillockfile); - $i++) { - sleep(1); - } - - unlink($lostlockfile); # No matter what eliminate our cruft - - if ( $i == $LOCK_RETRIES ) { - &Log_info("Could not grab lock on: " . "$mailfile" . " :timed out"); - if ( $should_requeue ) { - &Log_info("Requeing " . "$mailfile" . " for later retry"); - $retry_list .= " $mailfile"; - } - else { - &Log_info("Giving up on: " . "$mailfile"); - } - - return $ABORT_RESEND; - } - - # We created the link and therefore have the lock - - if (rename ($mailfile, $new_lost_file) == 0 ){ - # Failed to rename file -- this is serious. - unlink($maillockfile); - return $ABORT_RESEND; - } - - unlink($maillockfile); - return $new_lost_file; - -} - -############################################################################## -# # -# PARSE NEXT MAIL MESSAGE # -# # -############################################################################## -# -# Parameters: -# mailfile: handle of mailfile to use. -# -# Parses the next message in the mail file and inserts it in $current_msg -# -sub Get_next_msg { - local($mailfile,$found_body_delimiter) = @_; - - # If this is the first message in the spool file, read the first line - # otherwise use the MESSAGE_DELIM line from the previous message (which we - # were forced to overread). - - $done=$FALSE; - $found_body_delimiter=$FALSE; - - # This if eats the very first "From " line and should never fire again. - if ( ! defined $current_msg ) {<$mailfile>}; - undef ($current_msg); # Erase the old message. - - - # Read the mailfile and pass through all the lines up until the next - # message delimiter. Kill any previous resend headers. - while ( <$mailfile> ) { - last if (/$MESSAGE_DELIM/); - next if ( !$found_body_delimiter && /[Rr][Ee][Ss][Ee][Nn][Tt]-.+:/); - if ( !$found_body_delimiter && /^$HEADER_BODY_DELIM/) { - &Splice_in_resent_headers(); - $found_body_delimiter=$TRUE; - } - if (defined($current_msg)) { - $current_msg .= $_; - } else { - $current_msg = $_; - } - } - - # Return TRUE when we have hit the end of the file. - if (!defined($_) || $_ eq "" ) { - return $TRUE; - } else { - return $FALSE; - } -} - -############################################################################## -# # -# SPLICE IN RESENT_HEADERS # -# # -############################################################################## -# -# Insert the Resent- headers at the *current location* of the message stream -# (In Engish, print out a few Resent-X: lines and return :-) ) -# In addition splice in the X-resent-info: header. - -# -# Paremters: None. -# Return: None -# -sub Splice_in_resent_headers { - local($date,$utctime,$weekday,$time,$month,$hostname); - - $current_msg .= "$RESENT_TO" . "$currentTO" . "\n"; - $current_msg .= "$RESENT_FROM" . "$SYSTEM_FROM_ADDRESS" . "\n"; - - # Calculate date and time. It is a bit of a shame to do this each time - # the time needs to be acurate. - - @utctime=gmtime(time); - - $weekday=(Sun,Mon,Tue,Wed,Thu,Fri,Sat)[$utctime[6]]; - - - # If the minutes or second do not take two columns each, patch em up. - if ( $utctime[1] < 10 ) { - if ( $utctime[0] < 10 ) { - $time=sprintf("%d:0%d:0%d",$utctime[2],$utctime[1],$utctime[0]); - } - else { - $time=sprintf("%d:0%d:%d",$utctime[2],$utctime[1],$utctime[0]); - } - } - else { - if ( $utctime[0] < 10 ) { - $time=sprintf("%d:%d:0%d",$utctime[2],$utctime[1],$utctime[0]); - } - else { - $time=sprintf("%d:%2d:%2d",$utctime[2],$utctime[1],$utctime[0]); - } - } - - $month=(Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec)[$utctime[4]]; - - # Ensure Y2K format - $date=sprintf("%s, %d %s %d %s UTC", $weekday, $utctime[3], $month, $utctime[5]+1900, $time); - - $current_msg .= "$RESENT_DATE" . $date . "\n"; - - if ( defined $RESENT_INFO && $RESENT_INFO ne "") { - $hostname=`uname -n`; - $current_msg .= "$RESENT_INFO" . "Lost mail resent from ". $hostname; - } - - return; -} - -############################################################################## -# # -# DO_REMAIL # -# # -############################################################################## -# -# Actually resends the mail. Talks to the process configured as $MAILER -# We need better handling. -# -sub Do_remail { - open (MAILER, "| $MAILER $currentTO") || return $ABORT_RESEND; - print MAILER $current_msg; - close (MAILER); -} - -############################################################################## -# # -# CLEAN_UP # -# # -############################################################################## -# -# Clean up my messes. -# -sub Clean_up { - local ($hostname); - - # Ugly local hack that you should never have seen, but I forgot to - # remove. Hopefully it did not kill you (I tried as you see), but you - # should eiter remove or update it for yourself. I find the message - # subject needs to have the hostname to be useful. - # - chop ($hostname=`uname -n`); - $LOG_SUBJECT="$LOG_SUBJECT from $hostname" if ( $hostname =~ /.*\.cs\.columbia\.edu/ ); - # - # End of ugly local hack - - # Mail any log info to MAILGRUNT. - if (defined($logfile) && $logfile ne "" ) { - close (LOGFILE); # Flush logfile output. - if ( -s $logfile ) { - open (MAILER, "| $MAILER $MAILGRUNT"); - - print MAILER "To: $MAILGRUNT\n"; - print MAILER "Subject: $LOG_SUBJECT\n"; - print MAILER "$HEADER_BODY_DELIM"; - - open (LOGFILE, "< $logfile"); - - while (<LOGFILE>) { - print MAILER $_; - } - close (MAILER); - close (LOGFILE); - } - - unlink($logfile); - } - exit(0); -} - - -############################################################################## -# # -# COLLECT_WANDERERS # -# # -############################################################################## - -# -# Collects other files that appear to be mail file for the $currentTO -# but were not remailed successfully. -# -# Parameters: none (but uses $currentTO) -# Return: True if a old mail directory is found. False otherwise. -# Side effects: $wanderers set. -# -sub Collect_wanderers { - - undef (@wanderers); - - # Slurp in the directory and close. - - return ($found); -} - -############################################################################# -# # -# REMAIL ALL # -# # -############################################################################# - -# -# Takes an array of files that all seem to share a common repcipient and -# remails them if possible. -# -# Parameters: None (uses @wanderers). -# -sub Remail_all { - local($file,$i); - - $i=0; - foreach $file (@wanderers) { - if ( !open (LOSTFILE, "< $file")) { - &Log_info("Could not open " . "$file" . " for remailing"); - next; - } - - do { # Power loop! - $done = &Get_next_msg(LOSTFILE); # Retrieve the next message... - &Do_remail; # and remail it. - } until $done; - undef ($current_msg); # Erase the final remailed message. - - close(LOSTFILE); # Tidy up. - - unlink ($file); # Remove the remailed file - $i++; - } - -} - -############################################################################# -# # -# CHECK_USER # -# # -############################################################################# - -# -# Checks the password tables for the uid of $currentTO. If the user is -# uid 0 (ie *supposed* to get mail in altmail) or unknown the resend is -# aborted. -# -# -sub Check_user { - local (@passwdinfo); - undef (@passwdinfo); - - if ( !&vrfy_user($currentTO) ) { - &Log_info("Possible non user mail file: $currentTO"); - return $ABORT_RESEND; - } - - @passwdinfo = getpwnam($currentTO); - - print "Non user mailable mail: Name: $currentTO\n" - if ( $debug && ! defined @passwdinfo ); - - return !$ABORT_RESEND if ( ! defined @passwdinfo ); # A non user but evidently mailable - - print "Check User(): Name: $currentTO -- UID: $passwdinfo[2]\n" if ($debug); - - return $ABORT_RESEND if ( $passwdinfo[2] == 0 ); - - - return !$ABORT_RESEND; -} - -############################################################################# -# # -# VRFY USER # -# # -############################################################################# -# -# Use SMTP VRFY to insure that argument is in fact a legal mail id. -# Boolean: TRUE if mailable account, FALSE if not. - -sub vrfy_user { - - local ($mailname,$repl) = @_; - - if ( !&smtp_send("vrfy $mailname") ) { - &Log_info("Failed sending to vrfy smtp command for: $mailname"); - return 0; - } - - $repl = &smtp_recv; - - print "VRFY REPLY: $repl\n" if ($debug); - - return ( $repl =~ /^2\d\d/ ); - - -} - - -############################################################################# -# # -# MAIN PROC # -# # -############################################################################# - -# dummy code to shut up perl -w -$debug = 0 if !defined($debug); -print $nomail if $debug > 1; -print $RESENT_FROM if $debug > 1; -print $logopen if $debug > 1; -print $LOCAL_LOCK_EXT if $debug > 1; -print $RESENT_TO if $debug > 1; -print $LOCKEXT if $debug > 1; -print $RESENT_DATE if $debug > 1; -print $MESSAGE_DELIM if $debug > 1; -print $SMTP_retval if $debug > 1; -print $found if $debug > 1; -print $retry_list if $debug > 1; -print $MAILJUNK if $debug > 1; -print $noverify if $debug > 1; -print $SYSTEM_FROM_ADDRESS if $debug > 1; - -# BEGIN: stuff -$prefix="@prefix@"; -$CONFIGDIR="@sysconfdir@"; # Directory where global config lives -require "$CONFIGDIR/lostaltmail.conf" if (-f "$CONFIGDIR/lostaltmail.conf"); -require "/etc/global/lostaltmail.conf" if (-f "/etc/global/lostaltmail.conf"); -require "/etc/os/lostaltmail.conf" if (-f "/etc/os/lostaltmail.conf"); -require "/etc/local/lostaltmail.conf" if (-f "/etc/local/lostaltmail.conf"); - - -require "ctime.pl"; -use Socket; -#require "sys/socket.ph"; - -# SET some initial state variales -$logopen = 0; - -# -# Change to alt_dir -# -# Important!! This directory should be local. Folks will be responsible -# for finding this out for themselves. -# -chdir ( $MAILDIR ) || die "Cannot change to $MAILDIR (`x' bit not set?)"; - -# -# slurp in directory -# -opendir (MAIL, ".") || die "Cannot open $MAILDIR (`r' bit not set?)"; -@allentries= readdir (MAIL); -closedir (MAIL); -@allnames = grep (!/$LOCALMAILJUNK|$MAILJUNK/, @allentries); - -# Open chanel to SMTP for verification -- unless this option is -# configured off. - -if ( ! $noverify ) { - local($addr, $port,$sockaddr); - - socket (VRFY, &AF_INET, &SOCK_STREAM, 0) || - die "Could not create TCP socket (SMTP channel)"; - - $addr = (gethostbyname($SMTPHOST))[4]; # Just use the first addr - - die "Could not obtain STMP host ($SMTPHOST) address" - if ( $addr eq "" ); - - $port = (getservbyname('smtp','tcp'))[2]; # Get smtp port. - die "Could not obtain SMTP port number" if (!defined($port)); - - printf("SMTP: address: %s port: $port\n", - join ('.',unpack('C4',$addr))) if ($debug); - - $sockaddr = sockaddr_in($port, $addr); - - printf("Sockaddr: %s\n", join (' ',unpack('C14',$sockaddr))) if ($debug); - - connect (VRFY, $sockaddr) || - die "Could not connect to SMTP daemon on $SMTPHOST"; - - print "Establshed SMTP channel\n" if ($debug); - - &smtp_recv; # Greet wait - &smtp_send("helo $SMTPHOST"); # Helo message for picky SMTPs - &smtp_recv; # Helo reply - - # Connection is up and ready to VRFY -} - -# main stuff starts here -foreach $currentTO (@allnames) { - next if ( &Check_user == $ABORT_RESEND); - - undef (@wanderers); # Just reset this at each pass. - @wanderers=grep (/$currentTO\.\d+/, @allentries); - - $remail_file = &Lock_file($currentTO,$FALSE); # Need to lock the spool. - - next if ( $remail_file eq $ABORT_RESEND); # Could not get that lock - - push (@wanderers, $remail_file); # Try to resend "old" files. - print "List to remail: @wanderers\n" if ($debug); - # check if there is something to remail - &Remail_all if ( defined @wanderers && !$nomail); -} - -# this stuff should run at the end -foreach $file (grep (/$LOCALMAILJUNK/,@allentries)) { - - if ($debug) { - print "Would unlink $file\n" if ($debug); - } else { - unlink $file if (-f $file); - } - -} -&Clean_up; # Do a clean exit. |